@limetech/lime-elements 38.37.0 → 38.38.0

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 (307) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/{checkbox.template-92ae2e60.js → checkbox.template-db4cd6c5.js} +2 -2
  3. package/dist/cjs/{checkbox.template-92ae2e60.js.map → checkbox.template-db4cd6c5.js.map} +1 -1
  4. package/dist/cjs/{index-174a078a.js → index-1ed03b2b.js} +1 -14
  5. package/dist/cjs/index-1ed03b2b.js.map +1 -0
  6. package/dist/cjs/lime-elements.cjs.js +2 -2
  7. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +2 -2
  9. package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-badge.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +2 -2
  14. package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-button.cjs.entry.js +2 -2
  16. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-card.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-chart.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
  20. package/dist/cjs/limel-chip_2.cjs.entry.js +2 -2
  21. package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
  22. package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
  23. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
  24. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
  25. package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/limel-config.cjs.entry.js +1 -1
  27. package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
  28. package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
  29. package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
  30. package/dist/cjs/limel-dock.cjs.entry.js +1 -1
  31. package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
  32. package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
  33. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  35. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  36. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  37. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  38. package/dist/cjs/limel-form.cjs.entry.js +1 -1
  39. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  40. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  41. package/dist/cjs/limel-help-content.cjs.entry.js +1 -1
  42. package/dist/cjs/limel-help.cjs.entry.js +1 -1
  43. package/dist/cjs/limel-helper-line_2.cjs.entry.js +1 -1
  44. package/dist/cjs/limel-icon-button.cjs.entry.js +3 -3
  45. package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
  46. package/dist/cjs/limel-icon.cjs.entry.js +1 -1
  47. package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
  49. package/dist/cjs/limel-list-item.cjs.entry.js +2 -2
  50. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  51. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
  52. package/dist/cjs/limel-picker.cjs.entry.js +1 -1
  53. package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
  54. package/dist/cjs/limel-portal_3.cjs.entry.js +1 -1
  55. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  56. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
  57. package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
  58. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  59. package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
  60. package/dist/cjs/limel-radio-button.cjs.entry.js +1 -1
  61. package/dist/cjs/limel-select.cjs.entry.js +1 -1
  62. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  63. package/dist/cjs/limel-slider.cjs.entry.js +1 -1
  64. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  65. package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
  66. package/dist/cjs/limel-switch.cjs.entry.js +2 -2
  67. package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
  68. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  69. package/dist/cjs/limel-table.cjs.entry.js +26536 -20436
  70. package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
  71. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  72. package/dist/cjs/loader.cjs.js +2 -2
  73. package/dist/cjs/{make-enter-clickable-39af24ec.js → make-enter-clickable-3369d31a.js} +28 -15
  74. package/dist/cjs/make-enter-clickable-3369d31a.js.map +1 -0
  75. package/dist/collection/components/icon-button/icon-button.css +1 -1
  76. package/dist/collection/components/table/columns.js.map +1 -1
  77. package/dist/collection/components/table/table-selection.js +3 -0
  78. package/dist/collection/components/table/table-selection.js.map +1 -1
  79. package/dist/collection/components/table/table.css +406 -163
  80. package/dist/collection/components/table/table.js +94 -44
  81. package/dist/collection/components/table/table.js.map +1 -1
  82. package/dist/collection/util/make-enter-clickable.js +27 -13
  83. package/dist/collection/util/make-enter-clickable.js.map +1 -1
  84. package/dist/esm/{checkbox.template-9acc6347.js → checkbox.template-024bb3b3.js} +2 -2
  85. package/dist/esm/{checkbox.template-9acc6347.js.map → checkbox.template-024bb3b3.js.map} +1 -1
  86. package/dist/esm/{index-2714248e.js → index-0c4503aa.js} +2 -14
  87. package/dist/esm/index-0c4503aa.js.map +1 -0
  88. package/dist/esm/lime-elements.js +3 -3
  89. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  90. package/dist/esm/limel-action-bar-item_2.entry.js +2 -2
  91. package/dist/esm/limel-action-bar_2.entry.js +1 -1
  92. package/dist/esm/limel-ai-avatar.entry.js +1 -1
  93. package/dist/esm/limel-badge.entry.js +1 -1
  94. package/dist/esm/limel-banner.entry.js +1 -1
  95. package/dist/esm/limel-breadcrumbs_7.entry.js +2 -2
  96. package/dist/esm/limel-button-group.entry.js +1 -1
  97. package/dist/esm/limel-button.entry.js +2 -2
  98. package/dist/esm/limel-callout.entry.js +1 -1
  99. package/dist/esm/limel-card.entry.js +1 -1
  100. package/dist/esm/limel-chart.entry.js +1 -1
  101. package/dist/esm/limel-checkbox.entry.js +2 -2
  102. package/dist/esm/limel-chip_2.entry.js +2 -2
  103. package/dist/esm/limel-circular-progress.entry.js +1 -1
  104. package/dist/esm/limel-code-editor.entry.js +1 -1
  105. package/dist/esm/limel-collapsible-section.entry.js +2 -2
  106. package/dist/esm/limel-color-picker-palette.entry.js +1 -1
  107. package/dist/esm/limel-color-picker.entry.js +1 -1
  108. package/dist/esm/limel-config.entry.js +1 -1
  109. package/dist/esm/limel-date-picker.entry.js +1 -1
  110. package/dist/esm/limel-dialog.entry.js +1 -1
  111. package/dist/esm/limel-dock-button.entry.js +1 -1
  112. package/dist/esm/limel-dock.entry.js +1 -1
  113. package/dist/esm/limel-drag-handle.entry.js +1 -1
  114. package/dist/esm/limel-dynamic-label.entry.js +1 -1
  115. package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
  116. package/dist/esm/limel-file-viewer.entry.js +1 -1
  117. package/dist/esm/limel-file.entry.js +1 -1
  118. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  119. package/dist/esm/limel-flex-container.entry.js +1 -1
  120. package/dist/esm/limel-form.entry.js +1 -1
  121. package/dist/esm/limel-grid.entry.js +1 -1
  122. package/dist/esm/limel-header.entry.js +1 -1
  123. package/dist/esm/limel-help-content.entry.js +1 -1
  124. package/dist/esm/limel-help.entry.js +1 -1
  125. package/dist/esm/limel-helper-line_2.entry.js +1 -1
  126. package/dist/esm/limel-icon-button.entry.js +3 -3
  127. package/dist/esm/limel-icon-button.entry.js.map +1 -1
  128. package/dist/esm/limel-icon.entry.js +1 -1
  129. package/dist/esm/limel-info-tile.entry.js +1 -1
  130. package/dist/esm/limel-linear-progress.entry.js +1 -1
  131. package/dist/esm/limel-list-item.entry.js +2 -2
  132. package/dist/esm/limel-markdown.entry.js +1 -1
  133. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  134. package/dist/esm/limel-picker.entry.js +1 -1
  135. package/dist/esm/limel-popover_2.entry.js +1 -1
  136. package/dist/esm/limel-portal_3.entry.js +1 -1
  137. package/dist/esm/limel-profile-picture.entry.js +1 -1
  138. package/dist/esm/limel-progress-flow-item.entry.js +1 -1
  139. package/dist/esm/limel-progress-flow.entry.js +1 -1
  140. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  141. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  142. package/dist/esm/limel-radio-button.entry.js +1 -1
  143. package/dist/esm/limel-select.entry.js +1 -1
  144. package/dist/esm/limel-shortcut.entry.js +1 -1
  145. package/dist/esm/limel-slider.entry.js +1 -1
  146. package/dist/esm/limel-snackbar.entry.js +1 -1
  147. package/dist/esm/limel-split-button.entry.js +1 -1
  148. package/dist/esm/limel-switch.entry.js +2 -2
  149. package/dist/esm/limel-tab-bar.entry.js +1 -1
  150. package/dist/esm/limel-tab-panel.entry.js +1 -1
  151. package/dist/esm/limel-table.entry.js +26536 -20436
  152. package/dist/esm/limel-table.entry.js.map +1 -1
  153. package/dist/esm/limel-text-editor.entry.js +1 -1
  154. package/dist/esm/loader.js +3 -3
  155. package/dist/esm/{make-enter-clickable-e0d24198.js → make-enter-clickable-1ab65ddc.js} +28 -15
  156. package/dist/esm/make-enter-clickable-1ab65ddc.js.map +1 -0
  157. package/dist/lime-elements/lime-elements.esm.js +1 -1
  158. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  159. package/dist/lime-elements/{p-8ded6465.js → p-03fd2774.js} +2 -2
  160. package/dist/lime-elements/{p-8539647d.entry.js → p-054daef5.entry.js} +2 -2
  161. package/dist/lime-elements/{p-4f85b3c4.entry.js → p-07c4def0.entry.js} +2 -2
  162. package/dist/lime-elements/{p-5b1cb891.entry.js → p-08f75835.entry.js} +2 -2
  163. package/dist/lime-elements/{p-eac0220e.entry.js → p-147b0a68.entry.js} +2 -2
  164. package/dist/lime-elements/{p-407a0e61.entry.js → p-19f525ba.entry.js} +2 -2
  165. package/dist/lime-elements/{p-ac55217a.entry.js → p-1a351a7f.entry.js} +2 -2
  166. package/dist/lime-elements/{p-bb0095c2.entry.js → p-1af74f5c.entry.js} +2 -2
  167. package/dist/lime-elements/{p-2116b3ce.entry.js → p-2356b938.entry.js} +2 -2
  168. package/dist/lime-elements/{p-8c667a56.entry.js → p-25158b9e.entry.js} +2 -2
  169. package/dist/lime-elements/{p-8e7d31b3.entry.js → p-263bac63.entry.js} +2 -2
  170. package/dist/lime-elements/{p-18256ad9.entry.js → p-280cbd66.entry.js} +2 -2
  171. package/dist/lime-elements/{p-3a36b862.entry.js → p-291cd743.entry.js} +2 -2
  172. package/dist/lime-elements/{p-aa159bd8.entry.js → p-2a616374.entry.js} +2 -2
  173. package/dist/lime-elements/{p-5f113a63.entry.js → p-312d104a.entry.js} +2 -2
  174. package/dist/lime-elements/{p-52fb3988.entry.js → p-317f00ea.entry.js} +2 -2
  175. package/dist/lime-elements/{p-c7ffe359.entry.js → p-32611964.entry.js} +2 -2
  176. package/dist/lime-elements/{p-416f25fc.entry.js → p-333ba7ca.entry.js} +2 -2
  177. package/dist/lime-elements/{p-b80a7353.entry.js → p-354c2d16.entry.js} +2 -2
  178. package/dist/lime-elements/{p-d497cac7.entry.js → p-36ae8adf.entry.js} +2 -2
  179. package/dist/lime-elements/{p-4ed15eb7.entry.js → p-3fcd15bd.entry.js} +2 -2
  180. package/dist/lime-elements/{p-2ff2186f.entry.js → p-4d225689.entry.js} +2 -2
  181. package/dist/lime-elements/p-4e77c9a5.js +2 -0
  182. package/dist/lime-elements/p-4e77c9a5.js.map +1 -0
  183. package/dist/lime-elements/{p-668e583c.entry.js → p-56c9bb65.entry.js} +2 -2
  184. package/dist/lime-elements/{p-745417ee.entry.js → p-5ca68424.entry.js} +2 -2
  185. package/dist/lime-elements/{p-b928421f.entry.js → p-5ef0a1fe.entry.js} +2 -2
  186. package/dist/lime-elements/p-5ef0a1fe.entry.js.map +1 -0
  187. package/dist/lime-elements/{p-4a9a6e16.entry.js → p-60a43c1d.entry.js} +2 -2
  188. package/dist/lime-elements/{p-ac334aa7.entry.js → p-67b697b4.entry.js} +2 -2
  189. package/dist/lime-elements/{p-b45cfa71.entry.js → p-6c5eea77.entry.js} +2 -2
  190. package/dist/lime-elements/{p-5ac43dbd.entry.js → p-6ce5a93f.entry.js} +2 -2
  191. package/dist/lime-elements/{p-d4a220eb.entry.js → p-6ddb0265.entry.js} +2 -2
  192. package/dist/lime-elements/{p-0115bb1e.entry.js → p-6ef87216.entry.js} +2 -2
  193. package/dist/lime-elements/{p-51d475d8.entry.js → p-6f3a34f1.entry.js} +2 -2
  194. package/dist/lime-elements/{p-54fc2316.entry.js → p-718d5311.entry.js} +2 -2
  195. package/dist/lime-elements/{p-e839ce5b.entry.js → p-72a79ebe.entry.js} +2 -2
  196. package/dist/lime-elements/{p-0d247b83.entry.js → p-7b681f7c.entry.js} +2 -2
  197. package/dist/lime-elements/{p-f8b6d7e1.entry.js → p-7d107fba.entry.js} +2 -2
  198. package/dist/lime-elements/{p-47da9c59.entry.js → p-81de7836.entry.js} +2 -2
  199. package/dist/lime-elements/{p-32572c31.entry.js → p-8535dc16.entry.js} +2 -2
  200. package/dist/lime-elements/{p-706c2e84.entry.js → p-9697010e.entry.js} +2 -2
  201. package/dist/lime-elements/{p-483ba5da.entry.js → p-9a64025b.entry.js} +2 -2
  202. package/dist/lime-elements/{p-f1ec1eeb.entry.js → p-9c9876f9.entry.js} +2 -2
  203. package/dist/lime-elements/{p-9b809f4d.entry.js → p-9e225545.entry.js} +2 -2
  204. package/dist/lime-elements/{p-4ddb8b05.entry.js → p-a92369cb.entry.js} +2 -2
  205. package/dist/lime-elements/{p-1e4ca584.entry.js → p-ae25ca92.entry.js} +2 -2
  206. package/dist/lime-elements/{p-580a29c5.entry.js → p-b076958e.entry.js} +2 -2
  207. package/dist/lime-elements/{p-20950d83.entry.js → p-b3f1f121.entry.js} +2 -2
  208. package/dist/lime-elements/{p-07988749.entry.js → p-b89cb5a3.entry.js} +2 -2
  209. package/dist/lime-elements/{p-6ef94d19.entry.js → p-b906e1c5.entry.js} +2 -2
  210. package/dist/lime-elements/p-bdfa539c.js +3 -0
  211. package/dist/lime-elements/p-bdfa539c.js.map +1 -0
  212. package/dist/lime-elements/{p-b43e8cb2.entry.js → p-c445aed7.entry.js} +2 -2
  213. package/dist/lime-elements/{p-489d7f63.entry.js → p-c64e86fd.entry.js} +2 -2
  214. package/dist/lime-elements/{p-cbbe129b.entry.js → p-cb81be35.entry.js} +2 -2
  215. package/dist/lime-elements/{p-9af45dec.entry.js → p-cd0010ba.entry.js} +2 -2
  216. package/dist/lime-elements/{p-250acfe4.entry.js → p-ce0e6d28.entry.js} +2 -2
  217. package/dist/lime-elements/{p-7528a002.entry.js → p-cecdb592.entry.js} +2 -2
  218. package/dist/lime-elements/{p-2fdb51de.entry.js → p-dd0f3190.entry.js} +2 -2
  219. package/dist/lime-elements/{p-10d1256b.entry.js → p-e1df39fc.entry.js} +2 -2
  220. package/dist/lime-elements/{p-c823d32b.entry.js → p-e22edc40.entry.js} +2 -2
  221. package/dist/lime-elements/{p-3a61deb1.entry.js → p-e4fd6591.entry.js} +2 -2
  222. package/dist/lime-elements/{p-e739d600.entry.js → p-e8370ee5.entry.js} +2 -2
  223. package/dist/lime-elements/{p-874f06f0.entry.js → p-ead08551.entry.js} +5 -5
  224. package/dist/lime-elements/{p-ae507565.entry.js → p-ec03874d.entry.js} +2 -2
  225. package/dist/lime-elements/{p-b5a96409.entry.js → p-f1c9089e.entry.js} +2 -2
  226. package/dist/lime-elements/p-f6d8811f.entry.js +2 -0
  227. package/dist/lime-elements/p-f6d8811f.entry.js.map +1 -0
  228. package/dist/lime-elements/{p-c2f922ba.entry.js → p-f8cbb607.entry.js} +2 -2
  229. package/dist/types/components/table/columns.d.ts +7 -11
  230. package/dist/types/components/table/table-selection.d.ts +4 -4
  231. package/dist/types/components/table/table.d.ts +15 -5
  232. package/dist/types/components.d.ts +12 -0
  233. package/dist/types/util/make-enter-clickable.d.ts +19 -3
  234. package/package.json +3 -3
  235. package/dist/cjs/index-174a078a.js.map +0 -1
  236. package/dist/cjs/make-enter-clickable-39af24ec.js.map +0 -1
  237. package/dist/esm/index-2714248e.js.map +0 -1
  238. package/dist/esm/make-enter-clickable-e0d24198.js.map +0 -1
  239. package/dist/lime-elements/p-288f0842.js +0 -3
  240. package/dist/lime-elements/p-288f0842.js.map +0 -1
  241. package/dist/lime-elements/p-533a3cfb.entry.js +0 -2
  242. package/dist/lime-elements/p-533a3cfb.entry.js.map +0 -1
  243. package/dist/lime-elements/p-b928421f.entry.js.map +0 -1
  244. package/dist/lime-elements/p-e127eaaa.js +0 -2
  245. package/dist/lime-elements/p-e127eaaa.js.map +0 -1
  246. /package/dist/lime-elements/{p-8ded6465.js.map → p-03fd2774.js.map} +0 -0
  247. /package/dist/lime-elements/{p-8539647d.entry.js.map → p-054daef5.entry.js.map} +0 -0
  248. /package/dist/lime-elements/{p-4f85b3c4.entry.js.map → p-07c4def0.entry.js.map} +0 -0
  249. /package/dist/lime-elements/{p-5b1cb891.entry.js.map → p-08f75835.entry.js.map} +0 -0
  250. /package/dist/lime-elements/{p-eac0220e.entry.js.map → p-147b0a68.entry.js.map} +0 -0
  251. /package/dist/lime-elements/{p-407a0e61.entry.js.map → p-19f525ba.entry.js.map} +0 -0
  252. /package/dist/lime-elements/{p-ac55217a.entry.js.map → p-1a351a7f.entry.js.map} +0 -0
  253. /package/dist/lime-elements/{p-bb0095c2.entry.js.map → p-1af74f5c.entry.js.map} +0 -0
  254. /package/dist/lime-elements/{p-2116b3ce.entry.js.map → p-2356b938.entry.js.map} +0 -0
  255. /package/dist/lime-elements/{p-8c667a56.entry.js.map → p-25158b9e.entry.js.map} +0 -0
  256. /package/dist/lime-elements/{p-8e7d31b3.entry.js.map → p-263bac63.entry.js.map} +0 -0
  257. /package/dist/lime-elements/{p-18256ad9.entry.js.map → p-280cbd66.entry.js.map} +0 -0
  258. /package/dist/lime-elements/{p-3a36b862.entry.js.map → p-291cd743.entry.js.map} +0 -0
  259. /package/dist/lime-elements/{p-aa159bd8.entry.js.map → p-2a616374.entry.js.map} +0 -0
  260. /package/dist/lime-elements/{p-5f113a63.entry.js.map → p-312d104a.entry.js.map} +0 -0
  261. /package/dist/lime-elements/{p-52fb3988.entry.js.map → p-317f00ea.entry.js.map} +0 -0
  262. /package/dist/lime-elements/{p-c7ffe359.entry.js.map → p-32611964.entry.js.map} +0 -0
  263. /package/dist/lime-elements/{p-416f25fc.entry.js.map → p-333ba7ca.entry.js.map} +0 -0
  264. /package/dist/lime-elements/{p-b80a7353.entry.js.map → p-354c2d16.entry.js.map} +0 -0
  265. /package/dist/lime-elements/{p-d497cac7.entry.js.map → p-36ae8adf.entry.js.map} +0 -0
  266. /package/dist/lime-elements/{p-4ed15eb7.entry.js.map → p-3fcd15bd.entry.js.map} +0 -0
  267. /package/dist/lime-elements/{p-2ff2186f.entry.js.map → p-4d225689.entry.js.map} +0 -0
  268. /package/dist/lime-elements/{p-668e583c.entry.js.map → p-56c9bb65.entry.js.map} +0 -0
  269. /package/dist/lime-elements/{p-745417ee.entry.js.map → p-5ca68424.entry.js.map} +0 -0
  270. /package/dist/lime-elements/{p-4a9a6e16.entry.js.map → p-60a43c1d.entry.js.map} +0 -0
  271. /package/dist/lime-elements/{p-ac334aa7.entry.js.map → p-67b697b4.entry.js.map} +0 -0
  272. /package/dist/lime-elements/{p-b45cfa71.entry.js.map → p-6c5eea77.entry.js.map} +0 -0
  273. /package/dist/lime-elements/{p-5ac43dbd.entry.js.map → p-6ce5a93f.entry.js.map} +0 -0
  274. /package/dist/lime-elements/{p-d4a220eb.entry.js.map → p-6ddb0265.entry.js.map} +0 -0
  275. /package/dist/lime-elements/{p-0115bb1e.entry.js.map → p-6ef87216.entry.js.map} +0 -0
  276. /package/dist/lime-elements/{p-51d475d8.entry.js.map → p-6f3a34f1.entry.js.map} +0 -0
  277. /package/dist/lime-elements/{p-54fc2316.entry.js.map → p-718d5311.entry.js.map} +0 -0
  278. /package/dist/lime-elements/{p-e839ce5b.entry.js.map → p-72a79ebe.entry.js.map} +0 -0
  279. /package/dist/lime-elements/{p-0d247b83.entry.js.map → p-7b681f7c.entry.js.map} +0 -0
  280. /package/dist/lime-elements/{p-f8b6d7e1.entry.js.map → p-7d107fba.entry.js.map} +0 -0
  281. /package/dist/lime-elements/{p-47da9c59.entry.js.map → p-81de7836.entry.js.map} +0 -0
  282. /package/dist/lime-elements/{p-32572c31.entry.js.map → p-8535dc16.entry.js.map} +0 -0
  283. /package/dist/lime-elements/{p-706c2e84.entry.js.map → p-9697010e.entry.js.map} +0 -0
  284. /package/dist/lime-elements/{p-483ba5da.entry.js.map → p-9a64025b.entry.js.map} +0 -0
  285. /package/dist/lime-elements/{p-f1ec1eeb.entry.js.map → p-9c9876f9.entry.js.map} +0 -0
  286. /package/dist/lime-elements/{p-9b809f4d.entry.js.map → p-9e225545.entry.js.map} +0 -0
  287. /package/dist/lime-elements/{p-4ddb8b05.entry.js.map → p-a92369cb.entry.js.map} +0 -0
  288. /package/dist/lime-elements/{p-1e4ca584.entry.js.map → p-ae25ca92.entry.js.map} +0 -0
  289. /package/dist/lime-elements/{p-580a29c5.entry.js.map → p-b076958e.entry.js.map} +0 -0
  290. /package/dist/lime-elements/{p-20950d83.entry.js.map → p-b3f1f121.entry.js.map} +0 -0
  291. /package/dist/lime-elements/{p-07988749.entry.js.map → p-b89cb5a3.entry.js.map} +0 -0
  292. /package/dist/lime-elements/{p-6ef94d19.entry.js.map → p-b906e1c5.entry.js.map} +0 -0
  293. /package/dist/lime-elements/{p-b43e8cb2.entry.js.map → p-c445aed7.entry.js.map} +0 -0
  294. /package/dist/lime-elements/{p-489d7f63.entry.js.map → p-c64e86fd.entry.js.map} +0 -0
  295. /package/dist/lime-elements/{p-cbbe129b.entry.js.map → p-cb81be35.entry.js.map} +0 -0
  296. /package/dist/lime-elements/{p-9af45dec.entry.js.map → p-cd0010ba.entry.js.map} +0 -0
  297. /package/dist/lime-elements/{p-250acfe4.entry.js.map → p-ce0e6d28.entry.js.map} +0 -0
  298. /package/dist/lime-elements/{p-7528a002.entry.js.map → p-cecdb592.entry.js.map} +0 -0
  299. /package/dist/lime-elements/{p-2fdb51de.entry.js.map → p-dd0f3190.entry.js.map} +0 -0
  300. /package/dist/lime-elements/{p-10d1256b.entry.js.map → p-e1df39fc.entry.js.map} +0 -0
  301. /package/dist/lime-elements/{p-c823d32b.entry.js.map → p-e22edc40.entry.js.map} +0 -0
  302. /package/dist/lime-elements/{p-3a61deb1.entry.js.map → p-e4fd6591.entry.js.map} +0 -0
  303. /package/dist/lime-elements/{p-e739d600.entry.js.map → p-e8370ee5.entry.js.map} +0 -0
  304. /package/dist/lime-elements/{p-874f06f0.entry.js.map → p-ead08551.entry.js.map} +0 -0
  305. /package/dist/lime-elements/{p-ae507565.entry.js.map → p-ec03874d.entry.js.map} +0 -0
  306. /package/dist/lime-elements/{p-b5a96409.entry.js.map → p-f1c9089e.entry.js.map} +0 -0
  307. /package/dist/lime-elements/{p-c2f922ba.entry.js.map → p-f8cbb607.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r,c as e,h as t,H as i,g as n}from"./p-288f0842.js";import{c as o}from"./p-ad52787a.js";import{c as a,a as u}from"./p-4e9b4087.js";import{t as f}from"./p-df36e1ae.js";var l=a((function(r,e){(function(e,t){r.exports=t()})(u,(function(){var r=navigator.userAgent;var e=navigator.platform;var t=/gecko\/\d/i.test(r);var i=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var a=i||n||o;var u=a&&(i?document.documentMode||6:+(o||n)[1]);var f=!o&&/WebKit\//.test(r);var l=f&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var d=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var v=/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(e);var k=/\bCrOS\b/.test(r);var y=/win/i.test(e);var x=d&&r.match(/Version\/(\d*\.\d*)/);if(x){x=Number(x[1])}if(x&&x>=15){d=false;f=true}var C=w&&(l||d&&(x==null||x<12.11));var M=t||a&&u>=9;function A(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,e){var t=r.className;var i=A(e).exec(t);if(i){var n=t.slice(i.index+i[0].length);r.className=t.slice(0,i.index)+(n?i[1]+n:"")}};function S(r){for(var e=r.childNodes.length;e>0;--e){r.removeChild(r.firstChild)}return r}function T(r,e){return S(r).appendChild(e)}function N(r,e,t,i){var n=document.createElement(r);if(t){n.className=t}if(i){n.style.cssText=i}if(typeof e=="string"){n.appendChild(document.createTextNode(e))}else if(e){for(var o=0;o<e.length;++o){n.appendChild(e[o])}}return n}function E(r,e,t,i){var n=N(r,e,t,i);n.setAttribute("role","presentation");return n}var D;if(document.createRange){D=function(r,e,t,i){var n=document.createRange();n.setEnd(i||r,t);n.setStart(r,e);return n}}else{D=function(r,e,t){var i=document.body.createTextRange();try{i.moveToElementText(r.parentNode)}catch(r){return i}i.collapse(true);i.moveEnd("character",t);i.moveStart("character",e);return i}}function z(r,e){if(e.nodeType==3){e=e.parentNode}if(r.contains){return r.contains(e)}do{if(e.nodeType==11){e=e.host}if(e==r){return true}}while(e=e.parentNode)}function j(r){var e;try{e=r.activeElement}catch(t){e=r.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement){e=e.shadowRoot.activeElement}return e}function I(r,e){var t=r.className;if(!A(e).test(t)){r.className+=(t?" ":"")+e}}function B(r,e){var t=r.split(" ");for(var i=0;i<t.length;i++){if(t[i]&&!A(t[i]).test(e)){e+=" "+t[i]}}return e}var R=function(r){r.select()};if(p){R=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(a){R=function(r){try{r.select()}catch(r){}}}function F(r){return r.display.wrapper.ownerDocument}function O(r){return F(r).defaultView}function U(r){var e=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,e)}}function P(r,e,t){if(!e){e={}}for(var i in r){if(r.hasOwnProperty(i)&&(t!==false||!e.hasOwnProperty(i))){e[i]=r[i]}}return e}function _(r,e,t,i,n){if(e==null){e=r.search(/[^\s\u00a0]/);if(e==-1){e=r.length}}for(var o=i||0,a=n||0;;){var u=r.indexOf("\t",o);if(u<0||u>=e){return a+(e-o)}a+=u-o;a+=t-a%t;o=u+1}}var q=function(){this.id=null;this.f=null;this.time=0;this.handler=U(this.onTimeout,this)};q.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};q.prototype.set=function(r,e){this.f=e;var t=+new Date+r;if(!this.id||t<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=t}};function W(r,e){for(var t=0;t<r.length;++t){if(r[t]==e){return t}}return-1}var $=50;var G={toString:function(){return"CodeMirror.Pass"}};var H={scroll:false},K={origin:"*mouse"},V={origin:"+move"};function Q(r,e,t){for(var i=0,n=0;;){var o=r.indexOf("\t",i);if(o==-1){o=r.length}var a=o-i;if(o==r.length||n+a>=e){return i+Math.min(a,e-n)}n+=o-i;n+=t-n%t;i=o+1;if(n>=e){return i}}}var J=[""];function Y(r){while(J.length<=r){J.push(X(J)+" ")}return J[r]}function X(r){return r[r.length-1]}function Z(r,e){var t=[];for(var i=0;i<r.length;i++){t[i]=e(r[i],i)}return t}function rr(r,e,t){var i=0,n=t(e);while(i<r.length&&t(r[i])<=n){i++}r.splice(i,0,e)}function er(){}function tr(r,e){var t;if(Object.create){t=Object.create(r)}else{er.prototype=r;t=new er}if(e){P(e,t)}return t}var ir=/[\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()||ir.test(r))}function or(r,e){if(!e){return nr(r)}if(e.source.indexOf("\\w")>-1&&nr(r)){return true}return e.test(r)}function ar(r){for(var e in r){if(r.hasOwnProperty(e)&&r[e]){return false}}return true}var ur=/[\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 fr(r){return r.charCodeAt(0)>=768&&ur.test(r)}function lr(r,e,t){while((t<0?e>0:e<r.length)&&fr(r.charAt(e))){e+=t}return e}function sr(r,e,t){var i=e>t?-1:1;for(;;){if(e==t){return e}var n=(e+t)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==e){return r(o)?e:t}if(r(o)){t=o}else{e=o+i}}}function cr(r,e,t,i){if(!r){return i(e,t,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var a=r[o];if(a.from<t&&a.to>e||e==t&&a.to==e){i(Math.max(a.from,e),Math.min(a.to,t),a.level==1?"rtl":"ltr",o);n=true}}if(!n){i(e,t,"ltr")}}var dr=null;function hr(r,e,t){var i;dr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<e&&o.to>e){return n}if(o.to==e){if(o.from!=o.to&&t=="before"){i=n}else{dr=n}}if(o.from==e){if(o.from!=o.to&&t!="before"){i=n}else{dr=n}}}return i!=null?i:dr}var vr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function t(t){if(t<=247){return r.charAt(t)}else if(1424<=t&&t<=1524){return"R"}else if(1536<=t&&t<=1785){return e.charAt(t-1536)}else if(1774<=t&&t<=2220){return"r"}else if(8192<=t&&t<=8203){return"w"}else if(t==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,u=/[1n]/;function f(r,e,t){this.level=r;this.from=e;this.to=t}return function(r,e){var l=e=="ltr"?"L":"R";if(r.length==0||e=="ltr"&&!i.test(r)){return false}var s=r.length,c=[];for(var d=0;d<s;++d){c.push(t(r.charCodeAt(d)))}for(var h=0,v=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=v}else{v=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 y=c[w];if(y=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(y==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=y}for(var x=0;x<s;++x){var C=c[x];if(C==","){c[x]="N"}else if(C=="%"){var M=void 0;for(M=x+1;M<s&&c[M]=="%";++M){}var A=x&&c[x-1]=="!"||M<s&&c[M]=="1"?"1":"N";for(var L=x;L<M;++L){c[L]=A}x=M-1}}for(var S=0,T=l;S<s;++S){var N=c[S];if(T=="L"&&N=="1"){c[S]="L"}else if(o.test(N)){T=N}}for(var E=0;E<s;++E){if(n.test(c[E])){var D=void 0;for(D=E+1;D<s&&n.test(c[D]);++D){}var z=(E?c[E-1]:l)=="L";var j=(D<s?c[D]:l)=="L";var I=z==j?z?"L":"R":l;for(var B=E;B<D;++B){c[B]=I}E=D-1}}var R=[],F;for(var O=0;O<s;){if(a.test(c[O])){var U=O;for(++O;O<s&&a.test(c[O]);++O){}R.push(new f(0,U,O))}else{var P=O,_=R.length,q=e=="rtl"?1:0;for(++O;O<s&&c[O]!="L";++O){}for(var W=P;W<O;){if(u.test(c[W])){if(P<W){R.splice(_,0,new f(1,P,W));_+=q}var $=W;for(++W;W<O&&u.test(c[W]);++W){}R.splice(_,0,new f(2,$,W));_+=q;P=W}else{++W}}if(P<O){R.splice(_,0,new f(1,P,O))}}}if(e=="ltr"){if(R[0].level==1&&(F=r.match(/^\s+/))){R[0].from=F[0].length;R.unshift(new f(0,0,F[0].length))}if(X(R).level==1&&(F=r.match(/\s+$/))){X(R).to-=F[0].length;R.push(new f(0,s-F[0].length,s))}}return e=="rtl"?R.reverse():R}}();function mr(r,e){var t=r.order;if(t==null){t=r.order=vr(r.text,e)}return t}var pr=[];var gr=function(r,e,t){if(r.addEventListener){r.addEventListener(e,t,false)}else if(r.attachEvent){r.attachEvent("on"+e,t)}else{var i=r._handlers||(r._handlers={});i[e]=(i[e]||pr).concat(t)}};function br(r,e){return r._handlers&&r._handlers[e]||pr}function wr(r,e,t){if(r.removeEventListener){r.removeEventListener(e,t,false)}else if(r.detachEvent){r.detachEvent("on"+e,t)}else{var i=r._handlers,n=i&&i[e];if(n){var o=W(n,t);if(o>-1){i[e]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,e){var t=br(r,e);if(!t.length){return}var i=Array.prototype.slice.call(arguments,2);for(var n=0;n<t.length;++n){t[n].apply(null,i)}}function yr(r,e,t){if(typeof e=="string"){e={type:e,preventDefault:function(){this.defaultPrevented=true}}}kr(r,t||e.type,r,e);return Sr(e)||e.codemirrorIgnore}function xr(r){var e=r._handlers&&r._handlers.cursorActivity;if(!e){return}var t=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var i=0;i<e.length;++i){if(W(t,e[i])==-1){t.push(e[i])}}}function Cr(r,e){return br(r,e).length>0}function Mr(r){r.prototype.on=function(r,e){gr(this,r,e)};r.prototype.off=function(r,e){wr(this,r,e)}}function Ar(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 Tr(r){Ar(r);Lr(r)}function Nr(r){return r.target||r.srcElement}function Er(r){var e=r.which;if(e==null){if(r.button&1){e=1}else if(r.button&2){e=3}else if(r.button&4){e=2}}if(w&&r.ctrlKey&&e==1){e=3}return e}var Dr=function(){if(a&&u<9){return false}var r=N("div");return"draggable"in r||"dragDrop"in r}();var zr;function jr(r){if(zr==null){var e=N("span","​");T(r,N("span",[e,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){zr=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&u<8)}}var t=zr?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");t.setAttribute("cm-text","");return t}var Ir;function Br(r){if(Ir!=null){return Ir}var e=T(r,document.createTextNode("AخA"));var t=D(e,0,1).getBoundingClientRect();var i=D(e,1,2).getBoundingClientRect();S(r);if(!t||t.left==t.right){return false}return Ir=i.right-t.right<3}var Rr="\n\nb".split(/\n/).length!=3?function(r){var e=0,t=[],i=r.length;while(e<=i){var n=r.indexOf("\n",e);if(n==-1){n=r.length}var o=r.slice(e,r.charAt(n-1)=="\r"?n-1:n);var a=o.indexOf("\r");if(a!=-1){t.push(o.slice(0,a));e+=a+1}else{t.push(o);e=n+1}}return t}:function(r){return r.split(/\r\n?|\n/)};var Fr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var e;try{e=r.ownerDocument.selection.createRange()}catch(r){}if(!e||e.parentElement()!=r){return false}return e.compareEndPoints("StartToEnd",e)!=0};var Or=function(){var r=N("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Ur=null;function Pr(r){if(Ur!=null){return Ur}var e=T(r,N("span","x"));var t=e.getBoundingClientRect();var i=D(e,0,1).getBoundingClientRect();return Ur=Math.abs(t.left-i.left)>1}var _r={},qr={};function Wr(r,e){if(arguments.length>2){e.dependencies=Array.prototype.slice.call(arguments,2)}_r[r]=e}function $r(r,e){qr[r]=e}function Gr(r){if(typeof r=="string"&&qr.hasOwnProperty(r)){r=qr[r]}else if(r&&typeof r.name=="string"&&qr.hasOwnProperty(r.name)){var e=qr[r.name];if(typeof e=="string"){e={name:e}}r=tr(e,r);r.name=e.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return Gr("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return Gr("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function Hr(r,e){e=Gr(e);var t=_r[e.name];if(!t){return Hr(r,"text/plain")}var i=t(r,e);if(Kr.hasOwnProperty(e.name)){var n=Kr[e.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(i.hasOwnProperty(o)){i["_"+o]=i[o]}i[o]=n[o]}}i.name=e.name;if(e.helperType){i.helperType=e.helperType}if(e.modeProps){for(var a in e.modeProps){i[a]=e.modeProps[a]}}return i}var Kr={};function Vr(r,e){var t=Kr.hasOwnProperty(r)?Kr[r]:Kr[r]={};P(e,t)}function Qr(r,e){if(e===true){return e}if(r.copyState){return r.copyState(e)}var t={};for(var i in e){var n=e[i];if(n instanceof Array){n=n.concat([])}t[i]=n}return t}function Jr(r,e){var t;while(r.innerMode){t=r.innerMode(e);if(!t||t.mode==r){break}e=t.state;r=t.mode}return t||{mode:r,state:e}}function Yr(r,e,t){return r.startState?r.startState(e,t):true}var Xr=function(r,e,t){this.pos=this.start=0;this.string=r;this.tabSize=e||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=t};Xr.prototype.eol=function(){return this.pos>=this.string.length};Xr.prototype.sol=function(){return this.pos==this.lineStart};Xr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};Xr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};Xr.prototype.eat=function(r){var e=this.string.charAt(this.pos);var t;if(typeof r=="string"){t=e==r}else{t=e&&(r.test?r.test(e):r(e))}if(t){++this.pos;return e}};Xr.prototype.eatWhile=function(r){var e=this.pos;while(this.eat(r)){}return this.pos>e};Xr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};Xr.prototype.skipToEnd=function(){this.pos=this.string.length};Xr.prototype.skipTo=function(r){var e=this.string.indexOf(r,this.pos);if(e>-1){this.pos=e;return true}};Xr.prototype.backUp=function(r){this.pos-=r};Xr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.match=function(r,e,t){if(typeof r=="string"){var i=function(r){return t?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(i(n)==i(r)){if(e!==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&&e!==false){this.pos+=o[0].length}return o}};Xr.prototype.current=function(){return this.string.slice(this.start,this.pos)};Xr.prototype.hideFirstChars=function(r,e){this.lineStart+=r;try{return e()}finally{this.lineStart-=r}};Xr.prototype.lookAhead=function(r){var e=this.lineOracle;return e&&e.lookAhead(r)};Xr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,e){e-=r.first;if(e<0||e>=r.size){throw new Error("There is no line "+(e+r.first)+" in the document.")}var t=r;while(!t.lines){for(var i=0;;++i){var n=t.children[i],o=n.chunkSize();if(e<o){t=n;break}e-=o}}return t.lines[e]}function re(r,e,t){var i=[],n=e.line;r.iter(e.line,t.line+1,(function(r){var o=r.text;if(n==t.line){o=o.slice(0,t.ch)}if(n==e.line){o=o.slice(e.ch)}i.push(o);++n}));return i}function ee(r,e,t){var i=[];r.iter(e,t,(function(r){i.push(r.text)}));return i}function te(r,e){var t=e-r.height;if(t){for(var i=r;i;i=i.parent){i.height+=t}}}function ie(r){if(r.parent==null){return null}var e=r.parent,t=W(e.lines,r);for(var i=e.parent;i;e=i,i=i.parent){for(var n=0;;++n){if(i.children[n]==e){break}t+=i.children[n].chunkSize()}}return t+e.first}function ne(r,e){var t=r.first;r:do{for(var i=0;i<r.children.length;++i){var n=r.children[i],o=n.height;if(e<o){r=n;continue r}e-=o;t+=n.chunkSize()}return t}while(!r.lines);var a=0;for(;a<r.lines.length;++a){var u=r.lines[a],f=u.height;if(e<f){break}e-=f}return t+a}function oe(r,e){return e>=r.first&&e<r.first+r.size}function ae(r,e){return String(r.lineNumberFormatter(e+r.firstLineNumber))}function ue(r,e,t){if(t===void 0)t=null;if(!(this instanceof ue)){return new ue(r,e,t)}this.line=r;this.ch=e;this.sticky=t}function fe(r,e){return r.line-e.line||r.ch-e.ch}function le(r,e){return r.sticky==e.sticky&&fe(r,e)==0}function se(r){return ue(r.line,r.ch)}function ce(r,e){return fe(r,e)<0?e:r}function de(r,e){return fe(r,e)<0?r:e}function he(r,e){return Math.max(r.first,Math.min(e,r.first+r.size-1))}function ve(r,e){if(e.line<r.first){return ue(r.first,0)}var t=r.first+r.size-1;if(e.line>t){return ue(t,Zr(r,t).text.length)}return me(e,Zr(r,e.line).text.length)}function me(r,e){var t=r.ch;if(t==null||t>e){return ue(r.line,e)}else if(t<0){return ue(r.line,0)}else{return r}}function pe(r,e){var t=[];for(var i=0;i<e.length;i++){t[i]=ve(r,e[i])}return t}var ge=function(r,e){this.state=r;this.lookAhead=e};var be=function(r,e,t,i){this.state=e;this.doc=r;this.line=t;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};be.prototype.lookAhead=function(r){var e=this.doc.getLine(this.line+r);if(e!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return e};be.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};be.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};be.fromSaved=function(r,e,t){if(e instanceof ge){return new be(r,Qr(r.mode,e.state),t,e.lookAhead)}else{return new be(r,Qr(r.mode,e),t)}};be.prototype.save=function(r){var e=r!==false?Qr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};function we(r,e,t,i){var n=[r.state.modeGen],o={};Te(r,e.text,r.doc.mode,t,(function(r,e){return n.push(r,e)}),o,i);var a=t.state;var u=function(i){t.baseTokens=n;var u=r.state.overlays[i],f=1,l=0;t.state=true;Te(r,e.text,u.mode,t,(function(r,e){var t=f;while(l<r){var i=n[f];if(i>r){n.splice(f,1,r,n[f+1],i)}f+=2;l=Math.min(r,i)}if(!e){return}if(u.opaque){n.splice(t,f-t,r,"overlay "+e);f=t+2}else{for(;t<f;t+=2){var o=n[t+1];n[t+1]=(o?o+" ":"")+"overlay "+e}}}),o);t.state=a;t.baseTokens=null;t.baseTokenPos=1};for(var f=0;f<r.state.overlays.length;++f)u(f);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function ke(r,e,t){if(!e.styles||e.styles[0]!=r.state.modeGen){var i=ye(r,ie(e));var n=e.text.length>r.options.maxHighlightLength&&Qr(r.doc.mode,i.state);var o=we(r,e,i);if(n){i.state=n}e.stateAfter=i.save(!n);e.styles=o.styles;if(o.classes){e.styleClasses=o.classes}else if(e.styleClasses){e.styleClasses=null}if(t===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return e.styles}function ye(r,e,t){var i=r.doc,n=r.display;if(!i.mode.startState){return new be(i,true,e)}var o=Ne(r,e,t);var a=o>i.first&&Zr(i,o-1).stateAfter;var u=a?be.fromSaved(i,a,o):new be(i,Yr(i.mode),o);i.iter(o,e,(function(t){xe(r,t.text,u);var i=u.line;t.stateAfter=i==e-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?u.save():null;u.nextLine()}));if(t){i.modeFrontier=u.line}return u}function xe(r,e,t,i){var n=r.doc.mode;var o=new Xr(e,r.options.tabSize,t);o.start=o.pos=i||0;if(e==""){Ce(n,t.state)}while(!o.eol()){Me(n,o,t.state);o.start=o.pos}}function Ce(r,e){if(r.blankLine){return r.blankLine(e)}if(!r.innerMode){return}var t=Jr(r,e);if(t.mode.blankLine){return t.mode.blankLine(t.state)}}function Me(r,e,t,i){for(var n=0;n<10;n++){if(i){i[0]=Jr(r,t).mode}var o=r.token(e,t);if(e.pos>e.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var Ae=function(r,e,t){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=e||null;this.state=t};function Le(r,e,t,i){var n=r.doc,o=n.mode,a;e=ve(n,e);var u=Zr(n,e.line),f=ye(r,e.line,t);var l=new Xr(u.text,r.options.tabSize,f),s;if(i){s=[]}while((i||l.pos<e.ch)&&!l.eol()){l.start=l.pos;a=Me(o,l,f.state);if(i){s.push(new Ae(l,a,Qr(n.mode,f.state)))}}return i?s:new Ae(l,a,f.state)}function Se(r,e){if(r){for(;;){var t=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!t){break}r=r.slice(0,t.index)+r.slice(t.index+t[0].length);var i=t[1]?"bgClass":"textClass";if(e[i]==null){e[i]=t[2]}else if(!new RegExp("(?:^|\\s)"+t[2]+"(?:$|\\s)").test(e[i])){e[i]+=" "+t[2]}}}return r}function Te(r,e,t,i,n,o,a){var u=t.flattenSpans;if(u==null){u=r.options.flattenSpans}var f=0,l=null;var s=new Xr(e,r.options.tabSize,i),c;var d=r.options.addModeClass&&[null];if(e==""){Se(Ce(t,i.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){u=false;if(a){xe(r,e,i,s.pos)}s.pos=e.length;c=null}else{c=Se(Me(t,s,i.state,d),o)}if(d){var h=d[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!u||l!=c){while(f<s.start){f=Math.min(s.start,f+5e3);n(f,l)}l=c}s.start=s.pos}while(f<s.pos){var v=Math.min(s.pos,f+5e3);n(v,l);f=v}}function Ne(r,e,t){var i,n,o=r.doc;var a=t?-1:e-(r.doc.mode.innerMode?1e3:100);for(var u=e;u>a;--u){if(u<=o.first){return o.first}var f=Zr(o,u-1),l=f.stateAfter;if(l&&(!t||u+(l instanceof ge?l.lookAhead:0)<=o.modeFrontier)){return u}var s=_(f.text,null,r.options.tabSize);if(n==null||i>s){n=u-1;i=s}}return n}function Ee(r,e){r.modeFrontier=Math.min(r.modeFrontier,e);if(r.highlightFrontier<e-10){return}var t=r.first;for(var i=e-1;i>t;i--){var n=Zr(r,i).stateAfter;if(n&&(!(n instanceof ge)||i+n.lookAhead<e)){t=i+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,t)}var De=false,ze=false;function je(){De=true}function Ie(){ze=true}function Be(r,e,t){this.marker=r;this.from=e;this.to=t}function Re(r,e){if(r){for(var t=0;t<r.length;++t){var i=r[t];if(i.marker==e){return i}}}}function Fe(r,e){var t;for(var i=0;i<r.length;++i){if(r[i]!=e){(t||(t=[])).push(r[i])}}return t}function Oe(r,e,t){var i=t&&window.WeakSet&&(t.markedSpans||(t.markedSpans=new WeakSet));if(i&&r.markedSpans&&i.has(r.markedSpans)){r.markedSpans.push(e)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([e]):[e];if(i){i.add(r.markedSpans)}}e.marker.attachLine(r)}function Ue(r,e,t){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],a=o.marker;var u=o.from==null||(a.inclusiveLeft?o.from<=e:o.from<e);if(u||o.from==e&&a.type=="bookmark"&&(!t||!o.marker.insertLeft)){var f=o.to==null||(a.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new Be(a,o.from,f?null:o.to))}}}return i}function Pe(r,e,t){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],a=o.marker;var u=o.to==null||(a.inclusiveRight?o.to>=e:o.to>e);if(u||o.from==e&&a.type=="bookmark"&&(!t||o.marker.insertLeft)){var f=o.from==null||(a.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new Be(a,f?null:o.from-e,o.to==null?null:o.to-e))}}}return i}function _e(r,e){if(e.full){return null}var t=oe(r,e.from.line)&&Zr(r,e.from.line).markedSpans;var i=oe(r,e.to.line)&&Zr(r,e.to.line).markedSpans;if(!t&&!i){return null}var n=e.from.ch,o=e.to.ch,a=fe(e.from,e.to)==0;var u=Ue(t,n,a);var f=Pe(i,o,a);var l=e.text.length==1,s=X(e.text).length+(l?n:0);if(u){for(var c=0;c<u.length;++c){var d=u[c];if(d.to==null){var h=Re(f,d.marker);if(!h){d.to=n}else if(l){d.to=h.to==null?null:h.to+s}}}}if(f){for(var v=0;v<f.length;++v){var m=f[v];if(m.to!=null){m.to+=s}if(m.from==null){var p=Re(u,m.marker);if(!p){m.from=s;if(l){(u||(u=[])).push(m)}}}else{m.from+=s;if(l){(u||(u=[])).push(m)}}}}if(u){u=qe(u)}if(f&&f!=u){f=qe(f)}var g=[u];if(!l){var b=e.text.length-2,w;if(b>0&&u){for(var k=0;k<u.length;++k){if(u[k].to==null){(w||(w=[])).push(new Be(u[k].marker,null,null))}}}for(var y=0;y<b;++y){g.push(w)}g.push(f)}return g}function qe(r){for(var e=0;e<r.length;++e){var t=r[e];if(t.from!=null&&t.from==t.to&&t.marker.clearWhenEmpty!==false){r.splice(e--,1)}}if(!r.length){return null}return r}function We(r,e,t){var i=null;r.iter(e.line,t.line+1,(function(r){if(r.markedSpans){for(var e=0;e<r.markedSpans.length;++e){var t=r.markedSpans[e].marker;if(t.readOnly&&(!i||W(i,t)==-1)){(i||(i=[])).push(t)}}}}));if(!i){return null}var n=[{from:e,to:t}];for(var o=0;o<i.length;++o){var a=i[o],u=a.find(0);for(var f=0;f<n.length;++f){var l=n[f];if(fe(l.to,u.from)<0||fe(l.from,u.to)>0){continue}var s=[f,1],c=fe(l.from,u.from),d=fe(l.to,u.to);if(c<0||!a.inclusiveLeft&&!c){s.push({from:l.from,to:u.from})}if(d>0||!a.inclusiveRight&&!d){s.push({from:u.to,to:l.to})}n.splice.apply(n,s);f+=s.length-3}}return n}function $e(r){var e=r.markedSpans;if(!e){return}for(var t=0;t<e.length;++t){e[t].marker.detachLine(r)}r.markedSpans=null}function Ge(r,e){if(!e){return}for(var t=0;t<e.length;++t){e[t].marker.attachLine(r)}r.markedSpans=e}function He(r){return r.inclusiveLeft?-1:0}function Ke(r){return r.inclusiveRight?1:0}function Ve(r,e){var t=r.lines.length-e.lines.length;if(t!=0){return t}var i=r.find(),n=e.find();var o=fe(i.from,n.from)||He(r)-He(e);if(o){return-o}var a=fe(i.to,n.to)||Ke(r)-Ke(e);if(a){return a}return e.id-r.id}function Qe(r,e){var t=ze&&r.markedSpans,i;if(t){for(var n=void 0,o=0;o<t.length;++o){n=t[o];if(n.marker.collapsed&&(e?n.from:n.to)==null&&(!i||Ve(i,n.marker)<0)){i=n.marker}}}return i}function Je(r){return Qe(r,true)}function Ye(r){return Qe(r,false)}function Xe(r,e){var t=ze&&r.markedSpans,i;if(t){for(var n=0;n<t.length;++n){var o=t[n];if(o.marker.collapsed&&(o.from==null||o.from<e)&&(o.to==null||o.to>e)&&(!i||Ve(i,o.marker)<0)){i=o.marker}}}return i}function Ze(r,e,t,i,n){var o=Zr(r,e);var a=ze&&o.markedSpans;if(a){for(var u=0;u<a.length;++u){var f=a[u];if(!f.marker.collapsed){continue}var l=f.marker.find(0);var s=fe(l.from,t)||He(f.marker)-He(n);var c=fe(l.to,i)||Ke(f.marker)-Ke(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(f.marker.inclusiveRight&&n.inclusiveLeft?fe(l.to,t)>=0:fe(l.to,t)>0)||s>=0&&(f.marker.inclusiveRight&&n.inclusiveLeft?fe(l.from,i)<=0:fe(l.from,i)<0)){return true}}}}function rt(r){var e;while(e=Je(r)){r=e.find(-1,true).line}return r}function et(r){var e;while(e=Ye(r)){r=e.find(1,true).line}return r}function tt(r){var e,t;while(e=Ye(r)){r=e.find(1,true).line;(t||(t=[])).push(r)}return t}function it(r,e){var t=Zr(r,e),i=rt(t);if(t==i){return e}return ie(i)}function nt(r,e){if(e>r.lastLine()){return e}var t=Zr(r,e),i;if(!ot(r,t)){return e}while(i=Ye(t)){t=i.find(1,true).line}return ie(t)+1}function ot(r,e){var t=ze&&e.markedSpans;if(t){for(var i=void 0,n=0;n<t.length;++n){i=t[n];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&at(r,e,i)){return true}}}}function at(r,e,t){if(t.to==null){var i=t.marker.find(1,true);return at(r,i.line,Re(i.line.markedSpans,t.marker))}if(t.marker.inclusiveRight&&t.to==e.text.length){return true}for(var n=void 0,o=0;o<e.markedSpans.length;++o){n=e.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==t.to&&(n.to==null||n.to!=t.from)&&(n.marker.inclusiveLeft||t.marker.inclusiveRight)&&at(r,e,n)){return true}}}function ut(r){r=rt(r);var e=0,t=r.parent;for(var i=0;i<t.lines.length;++i){var n=t.lines[i];if(n==r){break}else{e+=n.height}}for(var o=t.parent;o;t=o,o=t.parent){for(var a=0;a<o.children.length;++a){var u=o.children[a];if(u==t){break}else{e+=u.height}}}return e}function ft(r){if(r.height==0){return 0}var e=r.text.length,t,i=r;while(t=Je(i)){var n=t.find(0,true);i=n.from.line;e+=n.from.ch-n.to.ch}i=r;while(t=Ye(i)){var o=t.find(0,true);e-=i.text.length-o.from.ch;i=o.to.line;e+=i.text.length-o.to.ch}return e}function lt(r){var e=r.display,t=r.doc;e.maxLine=Zr(t,t.first);e.maxLineLength=ft(e.maxLine);e.maxLineChanged=true;t.iter((function(r){var t=ft(r);if(t>e.maxLineLength){e.maxLineLength=t;e.maxLine=r}}))}var st=function(r,e,t){this.text=r;Ge(this,e);this.height=t?t(this):1};st.prototype.lineNo=function(){return ie(this)};Mr(st);function ct(r,e,t,i){r.text=e;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}$e(r);Ge(r,t);var n=i?i(r):1;if(n!=r.height){te(r,n)}}function dt(r){r.parent=null;$e(r)}var ht={},vt={};function mt(r,e){if(!r||/^\s*$/.test(r)){return null}var t=e.addModeClass?vt:ht;return t[r]||(t[r]=r.replace(/\S+/g,"cm-$&"))}function pt(r,e){var t=E("span",null,null,f?"padding-right: .1px":null);var i={pre:E("pre",[t],"CodeMirror-line"),content:t,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};e.measure={};for(var n=0;n<=(e.rest?e.rest.length:0);n++){var o=n?e.rest[n-1]:e.line,a=void 0;i.pos=0;i.addToken=bt;if(Br(r.display.measure)&&(a=mr(o,r.doc.direction))){i.addToken=kt(i.addToken,a)}i.map=[];var u=e!=r.display.externalMeasured&&ie(o);xt(o,i,ke(r,o,u));if(o.styleClasses){if(o.styleClasses.bgClass){i.bgClass=B(o.styleClasses.bgClass,i.bgClass||"")}if(o.styleClasses.textClass){i.textClass=B(o.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(jr(r.display.measure)))}if(n==0){e.measure.map=i.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(i.map);(e.measure.caches||(e.measure.caches=[])).push({})}}if(f){var l=i.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,e.line,i.pre);if(i.pre.className){i.textClass=B(i.pre.className,i.textClass||"")}return i}function gt(r){var e=N("span","•","cm-invalidchar");e.title="\\u"+r.charCodeAt(0).toString(16);e.setAttribute("aria-label",e.title);return e}function bt(r,e,t,i,n,o,f){if(!e){return}var l=r.splitSpaces?wt(e,r.trailingSpace):e;var s=r.cm.state.specialChars,c=false;var d;if(!s.test(e)){r.col+=e.length;d=document.createTextNode(l);r.map.push(r.pos,r.pos+e.length,d);if(a&&u<9){c=true}r.pos+=e.length}else{d=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var v=s.exec(e);var m=v?v.index-h:e.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(a&&u<9){d.appendChild(N("span",[p]))}else{d.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!v){break}h+=m+1;var g=void 0;if(v[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=d.appendChild(N("span",Y(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(v[0]=="\r"||v[0]=="\n"){g=d.appendChild(N("span",v[0]=="\r"?"␍":"␤","cm-invalidchar"));g.setAttribute("cm-text",v[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(v[0]);g.setAttribute("cm-text",v[0]);if(a&&u<9){d.appendChild(N("span",[g]))}else{d.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(e.length-1)==32;if(t||i||n||c||o||f){var k=t||"";if(i){k+=i}if(n){k+=n}var y=N("span",[d],k,o);if(f){for(var x in f){if(f.hasOwnProperty(x)&&x!="style"&&x!="class"){y.setAttribute(x,f[x])}}}return r.content.appendChild(y)}r.content.appendChild(d)}function wt(r,e){if(r.length>1&&!/ /.test(r)){return r}var t=e,i="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&t&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}i+=o;t=o==" "}return i}function kt(r,e){return function(t,i,n,o,a,u,f){n=n?n+" cm-force-border":"cm-force-border";var l=t.pos,s=l+i.length;for(;;){var c=void 0;for(var d=0;d<e.length;d++){c=e[d];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(t,i,n,o,a,u,f)}r(t,i.slice(0,c.to-l),n,o,null,u,f);o=null;i=i.slice(c.to-l);l=c.to}}}function yt(r,e,t,i){var n=!i&&t.widgetNode;if(n){r.map.push(r.pos,r.pos+e,n)}if(!i&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",t.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=e;r.trailingSpace=false}function xt(r,e,t){var i=r.markedSpans,n=r.text,o=0;if(!i){for(var a=1;a<t.length;a+=2){e.addToken(e,n.slice(o,o=t[a]),mt(t[a+1],e.cm.options))}return}var u=n.length,f=0,l=1,s="",c,d;var h=0,v,m,p,g,b;for(;;){if(h==f){v=m=p=d="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var y=0;y<i.length;++y){var x=i[y],C=x.marker;if(C.type=="bookmark"&&x.from==f&&C.widgetNode){w.push(C)}else if(x.from<=f&&(x.to==null||x.to>f||C.collapsed&&x.to==f&&x.from==f)){if(x.to!=null&&x.to!=f&&h>x.to){h=x.to;m=""}if(C.className){v+=" "+C.className}if(C.css){d=(d?d+";":"")+C.css}if(C.startStyle&&x.from==f){p+=" "+C.startStyle}if(C.endStyle&&x.to==h){(k||(k=[])).push(C.endStyle,x.to)}if(C.title){(b||(b={})).title=C.title}if(C.attributes){for(var M in C.attributes){(b||(b={}))[M]=C.attributes[M]}}if(C.collapsed&&(!g||Ve(g.marker,C)<0)){g=x}}else if(x.from>f&&h>x.from){h=x.from}}if(k){for(var A=0;A<k.length;A+=2){if(k[A+1]==h){m+=" "+k[A]}}}if(!g||g.from==f){for(var L=0;L<w.length;++L){yt(e,0,w[L])}}if(g&&(g.from||0)==f){yt(e,(g.to==null?u+1:g.to)-f,g.marker,g.from==null);if(g.to==null){return}if(g.to==f){g=false}}}if(f>=u){break}var S=Math.min(u,h);while(true){if(s){var T=f+s.length;if(!g){var N=T>S?s.slice(0,S-f):s;e.addToken(e,N,c?c+v:v,p,f+N.length==h?m:"",d,b)}if(T>=S){s=s.slice(S-f);f=S;break}f=T;p=""}s=n.slice(o,o=t[l++]);c=mt(t[l++],e.cm.options)}}}function Ct(r,e,t){this.line=e;this.rest=tt(e);this.size=this.rest?ie(X(this.rest))-t+1:1;this.node=this.text=null;this.hidden=ot(r,e)}function Mt(r,e,t){var i=[],n;for(var o=e;o<t;o=n){var a=new Ct(r.doc,Zr(r.doc,o),o);n=o+a.size;i.push(a)}return i}var At=null;function Lt(r){if(At){At.ops.push(r)}else{r.ownsGroup=At={ops:[r],delayedCallbacks:[]}}}function St(r){var e=r.delayedCallbacks,t=0;do{for(;t<e.length;t++){e[t].call(null)}for(var i=0;i<r.ops.length;i++){var n=r.ops[i];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(t<e.length)}function Tt(r,e){var t=r.ownsGroup;if(!t){return}try{St(t)}finally{At=null;e(t)}}var Nt=null;function Et(r,e){var t=br(r,e);if(!t.length){return}var i=Array.prototype.slice.call(arguments,2),n;if(At){n=At.delayedCallbacks}else if(Nt){n=Nt}else{n=Nt=[];setTimeout(Dt,0)}var o=function(r){n.push((function(){return t[r].apply(null,i)}))};for(var a=0;a<t.length;++a)o(a)}function Dt(){var r=Nt;Nt=null;for(var e=0;e<r.length;++e){r[e]()}}function zt(r,e,t,i){for(var n=0;n<e.changes.length;n++){var o=e.changes[n];if(o=="text"){Rt(r,e)}else if(o=="gutter"){Ot(r,e,t,i)}else if(o=="class"){Ft(r,e)}else if(o=="widget"){Ut(r,e,i)}}e.changes=null}function jt(r){if(r.node==r.text){r.node=N("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(a&&u<8){r.node.style.zIndex=2}}return r.node}function It(r,e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t){t+=" CodeMirror-linebackground"}if(e.background){if(t){e.background.className=t}else{e.background.parentNode.removeChild(e.background);e.background=null}}else if(t){var i=jt(e);e.background=i.insertBefore(N("div",null,t),i.firstChild);r.display.input.setUneditable(e.background)}}function Bt(r,e){var t=r.display.externalMeasured;if(t&&t.line==e.line){r.display.externalMeasured=null;e.measure=t.measure;return t.built}return pt(r,e)}function Rt(r,e){var t=e.text.className;var i=Bt(r,e);if(e.text==e.node){e.node=i.pre}e.text.parentNode.replaceChild(i.pre,e.text);e.text=i.pre;if(i.bgClass!=e.bgClass||i.textClass!=e.textClass){e.bgClass=i.bgClass;e.textClass=i.textClass;Ft(r,e)}else if(t){e.text.className=t}}function Ft(r,e){It(r,e);if(e.line.wrapClass){jt(e).className=e.line.wrapClass}else if(e.node!=e.text){e.node.className=""}var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(r,e,t,i){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}if(e.gutterBackground){e.node.removeChild(e.gutterBackground);e.gutterBackground=null}if(e.line.gutterClass){var n=jt(e);e.gutterBackground=N("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");r.display.input.setUneditable(e.gutterBackground);n.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(r.options.lineNumbers||o){var a=jt(e);var u=e.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");u.setAttribute("aria-hidden","true");r.display.input.setUneditable(u);a.insertBefore(u,e.text);if(e.line.gutterClass){u.className+=" "+e.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){e.lineNumber=u.appendChild(N("div",ae(r.options,t),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var f=0;f<r.display.gutterSpecs.length;++f){var l=r.display.gutterSpecs[f].className,s=o.hasOwnProperty(l)&&o[l];if(s){u.appendChild(N("div",[s],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}}}function Ut(r,e,t){if(e.alignable){e.alignable=null}var i=A("CodeMirror-linewidget");for(var n=e.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(i.test(n.className)){e.node.removeChild(n)}}_t(r,e,t)}function Pt(r,e,t,i){var n=Bt(r,e);e.text=e.node=n.pre;if(n.bgClass){e.bgClass=n.bgClass}if(n.textClass){e.textClass=n.textClass}Ft(r,e);Ot(r,e,t,i);_t(r,e,i);return e.node}function _t(r,e,t){qt(r,e.line,e,t,true);if(e.rest){for(var i=0;i<e.rest.length;i++){qt(r,e.rest[i],e,t,false)}}}function qt(r,e,t,i,n){if(!e.widgets){return}var o=jt(t);for(var a=0,u=e.widgets;a<u.length;++a){var f=u[a],l=N("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));if(!f.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}Wt(f,l,t,i);r.display.input.setUneditable(l);if(n&&f.above){o.insertBefore(l,t.gutter||t.text)}else{o.appendChild(l)}Et(f,"redraw")}}function Wt(r,e,t,i){if(r.noHScroll){(t.alignable||(t.alignable=[])).push(e);var n=i.wrapperWidth;e.style.left=i.fixedPos+"px";if(!r.coverGutter){n-=i.gutterTotalWidth;e.style.paddingLeft=i.gutterTotalWidth+"px"}e.style.width=n+"px"}if(r.coverGutter){e.style.zIndex=5;e.style.position="relative";if(!r.noHScroll){e.style.marginLeft=-i.gutterTotalWidth+"px"}}}function $t(r){if(r.height!=null){return r.height}var e=r.doc.cm;if(!e){return 0}if(!z(document.body,r.node)){var t="position: relative;";if(r.coverGutter){t+="margin-left: -"+e.display.gutters.offsetWidth+"px;"}if(r.noHScroll){t+="width: "+e.display.wrapper.clientWidth+"px;"}T(e.display.measure,N("div",[r.node],null,t))}return r.height=r.node.parentNode.offsetHeight}function Gt(r,e){for(var t=Nr(e);t!=r.wrapper;t=t.parentNode){if(!t||t.nodeType==1&&t.getAttribute("cm-ignore-events")=="true"||t.parentNode==r.sizer&&t!=r.mover){return true}}}function Ht(r){return r.lineSpace.offsetTop}function Kt(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Vt(r){if(r.cachedPaddingH){return r.cachedPaddingH}var e=T(r.measure,N("pre","x","CodeMirror-line-like"));var t=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;var i={left:parseInt(t.paddingLeft),right:parseInt(t.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){r.cachedPaddingH=i}return i}function Qt(r){return $-r.display.nativeBarWidth}function Jt(r){return r.display.scroller.clientWidth-Qt(r)-r.display.barWidth}function Yt(r){return r.display.scroller.clientHeight-Qt(r)-r.display.barHeight}function Xt(r,e,t){var i=r.options.lineWrapping;var n=i&&Jt(r);if(!e.measure.heights||i&&e.measure.width!=n){var o=e.measure.heights=[];if(i){e.measure.width=n;var a=e.text.firstChild.getClientRects();for(var u=0;u<a.length-1;u++){var f=a[u],l=a[u+1];if(Math.abs(f.bottom-l.bottom)>2){o.push((f.bottom+l.top)/2-t.top)}}}o.push(t.bottom-t.top)}}function Zt(r,e,t){if(r.line==e){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var i=0;i<r.rest.length;i++){if(r.rest[i]==e){return{map:r.measure.maps[i],cache:r.measure.caches[i]}}}for(var n=0;n<r.rest.length;n++){if(ie(r.rest[n])>t){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function ri(r,e){e=rt(e);var t=ie(e);var i=r.display.externalMeasured=new Ct(r.doc,e,t);i.lineN=t;var n=i.built=pt(r,i);i.text=n.pre;T(r.display.lineMeasure,n.pre);return i}function ei(r,e,t,i){return ni(r,ii(r,e),t,i)}function ti(r,e){if(e>=r.display.viewFrom&&e<r.display.viewTo){return r.display.view[Fi(r,e)]}var t=r.display.externalMeasured;if(t&&e>=t.lineN&&e<t.lineN+t.size){return t}}function ii(r,e){var t=ie(e);var i=ti(r,t);if(i&&!i.text){i=null}else if(i&&i.changes){zt(r,i,t,zi(r));r.curOp.forceUpdate=true}if(!i){i=ri(r,e)}var n=Zt(i,e,t);return{line:e,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ni(r,e,t,i,n){if(e.before){t=-1}var o=t+(i||""),a;if(e.cache.hasOwnProperty(o)){a=e.cache[o]}else{if(!e.rect){e.rect=e.view.text.getBoundingClientRect()}if(!e.hasHeights){Xt(r,e.view,e.rect);e.hasHeights=true}a=fi(r,e,t,i);if(!a.bogus){e.cache[o]=a}}return{left:a.left,right:a.right,top:n?a.rtop:a.top,bottom:n?a.rbottom:a.bottom}}var oi={left:0,right:0,top:0,bottom:0};function ai(r,e,t){var i,n,o,a,u,f;for(var l=0;l<r.length;l+=3){u=r[l];f=r[l+1];if(e<u){n=0;o=1;a="left"}else if(e<f){n=e-u;o=n+1}else if(l==r.length-3||e==f&&r[l+3]>e){o=f-u;n=o-1;if(e>=f){a="right"}}if(n!=null){i=r[l+2];if(u==f&&t==(i.insertLeft?"left":"right")){a=t}if(t=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){i=r[(l-=3)+2];a="left"}}if(t=="right"&&n==f-u){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){i=r[(l+=3)+2];a="right"}}break}}return{node:i,start:n,end:o,collapse:a,coverStart:u,coverEnd:f}}function ui(r,e){var t=oi;if(e=="left"){for(var i=0;i<r.length;i++){if((t=r[i]).left!=t.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((t=r[n]).left!=t.right){break}}}return t}function fi(r,e,t,i){var n=ai(e.map,t,i);var o=n.node,f=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var d=0;d<4;d++){while(f&&fr(e.line.text.charAt(n.coverStart+f))){--f}while(n.coverStart+l<n.coverEnd&&fr(e.line.text.charAt(n.coverStart+l))){++l}if(a&&u<9&&f==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=ui(D(o,f,l).getClientRects(),i)}if(c.left||c.right||f==0){break}l=f;f=f-1;s="right"}if(a&&u<11){c=li(r.display.measure,c)}}else{if(f>0){s=i="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[i=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(a&&u<9&&!f&&(!c||!c.left&&!c.right)){var v=o.parentNode.getClientRects()[0];if(v){c={left:v.left,right:v.left+Di(r.display),top:v.top,bottom:v.bottom}}else{c=oi}}var m=c.top-e.rect.top,p=c.bottom-e.rect.top;var g=(m+p)/2;var b=e.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,y=b[w];var x={left:(s=="right"?c.right:c.left)-e.rect.left,right:(s=="left"?c.left:c.right)-e.rect.left,top:k,bottom:y};if(!c.left&&!c.right){x.bogus=true}if(!r.options.singleCursorHeightPerLine){x.rtop=m;x.rbottom=p}return x}function li(r,e){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pr(r)){return e}var t=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*t,right:e.right*t,top:e.top*i,bottom:e.bottom*i}}function si(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var e=0;e<r.rest.length;e++){r.measure.caches[e]={}}}}}function ci(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var e=0;e<r.display.view.length;e++){si(r.display.view[e])}}function di(r){ci(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function hi(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function vi(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function mi(r){var e=rt(r);var t=e.widgets;var i=0;if(t){for(var n=0;n<t.length;++n){if(t[n].above){i+=$t(t[n])}}}return i}function pi(r,e,t,i,n){if(!n){var o=mi(e);t.top+=o;t.bottom+=o}if(i=="line"){return t}if(!i){i="local"}var a=ut(e);if(i=="local"){a+=Ht(r.display)}else{a-=r.display.viewOffset}if(i=="page"||i=="window"){var u=r.display.lineSpace.getBoundingClientRect();a+=u.top+(i=="window"?0:vi(F(r)));var f=u.left+(i=="window"?0:hi(F(r)));t.left+=f;t.right+=f}t.top+=a;t.bottom+=a;return t}function gi(r,e,t){if(t=="div"){return e}var i=e.left,n=e.top;if(t=="page"){i-=hi(F(r));n-=vi(F(r))}else if(t=="local"||!t){var o=r.display.sizer.getBoundingClientRect();i+=o.left;n+=o.top}var a=r.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:n-a.top}}function bi(r,e,t,i,n){if(!i){i=Zr(r.doc,e.line)}return pi(r,i,ei(r,i,e.ch,n),t)}function wi(r,e,t,i,n,o){i=i||Zr(r.doc,e.line);if(!n){n=ii(r,i)}function a(e,a){var u=ni(r,n,e,a?"right":"left",o);if(a){u.left=u.right}else{u.right=u.left}return pi(r,i,u,t)}var u=mr(i,r.doc.direction),f=e.ch,l=e.sticky;if(f>=i.text.length){f=i.text.length;l="before"}else if(f<=0){f=0;l="after"}if(!u){return a(l=="before"?f-1:f,l=="before")}function s(r,e,t){var i=u[e],n=i.level==1;return a(t?r-1:r,n!=t)}var c=hr(u,f,l);var d=dr;var h=s(f,c,l=="before");if(d!=null){h.other=s(f,d,l!="before")}return h}function ki(r,e){var t=0;e=ve(r.doc,e);if(!r.options.lineWrapping){t=Di(r.display)*e.ch}var i=Zr(r.doc,e.line);var n=ut(i)+Ht(r.display);return{left:t,right:t,top:n,bottom:n+i.height}}function yi(r,e,t,i,n){var o=ue(r,e,t);o.xRel=n;if(i){o.outside=i}return o}function xi(r,e,t){var i=r.doc;t+=r.display.viewOffset;if(t<0){return yi(i.first,0,null,-1,-1)}var n=ne(i,t),o=i.first+i.size-1;if(n>o){return yi(i.first+i.size-1,Zr(i,o).text.length,null,1,1)}if(e<0){e=0}var a=Zr(i,n);for(;;){var u=Li(r,a,n,e,t);var f=Xe(a,u.ch+(u.xRel>0||u.outside>0?1:0));if(!f){return u}var l=f.find(1);if(l.line==n){return l}a=Zr(i,n=l.line)}}function Ci(r,e,t,i){i-=mi(e);var n=e.text.length;var o=sr((function(e){return ni(r,t,e-1).bottom<=i}),n,0);n=sr((function(e){return ni(r,t,e).top>i}),o,n);return{begin:o,end:n}}function Mi(r,e,t,i){if(!t){t=ii(r,e)}var n=pi(r,e,ni(r,t,i),"line").top;return Ci(r,e,t,n)}function Ai(r,e,t,i){return r.bottom<=t?false:r.top>t?true:(i?r.left:r.right)>e}function Li(r,e,t,i,n){n-=ut(e);var o=ii(r,e);var a=mi(e);var u=0,f=e.text.length,l=true;var s=mr(e,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ti:Si)(r,e,t,o,s,i,n);l=c.level!=1;u=l?c.from:c.to-1;f=l?c.to:c.from-1}var d=null,h=null;var v=sr((function(e){var t=ni(r,o,e);t.top+=a;t.bottom+=a;if(!Ai(t,i,n,false)){return false}if(t.top<=n&&t.left<=i){d=e;h=t}return true}),u,f);var m,p,g=false;if(h){var b=i-h.left<h.right-i,w=b==l;v=d+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(v==f||v==u)){v++}p=v==0?"after":v==e.text.length?"before":ni(r,o,v-(l?1:0)).bottom+a<=n==l?"after":"before";var k=wi(r,ue(t,v,p),"line",e,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}v=lr(e.text,v,1);return yi(t,v,p,g,i-m)}function Si(r,e,t,i,n,o,a){var u=sr((function(u){var f=n[u],l=f.level!=1;return Ai(wi(r,ue(t,l?f.to:f.from,l?"before":"after"),"line",e,i),o,a,true)}),0,n.length-1);var f=n[u];if(u>0){var l=f.level!=1;var s=wi(r,ue(t,l?f.from:f.to,l?"after":"before"),"line",e,i);if(Ai(s,o,a,true)&&s.top>a){f=n[u-1]}}return f}function Ti(r,e,t,i,n,o,a){var u=Ci(r,e,i,a);var f=u.begin;var l=u.end;if(/\s/.test(e.text.charAt(l-1))){l--}var s=null,c=null;for(var d=0;d<n.length;d++){var h=n[d];if(h.from>=l||h.to<=f){continue}var v=h.level!=1;var m=ni(r,i,v?Math.min(l,h.to)-1:Math.max(f,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<f){s={from:f,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ni;function Ei(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ni==null){Ni=N("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e){Ni.appendChild(document.createTextNode("x"));Ni.appendChild(N("br"))}Ni.appendChild(document.createTextNode("x"))}T(r.measure,Ni);var t=Ni.offsetHeight/50;if(t>3){r.cachedTextHeight=t}S(r.measure);return t||1}function Di(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var e=N("span","xxxxxxxxxx");var t=N("pre",[e],"CodeMirror-line-like");T(r.measure,t);var i=e.getBoundingClientRect(),n=(i.right-i.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function zi(r){var e=r.display,t={},i={};var n=e.gutters.clientLeft;for(var o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var u=r.display.gutterSpecs[a].className;t[u]=o.offsetLeft+o.clientLeft+n;i[u]=o.clientWidth}return{fixedPos:ji(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:t,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function ji(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Ii(r){var e=Ei(r.display),t=r.options.lineWrapping;var i=t&&Math.max(5,r.display.scroller.clientWidth/Di(r.display)-3);return function(n){if(ot(r.doc,n)){return 0}var o=0;if(n.widgets){for(var a=0;a<n.widgets.length;a++){if(n.widgets[a].height){o+=n.widgets[a].height}}}if(t){return o+(Math.ceil(n.text.length/i)||1)*e}else{return o+e}}}function Bi(r){var e=r.doc,t=Ii(r);e.iter((function(r){var e=t(r);if(e!=r.height){te(r,e)}}))}function Ri(r,e,t,i){var n=r.display;if(!t&&Nr(e).getAttribute("cm-not-content")=="true"){return null}var o,a,u=n.lineSpace.getBoundingClientRect();try{o=e.clientX-u.left;a=e.clientY-u.top}catch(r){return null}var f=xi(r,o,a),l;if(i&&f.xRel>0&&(l=Zr(r.doc,f.line).text).length==f.ch){var s=_(l,l.length,r.options.tabSize)-l.length;f=ue(f.line,Math.max(0,Math.round((o-Vt(r.display).left)/Di(r.display))-s))}return f}function Fi(r,e){if(e>=r.display.viewTo){return null}e-=r.display.viewFrom;if(e<0){return null}var t=r.display.view;for(var i=0;i<t.length;i++){e-=t[i].size;if(e<0){return i}}}function Oi(r,e,t,i){if(e==null){e=r.doc.first}if(t==null){t=r.doc.first+r.doc.size}if(!i){i=0}var n=r.display;if(i&&t<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>e)){n.updateLineNumbers=e}r.curOp.viewChanged=true;if(e>=n.viewTo){if(ze&&it(r.doc,e)<n.viewTo){Pi(r)}}else if(t<=n.viewFrom){if(ze&&nt(r.doc,t+i)>n.viewFrom){Pi(r)}else{n.viewFrom+=i;n.viewTo+=i}}else if(e<=n.viewFrom&&t>=n.viewTo){Pi(r)}else if(e<=n.viewFrom){var o=_i(r,t,t+i,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=i}else{Pi(r)}}else if(t>=n.viewTo){var a=_i(r,e,e,-1);if(a){n.view=n.view.slice(0,a.index);n.viewTo=a.lineN}else{Pi(r)}}else{var u=_i(r,e,e,-1);var f=_i(r,t,t+i,1);if(u&&f){n.view=n.view.slice(0,u.index).concat(Mt(r,u.lineN,f.lineN)).concat(n.view.slice(f.index));n.viewTo+=i}else{Pi(r)}}var l=n.externalMeasured;if(l){if(t<l.lineN){l.lineN+=i}else if(e<l.lineN+l.size){n.externalMeasured=null}}}function Ui(r,e,t){r.curOp.viewChanged=true;var i=r.display,n=r.display.externalMeasured;if(n&&e>=n.lineN&&e<n.lineN+n.size){i.externalMeasured=null}if(e<i.viewFrom||e>=i.viewTo){return}var o=i.view[Fi(r,e)];if(o.node==null){return}var a=o.changes||(o.changes=[]);if(W(a,t)==-1){a.push(t)}}function Pi(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function _i(r,e,t,i){var n=Fi(r,e),o,a=r.display.view;if(!ze||t==r.doc.first+r.doc.size){return{index:n,lineN:t}}var u=r.display.viewFrom;for(var f=0;f<n;f++){u+=a[f].size}if(u!=e){if(i>0){if(n==a.length-1){return null}o=u+a[n].size-e;n++}else{o=u-e}e+=o;t+=o}while(it(r.doc,t)!=t){if(n==(i<0?0:a.length-1)){return null}t+=i*a[n-(i<0?1:0)].size;n+=i}return{index:n,lineN:t}}function qi(r,e,t){var i=r.display,n=i.view;if(n.length==0||e>=i.viewTo||t<=i.viewFrom){i.view=Mt(r,e,t);i.viewFrom=e}else{if(i.viewFrom>e){i.view=Mt(r,e,i.viewFrom).concat(i.view)}else if(i.viewFrom<e){i.view=i.view.slice(Fi(r,e))}i.viewFrom=e;if(i.viewTo<t){i.view=i.view.concat(Mt(r,i.viewTo,t))}else if(i.viewTo>t){i.view=i.view.slice(0,Fi(r,t))}}i.viewTo=t}function Wi(r){var e=r.display.view,t=0;for(var i=0;i<e.length;i++){var n=e[i];if(!n.hidden&&(!n.node||n.changes)){++t}}return t}function $i(r){r.display.input.showSelection(r.display.input.prepareSelection())}function Gi(r,e){if(e===void 0)e=true;var t=r.doc,i={};var n=i.cursors=document.createDocumentFragment();var o=i.selection=document.createDocumentFragment();var a=r.options.$customCursor;if(a){e=true}for(var u=0;u<t.sel.ranges.length;u++){if(!e&&u==t.sel.primIndex){continue}var f=t.sel.ranges[u];if(f.from().line>=r.display.viewTo||f.to().line<r.display.viewFrom){continue}var l=f.empty();if(a){var s=a(r,f);if(s){Hi(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){Hi(r,f.head,n)}if(!l){Vi(r,f,o)}}return i}function Hi(r,e,t){var i=wi(r,e,"div",null,null,!r.options.singleCursorHeightPerLine);var n=t.appendChild(N("div"," ","CodeMirror-cursor"));n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.height=Math.max(0,i.bottom-i.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=bi(r,e,"div",null,null);var a=o.right-o.left;n.style.width=(a>0?a:r.defaultCharWidth())+"px"}if(i.other){var u=t.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="";u.style.left=i.other.left+"px";u.style.top=i.other.top+"px";u.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Ki(r,e){return r.top-e.top||r.left-e.left}function Vi(r,e,t){var i=r.display,n=r.doc;var o=document.createDocumentFragment();var a=Vt(r.display),u=a.left;var f=Math.max(i.sizerWidth,Jt(r)-i.sizer.offsetLeft)-a.right;var l=n.direction=="ltr";function s(r,e,t,i){if(e<0){e=0}e=Math.round(e);i=Math.round(i);o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+e+"px; width: "+(t==null?f-r:t)+"px;\n height: "+(i-e)+"px"))}function c(e,t,i){var o=Zr(n,e);var a=o.text.length;var c,d;function h(t,i){return bi(r,ue(e,t),"div",o,i)}function v(e,t,i){var n=Mi(r,o,null,e);var a=t=="ltr"==(i=="after")?"left":"right";var u=i=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(u,a)[a]}var m=mr(o,n.direction);cr(m,t||0,i==null?a:i,(function(r,e,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(e-1,p?"right":"left");var w=t==null&&r==0,k=i==null&&e==a;var y=o==0,x=!m||o==m.length-1;if(b.top-g.top<=3){var C=(l?w:k)&&y;var M=(l?k:w)&&x;var A=C?u:(p?g:b).left;var L=M?f:(p?b:g).right;s(A,g.top,L-A,g.bottom)}else{var S,T,N,E;if(p){S=l&&w&&y?u:g.left;T=l?f:v(r,n,"before");N=l?u:v(e,n,"after");E=l&&k&&x?f:b.right}else{S=!l?u:v(r,n,"before");T=!l&&w&&y?f:g.right;N=!l&&k&&x?u:b.left;E=!l?f:v(e,n,"after")}s(S,g.top,T-S,g.bottom);if(g.bottom<b.top){s(u,g.bottom,null,b.top)}s(N,b.top,E-N,b.bottom)}if(!c||Ki(g,c)<0){c=g}if(Ki(b,c)<0){c=b}if(!d||Ki(g,d)<0){d=g}if(Ki(b,d)<0){d=b}}));return{start:c,end:d}}var d=e.from(),h=e.to();if(d.line==h.line){c(d.line,d.ch,h.ch)}else{var v=Zr(n,d.line),m=Zr(n,h.line);var p=rt(v)==rt(m);var g=c(d.line,d.ch,p?v.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(u,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(u,g.bottom,null,b.top)}}t.appendChild(o)}function Qi(r){if(!r.state.focused){return}var e=r.display;clearInterval(e.blinker);var t=true;e.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){e.blinker=setInterval((function(){if(!r.hasFocus()){Zi(r)}e.cursorDiv.style.visibility=(t=!t)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){e.cursorDiv.style.visibility="hidden"}}function Ji(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){Xi(r)}}}function Yi(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Zi(r)}}}),100)}function Xi(r,e){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,e);r.state.focused=true;I(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(f){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Qi(r)}function Zi(r,e){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,e);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 e=r.display;var t=e.lineDiv.offsetTop;var i=Math.max(0,e.scroller.getBoundingClientRect().top);var n=e.lineDiv.getBoundingClientRect().top;var o=0;for(var f=0;f<e.view.length;f++){var l=e.view[f],s=r.options.lineWrapping;var c=void 0,d=0;if(l.hidden){continue}n+=l.line.height;if(a&&u<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-t;t=h}else{var v=l.node.getBoundingClientRect();c=v.bottom-v.top;if(!s&&l.text.firstChild){d=l.text.firstChild.getBoundingClientRect().right-v.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<i){o-=m}te(l.line,c);en(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){en(l.rest[p])}}}if(d>r.display.sizerWidth){var g=Math.ceil(d/Di(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){e.scroller.scrollTop+=o}}function en(r){if(r.widgets){for(var e=0;e<r.widgets.length;++e){var t=r.widgets[e],i=t.node.parentNode;if(i){t.height=i.offsetHeight}}}}function tn(r,e,t){var i=t&&t.top!=null?Math.max(0,t.top):r.scroller.scrollTop;i=Math.floor(i-Ht(r));var n=t&&t.bottom!=null?t.bottom:i+r.wrapper.clientHeight;var o=ne(e,i),a=ne(e,n);if(t&&t.ensure){var u=t.ensure.from.line,f=t.ensure.to.line;if(u<o){o=u;a=ne(e,ut(Zr(e,u))+r.wrapper.clientHeight)}else if(Math.min(f,e.lastLine())>=a){o=ne(e,ut(Zr(e,f))-r.wrapper.clientHeight);a=f}}return{from:o,to:Math.max(a,o+1)}}function nn(r,e){if(yr(r,"scrollCursorIntoView")){return}var t=r.display,i=t.sizer.getBoundingClientRect(),n=null;var o=t.wrapper.ownerDocument;if(e.top+i.top<0){n=true}else if(e.bottom+i.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var a=N("div","​",null,"position: absolute;\n top: "+(e.top-t.viewOffset-Ht(r.display))+"px;\n height: "+(e.bottom-e.top+Qt(r)+t.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");r.display.lineSpace.appendChild(a);a.scrollIntoView(n);r.display.lineSpace.removeChild(a)}}function on(r,e,t,i){if(i==null){i=0}var n;if(!r.options.lineWrapping&&e==t){t=e.sticky=="before"?ue(e.line,e.ch+1,"before"):e;e=e.ch?ue(e.line,e.sticky=="before"?e.ch-1:e.ch,"after"):e}for(var o=0;o<5;o++){var a=false;var u=wi(r,e);var f=!t||t==e?u:wi(r,t);n={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-i,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+i};var l=un(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){vn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){a=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){a=true}}if(!a){break}}return n}function an(r,e){var t=un(r,e);if(t.scrollTop!=null){vn(r,t.scrollTop)}if(t.scrollLeft!=null){pn(r,t.scrollLeft)}}function un(r,e){var t=r.display,i=Ei(r.display);if(e.top<0){e.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:t.scroller.scrollTop;var o=Yt(r),a={};if(e.bottom-e.top>o){e.bottom=e.top+o}var u=r.doc.height+Kt(t);var f=e.top<i,l=e.bottom>u-i;if(e.top<n){a.scrollTop=f?0:e.top}else if(e.bottom>n+o){var s=Math.min(e.top,(l?u:e.bottom)-o);if(s!=n){a.scrollTop=s}}var c=r.options.fixedGutter?0:t.gutters.offsetWidth;var d=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:t.scroller.scrollLeft-c;var h=Jt(r)-t.gutters.offsetWidth;var v=e.right-e.left>h;if(v){e.right=e.left+h}if(e.left<10){a.scrollLeft=0}else if(e.left<d){a.scrollLeft=Math.max(0,e.left+c-(v?0:10))}else if(e.right>h+d-3){a.scrollLeft=e.right+(v?0:10)-h}return a}function fn(r,e){if(e==null){return}dn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+e}function ln(r){dn(r);var e=r.getCursor();r.curOp.scrollToPos={from:e,to:e,margin:r.options.cursorScrollMargin}}function sn(r,e,t){if(e!=null||t!=null){dn(r)}if(e!=null){r.curOp.scrollLeft=e}if(t!=null){r.curOp.scrollTop=t}}function cn(r,e){dn(r);r.curOp.scrollToPos=e}function dn(r){var e=r.curOp.scrollToPos;if(e){r.curOp.scrollToPos=null;var t=ki(r,e.from),i=ki(r,e.to);hn(r,t,i,e.margin)}}function hn(r,e,t,i){var n=un(r,{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top)-i,right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)+i});sn(r,n.scrollLeft,n.scrollTop)}function vn(r,e){if(Math.abs(r.doc.scrollTop-e)<2){return}if(!t){Gn(r,{top:e})}mn(r,e,true);if(t){Gn(r)}Fn(r,100)}function mn(r,e,t){e=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,e));if(r.display.scroller.scrollTop==e&&!t){return}r.doc.scrollTop=e;r.display.scrollbars.setScrollTop(e);if(r.display.scroller.scrollTop!=e){r.display.scroller.scrollTop=e}}function pn(r,e,t,i){e=Math.max(0,Math.min(e,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((t?e==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-e)<2)&&!i){return}r.doc.scrollLeft=e;Qn(r);if(r.display.scroller.scrollLeft!=e){r.display.scroller.scrollLeft=e}r.display.scrollbars.setScrollLeft(e)}function gn(r){var e=r.display,t=e.gutters.offsetWidth;var i=Math.round(r.doc.height+Kt(r.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:r.options.fixedGutter?t:0,docHeight:i,scrollHeight:i+Qt(r)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:t}}var bn=function(r,e,t){this.cm=t;var i=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1;r(i);r(n);gr(i,"scroll",(function(){if(i.clientHeight){e(i.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){e(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(a&&u<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var e=r.scrollWidth>r.clientWidth+1;var t=r.scrollHeight>r.clientHeight+1;var i=r.nativeBarWidth;if(t){this.vert.style.display="block";this.vert.style.bottom=e?i+"px":"0";var n=r.viewHeight-(e?i: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(e){this.horiz.style.display="block";this.horiz.style.right=t?i+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(t?i: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(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:t?i:0,bottom:e?i: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&&!v?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new q;this.disableVert=new q};bn.prototype.enableZeroWidthBar=function(r,e,t){r.style.visibility="";function i(){var n=r.getBoundingClientRect();var o=t=="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{e.set(1e3,i)}}e.set(1e3,i)};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,e){if(!e){e=gn(r)}var t=r.display.barWidth,i=r.display.barHeight;yn(r,e);for(var n=0;n<4&&t!=r.display.barWidth||i!=r.display.barHeight;n++){if(t!=r.display.barWidth&&r.options.lineWrapping){rn(r)}yn(r,gn(r));t=r.display.barWidth;i=r.display.barHeight}}function yn(r,e){var t=r.display;var i=t.scrollbars.update(e);t.sizer.style.paddingRight=(t.barWidth=i.right)+"px";t.sizer.style.paddingBottom=(t.barHeight=i.bottom)+"px";t.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){t.scrollbarFiller.style.display="block";t.scrollbarFiller.style.height=i.bottom+"px";t.scrollbarFiller.style.width=i.right+"px"}else{t.scrollbarFiller.style.display=""}if(i.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){t.gutterFiller.style.display="block";t.gutterFiller.style.height=i.bottom+"px";t.gutterFiller.style.width=e.gutterWidth+"px"}else{t.gutterFiller.style.display=""}}var xn={native:bn,null:wn};function Cn(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 xn[r.options.scrollbarStyle]((function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller);gr(e,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));e.setAttribute("cm-not-content","true")}),(function(e,t){if(t=="horizontal"){pn(r,e)}else{vn(r,e)}}),r);if(r.display.scrollbars.addClass){I(r.display.wrapper,r.display.scrollbars.addClass)}}var Mn=0;function An(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:++Mn,markArrays:null};Lt(r.curOp)}function Ln(r){var e=r.curOp;if(e){Tt(e,(function(r){for(var e=0;e<r.ops.length;e++){r.ops[e].cm.curOp=null}Sn(r)}))}}function Sn(r){var e=r.ops;for(var t=0;t<e.length;t++){Tn(e[t])}for(var i=0;i<e.length;i++){Nn(e[i])}for(var n=0;n<e.length;n++){En(e[n])}for(var o=0;o<e.length;o++){Dn(e[o])}for(var a=0;a<e.length;a++){zn(e[a])}}function Tn(r){var e=r.cm,t=e.display;Pn(e);if(r.updateMaxLine){lt(e)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<t.viewFrom||r.scrollToPos.to.line>=t.viewTo)||t.maxLineChanged&&e.options.lineWrapping;r.update=r.mustUpdate&&new Un(e,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function Nn(r){r.updatedDisplay=r.mustUpdate&&Wn(r.cm,r.update)}function En(r){var e=r.cm,t=e.display;if(r.updatedDisplay){rn(e)}r.barMeasure=gn(e);if(t.maxLineChanged&&!e.options.lineWrapping){r.adjustWidthTo=ei(e,t.maxLine,t.maxLine.text.length).left+3;e.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(t.scroller.clientWidth,t.sizer.offsetLeft+r.adjustWidthTo+Qt(e)+e.display.barWidth);r.maxScrollLeft=Math.max(0,t.sizer.offsetLeft+r.adjustWidthTo-Jt(e))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=t.input.prepareSelection()}}function Dn(r){var e=r.cm;if(r.adjustWidthTo!=null){e.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<e.doc.scrollLeft){pn(e,Math.min(e.display.scroller.scrollLeft,r.maxScrollLeft),true)}e.display.maxLineChanged=false}var t=r.focus&&r.focus==j(F(e));if(r.preparedSelection){e.display.input.showSelection(r.preparedSelection,t)}if(r.updatedDisplay||r.startHeight!=e.doc.height){kn(e,r.barMeasure)}if(r.updatedDisplay){Vn(e,r.barMeasure)}if(r.selectionChanged){Qi(e)}if(e.state.focused&&r.updateInput){e.display.input.reset(r.typing)}if(t){Ji(r.cm)}}function zn(r){var e=r.cm,t=e.display,i=e.doc;if(r.updatedDisplay){$n(e,r.update)}if(t.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){t.wheelStartX=t.wheelStartY=null}if(r.scrollTop!=null){mn(e,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(e,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(e,ve(i,r.scrollToPos.from),ve(i,r.scrollToPos.to),r.scrollToPos.margin);nn(e,n)}var o=r.maybeHiddenMarkers,a=r.maybeUnhiddenMarkers;if(o){for(var u=0;u<o.length;++u){if(!o[u].lines.length){kr(o[u],"hide")}}}if(a){for(var f=0;f<a.length;++f){if(a[f].lines.length){kr(a[f],"unhide")}}}if(t.wrapper.offsetHeight){i.scrollTop=e.display.scroller.scrollTop}if(r.changeObjs){kr(e,"changes",e,r.changeObjs)}if(r.update){r.update.finish()}}function jn(r,e){if(r.curOp){return e()}An(r);try{return e()}finally{Ln(r)}}function In(r,e){return function(){if(r.curOp){return e.apply(r,arguments)}An(r);try{return e.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}An(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Rn(r){return function(){var e=this.cm;if(!e||e.curOp){return r.apply(this,arguments)}An(e);try{return r.apply(this,arguments)}finally{Ln(e)}}}function Fn(r,e){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(e,U(On,r))}}function On(r){var e=r.doc;if(e.highlightFrontier>=r.display.viewTo){return}var t=+new Date+r.options.workTime;var i=ye(r,e.highlightFrontier);var n=[];e.iter(i.line,Math.min(e.first+e.size,r.display.viewTo+500),(function(o){if(i.line>=r.display.viewFrom){var a=o.styles;var u=o.text.length>r.options.maxHighlightLength?Qr(e.mode,i.state):null;var f=we(r,o,i,true);if(u){i.state=u}o.styles=f.styles;var l=o.styleClasses,s=f.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!a||a.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var d=0;!c&&d<a.length;++d){c=a[d]!=o.styles[d]}if(c){n.push(i.line)}o.stateAfter=i.save();i.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){xe(r,o.text,i)}o.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>t){Fn(r,r.options.workDelay);return true}}));e.highlightFrontier=i.line;e.modeFrontier=Math.max(e.modeFrontier,i.line);if(n.length){jn(r,(function(){for(var e=0;e<n.length;e++){Ui(r,n[e],"text")}}))}}var Un=function(r,e,t){var i=r.display;this.viewport=e;this.visible=tn(i,r.doc,e);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=Jt(r);this.force=t;this.dims=zi(r);this.events=[]};Un.prototype.signal=function(r,e){if(Cr(r,e)){this.events.push(arguments)}};Un.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Pn(r){var e=r.display;if(!e.scrollbarsClipped&&e.scroller.offsetWidth){e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth;e.heightForcer.style.height=Qt(r)+"px";e.sizer.style.marginBottom=-e.nativeBarWidth+"px";e.sizer.style.borderRightWidth=Qt(r)+"px";e.scrollbarsClipped=true}}function _n(r){if(r.hasFocus()){return null}var e=j(F(r));if(!e||!z(r.display.lineDiv,e)){return null}var t={activeElt:e};if(window.getSelection){var i=O(r).getSelection();if(i.anchorNode&&i.extend&&z(r.display.lineDiv,i.anchorNode)){t.anchorNode=i.anchorNode;t.anchorOffset=i.anchorOffset;t.focusNode=i.focusNode;t.focusOffset=i.focusOffset}}return t}function qn(r){if(!r||!r.activeElt||r.activeElt==j(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&z(document.body,r.anchorNode)&&z(document.body,r.focusNode)){var e=r.activeElt.ownerDocument;var t=e.defaultView.getSelection(),i=e.createRange();i.setEnd(r.anchorNode,r.anchorOffset);i.collapse(false);t.removeAllRanges();t.addRange(i);t.extend(r.focusNode,r.focusOffset)}}function Wn(r,e){var t=r.display,i=r.doc;if(e.editorIsHidden){Pi(r);return false}if(!e.force&&e.visible.from>=t.viewFrom&&e.visible.to<=t.viewTo&&(t.updateLineNumbers==null||t.updateLineNumbers>=t.viewTo)&&t.renderedView==t.view&&Wi(r)==0){return false}if(Jn(r)){Pi(r);e.dims=zi(r)}var n=i.first+i.size;var o=Math.max(e.visible.from-r.options.viewportMargin,i.first);var a=Math.min(n,e.visible.to+r.options.viewportMargin);if(t.viewFrom<o&&o-t.viewFrom<20){o=Math.max(i.first,t.viewFrom)}if(t.viewTo>a&&t.viewTo-a<20){a=Math.min(n,t.viewTo)}if(ze){o=it(r.doc,o);a=nt(r.doc,a)}var u=o!=t.viewFrom||a!=t.viewTo||t.lastWrapHeight!=e.wrapperHeight||t.lastWrapWidth!=e.wrapperWidth;qi(r,o,a);t.viewOffset=ut(Zr(r.doc,t.viewFrom));r.display.mover.style.top=t.viewOffset+"px";var f=Wi(r);if(!u&&f==0&&!e.force&&t.renderedView==t.view&&(t.updateLineNumbers==null||t.updateLineNumbers>=t.viewTo)){return false}var l=_n(r);if(f>4){t.lineDiv.style.display="none"}Hn(r,t.updateLineNumbers,e.dims);if(f>4){t.lineDiv.style.display=""}t.renderedView=t.view;qn(l);S(t.cursorDiv);S(t.selectionDiv);t.gutters.style.height=t.sizer.style.minHeight=0;if(u){t.lastWrapHeight=e.wrapperHeight;t.lastWrapWidth=e.wrapperWidth;Fn(r,400)}t.updateLineNumbers=null;return true}function $n(r,e){var t=e.viewport;for(var i=true;;i=false){if(!i||!r.options.lineWrapping||e.oldDisplayWidth==Jt(r)){if(t&&t.top!=null){t={top:Math.min(r.doc.height+Kt(r.display)-Yt(r),t.top)}}e.visible=tn(r.display,r.doc,t);if(e.visible.from>=r.display.viewFrom&&e.visible.to<=r.display.viewTo){break}}else if(i){e.visible=tn(r.display,r.doc,t)}if(!Wn(r,e)){break}rn(r);var n=gn(r);$i(r);kn(r,n);Vn(r,n);e.force=false}e.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){e.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function Gn(r,e){var t=new Un(r,e);if(Wn(r,t)){rn(r);$n(r,t);var i=gn(r);$i(r);kn(r,i);Vn(r,i);t.finish()}}function Hn(r,e,t){var i=r.display,n=r.options.lineNumbers;var o=i.lineDiv,a=o.firstChild;function u(e){var t=e.nextSibling;if(f&&w&&r.display.currentWheelTarget==e){e.style.display="none"}else{e.parentNode.removeChild(e)}return t}var l=i.view,s=i.viewFrom;for(var c=0;c<l.length;c++){var d=l[c];if(d.hidden);else if(!d.node||d.node.parentNode!=o){var h=Pt(r,d,s,t);o.insertBefore(h,a)}else{while(a!=d.node){a=u(a)}var v=n&&e!=null&&e<=s&&d.lineNumber;if(d.changes){if(W(d.changes,"gutter")>-1){v=false}zt(r,d,s,t)}if(v){S(d.lineNumber);d.lineNumber.appendChild(document.createTextNode(ae(r.options,s)))}a=d.node.nextSibling}s+=d.size}while(a){a=u(a)}}function Kn(r){var e=r.gutters.offsetWidth;r.sizer.style.marginLeft=e+"px";Et(r,"gutterChanged",r)}function Vn(r,e){r.display.sizer.style.minHeight=e.docHeight+"px";r.display.heightForcer.style.top=e.docHeight+"px";r.display.gutters.style.height=e.docHeight+r.display.barHeight+Qt(r)+"px"}function Qn(r){var e=r.display,t=e.view;if(!e.alignWidgets&&(!e.gutters.firstChild||!r.options.fixedGutter)){return}var i=ji(e)-e.scroller.scrollLeft+r.doc.scrollLeft;var n=e.gutters.offsetWidth,o=i+"px";for(var a=0;a<t.length;a++){if(!t[a].hidden){if(r.options.fixedGutter){if(t[a].gutter){t[a].gutter.style.left=o}if(t[a].gutterBackground){t[a].gutterBackground.style.left=o}}var u=t[a].alignable;if(u){for(var f=0;f<u.length;f++){u[f].style.left=o}}}}if(r.options.fixedGutter){e.gutters.style.left=i+n+"px"}}function Jn(r){if(!r.options.lineNumbers){return false}var e=r.doc,t=ae(r.options,e.first+e.size-1),i=r.display;if(t.length!=i.lineNumChars){var n=i.measure.appendChild(N("div",[N("div",t)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,a=n.offsetWidth-o;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1;i.lineNumWidth=i.lineNumInnerWidth+a;i.lineNumChars=i.lineNumInnerWidth?t.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Kn(r.display);return true}return false}function Yn(r,e){var t=[],i=false;for(var n=0;n<r.length;n++){var o=r[n],a=null;if(typeof o!="string"){a=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!e){continue}else{i=true}}t.push({className:o,style:a})}if(e&&!i){t.push({className:"CodeMirror-linenumbers",style:null})}return t}function Xn(r){var e=r.gutters,t=r.gutterSpecs;S(e);r.lineGutter=null;for(var i=0;i<t.length;++i){var n=t[i];var o=n.className;var a=n.style;var u=e.appendChild(N("div",null,"CodeMirror-gutter "+o));if(a){u.style.cssText=a}if(o=="CodeMirror-linenumbers"){r.lineGutter=u;u.style.width=(r.lineNumWidth||1)+"px"}}e.style.display=t.length?"":"none";Kn(r)}function Zn(r){Xn(r.display);Oi(r);Qn(r)}function ro(r,e,i,n){var o=this;this.input=i;o.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=N("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=E("div",null,"CodeMirror-code");o.selectionDiv=N("div",null,null,"position: relative; z-index: 1");o.cursorDiv=N("div",null,"CodeMirror-cursors");o.measure=N("div",null,"CodeMirror-measure");o.lineMeasure=N("div",null,"CodeMirror-measure");o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=N("div",[l],null,"position: relative");o.sizer=N("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=N("div",null,null,"position: absolute; height: "+$+"px; width: 1px;");o.gutters=N("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=N("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=N("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(a&&u<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!f&&!(t&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=e.first;o.reportedViewFrom=o.reportedViewTo=e.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=Yn(n.gutters,n.lineNumbers);Xn(o);i.init(o)}var eo=0,to=null;if(a){to=-.53}else if(t){to=15}else if(s){to=-.7}else if(h){to=-1/3}function io(r){var e=r.wheelDeltaX,t=r.wheelDeltaY;if(e==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){e=r.detail}if(t==null&&r.detail&&r.axis==r.VERTICAL_AXIS){t=r.detail}else if(t==null){t=r.wheelDelta}return{x:e,y:t}}function no(r){var e=io(r);e.x*=to;e.y*=to;return e}function oo(r,e){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 i=io(e),n=i.x,o=i.y;var a=to;if(e.deltaMode===0){n=e.deltaX;o=e.deltaY;a=1}var u=r.display,l=u.scroller;var h=l.scrollWidth>l.clientWidth;var v=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&v)){return}if(o&&w&&f){r:for(var m=e.target,p=u.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&&!t&&!d&&a!=null){if(o&&v){vn(r,Math.max(0,l.scrollTop+o*a))}pn(r,Math.max(0,l.scrollLeft+n*a));if(!o||o&&v){Ar(e)}u.wheelStartX=null;return}if(o&&a!=null){var b=o*a;var k=r.doc.scrollTop,y=k+u.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{y=Math.min(r.doc.height,y+b+50)}Gn(r,{top:k,bottom:y})}if(eo<20&&e.deltaMode!==0){if(u.wheelStartX==null){u.wheelStartX=l.scrollLeft;u.wheelStartY=l.scrollTop;u.wheelDX=n;u.wheelDY=o;setTimeout((function(){if(u.wheelStartX==null){return}var r=l.scrollLeft-u.wheelStartX;var e=l.scrollTop-u.wheelStartY;var t=e&&u.wheelDY&&e/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null;if(!t){return}to=(to*eo+t)/(eo+1);++eo}),200)}else{u.wheelDX+=n;u.wheelDY+=o}}}var ao=function(r,e){this.ranges=r;this.primIndex=e};ao.prototype.primary=function(){return this.ranges[this.primIndex]};ao.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var e=0;e<this.ranges.length;e++){var t=this.ranges[e],i=r.ranges[e];if(!le(t.anchor,i.anchor)||!le(t.head,i.head)){return false}}return true};ao.prototype.deepCopy=function(){var r=[];for(var e=0;e<this.ranges.length;e++){r[e]=new uo(se(this.ranges[e].anchor),se(this.ranges[e].head))}return new ao(r,this.primIndex)};ao.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};ao.prototype.contains=function(r,e){if(!e){e=r}for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t];if(fe(e,i.from())>=0&&fe(r,i.to())<=0){return t}}return-1};var uo=function(r,e){this.anchor=r;this.head=e};uo.prototype.from=function(){return de(this.anchor,this.head)};uo.prototype.to=function(){return ce(this.anchor,this.head)};uo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function fo(r,e,t){var i=r&&r.options.selectionsMayTouch;var n=e[t];e.sort((function(r,e){return fe(r.from(),e.from())}));t=W(e,n);for(var o=1;o<e.length;o++){var a=e[o],u=e[o-1];var f=fe(u.to(),a.from());if(i&&!a.empty()?f>0:f>=0){var l=de(u.from(),a.from()),s=ce(u.to(),a.to());var c=u.empty()?a.from()==a.head:u.from()==u.head;if(o<=t){--t}e.splice(--o,2,new uo(c?s:l,c?l:s))}}return new ao(e,t)}function lo(r,e){return new ao([new uo(r,e||r)],0)}function so(r){if(!r.text){return r.to}return ue(r.from.line+r.text.length-1,X(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,e){if(fe(r,e.from)<0){return r}if(fe(r,e.to)<=0){return so(e)}var t=r.line+e.text.length-(e.to.line-e.from.line)-1,i=r.ch;if(r.line==e.to.line){i+=so(e).ch-e.to.ch}return ue(t,i)}function ho(r,e){var t=[];for(var i=0;i<r.sel.ranges.length;i++){var n=r.sel.ranges[i];t.push(new uo(co(n.anchor,e),co(n.head,e)))}return fo(r.cm,t,r.sel.primIndex)}function vo(r,e,t){if(r.line==e.line){return ue(t.line,r.ch-e.ch+t.ch)}else{return ue(t.line+(r.line-e.line),r.ch)}}function mo(r,e,t){var i=[];var n=ue(r.first,0),o=n;for(var a=0;a<e.length;a++){var u=e[a];var f=vo(u.from,n,o);var l=vo(so(u),n,o);n=u.to;o=l;if(t=="around"){var s=r.sel.ranges[a],c=fe(s.head,s.anchor)<0;i[a]=new uo(c?l:f,c?f:l)}else{i[a]=new uo(f,f)}}return new ao(i,r.sel.primIndex)}function po(r){r.doc.mode=Hr(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;Fn(r,100);r.state.modeGen++;if(r.curOp){Oi(r)}}function bo(r,e){return e.from.ch==0&&e.to.ch==0&&X(e.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,e,t,i){function n(r){return t?t[r]:null}function o(r,t,n){ct(r,t,n,i);Et(r,"change",r,e)}function a(r,e){var t=[];for(var o=r;o<e;++o){t.push(new st(l[o],n(o),i))}return t}var u=e.from,f=e.to,l=e.text;var s=Zr(r,u.line),c=Zr(r,f.line);var d=X(l),h=n(l.length-1),v=f.line-u.line;if(e.full){r.insert(0,a(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,e)){var m=a(0,l.length-1);o(c,c.text,h);if(v){r.remove(u.line,v)}if(m.length){r.insert(u.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,u.ch)+d+s.text.slice(f.ch),h)}else{var p=a(1,l.length-1);p.push(new st(d+s.text.slice(f.ch),h,i));o(s,s.text.slice(0,u.ch)+l[0],n(0));r.insert(u.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,u.ch)+l[0]+c.text.slice(f.ch),n(0));r.remove(u.line+1,v)}else{o(s,s.text.slice(0,u.ch)+l[0],n(0));o(c,d+c.text.slice(f.ch),h);var g=a(1,l.length-1);if(v>1){r.remove(u.line+1,v-1)}r.insert(u.line+1,g)}Et(r,"change",r,e)}function ko(r,e,t){function i(r,n,o){if(r.linked){for(var a=0;a<r.linked.length;++a){var u=r.linked[a];if(u.doc==n){continue}var f=o&&u.sharedHist;if(t&&!f){continue}e(u.doc,f);i(u.doc,r,f)}}}i(r,null,true)}function yo(r,e){if(e.cm){throw new Error("This document is already in use.")}r.doc=e;e.cm=r;Bi(r);po(r);xo(r);r.options.direction=e.direction;if(!r.options.lineWrapping){lt(r)}r.options.mode=e.modeOption;Oi(r)}function xo(r){(r.doc.direction=="rtl"?I:L)(r.display.lineDiv,"CodeMirror-rtl")}function Co(r){jn(r,(function(){xo(r);Oi(r)}))}function Mo(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 Ao(r,e){var t={from:se(e.from),to:so(e),text:re(r,e.from,e.to)};zo(r,t,e.from.line,e.to.line+1);ko(r,(function(r){return zo(r,t,e.from.line,e.to.line+1)}),true);return t}function Lo(r){while(r.length){var e=X(r);if(e.ranges){r.pop()}else{break}}}function So(r,e){if(e){Lo(r.done);return X(r.done)}else if(r.done.length&&!X(r.done).ranges){return X(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return X(r.done)}}function To(r,e,t,i){var n=r.history;n.undone.length=0;var o=+new Date,a;var u;if((n.lastOp==i||n.lastOrigin==e.origin&&e.origin&&(e.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||e.origin.charAt(0)=="*"))&&(a=So(n,n.lastOp==i))){u=X(a.changes);if(fe(e.from,e.to)==0&&fe(e.from,u.to)==0){u.to=so(e)}else{a.changes.push(Ao(r,e))}}else{var f=X(n.done);if(!f||!f.ranges){Do(r.sel,n.done)}a={changes:[Ao(r,e)],generation:n.generation};n.done.push(a);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(t);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=i;n.lastOrigin=n.lastSelOrigin=e.origin;if(!u){kr(r,"historyAdded")}}function No(r,e,t,i){var n=e.charAt(0);return n=="*"||n=="+"&&t.ranges.length==i.ranges.length&&t.somethingSelected()==i.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Eo(r,e,t,i){var n=r.history,o=i&&i.origin;if(t==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||No(r,o,X(n.done),e))){n.done[n.done.length-1]=e}else{Do(e,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=t;if(i&&i.clearRedo!==false){Lo(n.undone)}}function Do(r,e){var t=X(e);if(!(t&&t.ranges&&t.equals(r))){e.push(r)}}function zo(r,e,t,i){var n=e["spans_"+r.id],o=0;r.iter(Math.max(r.first,t),Math.min(r.first+r.size,i),(function(t){if(t.markedSpans){(n||(n=e["spans_"+r.id]={}))[o]=t.markedSpans}++o}))}function jo(r){if(!r){return null}var e;for(var t=0;t<r.length;++t){if(r[t].marker.explicitlyCleared){if(!e){e=r.slice(0,t)}}else if(e){e.push(r[t])}}return!e?r:e.length?e:null}function Io(r,e){var t=e["spans_"+r.id];if(!t){return null}var i=[];for(var n=0;n<e.text.length;++n){i.push(jo(t[n]))}return i}function Bo(r,e){var t=Io(r,e);var i=_e(r,e);if(!t){return i}if(!i){return t}for(var n=0;n<t.length;++n){var o=t[n],a=i[n];if(o&&a){r:for(var u=0;u<a.length;++u){var f=a[u];for(var l=0;l<o.length;++l){if(o[l].marker==f.marker){continue r}}o.push(f)}}else if(a){t[n]=a}}return t}function Ro(r,e,t){var i=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){i.push(t?ao.prototype.deepCopy.call(o):o);continue}var a=o.changes,u=[];i.push({changes:u});for(var f=0;f<a.length;++f){var l=a[f],s=void 0;u.push({from:l.from,to:l.to,text:l.text});if(e){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(W(e,Number(s[1]))>-1){X(u)[c]=l[c];delete l[c]}}}}}}return i}function Fo(r,e,t,i){if(i){var n=r.anchor;if(t){var o=fe(e,n)<0;if(o!=fe(t,n)<0){n=e;e=t}else if(o!=fe(e,t)<0){e=t}}return new uo(n,e)}else{return new uo(t||e,e)}}function Oo(r,e,t,i,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}$o(r,new ao([Fo(r.sel.primary(),e,t,n)],0),i)}function Uo(r,e,t){var i=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){i[o]=Fo(r.sel.ranges[o],e[o],null,n)}var a=fo(r.cm,i,r.sel.primIndex);$o(r,a,t)}function Po(r,e,t,i){var n=r.sel.ranges.slice(0);n[e]=t;$o(r,fo(r.cm,n,r.sel.primIndex),i)}function _o(r,e,t,i){$o(r,lo(e,t),i)}function qo(r,e,t){var i={ranges:e.ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++){this.ranges[t]=new uo(ve(r,e[t].anchor),ve(r,e[t].head))}},origin:t&&t.origin};kr(r,"beforeSelectionChange",r,i);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,i)}if(i.ranges!=e.ranges){return fo(r.cm,i.ranges,i.ranges.length-1)}else{return e}}function Wo(r,e,t){var i=r.history.done,n=X(i);if(n&&n.ranges){i[i.length-1]=e;Go(r,e,t)}else{$o(r,e,t)}}function $o(r,e,t){Go(r,e,t);Eo(r,r.sel,r.cm?r.cm.curOp.id:NaN,t)}function Go(r,e,t){if(Cr(r,"beforeSelectionChange")||r.cm&&Cr(r.cm,"beforeSelectionChange")){e=qo(r,e,t)}var i=t&&t.bias||(fe(e.primary().head,r.sel.primary().head)<0?-1:1);Ho(r,Vo(r,e,i,true));if(!(t&&t.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function Ho(r,e){if(e.equals(r.sel)){return}r.sel=e;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;xr(r.cm)}Et(r,"cursorActivity",r)}function Ko(r){Ho(r,Vo(r,r.sel,null,false))}function Vo(r,e,t,i){var n;for(var o=0;o<e.ranges.length;o++){var a=e.ranges[o];var u=e.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var f=Jo(r,a.anchor,u&&u.anchor,t,i);var l=a.head==a.anchor?f:Jo(r,a.head,u&&u.head,t,i);if(n||f!=a.anchor||l!=a.head){if(!n){n=e.ranges.slice(0,o)}n[o]=new uo(f,l)}}return n?fo(r.cm,n,e.primIndex):e}function Qo(r,e,t,i,n){var o=Zr(r,e.line);if(o.markedSpans){for(var a=0;a<o.markedSpans.length;++a){var u=o.markedSpans[a],f=u.marker;var l="selectLeft"in f?!f.selectLeft:f.inclusiveLeft;var s="selectRight"in f?!f.selectRight:f.inclusiveRight;if((u.from==null||(l?u.from<=e.ch:u.from<e.ch))&&(u.to==null||(s?u.to>=e.ch:u.to>e.ch))){if(n){kr(f,"beforeCursorEnter");if(f.explicitlyCleared){if(!o.markedSpans){break}else{--a;continue}}}if(!f.atomic){continue}if(t){var c=f.find(i<0?1:-1),d=void 0;if(i<0?s:l){c=Yo(r,c,-i,c&&c.line==e.line?o:null)}if(c&&c.line==e.line&&(d=fe(c,t))&&(i<0?d<0:d>0)){return Qo(r,c,e,i,n)}}var h=f.find(i<0?-1:1);if(i<0?l:s){h=Yo(r,h,i,h.line==e.line?o:null)}return h?Qo(r,h,e,i,n):null}}}return e}function Jo(r,e,t,i,n){var o=i||1;var a=Qo(r,e,t,o,n)||!n&&Qo(r,e,t,o,true)||Qo(r,e,t,-o,n)||!n&&Qo(r,e,t,-o,true);if(!a){r.cantEdit=true;return ue(r.first,0)}return a}function Yo(r,e,t,i){if(t<0&&e.ch==0){if(e.line>r.first){return ve(r,ue(e.line-1))}else{return null}}else if(t>0&&e.ch==(i||Zr(r,e.line)).text.length){if(e.line<r.first+r.size-1){return ue(e.line+1,0)}else{return null}}else{return new ue(e.line,e.ch+t)}}function Xo(r){r.setSelection(ue(r.firstLine(),0),ue(r.lastLine()),H)}function Zo(r,e,t){var i={canceled:false,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=true}};if(t){i.update=function(e,t,n,o){if(e){i.from=ve(r,e)}if(t){i.to=ve(r,t)}if(n){i.text=n}if(o!==undefined){i.origin=o}}}kr(r,"beforeChange",r,i);if(r.cm){kr(r.cm,"beforeChange",r.cm,i)}if(i.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ra(r,e,t){if(r.cm){if(!r.cm.curOp){return In(r.cm,ra)(r,e,t)}if(r.cm.state.suppressEdits){return}}if(Cr(r,"beforeChange")||r.cm&&Cr(r.cm,"beforeChange")){e=Zo(r,e,true);if(!e){return}}var i=De&&!t&&We(r,e.from,e.to);if(i){for(var n=i.length-1;n>=0;--n){ea(r,{from:i[n].from,to:i[n].to,text:n?[""]:e.text,origin:e.origin})}}else{ea(r,e)}}function ea(r,e){if(e.text.length==1&&e.text[0]==""&&fe(e.from,e.to)==0){return}var t=ho(r,e);To(r,e,t,r.cm?r.cm.curOp.id:NaN);na(r,e,t,_e(r,e));var i=[];ko(r,(function(r,t){if(!t&&W(i,r.history)==-1){la(r.history,e);i.push(r.history)}na(r,e,null,_e(r,e))}))}function ta(r,e,t){var i=r.cm&&r.cm.state.suppressEdits;if(i&&!t){return}var n=r.history,o,a=r.sel;var u=e=="undo"?n.done:n.undone,f=e=="undo"?n.undone:n.done;var l=0;for(;l<u.length;l++){o=u[l];if(t?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==u.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=u.pop();if(o.ranges){Do(o,f);if(t&&!o.equals(r.sel)){$o(r,o,{clearRedo:false});return}a=o}else if(i){u.push(o);return}else{break}}var s=[];Do(a,f);f.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Cr(r,"beforeChange")||r.cm&&Cr(r.cm,"beforeChange");var d=function(t){var i=o.changes[t];i.origin=e;if(c&&!Zo(r,i,false)){u.length=0;return{}}s.push(Ao(r,i));var n=t?ho(r,i):X(u);na(r,i,n,Bo(r,i));if(!t&&r.cm){r.cm.scrollIntoView({from:i.from,to:so(i)})}var a=[];ko(r,(function(r,e){if(!e&&W(a,r.history)==-1){la(r.history,i);a.push(r.history)}na(r,i,null,Bo(r,i))}))};for(var h=o.changes.length-1;h>=0;--h){var v=d(h);if(v)return v.v}}function ia(r,e){if(e==0){return}r.first+=e;r.sel=new ao(Z(r.sel.ranges,(function(r){return new uo(ue(r.anchor.line+e,r.anchor.ch),ue(r.head.line+e,r.head.ch))})),r.sel.primIndex);if(r.cm){Oi(r.cm,r.first,r.first-e,e);for(var t=r.cm.display,i=t.viewFrom;i<t.viewTo;i++){Ui(r.cm,i,"gutter")}}}function na(r,e,t,i){if(r.cm&&!r.cm.curOp){return In(r.cm,na)(r,e,t,i)}if(e.to.line<r.first){ia(r,e.text.length-1-(e.to.line-e.from.line));return}if(e.from.line>r.lastLine()){return}if(e.from.line<r.first){var n=e.text.length-1-(r.first-e.from.line);ia(r,n);e={from:ue(r.first,0),to:ue(e.to.line+n,e.to.ch),text:[X(e.text)],origin:e.origin}}var o=r.lastLine();if(e.to.line>o){e={from:e.from,to:ue(o,Zr(r,o).text.length),text:[e.text[0]],origin:e.origin}}e.removed=re(r,e.from,e.to);if(!t){t=ho(r,e)}if(r.cm){oa(r.cm,e,i)}else{wo(r,e,i)}Go(r,t,H);if(r.cantEdit&&Jo(r,ue(r.firstLine(),0))){r.cantEdit=false}}function oa(r,e,t){var i=r.doc,n=r.display,o=e.from,a=e.to;var u=false,f=o.line;if(!r.options.lineWrapping){f=ie(rt(Zr(i,o.line)));i.iter(f,a.line+1,(function(r){if(r==n.maxLine){u=true;return true}}))}if(i.sel.contains(e.from,e.to)>-1){xr(r)}wo(i,e,t,Ii(r));if(!r.options.lineWrapping){i.iter(f,o.line+e.text.length,(function(r){var e=ft(r);if(e>n.maxLineLength){n.maxLine=r;n.maxLineLength=e;n.maxLineChanged=true;u=false}}));if(u){r.curOp.updateMaxLine=true}}Ee(i,o.line);Fn(r,400);var l=e.text.length-(a.line-o.line)-1;if(e.full){Oi(r)}else if(o.line==a.line&&e.text.length==1&&!bo(r.doc,e)){Ui(r,o.line,"text")}else{Oi(r,o.line,a.line+1,l)}var s=Cr(r,"changes"),c=Cr(r,"change");if(c||s){var d={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};if(c){Et(r,"change",r,d)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(d)}}r.display.selForContextMenu=null}function aa(r,e,t,i,n){var o;if(!i){i=t}if(fe(i,t)<0){o=[i,t],t=o[0],i=o[1]}if(typeof e=="string"){e=r.splitLines(e)}ra(r,{from:t,to:i,text:e,origin:n})}function ua(r,e,t,i){if(t<r.line){r.line+=i}else if(e<r.line){r.line=e;r.ch=0}}function fa(r,e,t,i){for(var n=0;n<r.length;++n){var o=r[n],a=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var u=0;u<o.ranges.length;u++){ua(o.ranges[u].anchor,e,t,i);ua(o.ranges[u].head,e,t,i)}continue}for(var f=0;f<o.changes.length;++f){var l=o.changes[f];if(t<l.from.line){l.from=ue(l.from.line+i,l.from.ch);l.to=ue(l.to.line+i,l.to.ch)}else if(e<=l.to.line){a=false;break}}if(!a){r.splice(0,n+1);n=0}}}function la(r,e){var t=e.from.line,i=e.to.line,n=e.text.length-(i-t)-1;fa(r.done,t,i,n);fa(r.undone,t,i,n)}function sa(r,e,t,i){var n=e,o=e;if(typeof e=="number"){o=Zr(r,he(r,e))}else{n=ie(e)}if(n==null){return null}if(i(o,n)&&r.cm){Ui(r.cm,n,t)}return o}function ca(r){this.lines=r;this.parent=null;var e=0;for(var t=0;t<r.length;++t){r[t].parent=this;e+=r[t].height}this.height=e}ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,e){for(var t=r,i=r+e;t<i;++t){var n=this.lines[t];this.height-=n.height;dt(n);Et(n,"delete")}this.lines.splice(r,e)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,e,t){this.height+=t;this.lines=this.lines.slice(0,r).concat(e).concat(this.lines.slice(r));for(var i=0;i<e.length;++i){e[i].parent=this}},iterN:function(r,e,t){for(var i=r+e;r<i;++r){if(t(this.lines[r])){return true}}}};function da(r){this.children=r;var e=0,t=0;for(var i=0;i<r.length;++i){var n=r[i];e+=n.chunkSize();t+=n.height;n.parent=this}this.size=e;this.height=t;this.parent=null}da.prototype={chunkSize:function(){return this.size},removeInner:function(r,e){this.size-=e;for(var t=0;t<this.children.length;++t){var i=this.children[t],n=i.chunkSize();if(r<n){var o=Math.min(e,n-r),a=i.height;i.removeInner(r,o);this.height-=a-i.height;if(n==o){this.children.splice(t--,1);i.parent=null}if((e-=o)==0){break}r=0}else{r-=n}}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var u=[];this.collapse(u);this.children=[new ca(u)];this.children[0].parent=this}},collapse:function(r){for(var e=0;e<this.children.length;++e){this.children[e].collapse(r)}},insertInner:function(r,e,t){this.size+=e.length;this.height+=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<=o){n.insertInner(r,e,t);if(n.lines&&n.lines.length>50){var a=n.lines.length%25+25;for(var u=a;u<n.lines.length;){var f=new ca(n.lines.slice(u,u+=25));n.height-=f.height;this.children.splice(++i,0,f);f.parent=this}n.lines=n.lines.slice(0,a);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var e=r.children.splice(r.children.length-5,5);var t=new da(e);if(!r.parent){var i=new da(r.children);i.parent=r;r.children=[i,t];r=i}else{r.size-=t.size;r.height-=t.height;var n=W(r.parent.children,r);r.parent.children.splice(n+1,0,t)}t.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,e,t){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<o){var a=Math.min(e,o-r);if(n.iterN(r,a,t)){return true}if((e-=a)==0){break}r=0}else{r-=o}}}};var ha=function(r,e,t){if(t){for(var i in t){if(t.hasOwnProperty(i)){this[i]=t[i]}}}this.doc=r;this.node=e};ha.prototype.clear=function(){var r=this.doc.cm,e=this.line.widgets,t=this.line,i=ie(t);if(i==null||!e){return}for(var n=0;n<e.length;++n){if(e[n]==this){e.splice(n--,1)}}if(!e.length){t.widgets=null}var o=$t(this);te(t,Math.max(0,t.height-o));if(r){jn(r,(function(){va(r,t,-o);Ui(r,i,"widget")}));Et(r,"lineWidgetCleared",r,this,i)}};ha.prototype.changed=function(){var r=this;var e=this.height,t=this.doc.cm,i=this.line;this.height=null;var n=$t(this)-e;if(!n){return}if(!ot(this.doc,i)){te(i,i.height+n)}if(t){jn(t,(function(){t.curOp.forceUpdate=true;va(t,i,n);Et(t,"lineWidgetChanged",t,r,ie(i))}))}};Mr(ha);function va(r,e,t){if(ut(e)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){fn(r,t)}}function ma(r,e,t,i){var n=new ha(r,t,i);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}sa(r,e,"widget",(function(e){var t=e.widgets||(e.widgets=[]);if(n.insertAt==null){t.push(n)}else{t.splice(Math.min(t.length,Math.max(0,n.insertAt)),0,n)}n.line=e;if(o&&!ot(r,e)){var i=ut(e)<r.scrollTop;te(e,e.height+$t(n));if(i){fn(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){Et(o,"lineWidgetAdded",o,n,typeof e=="number"?e:ie(e))}return n}var pa=0;var ga=function(r,e){this.lines=[];this.type=e;this.doc=r;this.id=++pa};ga.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,e=r&&!r.curOp;if(e){An(r)}if(Cr(this,"clear")){var t=this.find();if(t){Et(this,"clear",t.from,t.to)}}var i=null,n=null;for(var o=0;o<this.lines.length;++o){var a=this.lines[o];var u=Re(a.markedSpans,this);if(r&&!this.collapsed){Ui(r,ie(a),"text")}else if(r){if(u.to!=null){n=ie(a)}if(u.from!=null){i=ie(a)}}a.markedSpans=Fe(a.markedSpans,u);if(u.from==null&&this.collapsed&&!ot(this.doc,a)&&r){te(a,Ei(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var f=0;f<this.lines.length;++f){var l=rt(this.lines[f]),s=ft(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(i!=null&&r&&this.collapsed){Oi(r,i,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Ko(r.doc)}}if(r){Et(r,"markerCleared",r,this,i,n)}if(e){Ln(r)}if(this.parent){this.parent.clear()}};ga.prototype.find=function(r,e){if(r==null&&this.type=="bookmark"){r=1}var t,i;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var a=Re(o.markedSpans,this);if(a.from!=null){t=ue(e?o:ie(o),a.from);if(r==-1){return t}}if(a.to!=null){i=ue(e?o:ie(o),a.to);if(r==1){return i}}}return t&&{from:t,to:i}};ga.prototype.changed=function(){var r=this;var e=this.find(-1,true),t=this,i=this.doc.cm;if(!e||!i){return}jn(i,(function(){var n=e.line,o=ie(e.line);var a=ti(i,o);if(a){si(a);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!ot(t.doc,n)&&t.height!=null){var u=t.height;t.height=null;var f=$t(t)-u;if(f){te(n,n.height+f)}}Et(i,"markerChanged",i,r)}))};ga.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;if(!e.maybeHiddenMarkers||W(e.maybeHiddenMarkers,this)==-1){(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};ga.prototype.detachLine=function(r){this.lines.splice(W(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}};Mr(ga);function ba(r,e,t,i,n){if(i&&i.shared){return ka(r,e,t,i,n)}if(r.cm&&!r.cm.curOp){return In(r.cm,ba)(r,e,t,i,n)}var o=new ga(r,n),a=fe(e,t);if(i){P(i,o,false)}if(a>0||a==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Ze(r,e.line,e,t,o)||e.line!=t.line&&Ze(r,t.line,e,t,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ie()}if(o.addToHistory){To(r,{from:e,to:t,origin:"markText"},r.sel,NaN)}var u=e.line,f=r.cm,l;r.iter(u,t.line+1,(function(i){if(f&&o.collapsed&&!f.options.lineWrapping&&rt(i)==f.display.maxLine){l=true}if(o.collapsed&&u!=e.line){te(i,0)}Oe(i,new Be(o,u==e.line?e.ch:null,u==t.line?t.ch:null),r.cm&&r.cm.curOp);++u}));if(o.collapsed){r.iter(e.line,t.line+1,(function(e){if(ot(r,e)){te(e,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){je();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++pa;o.atomic=true}if(f){if(l){f.curOp.updateMaxLine=true}if(o.collapsed){Oi(f,e.line,t.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=e.line;s<=t.line;s++){Ui(f,s,"text")}}if(o.atomic){Ko(f.doc)}Et(f,"markerAdded",f,o)}return o}var wa=function(r,e){this.markers=r;this.primary=e;for(var t=0;t<r.length;++t){r[t].parent=this}};wa.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}Et(this,"clear")};wa.prototype.find=function(r,e){return this.primary.find(r,e)};Mr(wa);function ka(r,e,t,i,n){i=P(i);i.shared=false;var o=[ba(r,e,t,i,n)],a=o[0];var u=i.widgetNode;ko(r,(function(r){if(u){i.widgetNode=u.cloneNode(true)}o.push(ba(r,ve(r,e),ve(r,t),i,n));for(var f=0;f<r.linked.length;++f){if(r.linked[f].isParent){return}}a=X(o)}));return new wa(o,a)}function ya(r){return r.findMarks(ue(r.first,0),r.clipPos(ue(r.lastLine())),(function(r){return r.parent}))}function xa(r,e){for(var t=0;t<e.length;t++){var i=e[t],n=i.find();var o=r.clipPos(n.from),a=r.clipPos(n.to);if(fe(o,a)){var u=ba(r,o,a,i.primary,i.primary.type);i.markers.push(u);u.parent=i}}}function Ca(r){var e=function(e){var t=r[e],i=[t.primary.doc];ko(t.primary.doc,(function(r){return i.push(r)}));for(var n=0;n<t.markers.length;n++){var o=t.markers[n];if(W(i,o.doc)==-1){o.parent=null;t.markers.splice(n--,1)}}};for(var t=0;t<r.length;t++)e(t)}var Ma=0;var Aa=function(r,e,t,i,n){if(!(this instanceof Aa)){return new Aa(r,e,t,i,n)}if(t==null){t=0}da.call(this,[new ca([new st("",null)])]);this.first=t;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=t;var o=ue(t,0);this.sel=lo(o);this.history=new Mo(null);this.id=++Ma;this.modeOption=e;this.lineSep=i;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});$o(this,lo(o),H)};Aa.prototype=tr(da.prototype,{constructor:Aa,iter:function(r,e,t){if(t){this.iterN(r-this.first,e-r,t)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,e){var t=0;for(var i=0;i<e.length;++i){t+=e[i].height}this.insertInner(r-this.first,e,t)},remove:function(r,e){this.removeInner(r-this.first,e)},getValue:function(r){var e=ee(this,this.first,this.first+this.size);if(r===false){return e}return e.join(r||this.lineSeparator())},setValue:Rn((function(r){var e=ue(this.first,0),t=this.first+this.size-1;ra(this,{from:e,to:ue(t,Zr(this,t).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}$o(this,lo(e),H)})),replaceRange:function(r,e,t,i){e=ve(this,e);t=t?ve(this,t):e;aa(this,r,e,t,i)},getRange:function(r,e,t){var i=re(this,ve(this,r),ve(this,e));if(t===false){return i}if(t===""){return i.join("")}return i.join(t||this.lineSeparator())},getLine:function(r){var e=this.getLineHandle(r);return e&&e.text},getLineHandle:function(r){if(oe(this,r)){return Zr(this,r)}},getLineNumber:function(r){return ie(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return rt(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return ve(this,r)},getCursor:function(r){var e=this.sel.primary(),t;if(r==null||r=="head"){t=e.head}else if(r=="anchor"){t=e.anchor}else if(r=="end"||r=="to"||r===false){t=e.to()}else{t=e.from()}return t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Rn((function(r,e,t){_o(this,ve(this,typeof r=="number"?ue(r,e||0):r),null,t)})),setSelection:Rn((function(r,e,t){_o(this,ve(this,r),ve(this,e||r),t)})),extendSelection:Rn((function(r,e,t){Oo(this,ve(this,r),e&&ve(this,e),t)})),extendSelections:Rn((function(r,e){Uo(this,pe(this,r),e)})),extendSelectionsBy:Rn((function(r,e){var t=Z(this.sel.ranges,r);Uo(this,pe(this,t),e)})),setSelections:Rn((function(r,e,t){if(!r.length){return}var i=[];for(var n=0;n<r.length;n++){i[n]=new uo(ve(this,r[n].anchor),ve(this,r[n].head||r[n].anchor))}if(e==null){e=Math.min(r.length-1,this.sel.primIndex)}$o(this,fo(this.cm,i,e),t)})),addSelection:Rn((function(r,e,t){var i=this.sel.ranges.slice(0);i.push(new uo(ve(this,r),ve(this,e||r)));$o(this,fo(this.cm,i,i.length-1),t)})),getSelection:function(r){var e=this.sel.ranges,t;for(var i=0;i<e.length;i++){var n=re(this,e[i].from(),e[i].to());t=t?t.concat(n):n}if(r===false){return t}else{return t.join(r||this.lineSeparator())}},getSelections:function(r){var e=[],t=this.sel.ranges;for(var i=0;i<t.length;i++){var n=re(this,t[i].from(),t[i].to());if(r!==false){n=n.join(r||this.lineSeparator())}e[i]=n}return e},replaceSelection:function(r,e,t){var i=[];for(var n=0;n<this.sel.ranges.length;n++){i[n]=r}this.replaceSelections(i,e,t||"+input")},replaceSelections:Rn((function(r,e,t){var i=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var a=n.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(r[o]),origin:t}}var u=e&&e!="end"&&mo(this,i,e);for(var f=i.length-1;f>=0;f--){ra(this,i[f])}if(u){Wo(this,u)}else if(this.cm){ln(this.cm)}})),undo:Rn((function(){ta(this,"undo")})),redo:Rn((function(){ta(this,"redo")})),undoSelection:Rn((function(){ta(this,"undo",true)})),redoSelection:Rn((function(){ta(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,e=0,t=0;for(var i=0;i<r.done.length;i++){if(!r.done[i].ranges){++e}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++t}}return{undo:e,redo:t}},clearHistory:function(){var r=this;this.history=new Mo(this.history);ko(this,(function(e){return e.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:Ro(this.history.done),undone:Ro(this.history.undone)}},setHistory:function(r){var e=this.history=new Mo(this.history);e.done=Ro(r.done.slice(0),null,true);e.undone=Ro(r.undone.slice(0),null,true)},setGutterMarker:Rn((function(r,e,t){return sa(this,r,"gutter",(function(r){var i=r.gutterMarkers||(r.gutterMarkers={});i[e]=t;if(!t&&ar(i)){r.gutterMarkers=null}return true}))})),clearGutter:Rn((function(r){var e=this;this.iter((function(t){if(t.gutterMarkers&&t.gutterMarkers[r]){sa(e,t,"gutter",(function(){t.gutterMarkers[r]=null;if(ar(t.gutterMarkers)){t.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var e;if(typeof r=="number"){if(!oe(this,r)){return null}e=r;r=Zr(this,r);if(!r){return null}}else{e=ie(r);if(e==null){return null}}return{line:e,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Rn((function(r,e,t){return sa(this,r,e=="gutter"?"gutter":"class",(function(r){var i=e=="text"?"textClass":e=="background"?"bgClass":e=="gutter"?"gutterClass":"wrapClass";if(!r[i]){r[i]=t}else if(A(t).test(r[i])){return false}else{r[i]+=" "+t}return true}))})),removeLineClass:Rn((function(r,e,t){return sa(this,r,e=="gutter"?"gutter":"class",(function(r){var i=e=="text"?"textClass":e=="background"?"bgClass":e=="gutter"?"gutterClass":"wrapClass";var n=r[i];if(!n){return false}else if(t==null){r[i]=null}else{var o=n.match(A(t));if(!o){return false}var a=o.index+o[0].length;r[i]=n.slice(0,o.index)+(!o.index||a==n.length?"":" ")+n.slice(a)||null}return true}))})),addLineWidget:Rn((function(r,e,t){return ma(this,r,e,t)})),removeLineWidget:function(r){r.clear()},markText:function(r,e,t){return ba(this,ve(this,r),ve(this,e),t,t&&t.type||"range")},setBookmark:function(r,e){var t={replacedWith:e&&(e.nodeType==null?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:false,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};r=ve(this,r);return ba(this,r,r,t,"bookmark")},findMarksAt:function(r){r=ve(this,r);var e=[],t=Zr(this,r.line).markedSpans;if(t){for(var i=0;i<t.length;++i){var n=t[i];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){e.push(n.marker.parent||n.marker)}}}return e},findMarks:function(r,e,t){r=ve(this,r);e=ve(this,e);var i=[],n=r.line;this.iter(r.line,e.line+1,(function(o){var a=o.markedSpans;if(a){for(var u=0;u<a.length;u++){var f=a[u];if(!(f.to!=null&&n==r.line&&r.ch>=f.to||f.from==null&&n!=r.line||f.from!=null&&n==e.line&&f.from>=e.ch)&&(!t||t(f.marker))){i.push(f.marker.parent||f.marker)}}}++n}));return i},getAllMarks:function(){var r=[];this.iter((function(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i){if(t[i].from!=null){r.push(t[i].marker)}}}}));return r},posFromIndex:function(r){var e,t=this.first,i=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+i;if(o>r){e=r;return true}r-=o;++t}));return ve(this,ue(t,e))},indexFromPos:function(r){r=ve(this,r);var e=r.ch;if(r.line<this.first||r.ch<0){return 0}var t=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){e+=r.text.length+t}));return e},copy:function(r){var e=new Aa(ee(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);e.scrollTop=this.scrollTop;e.scrollLeft=this.scrollLeft;e.sel=this.sel;e.extend=false;if(r){e.history.undoDepth=this.history.undoDepth;e.setHistory(this.getHistory())}return e},linkedDoc:function(r){if(!r){r={}}var e=this.first,t=this.first+this.size;if(r.from!=null&&r.from>e){e=r.from}if(r.to!=null&&r.to<t){t=r.to}var i=new Aa(ee(this,e,t),r.mode||this.modeOption,e,this.lineSep,this.direction);if(r.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:r.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];xa(i,ya(this));return i},unlinkDoc:function(r){if(r instanceof Uu){r=r.doc}if(this.linked){for(var e=0;e<this.linked.length;++e){var t=this.linked[e];if(t.doc!=r){continue}this.linked.splice(e,1);r.unlinkDoc(this);Ca(ya(this));break}}if(r.history==this.history){var i=[r.id];ko(r,(function(r){return i.push(r.id)}),true);r.history=new Mo(null);r.history.done=Ro(this.history.done,i);r.history.undone=Ro(this.history.undone,i)}},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 Rr(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Rn((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){Co(this.cm)}}))});Aa.prototype.eachLine=Aa.prototype.iter;var La=0;function Sa(r){var e=this;Ea(e);if(yr(e,r)||Gt(e.display,r)){return}Ar(r);if(a){La=+new Date}var t=Ri(e,r,true),i=r.dataTransfer.files;if(!t||e.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var n=i.length,o=Array(n),u=0;var f=function(){if(++u==n){In(e,(function(){t=ve(e.doc,t);var r={from:t,to:t,text:e.doc.splitLines(o.filter((function(r){return r!=null})).join(e.doc.lineSeparator())),origin:"paste"};ra(e.doc,r);Wo(e.doc,lo(ve(e.doc,t),ve(e.doc,so(r))))}))()}};var l=function(r,t){if(e.options.allowDropFileTypes&&W(e.options.allowDropFileTypes,r.type)==-1){f();return}var i=new FileReader;i.onerror=function(){return f()};i.onload=function(){var r=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){f();return}o[t]=r;f()};i.readAsText(r)};for(var s=0;s<i.length;s++){l(i[s],s)}}else{if(e.state.draggingText&&e.doc.sel.contains(t)>-1){e.state.draggingText(r);setTimeout((function(){return e.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var d;if(e.state.draggingText&&!e.state.draggingText.copy){d=e.listSelections()}Go(e.doc,lo(t,t));if(d){for(var h=0;h<d.length;++h){aa(e.doc,"",d[h].anchor,d[h].head,"drag")}}e.replaceSelection(c,"around","paste");e.display.input.focus()}}catch(r){}}}function Ta(r,e){if(a&&(!r.state.draggingText||+new Date-La<100)){Tr(e);return}if(yr(r,e)||Gt(r.display,e)){return}e.dataTransfer.setData("Text",r.getSelection());e.dataTransfer.effectAllowed="copyMove";if(e.dataTransfer.setDragImage&&!h){var t=N("img",null,null,"position: fixed; left: 0; top: 0;");t.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(d){t.width=t.height=1;r.display.wrapper.appendChild(t);t._top=t.offsetTop}e.dataTransfer.setDragImage(t,0,0);if(d){t.parentNode.removeChild(t)}}}function Na(r,e){var t=Ri(r,e);if(!t){return}var i=document.createDocumentFragment();Hi(r,t,i);if(!r.display.dragCursor){r.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}T(r.display.dragCursor,i)}function Ea(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function Da(r){if(!document.getElementsByClassName){return}var e=document.getElementsByClassName("CodeMirror"),t=[];for(var i=0;i<e.length;i++){var n=e[i].CodeMirror;if(n){t.push(n)}}if(t.length){t[0].operation((function(){for(var e=0;e<t.length;e++){r(t[e])}}))}}var za=false;function ja(){if(za){return}Ia();za=true}function Ia(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;Da(Ba)}),100)}}));gr(window,"blur",(function(){return Da(Zi)}))}function Ba(r){var e=r.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=false;r.setSize()}var Ra={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 Fa=0;Fa<10;Fa++){Ra[Fa+48]=Ra[Fa+96]=String(Fa)}for(var Oa=65;Oa<=90;Oa++){Ra[Oa]=String.fromCharCode(Oa)}for(var Ua=1;Ua<=12;Ua++){Ra[Ua+111]=Ra[Ua+63235]="F"+Ua}var Pa={};Pa.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"};Pa.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"};Pa.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"};Pa.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"]};Pa["default"]=w?Pa.macDefault:Pa.pcDefault;function _a(r){var e=r.split(/-(?!$)/);r=e[e.length-1];var t,i,n,o;for(var a=0;a<e.length-1;a++){var u=e[a];if(/^(cmd|meta|m)$/i.test(u)){o=true}else if(/^a(lt)?$/i.test(u)){t=true}else if(/^(c|ctrl|control)$/i.test(u)){i=true}else if(/^s(hift)?$/i.test(u)){n=true}else{throw new Error("Unrecognized modifier name: "+u)}}if(t){r="Alt-"+r}if(i){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function qa(r){var e={};for(var t in r){if(r.hasOwnProperty(t)){var i=r[t];if(/^(name|fallthrough|(de|at)tach)$/.test(t)){continue}if(i=="..."){delete r[t];continue}var n=Z(t.split(" "),_a);for(var o=0;o<n.length;o++){var a=void 0,u=void 0;if(o==n.length-1){u=n.join(" ");a=i}else{u=n.slice(0,o+1).join(" ");a="..."}var f=e[u];if(!f){e[u]=a}else if(f!=a){throw new Error("Inconsistent bindings for "+u)}}delete r[t]}}for(var l in e){r[l]=e[l]}return r}function Wa(r,e,t,i){e=Ka(e);var n=e.call?e.call(r,i):e[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&t(n)){return"handled"}if(e.fallthrough){if(Object.prototype.toString.call(e.fallthrough)!="[object Array]"){return Wa(r,e.fallthrough,t,i)}for(var o=0;o<e.fallthrough.length;o++){var a=Wa(r,e.fallthrough[o],t,i);if(a){return a}}}}function $a(r){var e=typeof r=="string"?r:Ra[r.keyCode];return e=="Ctrl"||e=="Alt"||e=="Shift"||e=="Mod"}function Ga(r,e,t){var i=r;if(e.altKey&&i!="Alt"){r="Alt-"+r}if((C?e.metaKey:e.ctrlKey)&&i!="Ctrl"){r="Ctrl-"+r}if((C?e.ctrlKey:e.metaKey)&&i!="Mod"){r="Cmd-"+r}if(!t&&e.shiftKey&&i!="Shift"){r="Shift-"+r}return r}function Ha(r,e){if(d&&r.keyCode==34&&r["char"]){return false}var t=Ra[r.keyCode];if(t==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){t=r.code}return Ga(t,r,e)}function Ka(r){return typeof r=="string"?Pa[r]:r}function Va(r,e){var t=r.doc.sel.ranges,i=[];for(var n=0;n<t.length;n++){var o=e(t[n]);while(i.length&&fe(o.from,X(i).to)<=0){var a=i.pop();if(fe(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}jn(r,(function(){for(var e=i.length-1;e>=0;e--){aa(r.doc,"",i[e].from,i[e].to,"+delete")}ln(r)}))}function Qa(r,e,t){var i=lr(r.text,e+t,t);return i<0||i>r.text.length?null:i}function Ja(r,e,t){var i=Qa(r,e.ch,t);return i==null?null:new ue(e.line,i,t<0?"after":"before")}function Ya(r,e,t,i,n){if(r){if(e.doc.direction=="rtl"){n=-n}var o=mr(t,e.doc.direction);if(o){var a=n<0?X(o):o[0];var u=n<0==(a.level==1);var f=u?"after":"before";var l;if(a.level>0||e.doc.direction=="rtl"){var s=ii(e,t);l=n<0?t.text.length-1:0;var c=ni(e,s,l).top;l=sr((function(r){return ni(e,s,r).top==c}),n<0==(a.level==1)?a.from:a.to-1,l);if(f=="before"){l=Qa(t,l,1)}}else{l=n<0?a.to:a.from}return new ue(i,l,f)}}return new ue(i,n<0?t.text.length:0,n<0?"before":"after")}function Xa(r,e,t,i){var n=mr(e,r.doc.direction);if(!n){return Ja(e,t,i)}if(t.ch>=e.text.length){t.ch=e.text.length;t.sticky="before"}else if(t.ch<=0){t.ch=0;t.sticky="after"}var o=hr(n,t.ch,t.sticky),a=n[o];if(r.doc.direction=="ltr"&&a.level%2==0&&(i>0?a.to>t.ch:a.from<t.ch)){return Ja(e,t,i)}var u=function(r,t){return Qa(e,r instanceof ue?r.ch:r,t)};var f;var l=function(t){if(!r.options.lineWrapping){return{begin:0,end:e.text.length}}f=f||ii(r,e);return Mi(r,e,f,t)};var s=l(t.sticky=="before"?u(t,-1):t.ch);if(r.doc.direction=="rtl"||a.level==1){var c=a.level==1==i<0;var d=u(t,c?1:-1);if(d!=null&&(!c?d>=a.from&&d>=s.begin:d<=a.to&&d<=s.end)){var h=c?"before":"after";return new ue(t.line,d,h)}}var v=function(r,e,i){var o=function(r,e){return e?new ue(t.line,u(r,1),"before"):new ue(t.line,r,"after")};for(;r>=0&&r<n.length;r+=e){var a=n[r];var f=e>0==(a.level!=1);var l=f?i.begin:u(i.end,-1);if(a.from<=l&&l<a.to){return o(l,f)}l=f?a.from:u(a.to,-1);if(i.begin<=l&&l<i.end){return o(l,f)}}};var m=v(o+i,i,s);if(m){return m}var p=i>0?s.end:u(s.begin,-1);if(p!=null&&!(i>0&&p==e.text.length)){m=v(i>0?0:n.length-1,i,l(p));if(m){return m}}return null}var Za={selectAll:Xo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),H)},killLine:function(r){return Va(r,(function(e){if(e.empty()){var t=Zr(r.doc,e.head.line).text.length;if(e.head.ch==t&&e.head.line<r.lastLine()){return{from:e.head,to:ue(e.head.line+1,0)}}else{return{from:e.head,to:ue(e.head.line,t)}}}else{return{from:e.from(),to:e.to()}}}))},deleteLine:function(r){return Va(r,(function(e){return{from:ue(e.from().line,0),to:ve(r.doc,ue(e.to().line+1,0))}}))},delLineLeft:function(r){return Va(r,(function(r){return{from:ue(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Va(r,(function(e){var t=r.charCoords(e.head,"div").top+5;var i=r.coordsChar({left:0,top:t},"div");return{from:i,to:e.from()}}))},delWrappedLineRight:function(r){return Va(r,(function(e){var t=r.charCoords(e.head,"div").top+5;var i=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:i}}))},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(ue(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ue(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(e){return ru(r,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(e){return tu(r,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(e){return eu(r,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")}),V)},goLineLeft:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")}),V)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;var i=r.coordsChar({left:0,top:t},"div");if(i.ch<r.getLine(i.line).search(/\S/)){return tu(r,e.head)}return i}),V)},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 e=[],t=r.listSelections(),i=r.options.tabSize;for(var n=0;n<t.length;n++){var o=t[n].from();var a=_(r.getLine(o.line),o.ch,i);e.push(Y(i-a%i))}r.replaceSelections(e)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return jn(r,(function(){var e=r.listSelections(),t=[];for(var i=0;i<e.length;i++){if(!e[i].empty()){continue}var n=e[i].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ue(n.line,n.ch-1)}if(n.ch>0){n=new ue(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ue(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var a=Zr(r.doc,n.line-1).text;if(a){n=new ue(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+a.charAt(a.length-1),ue(n.line-1,a.length-1),n,"+transpose")}}}t.push(new uo(n,n))}r.setSelections(t)}))},newlineAndIndent:function(r){return jn(r,(function(){var e=r.listSelections();for(var t=e.length-1;t>=0;t--){r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,"+input")}e=r.listSelections();for(var i=0;i<e.length;i++){r.indentLine(e[i].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function ru(r,e){var t=Zr(r.doc,e);var i=rt(t);if(i!=t){e=ie(i)}return Ya(true,r,i,e,1)}function eu(r,e){var t=Zr(r.doc,e);var i=et(t);if(i!=t){e=ie(i)}return Ya(true,r,t,e,-1)}function tu(r,e){var t=ru(r,e.line);var i=Zr(r.doc,t.line);var n=mr(i,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(t.ch,i.text.search(/\S/));var a=e.line==t.line&&e.ch<=o&&e.ch;return ue(t.line,a?0:o,t.sticky)}return t}function iu(r,e,t){if(typeof e=="string"){e=Za[e];if(!e){return false}}r.display.input.ensurePolled();var i=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(t){r.display.shift=false}n=e(r)!=G}finally{r.display.shift=i;r.state.suppressEdits=false}return n}function nu(r,e,t){for(var i=0;i<r.state.keyMaps.length;i++){var n=Wa(e,r.state.keyMaps[i],t,r);if(n){return n}}return r.options.extraKeys&&Wa(e,r.options.extraKeys,t,r)||Wa(e,r.options.keyMap,t,r)}var ou=new q;function au(r,e,t,i){var n=r.state.keySeq;if(n){if($a(e)){return"handled"}if(/\'$/.test(e)){r.state.keySeq=null}else{ou.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(uu(r,n+" "+e,t,i)){return true}}return uu(r,e,t,i)}function uu(r,e,t,i){var n=nu(r,e,i);if(n=="multi"){r.state.keySeq=e}if(n=="handled"){Et(r,"keyHandled",r,e,t)}if(n=="handled"||n=="multi"){Ar(t);Qi(r)}return!!n}function fu(r,e){var t=Ha(e,true);if(!t){return false}if(e.shiftKey&&!r.state.keySeq){return au(r,"Shift-"+t,e,(function(e){return iu(r,e,true)}))||au(r,t,e,(function(e){if(typeof e=="string"?/^go[A-Z]/.test(e):e.motion){return iu(r,e)}}))}else{return au(r,t,e,(function(e){return iu(r,e)}))}}function lu(r,e,t){return au(r,"'"+t+"'",e,(function(e){return iu(r,e,true)}))}var su=null;function cu(r){var e=this;if(r.target&&r.target!=e.display.input.getField()){return}e.curOp.focus=j(F(e));if(yr(e,r)){return}if(a&&u<11&&r.keyCode==27){r.returnValue=false}var i=r.keyCode;e.display.shift=i==16||r.shiftKey;var n=fu(e,r);if(d){su=n?i:null;if(!n&&i==88&&!Or&&(w?r.metaKey:r.ctrlKey)){e.replaceSelection("",null,"cut")}}if(t&&!w&&!n&&i==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)){du(e)}}function du(r){var e=r.display.lineDiv;I(e,"CodeMirror-crosshair");function t(r){if(r.keyCode==18||!r.altKey){L(e,"CodeMirror-crosshair");wr(document,"keyup",t);wr(document,"mouseover",t)}}gr(document,"keyup",t);gr(document,"mouseover",t)}function hu(r){if(r.keyCode==16){this.doc.sel.shift=false}yr(this,r)}function vu(r){var e=this;if(r.target&&r.target!=e.display.input.getField()){return}if(Gt(e.display,r)||yr(e,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var t=r.keyCode,i=r.charCode;if(d&&t==su){su=null;Ar(r);return}if(d&&(!r.which||r.which<10)&&fu(e,r)){return}var n=String.fromCharCode(i==null?t:i);if(n=="\b"){return}if(lu(e,r,n)){return}e.display.input.onKeyPress(r)}var mu=400;var pu=function(r,e,t){this.time=r;this.pos=e;this.button=t};pu.prototype.compare=function(r,e,t){return this.time+mu>r&&fe(e,this.pos)==0&&t==this.button};var gu,bu;function wu(r,e){var t=+new Date;if(bu&&bu.compare(t,r,e)){gu=bu=null;return"triple"}else if(gu&&gu.compare(t,r,e)){bu=new pu(t,r,e);gu=null;return"double"}else{gu=new pu(t,r,e);bu=null;return"single"}}function ku(r){var e=this,t=e.display;if(yr(e,r)||t.activeTouch&&t.input.supportsTouch()){return}t.input.ensurePolled();t.shift=r.shiftKey;if(Gt(t,r)){if(!f){t.scroller.draggable=false;setTimeout((function(){return t.scroller.draggable=true}),100)}return}if(Nu(e,r)){return}var i=Ri(e,r),n=Er(r),o=i?wu(i,n):"single";O(e).focus();if(n==1&&e.state.selectingText){e.state.selectingText(r)}if(i&&yu(e,n,i,o,r)){return}if(n==1){if(i){Cu(e,i,o,r)}else if(Nr(r)==t.scroller){Ar(r)}}else if(n==2){if(i){Oo(e.doc,i)}setTimeout((function(){return t.input.focus()}),20)}else if(n==3){if(M){e.display.input.onContextMenu(r)}else{Yi(e)}}}function yu(r,e,t,i,n){var o="Click";if(i=="double"){o="Double"+o}else if(i=="triple"){o="Triple"+o}o=(e==1?"Left":e==2?"Middle":"Right")+o;return au(r,Ga(o,n),n,(function(e){if(typeof e=="string"){e=Za[e]}if(!e){return false}var i=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}i=e(r,t)!=G}finally{r.state.suppressEdits=false}return i}))}function xu(r,e,t){var i=r.getOption("configureMouse");var n=i?i(r,e,t):{};if(n.unit==null){var o=k?t.shiftKey&&t.metaKey:t.altKey;n.unit=o?"rectangle":e=="single"?"char":e=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||t.shiftKey}if(n.addNew==null){n.addNew=w?t.metaKey:t.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?t.altKey:t.ctrlKey)}return n}function Cu(r,e,t,i){if(a){setTimeout(U(Ji,r),0)}else{r.curOp.focus=j(F(r))}var n=xu(r,t,i);var o=r.doc.sel,u;if(r.options.dragDrop&&Dr&&!r.isReadOnly()&&t=="single"&&(u=o.contains(e))>-1&&(fe((u=o.ranges[u]).from(),e)<0||e.xRel>0)&&(fe(u.to(),e)>0||e.xRel<0)){Mu(r,i,e,n)}else{Lu(r,i,e,n)}}function Mu(r,e,t,i){var n=r.display,o=false;var l=In(r,(function(e){if(f){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Yi(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){Ar(e);if(!i.addNew){Oo(r.doc,t,null,null,i.extend)}if(f&&!h||a&&u==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(e.clientX-r.clientX)+Math.abs(e.clientY-r.clientY)>=10};var c=function(){return o=true};if(f){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!i.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 Au(r,e,t){if(t=="char"){return new uo(e,e)}if(t=="word"){return r.findWordAt(e)}if(t=="line"){return new uo(ue(e.line,0),ve(r.doc,ue(e.line+1,0)))}var i=t(r,e);return new uo(i.from,i.to)}function Lu(r,e,t,i){if(a){Yi(r)}var n=r.display,o=r.doc;Ar(e);var u,f,l=o.sel,s=l.ranges;if(i.addNew&&!i.extend){f=o.sel.contains(t);if(f>-1){u=s[f]}else{u=new uo(t,t)}}else{u=o.sel.primary();f=o.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){u=new uo(t,t)}t=Ri(r,e,true,true);f=-1}else{var c=Au(r,t,i.unit);if(i.extend){u=Fo(u,c.anchor,c.head,i.extend)}else{u=c}}if(!i.addNew){f=0;$o(o,new ao([u],0),K);l=o.sel}else if(f==-1){f=s.length;$o(o,fo(r,s.concat([u]),f),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[f].empty()&&i.unit=="char"&&!i.extend){$o(o,fo(r,s.slice(0,f).concat(s.slice(f+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Po(o,f,u,K)}var d=t;function h(e){if(fe(d,e)==0){return}d=e;if(i.unit=="rectangle"){var n=[],a=r.options.tabSize;var s=_(Zr(o,t.line).text,t.ch,a);var c=_(Zr(o,e.line).text,e.ch,a);var h=Math.min(s,c),v=Math.max(s,c);for(var m=Math.min(t.line,e.line),p=Math.min(r.lastLine(),Math.max(t.line,e.line));m<=p;m++){var g=Zr(o,m).text,b=Q(g,h,a);if(h==v){n.push(new uo(ue(m,b),ue(m,b)))}else if(g.length>b){n.push(new uo(ue(m,b),ue(m,Q(g,v,a))))}}if(!n.length){n.push(new uo(t,t))}$o(o,fo(r,l.ranges.slice(0,f).concat(n),f),{origin:"*mouse",scroll:false});r.scrollIntoView(e)}else{var w=u;var k=Au(r,e,i.unit);var y=w.anchor,x;if(fe(k.anchor,y)>0){x=k.head;y=de(w.from(),k.anchor)}else{x=k.anchor;y=ce(w.to(),k.head)}var C=l.ranges.slice(0);C[f]=Su(r,new uo(ve(o,y),x));$o(o,fo(r,C,f),K)}}var v=n.wrapper.getBoundingClientRect();var m=0;function p(e){var t=++m;var a=Ri(r,e,true,i.unit=="rectangle");if(!a){return}if(fe(a,d)!=0){r.curOp.focus=j(F(r));h(a);var u=tn(n,o);if(a.line>=u.to||a.line<u.from){setTimeout(In(r,(function(){if(m==t){p(e)}})),150)}}else{var f=e.clientY<v.top?-20:e.clientY>v.bottom?20:0;if(f){setTimeout(In(r,(function(){if(m!=t){return}n.scroller.scrollTop+=f;p(e)})),50)}}}function g(e){r.state.selectingText=false;m=Infinity;if(e){Ar(e);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=In(r,(function(r){if(r.buttons===0||!Er(r)){g(r)}else{p(r)}}));var w=In(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Su(r,e){var t=e.anchor;var i=e.head;var n=Zr(r.doc,t.line);if(fe(t,i)==0&&t.sticky==i.sticky){return e}var o=mr(n);if(!o){return e}var a=hr(o,t.ch,t.sticky),u=o[a];if(u.from!=t.ch&&u.to!=t.ch){return e}var f=a+(u.from==t.ch==(u.level!=1)?0:1);if(f==0||f==o.length){return e}var l;if(i.line!=t.line){l=(i.line-t.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,i.ch,i.sticky);var c=s-a||(i.ch-t.ch)*(u.level==1?-1:1);if(s==f-1||s==f){l=c<0}else{l=c>0}}var d=o[f+(l?-1:0)];var h=l==(d.level==1);var v=h?d.from:d.to,m=h?"after":"before";return t.ch==v&&t.sticky==m?e:new uo(new ue(t.line,v,m),i)}function Tu(r,e,t,i){var n,o;if(e.touches){n=e.touches[0].clientX;o=e.touches[0].clientY}else{try{n=e.clientX;o=e.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(i){Ar(e)}var a=r.display;var u=a.lineDiv.getBoundingClientRect();if(o>u.bottom||!Cr(r,t)){return Sr(e)}o-=u.top-a.viewOffset;for(var f=0;f<r.display.gutterSpecs.length;++f){var l=a.gutters.childNodes[f];if(l&&l.getBoundingClientRect().right>=n){var s=ne(r.doc,o);var c=r.display.gutterSpecs[f];kr(r,t,r,s,c.className,e);return Sr(e)}}}function Nu(r,e){return Tu(r,e,"gutterClick",true)}function Eu(r,e){if(Gt(r.display,e)||Du(r,e)){return}if(yr(r,e,"contextmenu")){return}if(!M){r.display.input.onContextMenu(e)}}function Du(r,e){if(!Cr(r,"gutterContextMenu")){return false}return Tu(r,e,"gutterContextMenu",false)}function zu(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");di(r)}var ju={toString:function(){return"CodeMirror.Init"}};var Iu={};var Bu={};function Ru(r){var e=r.optionHandlers;function t(t,i,n,o){r.defaults[t]=i;if(n){e[t]=o?function(r,e,t){if(t!=ju){n(r,e,t)}}:n}}r.defineOption=t;r.Init=ju;t("value","",(function(r,e){return r.setValue(e)}),true);t("mode",null,(function(r,e){r.doc.modeOption=e;po(r)}),true);t("indentUnit",2,po,true);t("indentWithTabs",false);t("smartIndent",true);t("tabSize",4,(function(r){go(r);di(r);Oi(r)}),true);t("lineSeparator",null,(function(r,e){r.doc.lineSep=e;if(!e){return}var t=[],i=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(e,n);if(o==-1){break}n=o+e.length;t.push(ue(i,o))}i++}));for(var n=t.length-1;n>=0;n--){aa(r.doc,e,t[n],ue(t[n].line,t[n].ch+e.length))}}));t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,e,t){r.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g");if(t!=ju){r.refresh()}}));t("specialCharPlaceholder",gt,(function(r){return r.refresh()}),true);t("electricChars",true);t("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);t("spellcheck",false,(function(r,e){return r.getInputField().spellcheck=e}),true);t("autocorrect",false,(function(r,e){return r.getInputField().autocorrect=e}),true);t("autocapitalize",false,(function(r,e){return r.getInputField().autocapitalize=e}),true);t("rtlMoveVisually",!y);t("wholeLineUpdateBefore",true);t("theme","default",(function(r){zu(r);Zn(r)}),true);t("keyMap","default",(function(r,e,t){var i=Ka(e);var n=t!=ju&&Ka(t);if(n&&n.detach){n.detach(r,i)}if(i.attach){i.attach(r,n||null)}}));t("extraKeys",null);t("configureMouse",null);t("lineWrapping",false,Ou,true);t("gutters",[],(function(r,e){r.display.gutterSpecs=Yn(e,r.options.lineNumbers);Zn(r)}),true);t("fixedGutter",true,(function(r,e){r.display.gutters.style.left=e?ji(r.display)+"px":"0";r.refresh()}),true);t("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);t("scrollbarStyle","native",(function(r){Cn(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);t("lineNumbers",false,(function(r,e){r.display.gutterSpecs=Yn(r.options.gutters,e);Zn(r)}),true);t("firstLineNumber",1,Zn,true);t("lineNumberFormatter",(function(r){return r}),Zn,true);t("showCursorWhenSelecting",false,$i,true);t("resetSelectionOnContextMenu",true);t("lineWiseCopyCut",true);t("pasteLinesPerSelection",true);t("selectionsMayTouch",false);t("readOnly",false,(function(r,e){if(e=="nocursor"){Zi(r);r.display.input.blur()}r.display.input.readOnlyChanged(e)}));t("screenReaderLabel",null,(function(r,e){e=e===""?null:e;r.display.input.screenReaderLabelChanged(e)}));t("disableInput",false,(function(r,e){if(!e){r.display.input.reset()}}),true);t("dragDrop",true,Fu);t("allowDropFileTypes",null);t("cursorBlinkRate",530);t("cursorScrollMargin",0);t("cursorHeight",1,$i,true);t("singleCursorHeightPerLine",true,$i,true);t("workTime",100);t("workDelay",100);t("flattenSpans",true,go,true);t("addModeClass",false,go,true);t("pollInterval",100);t("undoDepth",200,(function(r,e){return r.doc.history.undoDepth=e}));t("historyEventDelay",1250);t("viewportMargin",10,(function(r){return r.refresh()}),true);t("maxHighlightLength",1e4,go,true);t("moveInputWithCursor",true,(function(r,e){if(!e){r.display.input.resetPosition()}}));t("tabindex",null,(function(r,e){return r.display.input.getField().tabIndex=e||""}));t("autofocus",null);t("direction","ltr",(function(r,e){return r.doc.setDirection(e)}),true);t("phrases",null)}function Fu(r,e,t){var i=t&&t!=ju;if(!e!=!i){var n=r.display.dragFunctions;var o=e?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 Ou(r){if(r.options.lineWrapping){I(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");lt(r)}Bi(r);Oi(r);di(r);setTimeout((function(){return kn(r)}),100)}function Uu(r,e){var t=this;if(!(this instanceof Uu)){return new Uu(r,e)}this.options=e=e?P(e):{};P(Iu,e,false);var i=e.value;if(typeof i=="string"){i=new Aa(i,e.mode,null,e.lineSeparator,e.direction)}else if(e.mode){i.modeOption=e.mode}this.doc=i;var n=new Uu.inputStyles[e.inputStyle](this);var o=this.display=new ro(r,i,n,e);o.wrapper.CodeMirror=this;zu(this);if(e.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}Cn(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 q,keySeq:null,specialChars:null};if(e.autofocus&&!b){o.input.focus()}if(a&&u<11){setTimeout((function(){return t.display.input.reset(true)}),20)}Pu(this);ja();An(this);this.curOp.forceUpdate=true;yo(this,i);if(e.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(t.hasFocus()&&!t.state.focused){Xi(t)}}),20)}else{Zi(this)}for(var l in Bu){if(Bu.hasOwnProperty(l)){Bu[l](this,e[l],ju)}}Jn(this);if(e.finishInit){e.finishInit(this)}for(var s=0;s<_u.length;++s){_u[s](this)}Ln(this);if(f&&e.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Uu.defaults=Iu;Uu.optionHandlers=Bu;function Pu(r){var e=r.display;gr(e.scroller,"mousedown",In(r,ku));if(a&&u<11){gr(e.scroller,"dblclick",In(r,(function(e){if(yr(r,e)){return}var t=Ri(r,e);if(!t||Nu(r,e)||Gt(r.display,e)){return}Ar(e);var i=r.findWordAt(t);Oo(r.doc,i.anchor,i.head)})))}else{gr(e.scroller,"dblclick",(function(e){return yr(r,e)||Ar(e)}))}gr(e.scroller,"contextmenu",(function(e){return Eu(r,e)}));gr(e.input.getField(),"contextmenu",(function(t){if(!e.scroller.contains(t.target)){Eu(r,t)}}));var t,i={end:0};function n(){if(e.activeTouch){t=setTimeout((function(){return e.activeTouch=null}),1e3);i=e.activeTouch;i.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var e=r.touches[0];return e.radiusX<=1&&e.radiusY<=1}function f(r,e){if(e.left==null){return true}var t=e.left-r.left,i=e.top-r.top;return t*t+i*i>20*20}gr(e.scroller,"touchstart",(function(n){if(!yr(r,n)&&!o(n)&&!Nu(r,n)){e.input.ensurePolled();clearTimeout(t);var a=+new Date;e.activeTouch={start:a,moved:false,prev:a-i.end<=300?i:null};if(n.touches.length==1){e.activeTouch.left=n.touches[0].pageX;e.activeTouch.top=n.touches[0].pageY}}}));gr(e.scroller,"touchmove",(function(){if(e.activeTouch){e.activeTouch.moved=true}}));gr(e.scroller,"touchend",(function(t){var i=e.activeTouch;if(i&&!Gt(e,t)&&i.left!=null&&!i.moved&&new Date-i.start<300){var o=r.coordsChar(e.activeTouch,"page"),a;if(!i.prev||f(i,i.prev)){a=new uo(o,o)}else if(!i.prev.prev||f(i,i.prev.prev)){a=r.findWordAt(o)}else{a=new uo(ue(o.line,0),ve(r.doc,ue(o.line+1,0)))}r.setSelection(a.anchor,a.head);r.focus();Ar(t)}n()}));gr(e.scroller,"touchcancel",n);gr(e.scroller,"scroll",(function(){if(e.scroller.clientHeight){vn(r,e.scroller.scrollTop);pn(r,e.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(e.scroller,"mousewheel",(function(e){return oo(r,e)}));gr(e.scroller,"DOMMouseScroll",(function(e){return oo(r,e)}));gr(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}));e.dragFunctions={enter:function(e){if(!yr(r,e)){Tr(e)}},over:function(e){if(!yr(r,e)){Na(r,e);Tr(e)}},start:function(e){return Ta(r,e)},drop:In(r,Sa),leave:function(e){if(!yr(r,e)){Ea(r)}}};var l=e.input.getField();gr(l,"keyup",(function(e){return hu.call(r,e)}));gr(l,"keydown",In(r,cu));gr(l,"keypress",In(r,vu));gr(l,"focus",(function(e){return Xi(r,e)}));gr(l,"blur",(function(e){return Zi(r,e)}))}var _u=[];Uu.defineInitHook=function(r){return _u.push(r)};function qu(r,e,t,i){var n=r.doc,o;if(t==null){t="add"}if(t=="smart"){if(!n.mode.indent){t="prev"}else{o=ye(r,e).state}}var a=r.options.tabSize;var u=Zr(n,e),f=_(u.text,null,a);if(u.stateAfter){u.stateAfter=null}var l=u.text.match(/^\s*/)[0],s;if(!i&&!/\S/.test(u.text)){s=0;t="not"}else if(t=="smart"){s=n.mode.indent(o,u.text.slice(l.length),u.text);if(s==G||s>150){if(!i){return}t="prev"}}if(t=="prev"){if(e>n.first){s=_(Zr(n,e-1).text,null,a)}else{s=0}}else if(t=="add"){s=f+r.options.indentUnit}else if(t=="subtract"){s=f-r.options.indentUnit}else if(typeof t=="number"){s=f+t}s=Math.max(0,s);var c="",d=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/a);h;--h){d+=a;c+="\t"}}if(d<s){c+=Y(s-d)}if(c!=l){aa(n,c,ue(e,0),ue(e,l.length),"+input");u.stateAfter=null;return true}else{for(var v=0;v<n.sel.ranges.length;v++){var m=n.sel.ranges[v];if(m.head.line==e&&m.head.ch<l.length){var p=ue(e,l.length);Po(n,v,new uo(p,p));break}}}}var Wu=null;function $u(r){Wu=r}function Gu(r,e,t,i,n){var o=r.doc;r.display.shift=false;if(!i){i=o.sel}var a=+new Date-200;var u=n=="paste"||r.state.pasteIncoming>a;var f=Rr(e),l=null;if(u&&i.ranges.length>1){if(Wu&&Wu.text.join("\n")==e){if(i.ranges.length%Wu.text.length==0){l=[];for(var s=0;s<Wu.text.length;s++){l.push(o.splitLines(Wu.text[s]))}}}else if(f.length==i.ranges.length&&r.options.pasteLinesPerSelection){l=Z(f,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var d=i.ranges.length-1;d>=0;d--){var h=i.ranges[d];var v=h.from(),m=h.to();if(h.empty()){if(t&&t>0){v=ue(v.line,v.ch-t)}else if(r.state.overwrite&&!u){m=ue(m.line,Math.min(Zr(o,m.line).text.length,m.ch+X(f).length))}else if(u&&Wu&&Wu.lineWise&&Wu.text.join("\n")==f.join("\n")){v=m=ue(v.line,0)}}var p={from:v,to:m,text:l?l[d%l.length]:f,origin:n||(u?"paste":r.state.cutIncoming>a?"cut":"+input")};ra(r.doc,p);Et(r,"inputRead",r,p)}if(e&&!u){Ku(r,e)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Hu(r,e){var t=r.clipboardData&&r.clipboardData.getData("Text");if(t){r.preventDefault();if(!e.isReadOnly()&&!e.options.disableInput&&e.hasFocus()){jn(e,(function(){return Gu(e,t,0,null,"paste")}))}return true}}function Ku(r,e){if(!r.options.electricChars||!r.options.smartIndent){return}var t=r.doc.sel;for(var i=t.ranges.length-1;i>=0;i--){var n=t.ranges[i];if(n.head.ch>100||i&&t.ranges[i-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var a=false;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++){if(e.indexOf(o.electricChars.charAt(u))>-1){a=qu(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))){a=qu(r,n.head.line,"smart")}}if(a){Et(r,"electricInput",r,n.head.line)}}}function Vu(r){var e=[],t=[];for(var i=0;i<r.doc.sel.ranges.length;i++){var n=r.doc.sel.ranges[i].head.line;var o={anchor:ue(n,0),head:ue(n+1,0)};t.push(o);e.push(r.getRange(o.anchor,o.head))}return{text:e,ranges:t}}function Qu(r,e,t,i){r.setAttribute("autocorrect",t?"":"off");r.setAttribute("autocapitalize",i?"":"off");r.setAttribute("spellcheck",!!e)}function Ju(){var r=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var e=N("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(f){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}Qu(r);return e}function Yu(r){var e=r.optionHandlers;var t=r.helpers={};r.prototype={constructor:r,focus:function(){O(this).focus();this.display.input.focus()},setOption:function(r,t){var i=this.options,n=i[r];if(i[r]==t&&r!="mode"){return}i[r]=t;if(e.hasOwnProperty(r)){In(this,e[r])(this,t,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,e){this.state.keyMaps[e?"push":"unshift"](Ka(r))},removeKeyMap:function(r){var e=this.state.keyMaps;for(var t=0;t<e.length;++t){if(e[t]==r||e[t].name==r){e.splice(t,1);return true}}},addOverlay:Bn((function(e,t){var i=e.token?e:r.getMode(this.options,e);if(i.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:i,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},(function(r){return r.priority}));this.state.modeGen++;Oi(this)})),removeOverlay:Bn((function(r){var e=this.state.overlays;for(var t=0;t<e.length;++t){var i=e[t].modeSpec;if(i==r||typeof r=="string"&&i.name==r){e.splice(t,1);this.state.modeGen++;Oi(this);return}}})),indentLine:Bn((function(r,e,t){if(typeof e!="string"&&typeof e!="number"){if(e==null){e=this.options.smartIndent?"smart":"prev"}else{e=e?"add":"subtract"}}if(oe(this.doc,r)){qu(this,r,e,t)}})),indentSelection:Bn((function(r){var e=this.doc.sel.ranges,t=-1;for(var i=0;i<e.length;i++){var n=e[i];if(!n.empty()){var o=n.from(),a=n.to();var u=Math.max(t,o.line);t=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var f=u;f<t;++f){qu(this,f,r)}var l=this.doc.sel.ranges;if(o.ch==0&&e.length==l.length&&l[i].from().ch>0){Po(this.doc,i,new uo(o,l[i].to()),H)}}else if(n.head.line>t){qu(this,n.head.line,r,true);t=n.head.line;if(i==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,e){return Le(this,r,e)},getLineTokens:function(r,e){return Le(this,ue(r),e,true)},getTokenTypeAt:function(r){r=ve(this.doc,r);var e=ke(this,Zr(this.doc,r.line));var t=0,i=(e.length-1)/2,n=r.ch;var o;if(n==0){o=e[2]}else{for(;;){var a=t+i>>1;if((a?e[a*2-1]:0)>=n){i=a}else if(e[a*2+1]<n){t=a+1}else{o=e[a*2+2];break}}}var u=o?o.indexOf("overlay "):-1;return u<0?o:u==0?null:o.slice(0,u-1)},getModeAt:function(e){var t=this.doc.mode;if(!t.innerMode){return t}return r.innerMode(t,this.getTokenAt(e).state).mode},getHelper:function(r,e){return this.getHelpers(r,e)[0]},getHelpers:function(r,e){var i=[];if(!t.hasOwnProperty(e)){return i}var n=t[e],o=this.getModeAt(r);if(typeof o[e]=="string"){if(n[o[e]]){i.push(n[o[e]])}}else if(o[e]){for(var a=0;a<o[e].length;a++){var u=n[o[e][a]];if(u){i.push(u)}}}else if(o.helperType&&n[o.helperType]){i.push(n[o.helperType])}else if(n[o.name]){i.push(n[o.name])}for(var f=0;f<n._global.length;f++){var l=n._global[f];if(l.pred(o,this)&&W(i,l.val)==-1){i.push(l.val)}}return i},getStateAfter:function(r,e){var t=this.doc;r=he(t,r==null?t.first+t.size-1:r);return ye(this,r+1,e).state},cursorCoords:function(r,e){var t,i=this.doc.sel.primary();if(r==null){t=i.head}else if(typeof r=="object"){t=ve(this.doc,r)}else{t=r?i.from():i.to()}return wi(this,t,e||"page")},charCoords:function(r,e){return bi(this,ve(this.doc,r),e||"page")},coordsChar:function(r,e){r=gi(this,r,e||"page");return xi(this,r.left,r.top)},lineAtHeight:function(r,e){r=gi(this,{top:r,left:0},e||"page").top;return ne(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,e,t){var i=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;i=true}n=Zr(this.doc,r)}else{n=r}return pi(this,n,{top:0,left:0},e||"page",t||i).top+(i?this.doc.height-ut(n):0)},defaultTextHeight:function(){return Ei(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,e,t,i,n){var o=this.display;r=wi(this,ve(this.doc,r));var a=r.bottom,u=r.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(e);o.sizer.appendChild(e);if(i=="over"){a=r.top}else if(i=="above"||i=="near"){var f=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((i=="above"||r.bottom+e.offsetHeight>f)&&r.top>e.offsetHeight){a=r.top-e.offsetHeight}else if(r.bottom+e.offsetHeight<=f){a=r.bottom}if(u+e.offsetWidth>l){u=l-e.offsetWidth}}e.style.top=a+"px";e.style.left=e.style.right="";if(n=="right"){u=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"}else{if(n=="left"){u=0}else if(n=="middle"){u=(o.sizer.clientWidth-e.offsetWidth)/2}e.style.left=u+"px"}if(t){an(this,{left:u,top:a,right:u+e.offsetWidth,bottom:a+e.offsetHeight})}},triggerOnKeyDown:Bn(cu),triggerOnKeyPress:Bn(vu),triggerOnKeyUp:hu,triggerOnMouseDown:Bn(ku),execCommand:function(r){if(Za.hasOwnProperty(r)){return Za[r].call(null,this)}},triggerElectric:Bn((function(r){Ku(this,r)})),findPosH:function(r,e,t,i){var n=1;if(e<0){n=-1;e=-e}var o=ve(this.doc,r);for(var a=0;a<e;++a){o=Xu(this.doc,o,n,t,i);if(o.hitSide){break}}return o},moveH:Bn((function(r,e){var t=this;this.extendSelectionsBy((function(i){if(t.display.shift||t.doc.extend||i.empty()){return Xu(t.doc,i.head,r,e,t.options.rtlMoveVisually)}else{return r<0?i.from():i.to()}}),V)})),deleteH:Bn((function(r,e){var t=this.doc.sel,i=this.doc;if(t.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Va(this,(function(t){var n=Xu(i,t.head,r,e,false);return r<0?{from:n,to:t.head}:{from:t.head,to:n}}))}})),findPosV:function(r,e,t,i){var n=1,o=i;if(e<0){n=-1;e=-e}var a=ve(this.doc,r);for(var u=0;u<e;++u){var f=wi(this,a,"div");if(o==null){o=f.left}else{f.left=o}a=Zu(this,f,n,t);if(a.hitSide){break}}return a},moveV:Bn((function(r,e){var t=this;var i=this.doc,n=[];var o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(a){if(o){return r<0?a.from():a.to()}var u=wi(t,a.head,"div");if(a.goalColumn!=null){u.left=a.goalColumn}n.push(u.left);var f=Zu(t,u,r,e);if(e=="page"&&a==i.sel.primary()){fn(t,bi(t,f,"div").top-u.top)}return f}),V);if(n.length){for(var a=0;a<i.sel.ranges.length;a++){i.sel.ranges[a].goalColumn=n[a]}}})),findWordAt:function(r){var e=this.doc,t=Zr(e,r.line).text;var i=r.ch,n=r.ch;if(t){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==t.length)&&i){--i}else{++n}var a=t.charAt(i);var u=or(a,o)?function(r){return or(r,o)}:/\s/.test(a)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(i>0&&u(t.charAt(i-1))){--i}while(n<t.length&&u(t.charAt(n))){++n}}return new uo(ue(r.line,i),ue(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){I(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()==j(F(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,e){sn(this,r,e)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Qt(this)-this.display.barHeight,width:r.scrollWidth-Qt(this)-this.display.barWidth,clientHeight:Yt(this),clientWidth:Jt(this)}},scrollIntoView:Bn((function(r,e){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(e==null){e=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ue(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=e||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,e){var t=this;var i=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=i(r)}if(e!=null){this.display.wrapper.style.height=i(e)}if(this.options.lineWrapping){ci(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var e=0;e<r.widgets.length;e++){if(r.widgets[e].noHScroll){Ui(t,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return jn(this,r)},startOperation:function(){return An(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;Oi(this);this.curOp.forceUpdate=true;di(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Kn(this.display);if(r==null||Math.abs(r-Ei(this.display))>.5||this.options.lineWrapping){Bi(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var e=this.doc;e.cm=null;if(this.state.selectingText){this.state.selectingText()}yo(this,r);di(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;Et(this,"swapDoc",this,e);return e})),phrase:function(r){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,r)?e[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}};Mr(r);r.registerHelper=function(e,i,n){if(!t.hasOwnProperty(e)){t[e]=r[e]={_global:[]}}t[e][i]=n};r.registerGlobalHelper=function(e,i,n,o){r.registerHelper(e,i,o);t[e]._global.push({pred:n,val:o})}}function Xu(r,e,t,i,n){var o=e;var a=t;var u=Zr(r,e.line);var f=n&&r.direction=="rtl"?-t:t;function l(){var t=e.line+f;if(t<r.first||t>=r.first+r.size){return false}e=new ue(t,e.ch,e.sticky);return u=Zr(r,t)}function s(o){var a;if(i=="codepoint"){var s=u.text.charCodeAt(e.ch+(t>0?0:-1));if(isNaN(s)){a=null}else{var c=t>0?s>=55296&&s<56320:s>=56320&&s<57343;a=new ue(e.line,Math.max(0,Math.min(u.text.length,e.ch+t*(c?2:1))),-t)}}else if(n){a=Xa(r.cm,u,e,t)}else{a=Ja(u,e,t)}if(a==null){if(!o&&l()){e=Ya(n,r.cm,u,e.line,f)}else{return false}}else{e=a}return true}if(i=="char"||i=="codepoint"){s()}else if(i=="column"){s(true)}else if(i=="word"||i=="group"){var c=null,d=i=="group";var h=r.cm&&r.cm.getHelper(e,"wordChars");for(var v=true;;v=false){if(t<0&&!s(!v)){break}var m=u.text.charAt(e.ch)||"\n";var p=or(m,h)?"w":d&&m=="\n"?"n":!d||/\s/.test(m)?null:"p";if(d&&!v&&!p){p="s"}if(c&&c!=p){if(t<0){t=1;s();e.sticky="after"}break}if(p){c=p}if(t>0&&!s(!v)){break}}}var g=Jo(r,e,o,a,true);if(le(o,g)){g.hitSide=true}return g}function Zu(r,e,t,i){var n=r.doc,o=e.left,a;if(i=="page"){var u=Math.min(r.display.wrapper.clientHeight,O(r).innerHeight||n(r).documentElement.clientHeight);var f=Math.max(u-.5*Ei(r.display),3);a=(t>0?e.bottom:e.top)+t*f}else if(i=="line"){a=t>0?e.bottom+3:e.top-3}var l;for(;;){l=xi(r,o,a);if(!l.outside){break}if(t<0?a<=0:a>=n.height){l.hitSide=true;break}a+=t*5}return l}var rf=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new q;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};rf.prototype.init=function(r){var e=this;var t=this,i=t.cm;var n=t.div=r.lineDiv;n.contentEditable=true;Qu(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function o(r){for(var e=r.target;e;e=e.parentNode){if(e==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(e.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||yr(i,r)||Hu(r,i)){return}if(u<=11){setTimeout(In(i,(function(){return e.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){e.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!e.composing){e.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(e.composing){if(r.data!=e.composing.data){e.readFromDOMSoon()}e.composing.done=true}}));gr(n,"touchstart",(function(){return t.forceCompositionEnd()}));gr(n,"input",(function(){if(!e.composing){e.readFromDOMSoon()}}));function a(r){if(!o(r)||yr(i,r)){return}if(i.somethingSelected()){$u({lineWise:false,text:i.getSelections()});if(r.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var e=Vu(i);$u({lineWise:true,text:e.text});if(r.type=="cut"){i.operation((function(){i.setSelections(e.ranges,0,H);i.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var a=Wu.text.join("\n");r.clipboardData.setData("Text",a);if(r.clipboardData.getData("Text")==a){r.preventDefault();return}}var u=Ju(),f=u.firstChild;i.display.lineSpace.insertBefore(u,i.display.lineSpace.firstChild);f.value=Wu.text.join("\n");var l=j(n.ownerDocument);R(f);setTimeout((function(){i.display.lineSpace.removeChild(u);l.focus();if(l==n){t.showPrimarySelection()}}),50)}gr(n,"copy",a);gr(n,"cut",a)};rf.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};rf.prototype.prepareSelection=function(){var r=Gi(this.cm,false);r.focus=j(this.div.ownerDocument)==this.div;return r};rf.prototype.showSelection=function(r,e){if(!r||!this.cm.display.view.length){return}if(r.focus||e){this.showPrimarySelection()}this.showMultipleSelections(r)};rf.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};rf.prototype.showPrimarySelection=function(){var r=this.getSelection(),e=this.cm,i=e.doc.sel.primary();var n=i.from(),o=i.to();if(e.display.viewTo==e.display.viewFrom||n.line>=e.display.viewTo||o.line<e.display.viewFrom){r.removeAllRanges();return}var a=af(e,r.anchorNode,r.anchorOffset);var u=af(e,r.focusNode,r.focusOffset);if(a&&!a.bad&&u&&!u.bad&&fe(de(a,u),n)==0&&fe(ce(a,u),o)==0){return}var f=e.display.view;var l=n.line>=e.display.viewFrom&&ef(e,n)||{node:f[0].measure.map[2],offset:0};var s=o.line<e.display.viewTo&&ef(e,o);if(!s){var c=f[f.length-1].measure;var d=c.maps?c.maps[c.maps.length-1]:c.map;s={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),v;try{v=D(l.node,l.offset,s.offset,s.node)}catch(r){}if(v){if(!t&&e.state.focused){r.collapse(l.node,l.offset);if(!v.collapsed){r.removeAllRanges();r.addRange(v)}}else{r.removeAllRanges();r.addRange(v)}if(h&&r.anchorNode==null){r.addRange(h)}else if(t){this.startGracePeriod()}}this.rememberSelection()};rf.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)};rf.prototype.showMultipleSelections=function(r){T(this.cm.display.cursorDiv,r.cursors);T(this.cm.display.selectionDiv,r.selection)};rf.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};rf.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var e=r.getRangeAt(0).commonAncestorContainer;return z(this.div,e)};rf.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||j(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};rf.prototype.blur=function(){this.div.blur()};rf.prototype.getField=function(){return this.div};rf.prototype.supportsTouch=function(){return true};rf.prototype.receivedFocus=function(){var r=this;var e=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{jn(this.cm,(function(){return e.cm.curOp.selectionChanged=true}))}function t(){if(e.cm.state.focused){e.pollSelection();e.polling.set(e.cm.options.pollInterval,t)}}this.polling.set(this.cm.options.pollInterval,t)};rf.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};rf.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),e=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&tf(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var t=af(e,r.anchorNode,r.anchorOffset);var i=af(e,r.focusNode,r.focusOffset);if(t&&i){jn(e,(function(){$o(e.doc,lo(t,i),H);if(t.bad||i.bad){e.curOp.selectionChanged=true}}))}};rf.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,e=r.display,t=r.doc.sel.primary();var i=t.from(),n=t.to();if(i.ch==0&&i.line>r.firstLine()){i=ue(i.line-1,Zr(r.doc,i.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ue(n.line+1,0)}if(i.line<e.viewFrom||n.line>e.viewTo-1){return false}var o,a,u;if(i.line==e.viewFrom||(o=Fi(r,i.line))==0){a=ie(e.view[0].line);u=e.view[0].node}else{a=ie(e.view[o].line);u=e.view[o-1].node.nextSibling}var f=Fi(r,n.line);var l,s;if(f==e.view.length-1){l=e.viewTo-1;s=e.lineDiv.lastChild}else{l=ie(e.view[f+1].line)-1;s=e.view[f+1].node.previousSibling}if(!u){return false}var c=r.doc.splitLines(of(r,u,s,a,l));var d=re(r.doc,ue(a,0),ue(l,Zr(r.doc,l).text.length));while(c.length>1&&d.length>1){if(X(c)==X(d)){c.pop();d.pop();l--}else if(c[0]==d[0]){c.shift();d.shift();a++}else{break}}var h=0,v=0;var m=c[0],p=d[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=X(c),w=X(d);var k=Math.min(b.length-(c.length==1?h:0),w.length-(d.length==1?h:0));while(v<k&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1)){++v}if(c.length==1&&d.length==1&&a==i.line){while(h&&h>i.ch&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1)){h--;v++}}c[c.length-1]=b.slice(0,b.length-v).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var y=ue(a,h);var x=ue(l,d.length?X(d).length-v:0);if(c.length>1||c[0]||fe(y,x)){aa(r.doc,c,y,x,"+input");return true}};rf.prototype.ensurePolled=function(){this.forceCompositionEnd()};rf.prototype.reset=function(){this.forceCompositionEnd()};rf.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};rf.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)};rf.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){jn(this.cm,(function(){return Oi(r.cm)}))}};rf.prototype.setUneditable=function(r){r.contentEditable="false"};rf.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){In(this.cm,Gu)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};rf.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};rf.prototype.onContextMenu=function(){};rf.prototype.resetPosition=function(){};rf.prototype.needsContentAttribute=true;function ef(r,e){var t=ti(r,e.line);if(!t||t.hidden){return null}var i=Zr(r.doc,e.line);var n=Zt(t,i,e.line);var o=mr(i,r.doc.direction),a="left";if(o){var u=hr(o,e.ch);a=u%2?"right":"left"}var f=ai(n.map,e.ch,a);f.offset=f.collapse=="right"?f.end:f.start;return f}function tf(r){for(var e=r;e;e=e.parentNode){if(/CodeMirror-gutter-wrapper/.test(e.className)){return true}}return false}function nf(r,e){if(e){r.bad=true}return r}function of(r,e,t,i,n){var o="",a=false,u=r.doc.lineSeparator(),f=false;function l(r){return function(e){return e.id==r}}function s(){if(a){o+=u;if(f){o+=u}a=f=false}}function c(r){if(r){s();o+=r}}function d(e){if(e.nodeType==1){var t=e.getAttribute("cm-text");if(t){c(t);return}var o=e.getAttribute("cm-marker"),h;if(o){var v=r.findMarks(ue(i,0),ue(n+1,0),l(+o));if(v.length&&(h=v[0].find(0))){c(re(r.doc,h.from,h.to).join(u))}return}if(e.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&e.textContent.length==0){return}if(m){s()}for(var p=0;p<e.childNodes.length;p++){d(e.childNodes[p])}if(/^(pre|p)$/i.test(e.nodeName)){f=true}if(m){a=true}}else if(e.nodeType==3){c(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){d(e);if(e==t){break}e=e.nextSibling;f=false}return o}function af(r,e,t){var i;if(e==r.display.lineDiv){i=r.display.lineDiv.childNodes[t];if(!i){return nf(r.clipPos(ue(r.display.viewTo-1)),true)}e=null;t=0}else{for(i=e;;i=i.parentNode){if(!i||i==r.display.lineDiv){return null}if(i.parentNode&&i.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==i){return uf(o,e,t)}}}function uf(r,e,t){var i=r.text.firstChild,n=false;if(!e||!z(i,e)){return nf(ue(ie(r.line),0),true)}if(e==i){n=true;e=i.childNodes[t];t=0;if(!e){var o=r.rest?X(r.rest):r.line;return nf(ue(ie(o),o.text.length),n)}}var a=e.nodeType==3?e:null,u=e;if(!a&&e.childNodes.length==1&&e.firstChild.nodeType==3){a=e.firstChild;if(t){t=a.nodeValue.length}}while(u.parentNode!=i){u=u.parentNode}var f=r.measure,l=f.maps;function s(e,t,i){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?f.map:l[n];for(var a=0;a<o.length;a+=3){var u=o[a+2];if(u==e||u==t){var s=ie(n<0?r.line:r.rest[n]);var c=o[a]+i;if(i<0||u!=e){c=o[a+(i?1:0)]}return ue(s,c)}}}}var c=s(a,u,t);if(c){return nf(c,n)}for(var d=u.nextSibling,h=a?a.nodeValue.length-t:0;d;d=d.nextSibling){c=s(d,d.firstChild,0);if(c){return nf(ue(c.line,c.ch-h),n)}else{h+=d.textContent.length}}for(var v=u.previousSibling,m=t;v;v=v.previousSibling){c=s(v,v.firstChild,-1);if(c){return nf(ue(c.line,c.ch+m),n)}else{m+=v.textContent.length}}}var ff=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new q;this.hasSelection=false;this.composing=null;this.resetting=false};ff.prototype.init=function(r){var e=this;var t=this,i=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(a&&u>=9&&e.hasSelection){e.hasSelection=null}t.poll()}));gr(n,"paste",(function(r){if(yr(i,r)||Hu(r,i)){return}i.state.pasteIncoming=+new Date;t.fastPoll()}));function o(r){if(yr(i,r)){return}if(i.somethingSelected()){$u({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var e=Vu(i);$u({lineWise:true,text:e.text});if(r.type=="cut"){i.setSelections(e.ranges,null,H)}else{t.prevInput="";n.value=e.text.join("\n");R(n)}}if(r.type=="cut"){i.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(e){if(Gt(r,e)||yr(i,e)){return}if(!n.dispatchEvent){i.state.pasteIncoming=+new Date;t.focus();return}var o=new Event("paste");o.clipboardData=e.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(e){if(!Gt(r,e)){Ar(e)}}));gr(n,"compositionstart",(function(){var r=i.getCursor("from");if(t.composing){t.composing.range.clear()}t.composing={start:r,range:i.markText(r,i.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(t.composing){t.poll();t.composing.range.clear();t.composing=null}}))};ff.prototype.createField=function(r){this.wrapper=Ju();this.textarea=this.wrapper.firstChild};ff.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};ff.prototype.prepareSelection=function(){var r=this.cm,e=r.display,t=r.doc;var i=Gi(r);if(r.options.moveInputWithCursor){var n=wi(r,t.sel.primary().head,"div");var o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,n.top+a.top-o.top));i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,n.left+a.left-o.left))}return i};ff.prototype.showSelection=function(r){var e=this.cm,t=e.display;T(t.cursorDiv,r.cursors);T(t.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};ff.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var e=this.cm;this.resetting=true;if(e.somethingSelected()){this.prevInput="";var t=e.getSelection();this.textarea.value=t;if(e.state.focused){R(this.textarea)}if(a&&u>=9){this.hasSelection=t}}else if(!r){this.prevInput=this.textarea.value="";if(a&&u>=9){this.hasSelection=null}}this.resetting=false};ff.prototype.getField=function(){return this.textarea};ff.prototype.supportsTouch=function(){return false};ff.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||j(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};ff.prototype.blur=function(){this.textarea.blur()};ff.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ff.prototype.receivedFocus=function(){this.slowPoll()};ff.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()}}))};ff.prototype.fastPoll=function(){var r=false,e=this;e.pollingFast=true;function t(){var i=e.poll();if(!i&&!r){r=true;e.polling.set(60,t)}else{e.pollingFast=false;e.slowPoll()}}e.polling.set(20,t)};ff.prototype.poll=function(){var r=this;var e=this.cm,t=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Fr(t)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq){return false}var n=t.value;if(n==i&&!e.somethingSelected()){return false}if(a&&u>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){e.display.input.reset();return false}if(e.doc.sel==e.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!i){i="​"}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var f=0,l=Math.min(i.length,n.length);while(f<l&&i.charCodeAt(f)==n.charCodeAt(f)){++f}jn(e,(function(){Gu(e,n.slice(f),i.length-f,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){t.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=e.markText(r.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};ff.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};ff.prototype.onKeyPress=function(){if(a&&u>=9){this.hasSelection=null}this.fastPoll()};ff.prototype.onContextMenu=function(r){var e=this,t=e.cm,i=t.display,n=e.textarea;if(e.contextMenuPending){e.contextMenuPending()}var o=Ri(t,r),l=i.scroller.scrollTop;if(!o||d){return}var s=t.options.resetSelectionOnContextMenu;if(s&&t.doc.sel.contains(o)==-1){In(t,$o)(t.doc,lo(o),H)}var c=n.style.cssText,h=e.wrapper.style.cssText;var v=e.wrapper.offsetParent.getBoundingClientRect();e.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-v.top-5)+"px; left: "+(r.clientX-v.left-5)+"px;\n z-index: 1000; background: "+(a?"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(f){m=n.ownerDocument.defaultView.scrollY}i.input.focus();if(f){n.ownerDocument.defaultView.scrollTo(null,m)}i.input.reset();if(!t.somethingSelected()){n.value=e.prevInput=" "}e.contextMenuPending=g;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=t.somethingSelected();var o="​"+(r?n.value:"");n.value="⇚";n.value=o;e.prevInput=r?"":"​";n.selectionStart=1;n.selectionEnd=o.length;i.selForContextMenu=t.doc.sel}}function g(){if(e.contextMenuPending!=g){return}e.contextMenuPending=false;e.wrapper.style.cssText=h;n.style.cssText=c;if(a&&u<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!a||a&&u<9){p()}var r=0,o=function(){if(i.selForContextMenu==t.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&e.prevInput=="​"){In(t,Xo)(t)}else if(r++<10){i.detectingSelectAll=setTimeout(o,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(o,200)}}if(a&&u>=9){p()}if(M){Tr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};ff.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};ff.prototype.setUneditable=function(){};ff.prototype.needsContentAttribute=false;function lf(r,e){e=e?P(e):{};e.value=r.value;if(!e.tabindex&&r.tabIndex){e.tabindex=r.tabIndex}if(!e.placeholder&&r.placeholder){e.placeholder=r.placeholder}if(e.autofocus==null){var t=j(r.ownerDocument);e.autofocus=t==r||r.getAttribute("autofocus")!=null&&t==document.body}function i(){r.value=u.getValue()}var n;if(r.form){gr(r.form,"submit",i);if(!e.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var a=o.submit=function(){i();o.submit=n;o.submit();o.submit=a}}catch(r){}}}e.finishInit=function(t){t.save=i;t.getTextArea=function(){return r};t.toTextArea=function(){t.toTextArea=isNaN;i();r.parentNode.removeChild(t.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",i);if(!e.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var u=Uu((function(e){return r.parentNode.insertBefore(e,r.nextSibling)}),e);return u}function sf(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=Aa;r.splitLines=Rr;r.countColumn=_;r.findColumn=Q;r.isWordChar=nr;r.Pass=G;r.signal=kr;r.Line=st;r.changeEnd=so;r.scrollbarModel=xn;r.Pos=ue;r.cmpPos=fe;r.modes=_r;r.mimeModes=qr;r.resolveMode=Gr;r.getMode=Hr;r.modeExtensions=Kr;r.extendMode=Vr;r.copyState=Qr;r.startState=Yr;r.innerMode=Jr;r.commands=Za;r.keyMap=Pa;r.keyName=Ha;r.isModifierKey=$a;r.lookupKey=Wa;r.normalizeKeyMap=qa;r.StringStream=Xr;r.SharedTextMarker=wa;r.TextMarker=ga;r.LineWidget=ha;r.e_preventDefault=Ar;r.e_stopPropagation=Lr;r.e_stop=Tr;r.addClass=I;r.contains=z;r.rmClass=L;r.keyNames=Ra}Ru(Uu);Yu(Uu);var cf="iter insert remove copy getEditor constructor".split(" ");for(var df in Aa.prototype){if(Aa.prototype.hasOwnProperty(df)&&W(cf,df)<0){Uu.prototype[df]=function(r){return function(){return r.apply(this.doc,arguments)}}(Aa.prototype[df])}}Mr(Aa);Uu.inputStyles={textarea:ff,contenteditable:rf};Uu.defineMode=function(r){if(!Uu.defaults.mode&&r!="null"){Uu.defaults.mode=r}Wr.apply(this,arguments)};Uu.defineMIME=$r;Uu.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Uu.defineMIME("text/plain","null");Uu.defineExtension=function(r,e){Uu.prototype[r]=e};Uu.defineDocExtension=function(r,e){Aa.prototype[r]=e};Uu.fromTextArea=lf;sf(Uu);Uu.version="5.65.9";return Uu}))}));var s=a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("css",(function(e,t){var i=t.inline;if(!t.propertyKeywords)t=r.resolveMode("text/css");var n=e.indentUnit,o=t.tokenHooks,a=t.documentTypes||{},u=t.mediaTypes||{},f=t.mediaFeatures||{},l=t.mediaValueKeywords||{},s=t.propertyKeywords||{},c=t.nonStandardPropertyKeywords||{},d=t.fontProperties||{},h=t.counterDescriptors||{},v=t.colorKeywords||{},m=t.valueKeywords||{},p=t.allowNested,g=t.lineComment,b=t.supportsAtComponent===true,w=e.highlightNonStandardPropertyKeywords!==false;var k,y;function x(r,e){k=e;return r}function C(r,e){var t=r.next();if(o[t]){var i=o[t](r,e);if(i!==false)return i}if(t=="@"){r.eatWhile(/[\w\\\-]/);return x("def",r.current())}else if(t=="="||(t=="~"||t=="|")&&r.eat("=")){return x(null,"compare")}else if(t=='"'||t=="'"){e.tokenize=M(t);return e.tokenize(r,e)}else if(t=="#"){r.eatWhile(/[\w\\\-]/);return x("atom","hash")}else if(t=="!"){r.match(/^\s*\w*/);return x("keyword","important")}else if(/\d/.test(t)||t=="."&&r.eat(/\d/)){r.eatWhile(/[\w.%]/);return x("number","unit")}else if(t==="-"){if(/[\d.]/.test(r.peek())){r.eatWhile(/[\w.%]/);return x("number","unit")}else if(r.match(/^-[\w\\\-]*/)){r.eatWhile(/[\w\\\-]/);if(r.match(/^\s*:/,false))return x("variable-2","variable-definition");return x("variable-2","variable")}else if(r.match(/^\w+-/)){return x("meta","meta")}}else if(/[,+>*\/]/.test(t)){return x(null,"select-op")}else if(t=="."&&r.match(/^-?[_a-z][_a-z0-9-]*/i)){return x("qualifier","qualifier")}else if(/[:;{}\[\]\(\)]/.test(t)){return x(null,t)}else if(r.match(/^[\w-.]+(?=\()/)){if(/^(url(-prefix)?|domain|regexp)$/i.test(r.current())){e.tokenize=A}return x("variable callee","variable")}else if(/[\w\\\-]/.test(t)){r.eatWhile(/[\w\\\-]/);return x("property","word")}else{return x(null,null)}}function M(r){return function(e,t){var i=false,n;while((n=e.next())!=null){if(n==r&&!i){if(r==")")e.backUp(1);break}i=!i&&n=="\\"}if(n==r||!i&&r!=")")t.tokenize=null;return x("string","string")}}function A(r,e){r.next();if(!r.match(/^\s*[\"\')]/,false))e.tokenize=M(")");else e.tokenize=null;return x(null,"(")}function L(r,e,t){this.type=r;this.indent=e;this.prev=t}function S(r,e,t,i){r.context=new L(t,e.indentation()+(i===false?0:n),r.context);return t}function T(r){if(r.context.prev)r.context=r.context.prev;return r.context.type}function N(r,e,t){return z[t.context.type](r,e,t)}function E(r,e,t,i){for(var n=i||1;n>0;n--)t.context=t.context.prev;return N(r,e,t)}function D(r){var e=r.current().toLowerCase();if(m.hasOwnProperty(e))y="atom";else if(v.hasOwnProperty(e))y="keyword";else y="variable"}var z={};z.top=function(r,e,t){if(r=="{"){return S(t,e,"block")}else if(r=="}"&&t.context.prev){return T(t)}else if(b&&/@component/i.test(r)){return S(t,e,"atComponentBlock")}else if(/^@(-moz-)?document$/i.test(r)){return S(t,e,"documentTypes")}else if(/^@(media|supports|(-moz-)?document|import)$/i.test(r)){return S(t,e,"atBlock")}else if(/^@(font-face|counter-style)/i.test(r)){t.stateArg=r;return"restricted_atBlock_before"}else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(r)){return"keyframes"}else if(r&&r.charAt(0)=="@"){return S(t,e,"at")}else if(r=="hash"){y="builtin"}else if(r=="word"){y="tag"}else if(r=="variable-definition"){return"maybeprop"}else if(r=="interpolation"){return S(t,e,"interpolation")}else if(r==":"){return"pseudo"}else if(p&&r=="("){return S(t,e,"parens")}return t.context.type};z.block=function(r,e,t){if(r=="word"){var i=e.current().toLowerCase();if(s.hasOwnProperty(i)){y="property";return"maybeprop"}else if(c.hasOwnProperty(i)){y=w?"string-2":"property";return"maybeprop"}else if(p){y=e.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{y+=" error";return"maybeprop"}}else if(r=="meta"){return"block"}else if(!p&&(r=="hash"||r=="qualifier")){y="error";return"block"}else{return z.top(r,e,t)}};z.maybeprop=function(r,e,t){if(r==":")return S(t,e,"prop");return N(r,e,t)};z.prop=function(r,e,t){if(r==";")return T(t);if(r=="{"&&p)return S(t,e,"propBlock");if(r=="}"||r=="{")return E(r,e,t);if(r=="(")return S(t,e,"parens");if(r=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.current())){y+=" error"}else if(r=="word"){D(e)}else if(r=="interpolation"){return S(t,e,"interpolation")}return"prop"};z.propBlock=function(r,e,t){if(r=="}")return T(t);if(r=="word"){y="property";return"maybeprop"}return t.context.type};z.parens=function(r,e,t){if(r=="{"||r=="}")return E(r,e,t);if(r==")")return T(t);if(r=="(")return S(t,e,"parens");if(r=="interpolation")return S(t,e,"interpolation");if(r=="word")D(e);return"parens"};z.pseudo=function(r,e,t){if(r=="meta")return"pseudo";if(r=="word"){y="variable-3";return t.context.type}return N(r,e,t)};z.documentTypes=function(r,e,t){if(r=="word"&&a.hasOwnProperty(e.current())){y="tag";return t.context.type}else{return z.atBlock(r,e,t)}};z.atBlock=function(r,e,t){if(r=="(")return S(t,e,"atBlock_parens");if(r=="}"||r==";")return E(r,e,t);if(r=="{")return T(t)&&S(t,e,p?"block":"top");if(r=="interpolation")return S(t,e,"interpolation");if(r=="word"){var i=e.current().toLowerCase();if(i=="only"||i=="not"||i=="and"||i=="or")y="keyword";else if(u.hasOwnProperty(i))y="attribute";else if(f.hasOwnProperty(i))y="property";else if(l.hasOwnProperty(i))y="keyword";else if(s.hasOwnProperty(i))y="property";else if(c.hasOwnProperty(i))y=w?"string-2":"property";else if(m.hasOwnProperty(i))y="atom";else if(v.hasOwnProperty(i))y="keyword";else y="error"}return t.context.type};z.atComponentBlock=function(r,e,t){if(r=="}")return E(r,e,t);if(r=="{")return T(t)&&S(t,e,p?"block":"top",false);if(r=="word")y="error";return t.context.type};z.atBlock_parens=function(r,e,t){if(r==")")return T(t);if(r=="{"||r=="}")return E(r,e,t,2);return z.atBlock(r,e,t)};z.restricted_atBlock_before=function(r,e,t){if(r=="{")return S(t,e,"restricted_atBlock");if(r=="word"&&t.stateArg=="@counter-style"){y="variable";return"restricted_atBlock_before"}return N(r,e,t)};z.restricted_atBlock=function(r,e,t){if(r=="}"){t.stateArg=null;return T(t)}if(r=="word"){if(t.stateArg=="@font-face"&&!d.hasOwnProperty(e.current().toLowerCase())||t.stateArg=="@counter-style"&&!h.hasOwnProperty(e.current().toLowerCase()))y="error";else y="property";return"maybeprop"}return"restricted_atBlock"};z.keyframes=function(r,e,t){if(r=="word"){y="variable";return"keyframes"}if(r=="{")return S(t,e,"top");return N(r,e,t)};z.at=function(r,e,t){if(r==";")return T(t);if(r=="{"||r=="}")return E(r,e,t);if(r=="word")y="tag";else if(r=="hash")y="builtin";return"at"};z.interpolation=function(r,e,t){if(r=="}")return T(t);if(r=="{"||r==";")return E(r,e,t);if(r=="word")y="variable";else if(r!="variable"&&r!="("&&r!=")")y="error";return"interpolation"};return{startState:function(r){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new L(i?"block":"top",r||0,null)}},token:function(r,e){if(!e.tokenize&&r.eatSpace())return null;var t=(e.tokenize||C)(r,e);if(t&&typeof t=="object"){k=t[1];t=t[0]}y=t;if(k!="comment")e.state=z[e.state](k,r,e);return y},indent:function(r,e){var t=r.context,i=e&&e.charAt(0);var o=t.indent;if(t.type=="prop"&&(i=="}"||i==")"))t=t.prev;if(t.prev){if(i=="}"&&(t.type=="block"||t.type=="top"||t.type=="interpolation"||t.type=="restricted_atBlock")){t=t.prev;o=t.indent}else if(i==")"&&(t.type=="parens"||t.type=="atBlock_parens")||i=="{"&&(t.type=="at"||t.type=="atBlock")){o=Math.max(0,t.indent-n)}}return o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:g,fold:"brace"}}));function e(r){var e={};for(var t=0;t<r.length;++t){e[r[t].toLowerCase()]=true}return e}var t=["domain","regexp","url","url-prefix"],i=e(t);var n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(n);var a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],u=e(a);var f=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],l=e(f);var s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],c=e(s);var d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=e(d);var v=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=e(v);var p=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=e(p);var b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=e(b);var k=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=e(k);var x=t.concat(n).concat(a).concat(f).concat(s).concat(d).concat(b).concat(k);r.registerHelper("hintWords","css",x);function C(r,e){var t=false,i;while((i=r.next())!=null){if(t&&i=="/"){e.tokenize=null;break}t=i=="*"}return["comment","comment"]}r.defineMIME("text/css",{documentTypes:i,mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:g,colorKeywords:w,valueKeywords:y,tokenHooks:{"/":function(r,e){if(!r.eat("*"))return false;e.tokenize=C;return C(r,e)}},name:"css"});r.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:y,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(r,e){if(r.eat("/")){r.skipToEnd();return["comment","comment"]}else if(r.eat("*")){e.tokenize=C;return C(r,e)}else{return["operator","operator"]}},":":function(r){if(r.match(/^\s*\{/,false))return[null,null];return false},$:function(r){r.match(/^[\w-]+/);if(r.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"#":function(r){if(!r.eat("{"))return false;return[null,"interpolation"]}},name:"css",helperType:"scss"});r.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:y,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(r,e){if(r.eat("/")){r.skipToEnd();return["comment","comment"]}else if(r.eat("*")){e.tokenize=C;return C(r,e)}else{return["operator","operator"]}},"@":function(r){if(r.eat("{"))return[null,"interpolation"];if(r.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,false))return false;r.eatWhile(/[\w\\\-]/);if(r.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});r.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:o,mediaFeatures:u,propertyKeywords:c,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:g,colorKeywords:w,valueKeywords:y,supportsAtComponent:true,tokenHooks:{"/":function(r,e){if(!r.eat("*"))return false;e.tokenize=C;return C(r,e)}},name:"css",helperType:"gss"})}))}));var c=a((function(r,e){(function(r){r(l)})((function(r){var e={autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true};var t={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,allowMissingTagName:false,caseFold:false};r.defineMode("xml",(function(i,n){var o=i.indentUnit;var a={};var u=n.htmlMode?e:t;for(var f in u)a[f]=u[f];for(var f in n)a[f]=n[f];var l,s;function c(r,e){function t(t){e.tokenize=t;return t(r,e)}var i=r.next();if(i=="<"){if(r.eat("!")){if(r.eat("[")){if(r.match("CDATA["))return t(v("atom","]]>"));else return null}else if(r.match("--")){return t(v("comment","--\x3e"))}else if(r.match("DOCTYPE",true,true)){r.eatWhile(/[\w\._\-]/);return t(m(1))}else{return null}}else if(r.eat("?")){r.eatWhile(/[\w\._\-]/);e.tokenize=v("meta","?>");return"meta"}else{l=r.eat("/")?"closeTag":"openTag";e.tokenize=d;return"tag bracket"}}else if(i=="&"){var n;if(r.eat("#")){if(r.eat("x")){n=r.eatWhile(/[a-fA-F\d]/)&&r.eat(";")}else{n=r.eatWhile(/[\d]/)&&r.eat(";")}}else{n=r.eatWhile(/[\w\.\-:]/)&&r.eat(";")}return n?"atom":"error"}else{r.eatWhile(/[^&<]/);return null}}c.isInText=true;function d(r,e){var t=r.next();if(t==">"||t=="/"&&r.eat(">")){e.tokenize=c;l=t==">"?"endTag":"selfcloseTag";return"tag bracket"}else if(t=="="){l="equals";return null}else if(t=="<"){e.tokenize=c;e.state=k;e.tagName=e.tagStart=null;var i=e.tokenize(r,e);return i?i+" tag error":"tag error"}else if(/[\'\"]/.test(t)){e.tokenize=h(t);e.stringStartCol=r.column();return e.tokenize(r,e)}else{r.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}function h(r){var e=function(e,t){while(!e.eol()){if(e.next()==r){t.tokenize=d;break}}return"string"};e.isInAttribute=true;return e}function v(r,e){return function(t,i){while(!t.eol()){if(t.match(e)){i.tokenize=c;break}t.next()}return r}}function m(r){return function(e,t){var i;while((i=e.next())!=null){if(i=="<"){t.tokenize=m(r+1);return t.tokenize(e,t)}else if(i==">"){if(r==1){t.tokenize=c;break}else{t.tokenize=m(r-1);return t.tokenize(e,t)}}}return"meta"}}function p(r){return r&&r.toLowerCase()}function g(r,e,t){this.prev=r.context;this.tagName=e||"";this.indent=r.indented;this.startOfLine=t;if(a.doNotIndent.hasOwnProperty(e)||r.context&&r.context.noIndent)this.noIndent=true}function b(r){if(r.context)r.context=r.context.prev}function w(r,e){var t;while(true){if(!r.context){return}t=r.context.tagName;if(!a.contextGrabbers.hasOwnProperty(p(t))||!a.contextGrabbers[p(t)].hasOwnProperty(p(e))){return}b(r)}}function k(r,e,t){if(r=="openTag"){t.tagStart=e.column();return y}else if(r=="closeTag"){return x}else{return k}}function y(r,e,t){if(r=="word"){t.tagName=e.current();s="tag";return A}else if(a.allowMissingTagName&&r=="endTag"){s="tag bracket";return A(r,e,t)}else{s="error";return y}}function x(r,e,t){if(r=="word"){var i=e.current();if(t.context&&t.context.tagName!=i&&a.implicitlyClosed.hasOwnProperty(p(t.context.tagName)))b(t);if(t.context&&t.context.tagName==i||a.matchClosing===false){s="tag";return C}else{s="tag error";return M}}else if(a.allowMissingTagName&&r=="endTag"){s="tag bracket";return C(r,e,t)}else{s="error";return M}}function C(r,e,t){if(r!="endTag"){s="error";return C}b(t);return k}function M(r,e,t){s="error";return C(r,e,t)}function A(r,e,t){if(r=="word"){s="attribute";return L}else if(r=="endTag"||r=="selfcloseTag"){var i=t.tagName,n=t.tagStart;t.tagName=t.tagStart=null;if(r=="selfcloseTag"||a.autoSelfClosers.hasOwnProperty(p(i))){w(t,i)}else{w(t,i);t.context=new g(t,i,n==t.indented)}return k}s="error";return A}function L(r,e,t){if(r=="equals")return S;if(!a.allowMissing)s="error";return A(r,e,t)}function S(r,e,t){if(r=="string")return T;if(r=="word"&&a.allowUnquoted){s="string";return A}s="error";return A(r,e,t)}function T(r,e,t){if(r=="string")return T;return A(r,e,t)}return{startState:function(r){var e={tokenize:c,state:k,indented:r||0,tagName:null,tagStart:null,context:null};if(r!=null)e.baseIndent=r;return e},token:function(r,e){if(!e.tagName&&r.sol())e.indented=r.indentation();if(r.eatSpace())return null;l=null;var t=e.tokenize(r,e);if((t||l)&&t!="comment"){s=null;e.state=e.state(l||t,r,e);if(s)t=s=="error"?t+" error":s}return t},indent:function(e,t,i){var n=e.context;if(e.tokenize.isInAttribute){if(e.tagStart==e.indented)return e.stringStartCol+1;else return e.indented+o}if(n&&n.noIndent)return r.Pass;if(e.tokenize!=d&&e.tokenize!=c)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName){if(a.multilineTagIndentPastTag!==false)return e.tagStart+e.tagName.length+2;else return e.tagStart+o*(a.multilineTagIndentFactor||1)}if(a.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var u=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(u&&u[1]){while(n){if(n.tagName==u[2]){n=n.prev;break}else if(a.implicitlyClosed.hasOwnProperty(p(n.tagName))){n=n.prev}else{break}}}else if(u){while(n){var f=a.contextGrabbers[p(n.tagName)];if(f&&f.hasOwnProperty(p(u[2])))n=n.prev;else break}}while(n&&n.prev&&!n.startOfLine)n=n.prev;if(n)return n.indent+o;else return e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(r){if(r.state==S)r.state=A},xmlCurrentTag:function(r){return r.tagName?{name:r.tagName,close:r.type=="closeTag"}:null},xmlCurrentContext:function(r){var e=[];for(var t=r.context;t;t=t.prev)e.push(t.tagName);return e.reverse()}}}));r.defineMIME("text/xml","xml");r.defineMIME("application/xml","xml");if(!r.mimeModes.hasOwnProperty("text/html"))r.defineMIME("text/html",{name:"xml",htmlMode:true})}))}));var d=a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("javascript",(function(e,t){var i=e.indentUnit;var n=t.statementIndent;var o=t.jsonld;var a=t.json||o;var u=t.trackScope!==false;var f=t.typescript;var l=t.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var e=r("keyword a"),t=r("keyword b"),i=r("keyword c"),n=r("keyword d");var o=r("operator"),a={type:"atom",style:"atom"};return{if:r("if"),while:e,with:e,else:t,do:t,try:t,finally:t,return:n,break:n,continue:n,new:r("new"),delete:i,void:i,throw:i,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:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:r("this"),class:r("class"),super:r("atom"),yield:i,export:r("export"),import:r("import"),extends:i,await:i}}();var c=/[+\-*&%=<>!?|~^@]/;var d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var e=false,t,i=false;while((t=r.next())!=null){if(!e){if(t=="/"&&!i)return;if(t=="[")i=true;else if(i&&t=="]")i=false}e=!e&&t=="\\"}}var v,m;function p(r,e,t){v=r;m=t;return e}function g(r,e){var t=r.next();if(t=='"'||t=="'"){e.tokenize=b(t);return e.tokenize(r,e)}else if(t=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(t=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(t)){return p(t)}else if(t=="="&&r.eat(">")){return p("=>","operator")}else if(t=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(t)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(t=="/"){if(r.eat("*")){e.tokenize=w;return w(r,e)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(ne(r,e,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(t=="`"){e.tokenize=k;return k(r,e)}else if(t=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(t=="#"&&r.eatWhile(l)){return p("variable","property")}else if(t=="<"&&r.match("!--")||t=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(t)){if(t!=">"||!e.lexical||e.lexical.type!=">"){if(r.eat("=")){if(t=="!"||t=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(t)){r.eat(t);if(t==">")r.eat(t)}}if(t=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(t)){r.eatWhile(l);var i=r.current();if(e.lastType!="."){if(s.propertyIsEnumerable(i)){var n=s[i];return p(n.type,n.style,i)}if(i=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",i)}return p("variable","variable",i)}}function b(r){return function(e,t){var i=false,n;if(o&&e.peek()=="@"&&e.match(d)){t.tokenize=g;return p("jsonld-keyword","meta")}while((n=e.next())!=null){if(n==r&&!i)break;i=!i&&n=="\\"}if(!i)t.tokenize=g;return p("string","string")}}function w(r,e){var t=false,i;while(i=r.next()){if(i=="/"&&t){e.tokenize=g;break}t=i=="*"}return p("comment","comment")}function k(r,e){var t=false,i;while((i=r.next())!=null){if(!t&&(i=="`"||i=="$"&&r.eat("{"))){e.tokenize=g;break}t=!t&&i=="\\"}return p("quasi","string-2",r.current())}var y="([{}])";function x(r,e){if(e.fatArrowAt)e.fatArrowAt=null;var t=r.string.indexOf("=>",r.start);if(t<0)return;if(f){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,t));if(i)t=i.index}var n=0,o=false;for(var a=t-1;a>=0;--a){var u=r.string.charAt(a);var s=y.indexOf(u);if(s>=0&&s<3){if(!n){++a;break}if(--n==0){if(u=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(u)){o=true}else if(/["'\/`]/.test(u)){for(;;--a){if(a==0)return;var c=r.string.charAt(a-1);if(c==u&&r.string.charAt(a-2)!="\\"){a--;break}}}else if(o&&!n){++a;break}}if(o&&!n)e.fatArrowAt=a}var C={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function M(r,e,t,i,n,o){this.indented=r;this.column=e;this.type=t;this.prev=n;this.info=o;if(i!=null)this.align=i}function A(r,e){if(!u)return false;for(var t=r.localVars;t;t=t.next)if(t.name==e)return true;for(var i=r.context;i;i=i.prev){for(var t=i.vars;t;t=t.next)if(t.name==e)return true}}function L(r,e,t,i,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=e;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var u=o.length?o.pop():a?G:W;if(u(t,i)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(t=="variable"&&A(r,i))return"variable-2";return e}}}var S={state:null,column:null,marked:null,cc:null};function T(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function N(){T.apply(null,arguments);return true}function E(r,e){for(var t=e;t;t=t.next)if(t.name==r)return true;return false}function D(r){var e=S.state;S.marked="def";if(!u)return;if(e.context){if(e.lexical.info=="var"&&e.context&&e.context.block){var i=z(r,e.context);if(i!=null){e.context=i;return}}else if(!E(r,e.localVars)){e.localVars=new B(r,e.localVars);return}}if(t.globalVars&&!E(r,e.globalVars))e.globalVars=new B(r,e.globalVars)}function z(r,e){if(!e){return null}else if(e.block){var t=z(r,e.prev);if(!t)return null;if(t==e.prev)return e;return new I(t,e.vars,true)}else if(E(r,e.vars)){return e}else{return new I(e.prev,new B(r,e.vars),false)}}function j(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function I(r,e,t){this.prev=r;this.vars=e;this.block=t}function B(r,e){this.name=r;this.next=e}var R=new B("this",new B("arguments",null));function F(){S.state.context=new I(S.state.context,S.state.localVars,false);S.state.localVars=R}function O(){S.state.context=new I(S.state.context,S.state.localVars,true);S.state.localVars=null}F.lex=O.lex=true;function U(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}U.lex=true;function P(r,e){var t=function(){var t=S.state,i=t.indented;if(t.lexical.type=="stat")i=t.lexical.indented;else for(var n=t.lexical;n&&n.type==")"&&n.align;n=n.prev)i=n.indented;t.lexical=new M(i,S.stream.column(),r,null,t.lexical,e)};t.lex=true;return t}function _(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}_.lex=true;function q(r){function e(t){if(t==r)return N();else if(r==";"||t=="}"||t==")"||t=="]")return T();else return N(e)}return e}function W(r,e){if(r=="var")return N(P("vardef",e),Tr,q(";"),_);if(r=="keyword a")return N(P("form"),K,W,_);if(r=="keyword b")return N(P("form"),W,_);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?N():N(P("stat"),Q,q(";"),_);if(r=="debugger")return N(q(";"));if(r=="{")return N(P("}"),O,dr,_,U);if(r==";")return N();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==_)S.state.cc.pop()();return N(P("form"),K,W,_,Ir)}if(r=="function")return N(Or);if(r=="for")return N(P("form"),O,Br,W,U,_);if(r=="class"||f&&e=="interface"){S.marked="keyword";return N(P("form",r=="class"?r:e),Wr,_)}if(r=="variable"){if(f&&e=="declare"){S.marked="keyword";return N(W)}else if(f&&(e=="module"||e=="enum"||e=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(e=="enum")return N(ee);else if(e=="type")return N(Pr,q("operator"),gr,q(";"));else return N(P("form"),Nr,q("{"),P("}"),dr,_,_)}else if(f&&e=="namespace"){S.marked="keyword";return N(P("form"),G,W,_)}else if(f&&e=="abstract"){S.marked="keyword";return N(W)}else{return N(P("stat"),or)}}if(r=="switch")return N(P("form"),K,q("{"),P("}","switch"),O,dr,_,_,U);if(r=="case")return N(G,q(":"));if(r=="default")return N(q(":"));if(r=="catch")return N(P("form"),F,$,W,_,U);if(r=="export")return N(P("stat"),Kr,_);if(r=="import")return N(P("stat"),Qr,_);if(r=="async")return N(W);if(e=="@")return N(G,W);return T(P("stat"),G,q(";"),_)}function $(r){if(r=="(")return N(_r,q(")"))}function G(r,e){return V(r,e,false)}function H(r,e){return V(r,e,true)}function K(r){if(r!="(")return T();return N(P(")"),Q,q(")"),_)}function V(r,e,t){if(S.state.fatArrowAt==S.stream.start){var i=t?er:rr;if(r=="(")return N(F,P(")"),sr(_r,")"),_,q("=>"),i,U);else if(r=="variable")return T(F,Nr,q("=>"),i,U)}var n=t?Y:J;if(C.hasOwnProperty(r))return N(n);if(r=="function")return N(Or,n);if(r=="class"||f&&e=="interface"){S.marked="keyword";return N(P("form"),qr,_)}if(r=="keyword c"||r=="async")return N(t?H:G);if(r=="(")return N(P(")"),Q,q(")"),_,n);if(r=="operator"||r=="spread")return N(t?H:G);if(r=="[")return N(P("]"),re,_,n);if(r=="{")return cr(ur,"}",null,n);if(r=="quasi")return T(X,n);if(r=="new")return N(tr(t));return N()}function Q(r){if(r.match(/[;\}\)\],]/))return T();return T(G)}function J(r,e){if(r==",")return N(Q);return Y(r,e,false)}function Y(r,e,t){var i=t==false?J:Y;var n=t==false?G:H;if(r=="=>")return N(F,t?er:rr,U);if(r=="operator"){if(/\+\+|--/.test(e)||f&&e=="!")return N(i);if(f&&e=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return N(P(">"),sr(gr,">"),_,i);if(e=="?")return N(G,q(":"),n);return N(n)}if(r=="quasi"){return T(X,i)}if(r==";")return;if(r=="(")return cr(H,")","call",i);if(r==".")return N(ar,i);if(r=="[")return N(P("]"),Q,q("]"),_,i);if(f&&e=="as"){S.marked="keyword";return N(gr,i)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return N(n)}}function X(r,e){if(r!="quasi")return T();if(e.slice(e.length-2)!="${")return N(X);return N(Q,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return N(X)}}function rr(r){x(S.stream,S.state);return T(r=="{"?W:G)}function er(r){x(S.stream,S.state);return T(r=="{"?W:H)}function tr(r){return function(e){if(e==".")return N(r?nr:ir);else if(e=="variable"&&f)return N(Ar,r?Y:J);else return T(r?H:G)}}function ir(r,e){if(e=="target"){S.marked="keyword";return N(J)}}function nr(r,e){if(e=="target"){S.marked="keyword";return N(Y)}}function or(r){if(r==":")return N(_,W);return T(J,q(";"),_)}function ar(r){if(r=="variable"){S.marked="property";return N()}}function ur(r,e){if(r=="async"){S.marked="property";return N(ur)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(e=="get"||e=="set")return N(fr);var t;if(f&&S.state.fatArrowAt==S.stream.start&&(t=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+t[0].length;return N(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return N(lr)}else if(r=="jsonld-keyword"){return N(lr)}else if(f&&j(e)){S.marked="keyword";return N(ur)}else if(r=="["){return N(G,hr,q("]"),lr)}else if(r=="spread"){return N(H,lr)}else if(e=="*"){S.marked="keyword";return N(ur)}else if(r==":"){return T(lr)}}function fr(r){if(r!="variable")return T(lr);S.marked="property";return N(Or)}function lr(r){if(r==":")return N(H);if(r=="(")return T(Or)}function sr(r,e,t){function i(n,o){if(t?t.indexOf(n)>-1:n==","){var a=S.state.lexical;if(a.info=="call")a.pos=(a.pos||0)+1;return N((function(t,i){if(t==e||i==e)return T();return T(r)}),i)}if(n==e||o==e)return N();if(t&&t.indexOf(";")>-1)return T(r);return N(q(e))}return function(t,n){if(t==e||n==e)return N();return T(r,i)}}function cr(r,e,t){for(var i=3;i<arguments.length;i++)S.cc.push(arguments[i]);return N(P(e,t),sr(r,e),_)}function dr(r){if(r=="}")return N();return T(W,dr)}function hr(r,e){if(f){if(r==":")return N(gr);if(e=="?")return N(hr)}}function vr(r,e){if(f&&(r==":"||e=="in"))return N(gr)}function mr(r){if(f&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return N(G,pr,gr);else return N(gr)}}function pr(r,e){if(e=="is"){S.marked="keyword";return N()}}function gr(r,e){if(e=="keyof"||e=="typeof"||e=="infer"||e=="readonly"){S.marked="keyword";return N(e=="typeof"?H:gr)}if(r=="variable"||e=="void"){S.marked="type";return N(Mr)}if(e=="|"||e=="&")return N(gr);if(r=="string"||r=="number"||r=="atom")return N(Mr);if(r=="[")return N(P("]"),sr(gr,"]",","),_,Mr);if(r=="{")return N(P("}"),wr,_,Mr);if(r=="(")return N(sr(Cr,")"),br,Mr);if(r=="<")return N(sr(gr,">"),gr);if(r=="quasi"){return T(yr,Mr)}}function br(r){if(r=="=>")return N(gr)}function wr(r){if(r.match(/[\}\)\]]/))return N();if(r==","||r==";")return N(wr);return T(kr,wr)}function kr(r,e){if(r=="variable"||S.style=="keyword"){S.marked="property";return N(kr)}else if(e=="?"||r=="number"||r=="string"){return N(kr)}else if(r==":"){return N(gr)}else if(r=="["){return N(q("variable"),vr,q("]"),kr)}else if(r=="("){return T(Ur,kr)}else if(!r.match(/[;\}\)\],]/)){return N()}}function yr(r,e){if(r!="quasi")return T();if(e.slice(e.length-2)!="${")return N(yr);return N(gr,xr)}function xr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return N(yr)}}function Cr(r,e){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||e=="?")return N(Cr);if(r==":")return N(gr);if(r=="spread")return N(Cr);return T(gr)}function Mr(r,e){if(e=="<")return N(P(">"),sr(gr,">"),_,Mr);if(e=="|"||r=="."||e=="&")return N(gr);if(r=="[")return N(gr,q("]"),Mr);if(e=="extends"||e=="implements"){S.marked="keyword";return N(gr)}if(e=="?")return N(gr,q(":"),gr)}function Ar(r,e){if(e=="<")return N(P(">"),sr(gr,">"),_,Mr)}function Lr(){return T(gr,Sr)}function Sr(r,e){if(e=="=")return N(gr)}function Tr(r,e){if(e=="enum"){S.marked="keyword";return N(ee)}return T(Nr,hr,zr,jr)}function Nr(r,e){if(f&&j(e)){S.marked="keyword";return N(Nr)}if(r=="variable"){D(e);return N()}if(r=="spread")return N(Nr);if(r=="[")return cr(Dr,"]");if(r=="{")return cr(Er,"}")}function Er(r,e){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){D(e);return N(zr)}if(r=="variable")S.marked="property";if(r=="spread")return N(Nr);if(r=="}")return T();if(r=="[")return N(G,q("]"),q(":"),Er);return N(q(":"),Nr,zr)}function Dr(){return T(Nr,zr)}function zr(r,e){if(e=="=")return N(H)}function jr(r){if(r==",")return N(Tr)}function Ir(r,e){if(r=="keyword b"&&e=="else")return N(P("form","else"),W,_)}function Br(r,e){if(e=="await")return N(Br);if(r=="(")return N(P(")"),Rr,_)}function Rr(r){if(r=="var")return N(Tr,Fr);if(r=="variable")return N(Fr);return T(Fr)}function Fr(r,e){if(r==")")return N();if(r==";")return N(Fr);if(e=="in"||e=="of"){S.marked="keyword";return N(G,Fr)}return T(G,Fr)}function Or(r,e){if(e=="*"){S.marked="keyword";return N(Or)}if(r=="variable"){D(e);return N(Or)}if(r=="(")return N(F,P(")"),sr(_r,")"),_,mr,W,U);if(f&&e=="<")return N(P(">"),sr(Lr,">"),_,Or)}function Ur(r,e){if(e=="*"){S.marked="keyword";return N(Ur)}if(r=="variable"){D(e);return N(Ur)}if(r=="(")return N(F,P(")"),sr(_r,")"),_,mr,U);if(f&&e=="<")return N(P(">"),sr(Lr,">"),_,Ur)}function Pr(r,e){if(r=="keyword"||r=="variable"){S.marked="type";return N(Pr)}else if(e=="<"){return N(P(">"),sr(Lr,">"),_)}}function _r(r,e){if(e=="@")N(G,_r);if(r=="spread")return N(_r);if(f&&j(e)){S.marked="keyword";return N(_r)}if(f&&r=="this")return N(hr,zr);return T(Nr,hr,zr)}function qr(r,e){if(r=="variable")return Wr(r,e);return $r(r,e)}function Wr(r,e){if(r=="variable"){D(e);return N($r)}}function $r(r,e){if(e=="<")return N(P(">"),sr(Lr,">"),_,$r);if(e=="extends"||e=="implements"||f&&r==","){if(e=="implements")S.marked="keyword";return N(f?gr:G,$r)}if(r=="{")return N(P("}"),Gr,_)}function Gr(r,e){if(r=="async"||r=="variable"&&(e=="static"||e=="get"||e=="set"||f&&j(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return N(Gr)}if(r=="variable"||S.style=="keyword"){S.marked="property";return N(Hr,Gr)}if(r=="number"||r=="string")return N(Hr,Gr);if(r=="[")return N(G,hr,q("]"),Hr,Gr);if(e=="*"){S.marked="keyword";return N(Gr)}if(f&&r=="(")return T(Ur,Gr);if(r==";"||r==",")return N(Gr);if(r=="}")return N();if(e=="@")return N(G,Gr)}function Hr(r,e){if(e=="!")return N(Hr);if(e=="?")return N(Hr);if(r==":")return N(gr,zr);if(e=="=")return N(H);var t=S.state.lexical.prev,i=t&&t.info=="interface";return T(i?Ur:Or)}function Kr(r,e){if(e=="*"){S.marked="keyword";return N(Zr,q(";"))}if(e=="default"){S.marked="keyword";return N(G,q(";"))}if(r=="{")return N(sr(Vr,"}"),Zr,q(";"));return T(W)}function Vr(r,e){if(e=="as"){S.marked="keyword";return N(q("variable"))}if(r=="variable")return T(H,Vr)}function Qr(r){if(r=="string")return N();if(r=="(")return T(G);if(r==".")return T(J);return T(Jr,Yr,Zr)}function Jr(r,e){if(r=="{")return cr(Jr,"}");if(r=="variable")D(e);if(e=="*")S.marked="keyword";return N(Xr)}function Yr(r){if(r==",")return N(Jr,Yr)}function Xr(r,e){if(e=="as"){S.marked="keyword";return N(Jr)}}function Zr(r,e){if(e=="from"){S.marked="keyword";return N(G)}}function re(r){if(r=="]")return N();return T(sr(H,"]"))}function ee(){return T(P("form"),Nr,q("{"),P("}"),sr(te,"}"),_,_)}function te(){return T(Nr,zr)}function ie(r,e){return r.lastType=="operator"||r.lastType==","||c.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ne(r,e,t){return e.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||e.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(t||0)))}return{startState:function(r){var e={tokenize:g,lastType:"sof",cc:[],lexical:new M((r||0)-i,0,"block",false),localVars:t.localVars,context:t.localVars&&new I(null,null,false),indented:r||0};if(t.globalVars&&typeof t.globalVars=="object")e.globalVars=t.globalVars;return e},token:function(r,e){if(r.sol()){if(!e.lexical.hasOwnProperty("align"))e.lexical.align=false;e.indented=r.indentation();x(r,e)}if(e.tokenize!=w&&r.eatSpace())return null;var t=e.tokenize(r,e);if(v=="comment")return t;e.lastType=v=="operator"&&(m=="++"||m=="--")?"incdec":v;return L(e,t,v,m,r)},indent:function(e,o){if(e.tokenize==w||e.tokenize==k)return r.Pass;if(e.tokenize!=g)return 0;var a=o&&o.charAt(0),u=e.lexical,f;if(!/^\s*else\b/.test(o))for(var l=e.cc.length-1;l>=0;--l){var s=e.cc[l];if(s==_)u=u.prev;else if(s!=Ir&&s!=U)break}while((u.type=="stat"||u.type=="form")&&(a=="}"||(f=e.cc[e.cc.length-1])&&(f==J||f==Y)&&!/^[,\.=+\-*:?[\(]/.test(o)))u=u.prev;if(n&&u.type==")"&&u.prev.type=="stat")u=u.prev;var c=u.type,d=a==c;if(c=="vardef")return u.indented+(e.lastType=="operator"||e.lastType==","?u.info.length+1:0);else if(c=="form"&&a=="{")return u.indented;else if(c=="form")return u.indented+i;else if(c=="stat")return u.indented+(ie(e,o)?n||i:0);else if(u.info=="switch"&&!d&&t.doubleIndentSwitch!=false)return u.indented+(/^(?:case|default)\b/.test(o)?i:2*i);else if(u.align)return u.column+(d?0:1);else return u.indented+(d?0:i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:o,jsonMode:a,expressionAllowed:ne,skipExpression:function(e){L(e,"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})}))}));a((function(r,e){(function(r){r(l,c,d,s)})((function(r){var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function t(r,e,t){var i=r.current(),n=i.search(e);if(n>-1){r.backUp(i.length-n)}else if(i.match(/<\/?$/)){r.backUp(i.length);if(!r.match(e,false))r.match(i)}return t}var i={};function n(r){var e=i[r];if(e)return e;return i[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function o(r,e){var t=r.match(n(e));return t?/^\s*(.*?)\s*$/.exec(t[2])[1]:""}function a(r,e){return new RegExp((e?"^":"")+"</\\s*"+r+"\\s*>","i")}function u(r,e){for(var t in r){var i=e[t]||(e[t]=[]);var n=r[t];for(var o=n.length-1;o>=0;o--)i.unshift(n[o])}}function f(r,e){for(var t=0;t<r.length;t++){var i=r[t];if(!i[0]||i[1].test(o(e,i[0])))return i[2]}}r.defineMode("htmlmixed",(function(i,n){var o=r.getMode(i,{name:"xml",htmlMode:true,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag,allowMissingTagName:n.allowMissingTagName});var l={};var s=n&&n.tags,c=n&&n.scriptTypes;u(e,l);if(s)u(s,l);if(c)for(var d=c.length-1;d>=0;d--)l.script.unshift(["type",c[d].matches,c[d].mode]);function h(e,n){var u=o.token(e,n.htmlState),s=/\btag\b/.test(u),c;if(s&&!/[<>\s\/]/.test(e.current())&&(c=n.htmlState.tagName&&n.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(c)){n.inTag=c+" "}else if(n.inTag&&s&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(n.inTag);n.inTag=null;var v=e.current()==">"&&f(l[d[1]],d[2]);var m=r.getMode(i,v);var p=a(d[1],true),g=a(d[1],false);n.token=function(r,e){if(r.match(p,false)){e.token=h;e.localState=e.localMode=null;return null}return t(r,g,e.localMode.token(r,e.localState))};n.localMode=m;n.localState=r.startState(m,o.indent(n.htmlState,"",""))}else if(n.inTag){n.inTag+=e.current();if(e.eol())n.inTag+=" "}return u}return{startState:function(){var e=r.startState(o);return{token:h,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var t;if(e.localState){t=r.copyState(e.localMode,e.localState)}return{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:r.copyState(o,e.htmlState)}},token:function(r,e){return e.token(r,e)},indent:function(e,t,i){if(!e.localMode||/^\s*<\//.test(t))return o.indent(e.htmlState,t,i);else if(e.localMode.indent)return e.localMode.indent(e.localState,t,i);else return r.Pass},innerMode:function(r){return{state:r.localState||r.htmlState,mode:r.localMode||o}}}}),"xml","javascript","css");r.defineMIME("text/html","htmlmixed")}))}));a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],e=/^[+\-*&%=<>!?|~^]/,t=/^[:\[\(\{]/,i=["true","false"],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;r=new RegExp("(("+r.join(")|(")+"))\\b");i=new RegExp("(("+i.join(")|(")+"))\\b");function o(o,a){var u=o.peek();if(a.incomment){if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);a.incomment=false}return"comment"}else if(a.intag){if(a.operator){a.operator=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(a.sign){a.sign=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(a.instring){if(u==a.instring){a.instring=false}o.next();return"string"}else if(u=="'"||u=='"'){a.instring=u;o.next();return"string"}else if(a.inbraces>0&&u==")"){o.next();a.inbraces--}else if(u=="("){o.next();a.inbraces++}else if(a.inbrackets>0&&u=="]"){o.next();a.inbrackets--}else if(u=="["){o.next();a.inbrackets++}else if(!a.lineTag&&(o.match(a.intag+"}")||o.eat("-")&&o.match(a.intag+"}"))){a.intag=false;return"tag"}else if(o.match(e)){a.operator=true;return"operator"}else if(o.match(t)){a.sign=true}else{if(o.column()==1&&a.lineTag&&o.match(r)){return"keyword"}if(o.eat(" ")||o.sol()){if(o.match(r)){return"keyword"}if(o.match(i)){return"atom"}if(o.match(n)){return"number"}if(o.sol()){o.next()}}else{o.next()}}return"variable"}else if(o.eat("{")){if(o.eat("#")){a.incomment=true;if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);a.incomment=false}return"comment"}else if(u=o.eat(/\{|%/)){a.intag=u;a.inbraces=0;a.inbrackets=0;if(u=="{"){a.intag="}"}o.eat("-");return"tag"}}else if(o.eat("#")){if(o.peek()=="#"){o.skipToEnd();return"comment"}else if(!o.eol()){a.intag=true;a.lineTag=true;a.inbraces=0;a.inbrackets=0;return"tag"}}o.next()}return{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,e){var t=e.tokenize(r,e);if(r.eol()&&e.lineTag&&!e.instring&&e.inbraces==0&&e.inbrackets==0){e.intag=false;e.lineTag=false}return t},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}}));r.defineMIME("text/jinja2","jinja2")}))}));a((function(r,e){(function(r){r(l)})((function(r){var e="CodeMirror-activeline";var t="CodeMirror-activeline-background";var i="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(e,t,i){var o=i==r.Init?false:i;if(t==o)return;if(o){e.off("beforeSelectionChange",u);n(e);delete e.state.activeLines}if(t){e.state.activeLines=[];a(e,e.listSelections());e.on("beforeSelectionChange",u)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",e);r.removeLineClass(r.state.activeLines[n],"background",t);r.removeLineClass(r.state.activeLines[n],"gutter",i)}}function o(r,e){if(r.length!=e.length)return false;for(var t=0;t<r.length;t++)if(r[t]!=e[t])return false;return true}function a(r,a){var u=[];for(var f=0;f<a.length;f++){var l=a[f];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(u[u.length-1]!=c)u.push(c)}if(o(r.state.activeLines,u))return;r.operation((function(){n(r);for(var o=0;o<u.length;o++){r.addLineClass(u[o],"wrap",e);r.addLineClass(u[o],"background",t);r.addLineClass(u[o],"gutter",i)}r.state.activeLines=u}))}function u(r,e){a(r,e.ranges)}}))}));a((function(r,e){(function(r){r(l)})((function(r){var e=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var t=r.Pos;var i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,e,o){var u=r.getLineHandle(e.line),f=e.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&&f>=0&&s.test(u.text.charAt(f))&&i[u.text.charAt(f)]||s.test(u.text.charAt(f+1))&&i[u.text.charAt(++f)];if(!c)return null;var d=c.charAt(1)==">"?1:-1;if(o&&o.strict&&d>0!=(f==e.ch))return null;var h=r.getTokenTypeAt(t(e.line,f+1));var v=a(r,t(e.line,f+(d>0?1:0)),d,h,o);if(v==null)return null;return{from:t(e.line,f),to:v&&v.pos,match:v&&v.ch==c.charAt(0),forward:d>0}}function a(r,e,o,a,u){var f=u&&u.maxScanLineLength||1e4;var l=u&&u.maxScanLines||1e3;var s=[];var c=n(u);var d=o>0?Math.min(e.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,e.line-l);for(var h=e.line;h!=d;h+=o){var v=r.getLine(h);if(!v)continue;var m=o>0?0:v.length-1,p=o>0?v.length:-1;if(v.length>f)continue;if(h==e.line)m=e.ch-(o<0?1:0);for(;m!=p;m+=o){var g=v.charAt(m);if(c.test(g)&&(a===undefined||(r.getTokenTypeAt(t(h,m+1))||"")==(a||""))){var b=i[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:t(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function u(r,i,n){var a=r.state.matchBrackets.maxHighlightLineLength||1e3,u=n&&n.highlightNonMatching;var f=[],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||u!==false)&&r.getLine(c.from.line).length<=a){var d=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";f.push(r.markText(c.from,t(c.from.line,c.from.ch+1),{className:d}));if(c.to&&r.getLine(c.to.line).length<=a)f.push(r.markText(c.to,t(c.to.line,c.to.ch+1),{className:d}))}}if(f.length){if(e&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<f.length;r++)f[r].clear()}))};if(i)setTimeout(h,800);else return h}}function f(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=u(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(e,t,i){if(i&&i!=r.Init){e.off("cursorActivity",f);e.off("focus",f);e.off("blur",l);l(e)}if(t){e.state.matchBrackets=typeof t=="object"?t:{};e.on("cursorActivity",f);e.on("focus",f);e.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){u(this,true)}));r.defineExtension("findMatchingBracket",(function(r,e,t){if(t||typeof e=="boolean"){if(!t){e=e?{strict:true}:null}else{t.strict=e;e=t}}return o(this,r,e)}));r.defineExtension("scanForBracket",(function(r,e,t,i){return a(this,r,e,t,i)}))}))}));var h=a((function(r,e){(function(r){r(l)})((function(r){var e=r.Pos;function t(r,e){return r.line-e.line||r.ch-e.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var n=i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var o=new RegExp("<(/?)(["+i+"]["+n+"]*)","g");function a(r,e,t,i){this.line=e;this.ch=t;this.cm=r;this.text=r.getLine(e);this.min=i?Math.max(i.from,r.firstLine()):r.firstLine();this.max=i?Math.min(i.to-1,r.lastLine()):r.lastLine()}function u(r,t){var i=r.cm.getTokenTypeAt(e(r.line,t));return i&&/\btag\b/.test(i)}function f(r){if(r.line>=r.max)return;r.ch=0;r.text=r.cm.getLine(++r.line);return true}function l(r){if(r.line<=r.min)return;r.text=r.cm.getLine(--r.line);r.ch=r.text.length;return true}function s(r){for(;;){var e=r.text.indexOf(">",r.ch);if(e==-1){if(f(r))continue;else return}if(!u(r,e+1)){r.ch=e+1;continue}var t=r.text.lastIndexOf("/",e);var i=t>-1&&!/\S/.test(r.text.slice(t+1,e));r.ch=e+1;return i?"selfClose":"regular"}}function c(r){for(;;){var e=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(e==-1){if(l(r))continue;else return}if(!u(r,e+1)){r.ch=e;continue}o.lastIndex=e;r.ch=e;var t=o.exec(r.text);if(t&&t.index==e)return t}}function d(r){for(;;){o.lastIndex=r.ch;var e=o.exec(r.text);if(!e){if(f(r))continue;else return}if(!u(r,e.index+1)){r.ch=e.index+1;continue}r.ch=e.index+e[0].length;return e}}function h(r){for(;;){var e=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(e==-1){if(l(r))continue;else return}if(!u(r,e+1)){r.ch=e;continue}var t=r.text.lastIndexOf("/",e);var i=t>-1&&!/\S/.test(r.text.slice(t+1,e));r.ch=e+1;return i?"selfClose":"regular"}}function v(r,t){var i=[];for(;;){var n=d(r),o,a=r.line,u=r.ch-(n?n[0].length:0);if(!n||!(o=s(r)))return;if(o=="selfClose")continue;if(n[1]){for(var f=i.length-1;f>=0;--f)if(i[f]==n[2]){i.length=f;break}if(f<0&&(!t||t==n[2]))return{tag:n[2],from:e(a,u),to:e(r.line,r.ch)}}else{i.push(n[2])}}}function m(r,t){var i=[];for(;;){var n=h(r);if(!n)return;if(n=="selfClose"){c(r);continue}var o=r.line,a=r.ch;var u=c(r);if(!u)return;if(u[1]){i.push(u[2])}else{for(var f=i.length-1;f>=0;--f)if(i[f]==u[2]){i.length=f;break}if(f<0&&(!t||t==u[2]))return{tag:u[2],from:e(r.line,r.ch),to:e(o,a)}}}}r.registerHelper("fold","xml",(function(r,i){var n=new a(r,i.line,0);for(;;){var o=d(n);if(!o||n.line!=i.line)return;var u=s(n);if(!u)return;if(!o[1]&&u!="selfClose"){var f=e(n.line,n.ch);var l=v(n,o[2]);return l&&t(l.from,f)>0?{from:f,to:l.from}:null}}}));r.findMatchingTag=function(r,i,n){var o=new a(r,i.line,i.ch,n);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var u=s(o),f=u&&e(o.line,o.ch);var l=u&&c(o);if(!u||!l||t(o,i)>0)return;var d={from:e(o.line,o.ch),to:f,tag:l[2]};if(u=="selfClose")return{open:d,close:null,at:"open"};if(l[1]){return{open:m(o,l[2]),close:d,at:"close"}}else{o=new a(r,f.line,f.ch,n);return{open:d,close:v(o,l[2]),at:"open"}}};r.findEnclosingTag=function(r,e,t,i){var n=new a(r,e.line,e.ch,t);for(;;){var o=m(n,i);if(!o)break;var u=new a(r,e.line,e.ch,t);var f=v(u,o.tag);if(f)return{open:o,close:f}}};r.scanForClosingTag=function(r,e,t,i){var n=new a(r,e.line,e.ch,i?{from:0,to:i}:null);return v(n,t)}}))}));a((function(r,e){(function(r){r(l,h)})((function(r){r.defineOption("matchTags",false,(function(n,o,a){if(a&&a!=r.Init){n.off("cursorActivity",t);n.off("viewportChange",i);e(n)}if(o){n.state.matchBothTags=typeof o=="object"&&o.bothTags;n.on("cursorActivity",t);n.on("viewportChange",i);t(n)}}));function e(r){if(r.state.tagHit)r.state.tagHit.clear();if(r.state.tagOther)r.state.tagOther.clear();r.state.tagHit=r.state.tagOther=null}function t(t){t.state.failedTagMatch=false;t.operation((function(){e(t);if(t.somethingSelected())return;var i=t.getCursor(),n=t.getViewport();n.from=Math.min(n.from,i.line);n.to=Math.max(i.line+1,n.to);var o=r.findMatchingTag(t,i,n);if(!o)return;if(t.state.matchBothTags){var a=o.at=="open"?o.open:o.close;if(a)t.state.tagHit=t.markText(a.from,a.to,{className:"CodeMirror-matchingtag"})}var u=o.at=="close"?o.open:o.close;if(u)t.state.tagOther=t.markText(u.from,u.to,{className:"CodeMirror-matchingtag"});else t.state.failedTagMatch=true}))}function i(r){if(r.state.failedTagMatch)t(r)}r.commands.toMatchingTag=function(e){var t=r.findMatchingTag(e,e.getCursor());if(t){var i=t.at=="close"?t.open:t.close;if(i)e.extendSelection(i.to,i.from)}}}))}));a((function(r,e){(function(r){r(l)})((function(r){var e="CodeMirror-lint-markers";var t="CodeMirror-lint-line-";function i(e,t,i){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+e.options.theme;n.appendChild(i.cloneNode(true));if(e.state.lint.options.selfContain)e.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(e){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,e.clientY-n.offsetHeight-5)+"px";n.style.left=e.clientX+5+"px"}r.on(document,"mousemove",o);o(t);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 a(e,t,n,a){var u=i(e,t,n);function f(){r.off(a,"mouseout",f);if(u){o(u);u=null}}var l=setInterval((function(){if(u)for(var r=a;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){f();break}}if(!u)return clearInterval(l)}),400);r.on(a,"mouseout",f)}function u(r,e,t){this.marked=[];if(e instanceof Function)e={getAnnotations:e};if(!e||e===true)e={};this.options={};this.linterOptions=e.options||{};for(var i in f)this.options[i]=f[i];for(var i in e){if(f.hasOwnProperty(i)){if(e[i]!=null)this.options[i]=e[i]}else if(!e.options){this.linterOptions[i]=e[i]}}this.timeout=null;this.hasGutter=t;this.onMouseOver=function(e){k(r,e)};this.waitingFor=0}var f={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var t=r.state.lint;if(t.hasGutter)r.clearGutter(e);if(t.options.highlightLines)s(r);for(var i=0;i<t.marked.length;++i)t.marked[i].clear();t.marked.length=0}function s(r){r.eachLine((function(e){var t=e.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass);if(t)r.removeLineClass(e,"wrap",t[0])}))}function c(e,t,i,n,o){var u=document.createElement("div"),f=u;u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i;if(n){f=u.appendChild(document.createElement("div"));f.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(f,"mouseover",(function(r){a(e,r,t,f)}));return u}function d(r,e){if(r=="error")return r;else return e}function h(r){var e=[];for(var t=0;t<r.length;++t){var i=r[t],n=i.from.line;(e[n]||(e[n]=[])).push(i)}return e}function v(r){var e=r.severity;if(!e)e="error";var t=document.createElement("div");t.className="CodeMirror-lint-message CodeMirror-lint-message-"+e;if(typeof r.messageHTML!="undefined"){t.innerHTML=r.messageHTML}else{t.appendChild(document.createTextNode(r.message))}return t}function m(e,t){var i=e.state.lint;var n=++i.waitingFor;function o(){n=-1;e.off("change",o)}e.on("change",o);t(e.getValue(),(function(t,a){e.off("change",o);if(i.waitingFor!=n)return;if(a&&t instanceof r)t=a;e.operation((function(){g(e,t)}))}),i.linterOptions,e)}function p(e){var t=e.state.lint;if(!t)return;var i=t.options;var n=i.getAnnotations||e.getHelper(r.Pos(0,0),"lint");if(!n)return;if(i.async||n.async){m(e,n)}else{var o=n(e.getValue(),t.linterOptions,e);if(!o)return;if(o.then)o.then((function(r){e.operation((function(){g(e,r)}))}));else e.operation((function(){g(e,o)}))}}function g(r,i){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var a=h(i);for(var u=0;u<a.length;++u){var f=a[u];if(!f)continue;var s=[];f=f.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<f.length;++g){var b=f[g];var w=b.severity;if(!w)w="error";m=d(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(v(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(u,e,c(r,p,m,a[u].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(u,"wrap",t+m)}if(o.onUpdateLinting)o.onUpdateLinting(i,a,r)}function b(r){var e=r.state.lint;if(!e)return;clearTimeout(e.timeout);e.timeout=setTimeout((function(){p(r)}),e.options.delay)}function w(r,e,t){var i=t.target||t.srcElement;var n=document.createDocumentFragment();for(var o=0;o<e.length;o++){var u=e[o];n.appendChild(v(u))}a(r,t,n,i)}function k(r,e){var t=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(t.className))return;var i=t.getBoundingClientRect(),n=(i.left+i.right)/2,o=(i.top+i.bottom)/2;var a=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var u=[];for(var f=0;f<a.length;++f){var l=a[f].__annotation;if(l)u.push(l)}if(u.length)w(r,u,e)}r.defineOption("lint",false,(function(t,i,n){if(n&&n!=r.Init){l(t);if(t.state.lint.options.lintOnChange!==false)t.off("change",b);r.off(t.getWrapperElement(),"mouseover",t.state.lint.onMouseOver);clearTimeout(t.state.lint.timeout);delete t.state.lint}if(i){var o=t.getOption("gutters"),a=false;for(var f=0;f<o.length;++f)if(o[f]==e)a=true;var s=t.state.lint=new u(t,i,a);if(s.options.lintOnChange)t.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(t.getWrapperElement(),"mouseover",s.onMouseOver);p(t)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));a((function(r,e){(function(r){r(l)})((function(r){r.registerHelper("lint","json",(function(e){var t=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return t}var i=window.jsonlint.parser||window.jsonlint;i.parseError=function(e,i){var n=i.loc;t.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:e})};try{i.parse(e)}catch(r){}return t}))}))}));var v=a((function(r,e){(function(r){r(l)})((function(r){function e(e,i,o,a){if(o&&o.call){var u=o;o=null}else{var u=n(e,o,"rangeFinder")}if(typeof i=="number")i=r.Pos(i,0);var f=n(e,o,"minFoldSize");function l(r){var t=u(e,i);if(!t||t.to.line-t.from.line<f)return null;if(a==="fold")return t;var n=e.findMarksAt(t.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;t.cleared=true;n[o].clear()}}return t}var s=l(true);if(n(e,o,"scanUp"))while(!s&&i.line>e.firstLine()){i=r.Pos(i.line-1,0);s=l(false)}if(!s||s.cleared||a==="unfold")return;var c=t(e,o,s);r.on(c,"mousedown",(function(e){d.clear();r.e_preventDefault(e)}));var d=e.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(e,o,"clearOnEnter"),__isFold:true});d.on("clear",(function(t,i){r.signal(e,"unfold",e,t,i)}));r.signal(e,"fold",e,s.from,s.to)}function t(r,e,t){var i=n(r,e,"widget");if(typeof i=="function"){i=i(t.from,t.to)}if(typeof i=="string"){var o=document.createTextNode(i);i=document.createElement("span");i.appendChild(o);i.className="CodeMirror-foldmarker"}else if(i){i=i.cloneNode(true)}return i}r.newFoldFunction=function(r,t){return function(i,n){e(i,n,{rangeFinder:r,widget:t})}};r.defineExtension("foldCode",(function(r,t,i){e(this,r,t,i)}));r.defineExtension("isFolded",(function(r){var e=this.findMarksAt(r);for(var t=0;t<e.length;++t)if(e[t].__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(e){e.operation((function(){for(var t=e.firstLine(),i=e.lastLine();t<=i;t++)e.foldCode(r.Pos(t,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(e){e.operation((function(){for(var t=e.firstLine(),i=e.lastLine();t<=i;t++)e.foldCode(r.Pos(t,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(e,t){for(var i=0;i<r.length;++i){var n=r[i](e,t);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,e){var t=r.getHelpers(e,"fold");for(var i=0;i<t.length;i++){var n=t[i](r,e);if(n)return n}}));var i={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,e,t){if(e&&e[t]!==undefined)return e[t];var n=r.options.foldOptions;if(n&&n[t]!==undefined)return n[t];return i[t]}r.defineExtension("foldOption",(function(r,e){return n(this,r,e)}))}))}));a((function(r,e){(function(r){r(l,v)})((function(r){r.defineOption("foldGutter",false,(function(e,n,o){if(o&&o!=r.Init){e.clearGutter(e.state.foldGutter.options.gutter);e.state.foldGutter=null;e.off("gutterClick",l);e.off("changes",c);e.off("viewportChange",d);e.off("fold",h);e.off("unfold",h);e.off("swapDoc",c);e.off("optionChange",s)}if(n){e.state.foldGutter=new t(i(n));f(e);e.on("gutterClick",l);e.on("changes",c);e.on("viewportChange",d);e.on("fold",h);e.on("unfold",h);e.on("swapDoc",c);e.on("optionChange",s)}}));var e=r.Pos;function t(r){this.options=r;this.from=this.to=0}function i(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,t){var i=r.findMarks(e(t,0),e(t+1,0));for(var n=0;n<i.length;++n){if(i[n].__isFold){var o=i[n].find(-1);if(o&&o.line===t)return i[n]}}}function o(r){if(typeof r=="string"){var e=document.createElement("div");e.className=r+" CodeMirror-guttermarker-subtle";return e}else{return r.cloneNode(true)}}function a(r,t,i){var a=r.state.foldGutter.options,f=t-1;var l=r.foldOption(a,"minFoldSize");var s=r.foldOption(a,"rangeFinder");var c=typeof a.indicatorFolded=="string"&&u(a.indicatorFolded);var d=typeof a.indicatorOpen=="string"&&u(a.indicatorOpen);r.eachLine(t,i,(function(t){++f;var i=null;var u=t.gutterMarkers;if(u)u=u[a.gutter];if(n(r,f)){if(c&&u&&c.test(u.className))return;i=o(a.indicatorFolded)}else{var h=e(f,0);var v=s&&s(r,h);if(v&&v.to.line-v.from.line>=l){if(d&&u&&d.test(u.className))return;i=o(a.indicatorOpen)}}if(!i&&!u)return;r.setGutterMarker(t,a.gutter,i)}))}function u(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function f(r){var e=r.getViewport(),t=r.state.foldGutter;if(!t)return;r.operation((function(){a(r,e.from,e.to)}));t.from=e.from;t.to=e.to}function l(r,t,i){var o=r.state.foldGutter;if(!o)return;var a=o.options;if(i!=a.gutter)return;var u=n(r,t);if(u)u.clear();else r.foldCode(e(t,0),a)}function s(r,e){if(e=="mode")c(r)}function c(r){var e=r.state.foldGutter;if(!e)return;var t=e.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout((function(){f(r)}),t.foldOnChangeTimeSpan||600)}function d(r){var e=r.state.foldGutter;if(!e)return;var t=e.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout((function(){var t=r.getViewport();if(e.from==e.to||t.from-e.to>20||e.from-t.to>20){f(r)}else{r.operation((function(){if(t.from<e.from){a(r,t.from,e.from);e.from=t.from}if(t.to>e.to){a(r,e.to,t.to);e.to=t.to}}))}}),t.updateViewportTimeSpan||400)}function h(r,e){var t=r.state.foldGutter;if(!t)return;var i=e.line;if(i>=t.from&&i<t.to)a(r,i,i+1)}}))}));a((function(r,e){(function(r){r(l)})((function(r){function e(e){return function(t,i){var n=i.line,o=t.getLine(n);function a(e){var a;for(var u=i.ch,f=0;;){var l=u<=0?-1:o.lastIndexOf(e[0],u-1);if(l==-1){if(f==1)break;f=1;u=o.length;continue}if(f==1&&l<i.ch)break;a=t.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(a))return{ch:l+1,tokenType:a,pair:e};u=l-1}}function u(e){var i=1,o=t.lastLine(),a,u=e.ch,f;r:for(var l=n;l<=o;++l){var s=t.getLine(l),c=l==n?u:0;for(;;){var d=s.indexOf(e.pair[0],c),h=s.indexOf(e.pair[1],c);if(d<0)d=s.length;if(h<0)h=s.length;c=Math.min(d,h);if(c==s.length)break;if(t.getTokenTypeAt(r.Pos(l,c+1))==e.tokenType){if(c==d)++i;else if(!--i){a=l;f=c;break r}}++c}}if(a==null||n==a)return null;return{from:r.Pos(n,u),to:r.Pos(a,f)}}var f=[];for(var l=0;l<e.length;l++){var s=a(e[l]);if(s)f.push(s)}f.sort((function(r,e){return r.ch-e.ch}));for(var l=0;l<f.length;l++){var c=u(f[l]);if(c)return c}return null}}r.registerHelper("fold","brace",e([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",e([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(e,t){function i(t){if(t<e.firstLine()||t>e.lastLine())return null;var i=e.getTokenAt(r.Pos(t,1));if(!/\S/.test(i.string))i=e.getTokenAt(r.Pos(t,i.end+1));if(i.type!="keyword"||i.string!="import")return null;for(var n=t,o=Math.min(e.lastLine(),t+10);n<=o;++n){var a=e.getLine(n),u=a.indexOf(";");if(u!=-1)return{startCh:i.end,end:r.Pos(n,u)}}}var n=t.line,o=i(n),a;if(!o||i(n-1)||(a=i(n-2))&&a.end.line==n-1)return null;for(var u=o.end;;){var f=i(u.line+1);if(f==null)break;u=f.end}return{from:e.clipPos(r.Pos(n,o.startCh+1)),to:u}}));r.registerHelper("fold","include",(function(e,t){function i(t){if(t<e.firstLine()||t>e.lastLine())return null;var i=e.getTokenAt(r.Pos(t,1));if(!/\S/.test(i.string))i=e.getTokenAt(r.Pos(t,i.end+1));if(i.type=="meta"&&i.string.slice(0,8)=="#include")return i.start+8}var n=t.line,o=i(n);if(o==null||i(n-1)!=null)return null;for(var a=n;;){var u=i(a+1);if(u==null)break;++a}return{from:r.Pos(n,o+1),to:e.clipPos(r.Pos(a))}}))}))}));var m=a((function(r){var e=function(){var r=true,e=false;var t={};var i=function(){var r;var e;var t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var i;var n=function(e){throw{name:"SyntaxError",message:e,at:r,text:i}};var o=function(t){if(t&&t!==e){n("Expected '"+t+"' instead of '"+e+"'")}e=i.charAt(r);r+=1;return e};var a=function(){var r;var t="";if(e==="-"){t="-";o("-")}while(e>="0"&&e<="9"){t+=e;o()}if(e==="."){t+=".";while(o()&&e>="0"&&e<="9"){t+=e}}if(e==="e"||e==="E"){t+=e;o();if(e==="-"||e==="+"){t+=e;o()}while(e>="0"&&e<="9"){t+=e;o()}}r=+t;if(!isFinite(r)){n("Bad number")}else{return r}};var u=function(){var r;var i;var a="";var u;if(e==='"'){while(o()){if(e==='"'){o();return a}if(e==="\\"){o();if(e==="u"){u=0;for(i=0;i<4;i+=1){r=parseInt(o(),16);if(!isFinite(r)){break}u=u*16+r}a+=String.fromCharCode(u)}else if(typeof t[e]==="string"){a+=t[e]}else{break}}else{a+=e}}}n("Bad string")};var f=function(){while(e&&e<=" "){o()}};var l=function(){switch(e){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 '"+e+"'")};var s;var c=function(){var r=[];if(e==="["){o("[");f();if(e==="]"){o("]");return r}while(e){r.push(s());f();if(e==="]"){o("]");return r}o(",");f()}}n("Bad array")};var d=function(){var r;var t={};if(e==="{"){o("{");f();if(e==="}"){o("}");return t}while(e){r=u();f();o(":");if(Object.hasOwnProperty.call(t,r)){n("Duplicate key '"+r+"'")}t[r]=s();f();if(e==="}"){o("}");return t}o(",");f()}}n("Bad object")};s=function(){f();switch(e){case"{":return d();case"[":return c();case'"':return u();case"-":return a();default:return e>="0"&&e<="9"?a():l()}};return function(t,o){var a;i=t;r=0;e=" ";a=s();f();if(e){n("Syntax error")}return typeof o==="function"?function r(e,t){var i;var n;var a=e[t];if(a&&typeof a==="object"){for(i in a){if(Object.prototype.hasOwnProperty.call(a,i)){n=r(a,i);if(n!==undefined){a[i]=n}else{delete a[i]}}}}return o.call(e,t,a)}({"":a},""):a}}();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(e,t,i,n,o,a,u){var f=a.length-1;switch(o){case 1:this.$=e.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(e);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=a[f-1];case 13:this.$={};break;case 14:this.$=a[f-1];break;case 15:this.$=[a[f-2],a[f]];break;case 16:this.$={};this.$[a[f][0]]=a[f][1];break;case 17:this.$=a[f-2];a[f-2][a[f][0]]=a[f][1];break;case 18:this.$=[];break;case 19:this.$=a[f-1];break;case 20:this.$=[a[f]];break;case 21:this.$=a[f-2];a[f-2].push(a[f]);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(e,t){throw new Error(e)},parse:function r(e){var t=this,i=[0],n=[null],o=[],a=this.table,u="",f=0,l=0,s=0,c=2,d=1;this.lexer.setInput(e);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 v(r){i.length=i.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=t.lexer.lex()||1;if(typeof r!=="number"){r=t.symbols_[r]||r}return r}var p,g,b,w,k,y={},x,C,M,A;while(true){b=i[i.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=a[b]&&a[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){A=[];for(x in a[b])if(this.terminals_[x]&&x>2){A.push("'"+this.terminals_[x]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(f+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(f+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:A})}if(s==3){if(p==d){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;u=this.lexer.yytext;f=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in a[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}v(1);b=i[i.length-1]}g=p;p=c;b=i[i.length-1];w=a[b]&&a[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:i.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);i.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;u=this.lexer.yytext;f=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:C=this.productions_[w[1]][1];y.$=n[n.length-C];y._$={first_line:o[o.length-(C||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(C||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(y,u,l,f,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(C){i=i.slice(0,-1*C*2);n=n.slice(0,-1*C);o=o.slice(0,-1*C)}i.push(this.productions_[w[1]][0]);n.push(y.$);o.push(y._$);M=a[i[i.length-2]][i[i.length-1]];i.push(M);break;case 3:return true}}return true}};var e=function(){var r={EOF:1,parseError:function r(e,t){if(this.yy.parseError){this.yy.parseError(e,t)}else{throw new Error(e)}},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 e=r.match(/\n/);if(e)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 e=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,e,t,i,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var a=0;a<o.length;a++){t=this._input.match(this.rules[o[a]]);if(t&&(!e||t[0].length>e[0].length)){e=t;i=a;if(!this.options.flex)break}}if(e){n=e[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+e[0].length};this.yytext+=e[0];this.match+=e[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(e[0].length);this.matched+=e[0];r=this.performAction.call(this,this.yy,this,o[i],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 e=this.next();if(typeof e!=="undefined"){return e}else{return this.lex()}},begin:function r(e){this.conditionStack.push(e)},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(e){this.begin(e)}};r.options={};r.performAction=function r(e,t,i,n){switch(i){case 0:break;case 1:return 6;case 2:t.yytext=t.yytext.substr(1,t.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=e;return r}();var o=n.parse;n.parse=function(e){var t=o.call(n,e);var a=typeof i==="undefined"?r("./doug-json-parse"):i;try{a(e)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var u=e.substring(0,r.at).split("\n");var f=u.length;var l=u[f-1].length-1;this.parseError(r.message,{line:f,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+f)}}return t};if(typeof t!=="undefined"){t.parser=n;t.parse=function(){return n.parse.apply(n,arguments)};t.main=function e(i){if(!i[1])throw new Error("Usage: "+i[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),i[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(i[1]).read({charset:"utf-8"})}return t.parser.parse(n)};if(r.main===e){t.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return t}();if(r.exports)r.exports=e}));const p="@charset \"UTF-8\";.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(limel-code-editor){isolation:isolate;position:relative;display:flex;flex-direction:column;width:100%;font-size:var(--code-editor-font-size, 0.8125rem);--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(limel-code-editor) .cm-attribute,:host(limel-code-editor) .cm-property,:host(limel-code-editor) .cm-keyword{color:rgb(var(--color-violet-light))}:host(limel-code-editor) .cm-operator{color:rgb(var(--color-sky-dark))}:host(limel-code-editor) .cm-variable{color:rgb(var(--color-pink-light))}:host(limel-code-editor) .cm-variable-2{color:rgb(var(--contrast-1100))}:host(limel-code-editor) .cm-variable-3,:host(limel-code-editor) .cm-type{color:rgb(var(--color-amber-darker))}:host(limel-code-editor) .cm-builtin,:host(limel-code-editor) .cm-meta{color:rgb(var(--color-amber-default))}:host(limel-code-editor) .cm-atom{color:rgb(var(--color-coral-default))}:host(limel-code-editor) .cm-tag,:host(limel-code-editor) .cm-number{color:rgb(var(--color-magenta-default))}:host(limel-code-editor) .cm-def{color:rgb(var(--color-sky-default))}:host(limel-code-editor) .cm-string{color:rgb(var(--color-green-dark))}:host(limel-code-editor) .cm-string-2{color:rgb(var(--color-pink-default))}:host(limel-code-editor) .cm-qualifier{color:rgb(var(--color-grass-default))}:host(limel-code-editor) .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host(limel-code-editor) .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%;min-height:2.5rem}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;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-lines{padding:0.25rem 0}.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 var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);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,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.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}limel-notched-outline{flex-grow:1}.copy-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);position:absolute;top:0.25rem;right:0.25rem;z-index:1;padding:0.25rem 0.5rem;border-radius:0.375rem;font-size:0.75rem;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease), opacity var(--limel-clickable-transition-speed, 0.4s) ease;opacity:0}.copy-button:hover,.copy-button:focus,.copy-button:focus-visible{will-change:color, background-color, box-shadow, transform}.copy-button:hover,.copy-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.copy-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.copy-button:hover,.copy-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.copy-button:focus{outline:none}.copy-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host(limel-code-editor:hover) .copy-button,:host(limel-code-editor:focus-within) .copy-button{opacity:1}:host(limel-code-editor:focus),:host(limel-code-editor:focus-visible),:host(limel-code-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-code-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-code-editor:focus) limel-helper-line,:host(limel-code-editor:focus-visible) limel-helper-line,:host(limel-code-editor:focus-within) limel-helper-line,:host(limel-code-editor:hover) limel-helper-line{will-change:grid-template-rows}";const g=class{constructor(i){r(this,i);this.change=e(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.renderHelperLine=()=>{if(!this.helperText){return}return t("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})};this.copyCode=async()=>{var r,e,t;const i=(t=(e=(r=this.editor)===null||r===void 0?void 0:r.getValue())!==null&&e!==void 0?e:this.value)!==null&&t!==void 0?t:"";try{await navigator.clipboard.writeText(i);this.wasCopied="success";setTimeout((()=>{this.wasCopied="idle"}),2e3)}catch(r){console.error("Failed to copy to clipboard:",r);this.wasCopied="failed"}};this.value="";this.language=undefined;this.readonly=false;this.disabled=false;this.invalid=false;this.required=false;this.label=undefined;this.helperText=undefined;this.lineNumbers=false;this.lineWrapping=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.translationLanguage="en";this.random=undefined;this.wasCopied="idle";this.labelId=o();this.helperTextId=o()}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host);(r=this.editor)===null||r===void 0?void 0:r.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const e=this.host.shadowRoot.querySelector(".editor");for(const r of e===null||e===void 0?void 0:e.childNodes){r.remove()}}componentDidRender(){if(this.editor){return}this.editor=this.createEditor();this.updateInputFieldAccessibilityAttributes()}watchValue(r){if(!this.editor){return}const e=this.editor.getValue();if(r===e){return}this.editor.getDoc().setValue(r||"")}watchDisabled(){this.updateEditorReadOnlyState();this.updateInputFieldAccessibilityAttributes()}watchReadonly(){this.updateEditorReadOnlyState();this.updateInputFieldAccessibilityAttributes()}watchInvalid(){this.updateInputFieldAccessibilityAttributes()}watchRequired(){this.updateInputFieldAccessibilityAttributes()}watchHelperText(){this.updateInputFieldAccessibilityAttributes()}createEditor(){const r=this.getOptions();const e=l(this.host.shadowRoot.querySelector(".editor"),r);e.on("change",this.handleChange);e.setOption("extraKeys",{Tab:r=>{const e=" ".repeat(r.getOption("indentUnit"));r.replaceSelection(e)}});return e}getOptions(){let r=this.language;const e=4;let t="lime light";const i=[];if(this.isDarkMode()){t="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){i.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=m}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}else if(this.language==="html"){r="htmlmixed"}if(this.fold){i.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:t,readOnly:this.getReadOnlyOption(),tabSize:e,indentUnit:e,lineNumbers:this.lineNumbers,lineWrapping:this.lineWrapping,styleActiveLine:true,matchBrackets:true,matchTags:{bothTags:true},lint:this.lint,foldGutter:this.fold,gutters:i}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly||this.disabled,disabled:this.disabled,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return t(i,null,this.renderCopyButton(),t("limel-notched-outline",{labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:true},t("div",{slot:"content",class:r})),this.renderHelperLine())}forceRedraw(){this.random=Math.random()}renderCopyButton(){var r;const e=!!(((r=this.editor)===null||r===void 0?void 0:r.getValue())||this.value);if(!e||this.disabled){return}return t("button",{class:"copy-button",onClick:this.copyCode,type:"button","aria-live":"polite","aria-atomic":"true","aria-label":this.getButtonAriaLabel()},this.getButtonText())}getButtonText(){if(this.wasCopied==="success"){return f.get("code-editor.copied",this.translationLanguage)}if(this.wasCopied==="failed"){return f.get("code-editor.copy-failed",this.translationLanguage)}return f.get("code-editor.copy",this.translationLanguage)}getButtonAriaLabel(){const r=this.label||f.get("code-editor",this.translationLanguage);const e={success:"code-editor.copied-aria-label",failed:"code-editor.copy-failed-aria-label",idle:"code-editor.copy-aria-label"};const t=e[this.wasCopied];return f.get(t,this.translationLanguage,{label:r})}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}updateEditorReadOnlyState(){if(!this.editor){return}this.editor.setOption("readOnly",this.getReadOnlyOption())}getReadOnlyOption(){if(this.disabled){return"nocursor"}return this.readonly}updateInputFieldAccessibilityAttributes(){if(!this.editor){return}const r=this.editor.getInputField();if(!r){return}r.id=this.labelId;if(this.helperText){r.setAttribute("aria-describedby",this.helperTextId);r.setAttribute("aria-controls",this.helperTextId)}else{r.removeAttribute("aria-describedby");r.removeAttribute("aria-controls")}if(this.required){r.setAttribute("aria-required","true")}else{r.removeAttribute("aria-required")}if(this.invalid){r.setAttribute("aria-invalid","true")}else{r.removeAttribute("aria-invalid")}if(this.disabled){r.setAttribute("aria-disabled","true")}else{r.removeAttribute("aria-disabled")}if(this.readonly||this.disabled){r.setAttribute("aria-readonly","true")}else{r.removeAttribute("aria-readonly")}}get host(){return n(this)}static get watchers(){return{value:["watchValue"],disabled:["watchDisabled"],readonly:["watchReadonly"],invalid:["watchInvalid"],required:["watchRequired"],helperText:["watchHelperText"]}}};g.style=p;export{g as limel_code_editor};
2
- //# sourceMappingURL=p-745417ee.entry.js.map
1
+ import{r,c as e,h as t,H as i,g as n}from"./p-bdfa539c.js";import{c as o}from"./p-ad52787a.js";import{c as a,a as u}from"./p-4e9b4087.js";import{t as f}from"./p-df36e1ae.js";var l=a((function(r,e){(function(e,t){r.exports=t()})(u,(function(){var r=navigator.userAgent;var e=navigator.platform;var t=/gecko\/\d/i.test(r);var i=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var a=i||n||o;var u=a&&(i?document.documentMode||6:+(o||n)[1]);var f=!o&&/WebKit\//.test(r);var l=f&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var d=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var v=/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(e);var k=/\bCrOS\b/.test(r);var y=/win/i.test(e);var x=d&&r.match(/Version\/(\d*\.\d*)/);if(x){x=Number(x[1])}if(x&&x>=15){d=false;f=true}var C=w&&(l||d&&(x==null||x<12.11));var M=t||a&&u>=9;function A(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,e){var t=r.className;var i=A(e).exec(t);if(i){var n=t.slice(i.index+i[0].length);r.className=t.slice(0,i.index)+(n?i[1]+n:"")}};function S(r){for(var e=r.childNodes.length;e>0;--e){r.removeChild(r.firstChild)}return r}function T(r,e){return S(r).appendChild(e)}function N(r,e,t,i){var n=document.createElement(r);if(t){n.className=t}if(i){n.style.cssText=i}if(typeof e=="string"){n.appendChild(document.createTextNode(e))}else if(e){for(var o=0;o<e.length;++o){n.appendChild(e[o])}}return n}function E(r,e,t,i){var n=N(r,e,t,i);n.setAttribute("role","presentation");return n}var D;if(document.createRange){D=function(r,e,t,i){var n=document.createRange();n.setEnd(i||r,t);n.setStart(r,e);return n}}else{D=function(r,e,t){var i=document.body.createTextRange();try{i.moveToElementText(r.parentNode)}catch(r){return i}i.collapse(true);i.moveEnd("character",t);i.moveStart("character",e);return i}}function z(r,e){if(e.nodeType==3){e=e.parentNode}if(r.contains){return r.contains(e)}do{if(e.nodeType==11){e=e.host}if(e==r){return true}}while(e=e.parentNode)}function j(r){var e;try{e=r.activeElement}catch(t){e=r.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement){e=e.shadowRoot.activeElement}return e}function I(r,e){var t=r.className;if(!A(e).test(t)){r.className+=(t?" ":"")+e}}function B(r,e){var t=r.split(" ");for(var i=0;i<t.length;i++){if(t[i]&&!A(t[i]).test(e)){e+=" "+t[i]}}return e}var R=function(r){r.select()};if(p){R=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(a){R=function(r){try{r.select()}catch(r){}}}function F(r){return r.display.wrapper.ownerDocument}function O(r){return F(r).defaultView}function U(r){var e=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,e)}}function P(r,e,t){if(!e){e={}}for(var i in r){if(r.hasOwnProperty(i)&&(t!==false||!e.hasOwnProperty(i))){e[i]=r[i]}}return e}function _(r,e,t,i,n){if(e==null){e=r.search(/[^\s\u00a0]/);if(e==-1){e=r.length}}for(var o=i||0,a=n||0;;){var u=r.indexOf("\t",o);if(u<0||u>=e){return a+(e-o)}a+=u-o;a+=t-a%t;o=u+1}}var q=function(){this.id=null;this.f=null;this.time=0;this.handler=U(this.onTimeout,this)};q.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};q.prototype.set=function(r,e){this.f=e;var t=+new Date+r;if(!this.id||t<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=t}};function W(r,e){for(var t=0;t<r.length;++t){if(r[t]==e){return t}}return-1}var $=50;var G={toString:function(){return"CodeMirror.Pass"}};var H={scroll:false},K={origin:"*mouse"},V={origin:"+move"};function Q(r,e,t){for(var i=0,n=0;;){var o=r.indexOf("\t",i);if(o==-1){o=r.length}var a=o-i;if(o==r.length||n+a>=e){return i+Math.min(a,e-n)}n+=o-i;n+=t-n%t;i=o+1;if(n>=e){return i}}}var J=[""];function Y(r){while(J.length<=r){J.push(X(J)+" ")}return J[r]}function X(r){return r[r.length-1]}function Z(r,e){var t=[];for(var i=0;i<r.length;i++){t[i]=e(r[i],i)}return t}function rr(r,e,t){var i=0,n=t(e);while(i<r.length&&t(r[i])<=n){i++}r.splice(i,0,e)}function er(){}function tr(r,e){var t;if(Object.create){t=Object.create(r)}else{er.prototype=r;t=new er}if(e){P(e,t)}return t}var ir=/[\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()||ir.test(r))}function or(r,e){if(!e){return nr(r)}if(e.source.indexOf("\\w")>-1&&nr(r)){return true}return e.test(r)}function ar(r){for(var e in r){if(r.hasOwnProperty(e)&&r[e]){return false}}return true}var ur=/[\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 fr(r){return r.charCodeAt(0)>=768&&ur.test(r)}function lr(r,e,t){while((t<0?e>0:e<r.length)&&fr(r.charAt(e))){e+=t}return e}function sr(r,e,t){var i=e>t?-1:1;for(;;){if(e==t){return e}var n=(e+t)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==e){return r(o)?e:t}if(r(o)){t=o}else{e=o+i}}}function cr(r,e,t,i){if(!r){return i(e,t,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var a=r[o];if(a.from<t&&a.to>e||e==t&&a.to==e){i(Math.max(a.from,e),Math.min(a.to,t),a.level==1?"rtl":"ltr",o);n=true}}if(!n){i(e,t,"ltr")}}var dr=null;function hr(r,e,t){var i;dr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<e&&o.to>e){return n}if(o.to==e){if(o.from!=o.to&&t=="before"){i=n}else{dr=n}}if(o.from==e){if(o.from!=o.to&&t!="before"){i=n}else{dr=n}}}return i!=null?i:dr}var vr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function t(t){if(t<=247){return r.charAt(t)}else if(1424<=t&&t<=1524){return"R"}else if(1536<=t&&t<=1785){return e.charAt(t-1536)}else if(1774<=t&&t<=2220){return"r"}else if(8192<=t&&t<=8203){return"w"}else if(t==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,u=/[1n]/;function f(r,e,t){this.level=r;this.from=e;this.to=t}return function(r,e){var l=e=="ltr"?"L":"R";if(r.length==0||e=="ltr"&&!i.test(r)){return false}var s=r.length,c=[];for(var d=0;d<s;++d){c.push(t(r.charCodeAt(d)))}for(var h=0,v=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=v}else{v=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 y=c[w];if(y=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(y==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=y}for(var x=0;x<s;++x){var C=c[x];if(C==","){c[x]="N"}else if(C=="%"){var M=void 0;for(M=x+1;M<s&&c[M]=="%";++M){}var A=x&&c[x-1]=="!"||M<s&&c[M]=="1"?"1":"N";for(var L=x;L<M;++L){c[L]=A}x=M-1}}for(var S=0,T=l;S<s;++S){var N=c[S];if(T=="L"&&N=="1"){c[S]="L"}else if(o.test(N)){T=N}}for(var E=0;E<s;++E){if(n.test(c[E])){var D=void 0;for(D=E+1;D<s&&n.test(c[D]);++D){}var z=(E?c[E-1]:l)=="L";var j=(D<s?c[D]:l)=="L";var I=z==j?z?"L":"R":l;for(var B=E;B<D;++B){c[B]=I}E=D-1}}var R=[],F;for(var O=0;O<s;){if(a.test(c[O])){var U=O;for(++O;O<s&&a.test(c[O]);++O){}R.push(new f(0,U,O))}else{var P=O,_=R.length,q=e=="rtl"?1:0;for(++O;O<s&&c[O]!="L";++O){}for(var W=P;W<O;){if(u.test(c[W])){if(P<W){R.splice(_,0,new f(1,P,W));_+=q}var $=W;for(++W;W<O&&u.test(c[W]);++W){}R.splice(_,0,new f(2,$,W));_+=q;P=W}else{++W}}if(P<O){R.splice(_,0,new f(1,P,O))}}}if(e=="ltr"){if(R[0].level==1&&(F=r.match(/^\s+/))){R[0].from=F[0].length;R.unshift(new f(0,0,F[0].length))}if(X(R).level==1&&(F=r.match(/\s+$/))){X(R).to-=F[0].length;R.push(new f(0,s-F[0].length,s))}}return e=="rtl"?R.reverse():R}}();function mr(r,e){var t=r.order;if(t==null){t=r.order=vr(r.text,e)}return t}var pr=[];var gr=function(r,e,t){if(r.addEventListener){r.addEventListener(e,t,false)}else if(r.attachEvent){r.attachEvent("on"+e,t)}else{var i=r._handlers||(r._handlers={});i[e]=(i[e]||pr).concat(t)}};function br(r,e){return r._handlers&&r._handlers[e]||pr}function wr(r,e,t){if(r.removeEventListener){r.removeEventListener(e,t,false)}else if(r.detachEvent){r.detachEvent("on"+e,t)}else{var i=r._handlers,n=i&&i[e];if(n){var o=W(n,t);if(o>-1){i[e]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,e){var t=br(r,e);if(!t.length){return}var i=Array.prototype.slice.call(arguments,2);for(var n=0;n<t.length;++n){t[n].apply(null,i)}}function yr(r,e,t){if(typeof e=="string"){e={type:e,preventDefault:function(){this.defaultPrevented=true}}}kr(r,t||e.type,r,e);return Sr(e)||e.codemirrorIgnore}function xr(r){var e=r._handlers&&r._handlers.cursorActivity;if(!e){return}var t=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var i=0;i<e.length;++i){if(W(t,e[i])==-1){t.push(e[i])}}}function Cr(r,e){return br(r,e).length>0}function Mr(r){r.prototype.on=function(r,e){gr(this,r,e)};r.prototype.off=function(r,e){wr(this,r,e)}}function Ar(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 Tr(r){Ar(r);Lr(r)}function Nr(r){return r.target||r.srcElement}function Er(r){var e=r.which;if(e==null){if(r.button&1){e=1}else if(r.button&2){e=3}else if(r.button&4){e=2}}if(w&&r.ctrlKey&&e==1){e=3}return e}var Dr=function(){if(a&&u<9){return false}var r=N("div");return"draggable"in r||"dragDrop"in r}();var zr;function jr(r){if(zr==null){var e=N("span","​");T(r,N("span",[e,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){zr=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&u<8)}}var t=zr?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");t.setAttribute("cm-text","");return t}var Ir;function Br(r){if(Ir!=null){return Ir}var e=T(r,document.createTextNode("AخA"));var t=D(e,0,1).getBoundingClientRect();var i=D(e,1,2).getBoundingClientRect();S(r);if(!t||t.left==t.right){return false}return Ir=i.right-t.right<3}var Rr="\n\nb".split(/\n/).length!=3?function(r){var e=0,t=[],i=r.length;while(e<=i){var n=r.indexOf("\n",e);if(n==-1){n=r.length}var o=r.slice(e,r.charAt(n-1)=="\r"?n-1:n);var a=o.indexOf("\r");if(a!=-1){t.push(o.slice(0,a));e+=a+1}else{t.push(o);e=n+1}}return t}:function(r){return r.split(/\r\n?|\n/)};var Fr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var e;try{e=r.ownerDocument.selection.createRange()}catch(r){}if(!e||e.parentElement()!=r){return false}return e.compareEndPoints("StartToEnd",e)!=0};var Or=function(){var r=N("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Ur=null;function Pr(r){if(Ur!=null){return Ur}var e=T(r,N("span","x"));var t=e.getBoundingClientRect();var i=D(e,0,1).getBoundingClientRect();return Ur=Math.abs(t.left-i.left)>1}var _r={},qr={};function Wr(r,e){if(arguments.length>2){e.dependencies=Array.prototype.slice.call(arguments,2)}_r[r]=e}function $r(r,e){qr[r]=e}function Gr(r){if(typeof r=="string"&&qr.hasOwnProperty(r)){r=qr[r]}else if(r&&typeof r.name=="string"&&qr.hasOwnProperty(r.name)){var e=qr[r.name];if(typeof e=="string"){e={name:e}}r=tr(e,r);r.name=e.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return Gr("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return Gr("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function Hr(r,e){e=Gr(e);var t=_r[e.name];if(!t){return Hr(r,"text/plain")}var i=t(r,e);if(Kr.hasOwnProperty(e.name)){var n=Kr[e.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(i.hasOwnProperty(o)){i["_"+o]=i[o]}i[o]=n[o]}}i.name=e.name;if(e.helperType){i.helperType=e.helperType}if(e.modeProps){for(var a in e.modeProps){i[a]=e.modeProps[a]}}return i}var Kr={};function Vr(r,e){var t=Kr.hasOwnProperty(r)?Kr[r]:Kr[r]={};P(e,t)}function Qr(r,e){if(e===true){return e}if(r.copyState){return r.copyState(e)}var t={};for(var i in e){var n=e[i];if(n instanceof Array){n=n.concat([])}t[i]=n}return t}function Jr(r,e){var t;while(r.innerMode){t=r.innerMode(e);if(!t||t.mode==r){break}e=t.state;r=t.mode}return t||{mode:r,state:e}}function Yr(r,e,t){return r.startState?r.startState(e,t):true}var Xr=function(r,e,t){this.pos=this.start=0;this.string=r;this.tabSize=e||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=t};Xr.prototype.eol=function(){return this.pos>=this.string.length};Xr.prototype.sol=function(){return this.pos==this.lineStart};Xr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};Xr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};Xr.prototype.eat=function(r){var e=this.string.charAt(this.pos);var t;if(typeof r=="string"){t=e==r}else{t=e&&(r.test?r.test(e):r(e))}if(t){++this.pos;return e}};Xr.prototype.eatWhile=function(r){var e=this.pos;while(this.eat(r)){}return this.pos>e};Xr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};Xr.prototype.skipToEnd=function(){this.pos=this.string.length};Xr.prototype.skipTo=function(r){var e=this.string.indexOf(r,this.pos);if(e>-1){this.pos=e;return true}};Xr.prototype.backUp=function(r){this.pos-=r};Xr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.match=function(r,e,t){if(typeof r=="string"){var i=function(r){return t?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(i(n)==i(r)){if(e!==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&&e!==false){this.pos+=o[0].length}return o}};Xr.prototype.current=function(){return this.string.slice(this.start,this.pos)};Xr.prototype.hideFirstChars=function(r,e){this.lineStart+=r;try{return e()}finally{this.lineStart-=r}};Xr.prototype.lookAhead=function(r){var e=this.lineOracle;return e&&e.lookAhead(r)};Xr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,e){e-=r.first;if(e<0||e>=r.size){throw new Error("There is no line "+(e+r.first)+" in the document.")}var t=r;while(!t.lines){for(var i=0;;++i){var n=t.children[i],o=n.chunkSize();if(e<o){t=n;break}e-=o}}return t.lines[e]}function re(r,e,t){var i=[],n=e.line;r.iter(e.line,t.line+1,(function(r){var o=r.text;if(n==t.line){o=o.slice(0,t.ch)}if(n==e.line){o=o.slice(e.ch)}i.push(o);++n}));return i}function ee(r,e,t){var i=[];r.iter(e,t,(function(r){i.push(r.text)}));return i}function te(r,e){var t=e-r.height;if(t){for(var i=r;i;i=i.parent){i.height+=t}}}function ie(r){if(r.parent==null){return null}var e=r.parent,t=W(e.lines,r);for(var i=e.parent;i;e=i,i=i.parent){for(var n=0;;++n){if(i.children[n]==e){break}t+=i.children[n].chunkSize()}}return t+e.first}function ne(r,e){var t=r.first;r:do{for(var i=0;i<r.children.length;++i){var n=r.children[i],o=n.height;if(e<o){r=n;continue r}e-=o;t+=n.chunkSize()}return t}while(!r.lines);var a=0;for(;a<r.lines.length;++a){var u=r.lines[a],f=u.height;if(e<f){break}e-=f}return t+a}function oe(r,e){return e>=r.first&&e<r.first+r.size}function ae(r,e){return String(r.lineNumberFormatter(e+r.firstLineNumber))}function ue(r,e,t){if(t===void 0)t=null;if(!(this instanceof ue)){return new ue(r,e,t)}this.line=r;this.ch=e;this.sticky=t}function fe(r,e){return r.line-e.line||r.ch-e.ch}function le(r,e){return r.sticky==e.sticky&&fe(r,e)==0}function se(r){return ue(r.line,r.ch)}function ce(r,e){return fe(r,e)<0?e:r}function de(r,e){return fe(r,e)<0?r:e}function he(r,e){return Math.max(r.first,Math.min(e,r.first+r.size-1))}function ve(r,e){if(e.line<r.first){return ue(r.first,0)}var t=r.first+r.size-1;if(e.line>t){return ue(t,Zr(r,t).text.length)}return me(e,Zr(r,e.line).text.length)}function me(r,e){var t=r.ch;if(t==null||t>e){return ue(r.line,e)}else if(t<0){return ue(r.line,0)}else{return r}}function pe(r,e){var t=[];for(var i=0;i<e.length;i++){t[i]=ve(r,e[i])}return t}var ge=function(r,e){this.state=r;this.lookAhead=e};var be=function(r,e,t,i){this.state=e;this.doc=r;this.line=t;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};be.prototype.lookAhead=function(r){var e=this.doc.getLine(this.line+r);if(e!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return e};be.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};be.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};be.fromSaved=function(r,e,t){if(e instanceof ge){return new be(r,Qr(r.mode,e.state),t,e.lookAhead)}else{return new be(r,Qr(r.mode,e),t)}};be.prototype.save=function(r){var e=r!==false?Qr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};function we(r,e,t,i){var n=[r.state.modeGen],o={};Te(r,e.text,r.doc.mode,t,(function(r,e){return n.push(r,e)}),o,i);var a=t.state;var u=function(i){t.baseTokens=n;var u=r.state.overlays[i],f=1,l=0;t.state=true;Te(r,e.text,u.mode,t,(function(r,e){var t=f;while(l<r){var i=n[f];if(i>r){n.splice(f,1,r,n[f+1],i)}f+=2;l=Math.min(r,i)}if(!e){return}if(u.opaque){n.splice(t,f-t,r,"overlay "+e);f=t+2}else{for(;t<f;t+=2){var o=n[t+1];n[t+1]=(o?o+" ":"")+"overlay "+e}}}),o);t.state=a;t.baseTokens=null;t.baseTokenPos=1};for(var f=0;f<r.state.overlays.length;++f)u(f);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function ke(r,e,t){if(!e.styles||e.styles[0]!=r.state.modeGen){var i=ye(r,ie(e));var n=e.text.length>r.options.maxHighlightLength&&Qr(r.doc.mode,i.state);var o=we(r,e,i);if(n){i.state=n}e.stateAfter=i.save(!n);e.styles=o.styles;if(o.classes){e.styleClasses=o.classes}else if(e.styleClasses){e.styleClasses=null}if(t===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return e.styles}function ye(r,e,t){var i=r.doc,n=r.display;if(!i.mode.startState){return new be(i,true,e)}var o=Ne(r,e,t);var a=o>i.first&&Zr(i,o-1).stateAfter;var u=a?be.fromSaved(i,a,o):new be(i,Yr(i.mode),o);i.iter(o,e,(function(t){xe(r,t.text,u);var i=u.line;t.stateAfter=i==e-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?u.save():null;u.nextLine()}));if(t){i.modeFrontier=u.line}return u}function xe(r,e,t,i){var n=r.doc.mode;var o=new Xr(e,r.options.tabSize,t);o.start=o.pos=i||0;if(e==""){Ce(n,t.state)}while(!o.eol()){Me(n,o,t.state);o.start=o.pos}}function Ce(r,e){if(r.blankLine){return r.blankLine(e)}if(!r.innerMode){return}var t=Jr(r,e);if(t.mode.blankLine){return t.mode.blankLine(t.state)}}function Me(r,e,t,i){for(var n=0;n<10;n++){if(i){i[0]=Jr(r,t).mode}var o=r.token(e,t);if(e.pos>e.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var Ae=function(r,e,t){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=e||null;this.state=t};function Le(r,e,t,i){var n=r.doc,o=n.mode,a;e=ve(n,e);var u=Zr(n,e.line),f=ye(r,e.line,t);var l=new Xr(u.text,r.options.tabSize,f),s;if(i){s=[]}while((i||l.pos<e.ch)&&!l.eol()){l.start=l.pos;a=Me(o,l,f.state);if(i){s.push(new Ae(l,a,Qr(n.mode,f.state)))}}return i?s:new Ae(l,a,f.state)}function Se(r,e){if(r){for(;;){var t=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!t){break}r=r.slice(0,t.index)+r.slice(t.index+t[0].length);var i=t[1]?"bgClass":"textClass";if(e[i]==null){e[i]=t[2]}else if(!new RegExp("(?:^|\\s)"+t[2]+"(?:$|\\s)").test(e[i])){e[i]+=" "+t[2]}}}return r}function Te(r,e,t,i,n,o,a){var u=t.flattenSpans;if(u==null){u=r.options.flattenSpans}var f=0,l=null;var s=new Xr(e,r.options.tabSize,i),c;var d=r.options.addModeClass&&[null];if(e==""){Se(Ce(t,i.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){u=false;if(a){xe(r,e,i,s.pos)}s.pos=e.length;c=null}else{c=Se(Me(t,s,i.state,d),o)}if(d){var h=d[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!u||l!=c){while(f<s.start){f=Math.min(s.start,f+5e3);n(f,l)}l=c}s.start=s.pos}while(f<s.pos){var v=Math.min(s.pos,f+5e3);n(v,l);f=v}}function Ne(r,e,t){var i,n,o=r.doc;var a=t?-1:e-(r.doc.mode.innerMode?1e3:100);for(var u=e;u>a;--u){if(u<=o.first){return o.first}var f=Zr(o,u-1),l=f.stateAfter;if(l&&(!t||u+(l instanceof ge?l.lookAhead:0)<=o.modeFrontier)){return u}var s=_(f.text,null,r.options.tabSize);if(n==null||i>s){n=u-1;i=s}}return n}function Ee(r,e){r.modeFrontier=Math.min(r.modeFrontier,e);if(r.highlightFrontier<e-10){return}var t=r.first;for(var i=e-1;i>t;i--){var n=Zr(r,i).stateAfter;if(n&&(!(n instanceof ge)||i+n.lookAhead<e)){t=i+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,t)}var De=false,ze=false;function je(){De=true}function Ie(){ze=true}function Be(r,e,t){this.marker=r;this.from=e;this.to=t}function Re(r,e){if(r){for(var t=0;t<r.length;++t){var i=r[t];if(i.marker==e){return i}}}}function Fe(r,e){var t;for(var i=0;i<r.length;++i){if(r[i]!=e){(t||(t=[])).push(r[i])}}return t}function Oe(r,e,t){var i=t&&window.WeakSet&&(t.markedSpans||(t.markedSpans=new WeakSet));if(i&&r.markedSpans&&i.has(r.markedSpans)){r.markedSpans.push(e)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([e]):[e];if(i){i.add(r.markedSpans)}}e.marker.attachLine(r)}function Ue(r,e,t){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],a=o.marker;var u=o.from==null||(a.inclusiveLeft?o.from<=e:o.from<e);if(u||o.from==e&&a.type=="bookmark"&&(!t||!o.marker.insertLeft)){var f=o.to==null||(a.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new Be(a,o.from,f?null:o.to))}}}return i}function Pe(r,e,t){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],a=o.marker;var u=o.to==null||(a.inclusiveRight?o.to>=e:o.to>e);if(u||o.from==e&&a.type=="bookmark"&&(!t||o.marker.insertLeft)){var f=o.from==null||(a.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new Be(a,f?null:o.from-e,o.to==null?null:o.to-e))}}}return i}function _e(r,e){if(e.full){return null}var t=oe(r,e.from.line)&&Zr(r,e.from.line).markedSpans;var i=oe(r,e.to.line)&&Zr(r,e.to.line).markedSpans;if(!t&&!i){return null}var n=e.from.ch,o=e.to.ch,a=fe(e.from,e.to)==0;var u=Ue(t,n,a);var f=Pe(i,o,a);var l=e.text.length==1,s=X(e.text).length+(l?n:0);if(u){for(var c=0;c<u.length;++c){var d=u[c];if(d.to==null){var h=Re(f,d.marker);if(!h){d.to=n}else if(l){d.to=h.to==null?null:h.to+s}}}}if(f){for(var v=0;v<f.length;++v){var m=f[v];if(m.to!=null){m.to+=s}if(m.from==null){var p=Re(u,m.marker);if(!p){m.from=s;if(l){(u||(u=[])).push(m)}}}else{m.from+=s;if(l){(u||(u=[])).push(m)}}}}if(u){u=qe(u)}if(f&&f!=u){f=qe(f)}var g=[u];if(!l){var b=e.text.length-2,w;if(b>0&&u){for(var k=0;k<u.length;++k){if(u[k].to==null){(w||(w=[])).push(new Be(u[k].marker,null,null))}}}for(var y=0;y<b;++y){g.push(w)}g.push(f)}return g}function qe(r){for(var e=0;e<r.length;++e){var t=r[e];if(t.from!=null&&t.from==t.to&&t.marker.clearWhenEmpty!==false){r.splice(e--,1)}}if(!r.length){return null}return r}function We(r,e,t){var i=null;r.iter(e.line,t.line+1,(function(r){if(r.markedSpans){for(var e=0;e<r.markedSpans.length;++e){var t=r.markedSpans[e].marker;if(t.readOnly&&(!i||W(i,t)==-1)){(i||(i=[])).push(t)}}}}));if(!i){return null}var n=[{from:e,to:t}];for(var o=0;o<i.length;++o){var a=i[o],u=a.find(0);for(var f=0;f<n.length;++f){var l=n[f];if(fe(l.to,u.from)<0||fe(l.from,u.to)>0){continue}var s=[f,1],c=fe(l.from,u.from),d=fe(l.to,u.to);if(c<0||!a.inclusiveLeft&&!c){s.push({from:l.from,to:u.from})}if(d>0||!a.inclusiveRight&&!d){s.push({from:u.to,to:l.to})}n.splice.apply(n,s);f+=s.length-3}}return n}function $e(r){var e=r.markedSpans;if(!e){return}for(var t=0;t<e.length;++t){e[t].marker.detachLine(r)}r.markedSpans=null}function Ge(r,e){if(!e){return}for(var t=0;t<e.length;++t){e[t].marker.attachLine(r)}r.markedSpans=e}function He(r){return r.inclusiveLeft?-1:0}function Ke(r){return r.inclusiveRight?1:0}function Ve(r,e){var t=r.lines.length-e.lines.length;if(t!=0){return t}var i=r.find(),n=e.find();var o=fe(i.from,n.from)||He(r)-He(e);if(o){return-o}var a=fe(i.to,n.to)||Ke(r)-Ke(e);if(a){return a}return e.id-r.id}function Qe(r,e){var t=ze&&r.markedSpans,i;if(t){for(var n=void 0,o=0;o<t.length;++o){n=t[o];if(n.marker.collapsed&&(e?n.from:n.to)==null&&(!i||Ve(i,n.marker)<0)){i=n.marker}}}return i}function Je(r){return Qe(r,true)}function Ye(r){return Qe(r,false)}function Xe(r,e){var t=ze&&r.markedSpans,i;if(t){for(var n=0;n<t.length;++n){var o=t[n];if(o.marker.collapsed&&(o.from==null||o.from<e)&&(o.to==null||o.to>e)&&(!i||Ve(i,o.marker)<0)){i=o.marker}}}return i}function Ze(r,e,t,i,n){var o=Zr(r,e);var a=ze&&o.markedSpans;if(a){for(var u=0;u<a.length;++u){var f=a[u];if(!f.marker.collapsed){continue}var l=f.marker.find(0);var s=fe(l.from,t)||He(f.marker)-He(n);var c=fe(l.to,i)||Ke(f.marker)-Ke(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(f.marker.inclusiveRight&&n.inclusiveLeft?fe(l.to,t)>=0:fe(l.to,t)>0)||s>=0&&(f.marker.inclusiveRight&&n.inclusiveLeft?fe(l.from,i)<=0:fe(l.from,i)<0)){return true}}}}function rt(r){var e;while(e=Je(r)){r=e.find(-1,true).line}return r}function et(r){var e;while(e=Ye(r)){r=e.find(1,true).line}return r}function tt(r){var e,t;while(e=Ye(r)){r=e.find(1,true).line;(t||(t=[])).push(r)}return t}function it(r,e){var t=Zr(r,e),i=rt(t);if(t==i){return e}return ie(i)}function nt(r,e){if(e>r.lastLine()){return e}var t=Zr(r,e),i;if(!ot(r,t)){return e}while(i=Ye(t)){t=i.find(1,true).line}return ie(t)+1}function ot(r,e){var t=ze&&e.markedSpans;if(t){for(var i=void 0,n=0;n<t.length;++n){i=t[n];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&at(r,e,i)){return true}}}}function at(r,e,t){if(t.to==null){var i=t.marker.find(1,true);return at(r,i.line,Re(i.line.markedSpans,t.marker))}if(t.marker.inclusiveRight&&t.to==e.text.length){return true}for(var n=void 0,o=0;o<e.markedSpans.length;++o){n=e.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==t.to&&(n.to==null||n.to!=t.from)&&(n.marker.inclusiveLeft||t.marker.inclusiveRight)&&at(r,e,n)){return true}}}function ut(r){r=rt(r);var e=0,t=r.parent;for(var i=0;i<t.lines.length;++i){var n=t.lines[i];if(n==r){break}else{e+=n.height}}for(var o=t.parent;o;t=o,o=t.parent){for(var a=0;a<o.children.length;++a){var u=o.children[a];if(u==t){break}else{e+=u.height}}}return e}function ft(r){if(r.height==0){return 0}var e=r.text.length,t,i=r;while(t=Je(i)){var n=t.find(0,true);i=n.from.line;e+=n.from.ch-n.to.ch}i=r;while(t=Ye(i)){var o=t.find(0,true);e-=i.text.length-o.from.ch;i=o.to.line;e+=i.text.length-o.to.ch}return e}function lt(r){var e=r.display,t=r.doc;e.maxLine=Zr(t,t.first);e.maxLineLength=ft(e.maxLine);e.maxLineChanged=true;t.iter((function(r){var t=ft(r);if(t>e.maxLineLength){e.maxLineLength=t;e.maxLine=r}}))}var st=function(r,e,t){this.text=r;Ge(this,e);this.height=t?t(this):1};st.prototype.lineNo=function(){return ie(this)};Mr(st);function ct(r,e,t,i){r.text=e;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}$e(r);Ge(r,t);var n=i?i(r):1;if(n!=r.height){te(r,n)}}function dt(r){r.parent=null;$e(r)}var ht={},vt={};function mt(r,e){if(!r||/^\s*$/.test(r)){return null}var t=e.addModeClass?vt:ht;return t[r]||(t[r]=r.replace(/\S+/g,"cm-$&"))}function pt(r,e){var t=E("span",null,null,f?"padding-right: .1px":null);var i={pre:E("pre",[t],"CodeMirror-line"),content:t,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};e.measure={};for(var n=0;n<=(e.rest?e.rest.length:0);n++){var o=n?e.rest[n-1]:e.line,a=void 0;i.pos=0;i.addToken=bt;if(Br(r.display.measure)&&(a=mr(o,r.doc.direction))){i.addToken=kt(i.addToken,a)}i.map=[];var u=e!=r.display.externalMeasured&&ie(o);xt(o,i,ke(r,o,u));if(o.styleClasses){if(o.styleClasses.bgClass){i.bgClass=B(o.styleClasses.bgClass,i.bgClass||"")}if(o.styleClasses.textClass){i.textClass=B(o.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(jr(r.display.measure)))}if(n==0){e.measure.map=i.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(i.map);(e.measure.caches||(e.measure.caches=[])).push({})}}if(f){var l=i.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,e.line,i.pre);if(i.pre.className){i.textClass=B(i.pre.className,i.textClass||"")}return i}function gt(r){var e=N("span","•","cm-invalidchar");e.title="\\u"+r.charCodeAt(0).toString(16);e.setAttribute("aria-label",e.title);return e}function bt(r,e,t,i,n,o,f){if(!e){return}var l=r.splitSpaces?wt(e,r.trailingSpace):e;var s=r.cm.state.specialChars,c=false;var d;if(!s.test(e)){r.col+=e.length;d=document.createTextNode(l);r.map.push(r.pos,r.pos+e.length,d);if(a&&u<9){c=true}r.pos+=e.length}else{d=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var v=s.exec(e);var m=v?v.index-h:e.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(a&&u<9){d.appendChild(N("span",[p]))}else{d.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!v){break}h+=m+1;var g=void 0;if(v[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=d.appendChild(N("span",Y(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(v[0]=="\r"||v[0]=="\n"){g=d.appendChild(N("span",v[0]=="\r"?"␍":"␤","cm-invalidchar"));g.setAttribute("cm-text",v[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(v[0]);g.setAttribute("cm-text",v[0]);if(a&&u<9){d.appendChild(N("span",[g]))}else{d.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(e.length-1)==32;if(t||i||n||c||o||f){var k=t||"";if(i){k+=i}if(n){k+=n}var y=N("span",[d],k,o);if(f){for(var x in f){if(f.hasOwnProperty(x)&&x!="style"&&x!="class"){y.setAttribute(x,f[x])}}}return r.content.appendChild(y)}r.content.appendChild(d)}function wt(r,e){if(r.length>1&&!/ /.test(r)){return r}var t=e,i="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&t&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}i+=o;t=o==" "}return i}function kt(r,e){return function(t,i,n,o,a,u,f){n=n?n+" cm-force-border":"cm-force-border";var l=t.pos,s=l+i.length;for(;;){var c=void 0;for(var d=0;d<e.length;d++){c=e[d];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(t,i,n,o,a,u,f)}r(t,i.slice(0,c.to-l),n,o,null,u,f);o=null;i=i.slice(c.to-l);l=c.to}}}function yt(r,e,t,i){var n=!i&&t.widgetNode;if(n){r.map.push(r.pos,r.pos+e,n)}if(!i&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",t.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=e;r.trailingSpace=false}function xt(r,e,t){var i=r.markedSpans,n=r.text,o=0;if(!i){for(var a=1;a<t.length;a+=2){e.addToken(e,n.slice(o,o=t[a]),mt(t[a+1],e.cm.options))}return}var u=n.length,f=0,l=1,s="",c,d;var h=0,v,m,p,g,b;for(;;){if(h==f){v=m=p=d="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var y=0;y<i.length;++y){var x=i[y],C=x.marker;if(C.type=="bookmark"&&x.from==f&&C.widgetNode){w.push(C)}else if(x.from<=f&&(x.to==null||x.to>f||C.collapsed&&x.to==f&&x.from==f)){if(x.to!=null&&x.to!=f&&h>x.to){h=x.to;m=""}if(C.className){v+=" "+C.className}if(C.css){d=(d?d+";":"")+C.css}if(C.startStyle&&x.from==f){p+=" "+C.startStyle}if(C.endStyle&&x.to==h){(k||(k=[])).push(C.endStyle,x.to)}if(C.title){(b||(b={})).title=C.title}if(C.attributes){for(var M in C.attributes){(b||(b={}))[M]=C.attributes[M]}}if(C.collapsed&&(!g||Ve(g.marker,C)<0)){g=x}}else if(x.from>f&&h>x.from){h=x.from}}if(k){for(var A=0;A<k.length;A+=2){if(k[A+1]==h){m+=" "+k[A]}}}if(!g||g.from==f){for(var L=0;L<w.length;++L){yt(e,0,w[L])}}if(g&&(g.from||0)==f){yt(e,(g.to==null?u+1:g.to)-f,g.marker,g.from==null);if(g.to==null){return}if(g.to==f){g=false}}}if(f>=u){break}var S=Math.min(u,h);while(true){if(s){var T=f+s.length;if(!g){var N=T>S?s.slice(0,S-f):s;e.addToken(e,N,c?c+v:v,p,f+N.length==h?m:"",d,b)}if(T>=S){s=s.slice(S-f);f=S;break}f=T;p=""}s=n.slice(o,o=t[l++]);c=mt(t[l++],e.cm.options)}}}function Ct(r,e,t){this.line=e;this.rest=tt(e);this.size=this.rest?ie(X(this.rest))-t+1:1;this.node=this.text=null;this.hidden=ot(r,e)}function Mt(r,e,t){var i=[],n;for(var o=e;o<t;o=n){var a=new Ct(r.doc,Zr(r.doc,o),o);n=o+a.size;i.push(a)}return i}var At=null;function Lt(r){if(At){At.ops.push(r)}else{r.ownsGroup=At={ops:[r],delayedCallbacks:[]}}}function St(r){var e=r.delayedCallbacks,t=0;do{for(;t<e.length;t++){e[t].call(null)}for(var i=0;i<r.ops.length;i++){var n=r.ops[i];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(t<e.length)}function Tt(r,e){var t=r.ownsGroup;if(!t){return}try{St(t)}finally{At=null;e(t)}}var Nt=null;function Et(r,e){var t=br(r,e);if(!t.length){return}var i=Array.prototype.slice.call(arguments,2),n;if(At){n=At.delayedCallbacks}else if(Nt){n=Nt}else{n=Nt=[];setTimeout(Dt,0)}var o=function(r){n.push((function(){return t[r].apply(null,i)}))};for(var a=0;a<t.length;++a)o(a)}function Dt(){var r=Nt;Nt=null;for(var e=0;e<r.length;++e){r[e]()}}function zt(r,e,t,i){for(var n=0;n<e.changes.length;n++){var o=e.changes[n];if(o=="text"){Rt(r,e)}else if(o=="gutter"){Ot(r,e,t,i)}else if(o=="class"){Ft(r,e)}else if(o=="widget"){Ut(r,e,i)}}e.changes=null}function jt(r){if(r.node==r.text){r.node=N("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(a&&u<8){r.node.style.zIndex=2}}return r.node}function It(r,e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t){t+=" CodeMirror-linebackground"}if(e.background){if(t){e.background.className=t}else{e.background.parentNode.removeChild(e.background);e.background=null}}else if(t){var i=jt(e);e.background=i.insertBefore(N("div",null,t),i.firstChild);r.display.input.setUneditable(e.background)}}function Bt(r,e){var t=r.display.externalMeasured;if(t&&t.line==e.line){r.display.externalMeasured=null;e.measure=t.measure;return t.built}return pt(r,e)}function Rt(r,e){var t=e.text.className;var i=Bt(r,e);if(e.text==e.node){e.node=i.pre}e.text.parentNode.replaceChild(i.pre,e.text);e.text=i.pre;if(i.bgClass!=e.bgClass||i.textClass!=e.textClass){e.bgClass=i.bgClass;e.textClass=i.textClass;Ft(r,e)}else if(t){e.text.className=t}}function Ft(r,e){It(r,e);if(e.line.wrapClass){jt(e).className=e.line.wrapClass}else if(e.node!=e.text){e.node.className=""}var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Ot(r,e,t,i){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}if(e.gutterBackground){e.node.removeChild(e.gutterBackground);e.gutterBackground=null}if(e.line.gutterClass){var n=jt(e);e.gutterBackground=N("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");r.display.input.setUneditable(e.gutterBackground);n.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(r.options.lineNumbers||o){var a=jt(e);var u=e.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");u.setAttribute("aria-hidden","true");r.display.input.setUneditable(u);a.insertBefore(u,e.text);if(e.line.gutterClass){u.className+=" "+e.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){e.lineNumber=u.appendChild(N("div",ae(r.options,t),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var f=0;f<r.display.gutterSpecs.length;++f){var l=r.display.gutterSpecs[f].className,s=o.hasOwnProperty(l)&&o[l];if(s){u.appendChild(N("div",[s],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}}}function Ut(r,e,t){if(e.alignable){e.alignable=null}var i=A("CodeMirror-linewidget");for(var n=e.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(i.test(n.className)){e.node.removeChild(n)}}_t(r,e,t)}function Pt(r,e,t,i){var n=Bt(r,e);e.text=e.node=n.pre;if(n.bgClass){e.bgClass=n.bgClass}if(n.textClass){e.textClass=n.textClass}Ft(r,e);Ot(r,e,t,i);_t(r,e,i);return e.node}function _t(r,e,t){qt(r,e.line,e,t,true);if(e.rest){for(var i=0;i<e.rest.length;i++){qt(r,e.rest[i],e,t,false)}}}function qt(r,e,t,i,n){if(!e.widgets){return}var o=jt(t);for(var a=0,u=e.widgets;a<u.length;++a){var f=u[a],l=N("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));if(!f.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}Wt(f,l,t,i);r.display.input.setUneditable(l);if(n&&f.above){o.insertBefore(l,t.gutter||t.text)}else{o.appendChild(l)}Et(f,"redraw")}}function Wt(r,e,t,i){if(r.noHScroll){(t.alignable||(t.alignable=[])).push(e);var n=i.wrapperWidth;e.style.left=i.fixedPos+"px";if(!r.coverGutter){n-=i.gutterTotalWidth;e.style.paddingLeft=i.gutterTotalWidth+"px"}e.style.width=n+"px"}if(r.coverGutter){e.style.zIndex=5;e.style.position="relative";if(!r.noHScroll){e.style.marginLeft=-i.gutterTotalWidth+"px"}}}function $t(r){if(r.height!=null){return r.height}var e=r.doc.cm;if(!e){return 0}if(!z(document.body,r.node)){var t="position: relative;";if(r.coverGutter){t+="margin-left: -"+e.display.gutters.offsetWidth+"px;"}if(r.noHScroll){t+="width: "+e.display.wrapper.clientWidth+"px;"}T(e.display.measure,N("div",[r.node],null,t))}return r.height=r.node.parentNode.offsetHeight}function Gt(r,e){for(var t=Nr(e);t!=r.wrapper;t=t.parentNode){if(!t||t.nodeType==1&&t.getAttribute("cm-ignore-events")=="true"||t.parentNode==r.sizer&&t!=r.mover){return true}}}function Ht(r){return r.lineSpace.offsetTop}function Kt(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Vt(r){if(r.cachedPaddingH){return r.cachedPaddingH}var e=T(r.measure,N("pre","x","CodeMirror-line-like"));var t=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle;var i={left:parseInt(t.paddingLeft),right:parseInt(t.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){r.cachedPaddingH=i}return i}function Qt(r){return $-r.display.nativeBarWidth}function Jt(r){return r.display.scroller.clientWidth-Qt(r)-r.display.barWidth}function Yt(r){return r.display.scroller.clientHeight-Qt(r)-r.display.barHeight}function Xt(r,e,t){var i=r.options.lineWrapping;var n=i&&Jt(r);if(!e.measure.heights||i&&e.measure.width!=n){var o=e.measure.heights=[];if(i){e.measure.width=n;var a=e.text.firstChild.getClientRects();for(var u=0;u<a.length-1;u++){var f=a[u],l=a[u+1];if(Math.abs(f.bottom-l.bottom)>2){o.push((f.bottom+l.top)/2-t.top)}}}o.push(t.bottom-t.top)}}function Zt(r,e,t){if(r.line==e){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var i=0;i<r.rest.length;i++){if(r.rest[i]==e){return{map:r.measure.maps[i],cache:r.measure.caches[i]}}}for(var n=0;n<r.rest.length;n++){if(ie(r.rest[n])>t){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function ri(r,e){e=rt(e);var t=ie(e);var i=r.display.externalMeasured=new Ct(r.doc,e,t);i.lineN=t;var n=i.built=pt(r,i);i.text=n.pre;T(r.display.lineMeasure,n.pre);return i}function ei(r,e,t,i){return ni(r,ii(r,e),t,i)}function ti(r,e){if(e>=r.display.viewFrom&&e<r.display.viewTo){return r.display.view[Fi(r,e)]}var t=r.display.externalMeasured;if(t&&e>=t.lineN&&e<t.lineN+t.size){return t}}function ii(r,e){var t=ie(e);var i=ti(r,t);if(i&&!i.text){i=null}else if(i&&i.changes){zt(r,i,t,zi(r));r.curOp.forceUpdate=true}if(!i){i=ri(r,e)}var n=Zt(i,e,t);return{line:e,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ni(r,e,t,i,n){if(e.before){t=-1}var o=t+(i||""),a;if(e.cache.hasOwnProperty(o)){a=e.cache[o]}else{if(!e.rect){e.rect=e.view.text.getBoundingClientRect()}if(!e.hasHeights){Xt(r,e.view,e.rect);e.hasHeights=true}a=fi(r,e,t,i);if(!a.bogus){e.cache[o]=a}}return{left:a.left,right:a.right,top:n?a.rtop:a.top,bottom:n?a.rbottom:a.bottom}}var oi={left:0,right:0,top:0,bottom:0};function ai(r,e,t){var i,n,o,a,u,f;for(var l=0;l<r.length;l+=3){u=r[l];f=r[l+1];if(e<u){n=0;o=1;a="left"}else if(e<f){n=e-u;o=n+1}else if(l==r.length-3||e==f&&r[l+3]>e){o=f-u;n=o-1;if(e>=f){a="right"}}if(n!=null){i=r[l+2];if(u==f&&t==(i.insertLeft?"left":"right")){a=t}if(t=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){i=r[(l-=3)+2];a="left"}}if(t=="right"&&n==f-u){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){i=r[(l+=3)+2];a="right"}}break}}return{node:i,start:n,end:o,collapse:a,coverStart:u,coverEnd:f}}function ui(r,e){var t=oi;if(e=="left"){for(var i=0;i<r.length;i++){if((t=r[i]).left!=t.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((t=r[n]).left!=t.right){break}}}return t}function fi(r,e,t,i){var n=ai(e.map,t,i);var o=n.node,f=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var d=0;d<4;d++){while(f&&fr(e.line.text.charAt(n.coverStart+f))){--f}while(n.coverStart+l<n.coverEnd&&fr(e.line.text.charAt(n.coverStart+l))){++l}if(a&&u<9&&f==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=ui(D(o,f,l).getClientRects(),i)}if(c.left||c.right||f==0){break}l=f;f=f-1;s="right"}if(a&&u<11){c=li(r.display.measure,c)}}else{if(f>0){s=i="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[i=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(a&&u<9&&!f&&(!c||!c.left&&!c.right)){var v=o.parentNode.getClientRects()[0];if(v){c={left:v.left,right:v.left+Di(r.display),top:v.top,bottom:v.bottom}}else{c=oi}}var m=c.top-e.rect.top,p=c.bottom-e.rect.top;var g=(m+p)/2;var b=e.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,y=b[w];var x={left:(s=="right"?c.right:c.left)-e.rect.left,right:(s=="left"?c.left:c.right)-e.rect.left,top:k,bottom:y};if(!c.left&&!c.right){x.bogus=true}if(!r.options.singleCursorHeightPerLine){x.rtop=m;x.rbottom=p}return x}function li(r,e){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pr(r)){return e}var t=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*t,right:e.right*t,top:e.top*i,bottom:e.bottom*i}}function si(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var e=0;e<r.rest.length;e++){r.measure.caches[e]={}}}}}function ci(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var e=0;e<r.display.view.length;e++){si(r.display.view[e])}}function di(r){ci(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function hi(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function vi(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function mi(r){var e=rt(r);var t=e.widgets;var i=0;if(t){for(var n=0;n<t.length;++n){if(t[n].above){i+=$t(t[n])}}}return i}function pi(r,e,t,i,n){if(!n){var o=mi(e);t.top+=o;t.bottom+=o}if(i=="line"){return t}if(!i){i="local"}var a=ut(e);if(i=="local"){a+=Ht(r.display)}else{a-=r.display.viewOffset}if(i=="page"||i=="window"){var u=r.display.lineSpace.getBoundingClientRect();a+=u.top+(i=="window"?0:vi(F(r)));var f=u.left+(i=="window"?0:hi(F(r)));t.left+=f;t.right+=f}t.top+=a;t.bottom+=a;return t}function gi(r,e,t){if(t=="div"){return e}var i=e.left,n=e.top;if(t=="page"){i-=hi(F(r));n-=vi(F(r))}else if(t=="local"||!t){var o=r.display.sizer.getBoundingClientRect();i+=o.left;n+=o.top}var a=r.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:n-a.top}}function bi(r,e,t,i,n){if(!i){i=Zr(r.doc,e.line)}return pi(r,i,ei(r,i,e.ch,n),t)}function wi(r,e,t,i,n,o){i=i||Zr(r.doc,e.line);if(!n){n=ii(r,i)}function a(e,a){var u=ni(r,n,e,a?"right":"left",o);if(a){u.left=u.right}else{u.right=u.left}return pi(r,i,u,t)}var u=mr(i,r.doc.direction),f=e.ch,l=e.sticky;if(f>=i.text.length){f=i.text.length;l="before"}else if(f<=0){f=0;l="after"}if(!u){return a(l=="before"?f-1:f,l=="before")}function s(r,e,t){var i=u[e],n=i.level==1;return a(t?r-1:r,n!=t)}var c=hr(u,f,l);var d=dr;var h=s(f,c,l=="before");if(d!=null){h.other=s(f,d,l!="before")}return h}function ki(r,e){var t=0;e=ve(r.doc,e);if(!r.options.lineWrapping){t=Di(r.display)*e.ch}var i=Zr(r.doc,e.line);var n=ut(i)+Ht(r.display);return{left:t,right:t,top:n,bottom:n+i.height}}function yi(r,e,t,i,n){var o=ue(r,e,t);o.xRel=n;if(i){o.outside=i}return o}function xi(r,e,t){var i=r.doc;t+=r.display.viewOffset;if(t<0){return yi(i.first,0,null,-1,-1)}var n=ne(i,t),o=i.first+i.size-1;if(n>o){return yi(i.first+i.size-1,Zr(i,o).text.length,null,1,1)}if(e<0){e=0}var a=Zr(i,n);for(;;){var u=Li(r,a,n,e,t);var f=Xe(a,u.ch+(u.xRel>0||u.outside>0?1:0));if(!f){return u}var l=f.find(1);if(l.line==n){return l}a=Zr(i,n=l.line)}}function Ci(r,e,t,i){i-=mi(e);var n=e.text.length;var o=sr((function(e){return ni(r,t,e-1).bottom<=i}),n,0);n=sr((function(e){return ni(r,t,e).top>i}),o,n);return{begin:o,end:n}}function Mi(r,e,t,i){if(!t){t=ii(r,e)}var n=pi(r,e,ni(r,t,i),"line").top;return Ci(r,e,t,n)}function Ai(r,e,t,i){return r.bottom<=t?false:r.top>t?true:(i?r.left:r.right)>e}function Li(r,e,t,i,n){n-=ut(e);var o=ii(r,e);var a=mi(e);var u=0,f=e.text.length,l=true;var s=mr(e,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ti:Si)(r,e,t,o,s,i,n);l=c.level!=1;u=l?c.from:c.to-1;f=l?c.to:c.from-1}var d=null,h=null;var v=sr((function(e){var t=ni(r,o,e);t.top+=a;t.bottom+=a;if(!Ai(t,i,n,false)){return false}if(t.top<=n&&t.left<=i){d=e;h=t}return true}),u,f);var m,p,g=false;if(h){var b=i-h.left<h.right-i,w=b==l;v=d+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(v==f||v==u)){v++}p=v==0?"after":v==e.text.length?"before":ni(r,o,v-(l?1:0)).bottom+a<=n==l?"after":"before";var k=wi(r,ue(t,v,p),"line",e,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}v=lr(e.text,v,1);return yi(t,v,p,g,i-m)}function Si(r,e,t,i,n,o,a){var u=sr((function(u){var f=n[u],l=f.level!=1;return Ai(wi(r,ue(t,l?f.to:f.from,l?"before":"after"),"line",e,i),o,a,true)}),0,n.length-1);var f=n[u];if(u>0){var l=f.level!=1;var s=wi(r,ue(t,l?f.from:f.to,l?"after":"before"),"line",e,i);if(Ai(s,o,a,true)&&s.top>a){f=n[u-1]}}return f}function Ti(r,e,t,i,n,o,a){var u=Ci(r,e,i,a);var f=u.begin;var l=u.end;if(/\s/.test(e.text.charAt(l-1))){l--}var s=null,c=null;for(var d=0;d<n.length;d++){var h=n[d];if(h.from>=l||h.to<=f){continue}var v=h.level!=1;var m=ni(r,i,v?Math.min(l,h.to)-1:Math.max(f,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<f){s={from:f,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ni;function Ei(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ni==null){Ni=N("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e){Ni.appendChild(document.createTextNode("x"));Ni.appendChild(N("br"))}Ni.appendChild(document.createTextNode("x"))}T(r.measure,Ni);var t=Ni.offsetHeight/50;if(t>3){r.cachedTextHeight=t}S(r.measure);return t||1}function Di(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var e=N("span","xxxxxxxxxx");var t=N("pre",[e],"CodeMirror-line-like");T(r.measure,t);var i=e.getBoundingClientRect(),n=(i.right-i.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function zi(r){var e=r.display,t={},i={};var n=e.gutters.clientLeft;for(var o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var u=r.display.gutterSpecs[a].className;t[u]=o.offsetLeft+o.clientLeft+n;i[u]=o.clientWidth}return{fixedPos:ji(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:t,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function ji(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Ii(r){var e=Ei(r.display),t=r.options.lineWrapping;var i=t&&Math.max(5,r.display.scroller.clientWidth/Di(r.display)-3);return function(n){if(ot(r.doc,n)){return 0}var o=0;if(n.widgets){for(var a=0;a<n.widgets.length;a++){if(n.widgets[a].height){o+=n.widgets[a].height}}}if(t){return o+(Math.ceil(n.text.length/i)||1)*e}else{return o+e}}}function Bi(r){var e=r.doc,t=Ii(r);e.iter((function(r){var e=t(r);if(e!=r.height){te(r,e)}}))}function Ri(r,e,t,i){var n=r.display;if(!t&&Nr(e).getAttribute("cm-not-content")=="true"){return null}var o,a,u=n.lineSpace.getBoundingClientRect();try{o=e.clientX-u.left;a=e.clientY-u.top}catch(r){return null}var f=xi(r,o,a),l;if(i&&f.xRel>0&&(l=Zr(r.doc,f.line).text).length==f.ch){var s=_(l,l.length,r.options.tabSize)-l.length;f=ue(f.line,Math.max(0,Math.round((o-Vt(r.display).left)/Di(r.display))-s))}return f}function Fi(r,e){if(e>=r.display.viewTo){return null}e-=r.display.viewFrom;if(e<0){return null}var t=r.display.view;for(var i=0;i<t.length;i++){e-=t[i].size;if(e<0){return i}}}function Oi(r,e,t,i){if(e==null){e=r.doc.first}if(t==null){t=r.doc.first+r.doc.size}if(!i){i=0}var n=r.display;if(i&&t<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>e)){n.updateLineNumbers=e}r.curOp.viewChanged=true;if(e>=n.viewTo){if(ze&&it(r.doc,e)<n.viewTo){Pi(r)}}else if(t<=n.viewFrom){if(ze&&nt(r.doc,t+i)>n.viewFrom){Pi(r)}else{n.viewFrom+=i;n.viewTo+=i}}else if(e<=n.viewFrom&&t>=n.viewTo){Pi(r)}else if(e<=n.viewFrom){var o=_i(r,t,t+i,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=i}else{Pi(r)}}else if(t>=n.viewTo){var a=_i(r,e,e,-1);if(a){n.view=n.view.slice(0,a.index);n.viewTo=a.lineN}else{Pi(r)}}else{var u=_i(r,e,e,-1);var f=_i(r,t,t+i,1);if(u&&f){n.view=n.view.slice(0,u.index).concat(Mt(r,u.lineN,f.lineN)).concat(n.view.slice(f.index));n.viewTo+=i}else{Pi(r)}}var l=n.externalMeasured;if(l){if(t<l.lineN){l.lineN+=i}else if(e<l.lineN+l.size){n.externalMeasured=null}}}function Ui(r,e,t){r.curOp.viewChanged=true;var i=r.display,n=r.display.externalMeasured;if(n&&e>=n.lineN&&e<n.lineN+n.size){i.externalMeasured=null}if(e<i.viewFrom||e>=i.viewTo){return}var o=i.view[Fi(r,e)];if(o.node==null){return}var a=o.changes||(o.changes=[]);if(W(a,t)==-1){a.push(t)}}function Pi(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function _i(r,e,t,i){var n=Fi(r,e),o,a=r.display.view;if(!ze||t==r.doc.first+r.doc.size){return{index:n,lineN:t}}var u=r.display.viewFrom;for(var f=0;f<n;f++){u+=a[f].size}if(u!=e){if(i>0){if(n==a.length-1){return null}o=u+a[n].size-e;n++}else{o=u-e}e+=o;t+=o}while(it(r.doc,t)!=t){if(n==(i<0?0:a.length-1)){return null}t+=i*a[n-(i<0?1:0)].size;n+=i}return{index:n,lineN:t}}function qi(r,e,t){var i=r.display,n=i.view;if(n.length==0||e>=i.viewTo||t<=i.viewFrom){i.view=Mt(r,e,t);i.viewFrom=e}else{if(i.viewFrom>e){i.view=Mt(r,e,i.viewFrom).concat(i.view)}else if(i.viewFrom<e){i.view=i.view.slice(Fi(r,e))}i.viewFrom=e;if(i.viewTo<t){i.view=i.view.concat(Mt(r,i.viewTo,t))}else if(i.viewTo>t){i.view=i.view.slice(0,Fi(r,t))}}i.viewTo=t}function Wi(r){var e=r.display.view,t=0;for(var i=0;i<e.length;i++){var n=e[i];if(!n.hidden&&(!n.node||n.changes)){++t}}return t}function $i(r){r.display.input.showSelection(r.display.input.prepareSelection())}function Gi(r,e){if(e===void 0)e=true;var t=r.doc,i={};var n=i.cursors=document.createDocumentFragment();var o=i.selection=document.createDocumentFragment();var a=r.options.$customCursor;if(a){e=true}for(var u=0;u<t.sel.ranges.length;u++){if(!e&&u==t.sel.primIndex){continue}var f=t.sel.ranges[u];if(f.from().line>=r.display.viewTo||f.to().line<r.display.viewFrom){continue}var l=f.empty();if(a){var s=a(r,f);if(s){Hi(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){Hi(r,f.head,n)}if(!l){Vi(r,f,o)}}return i}function Hi(r,e,t){var i=wi(r,e,"div",null,null,!r.options.singleCursorHeightPerLine);var n=t.appendChild(N("div"," ","CodeMirror-cursor"));n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.height=Math.max(0,i.bottom-i.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=bi(r,e,"div",null,null);var a=o.right-o.left;n.style.width=(a>0?a:r.defaultCharWidth())+"px"}if(i.other){var u=t.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="";u.style.left=i.other.left+"px";u.style.top=i.other.top+"px";u.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Ki(r,e){return r.top-e.top||r.left-e.left}function Vi(r,e,t){var i=r.display,n=r.doc;var o=document.createDocumentFragment();var a=Vt(r.display),u=a.left;var f=Math.max(i.sizerWidth,Jt(r)-i.sizer.offsetLeft)-a.right;var l=n.direction=="ltr";function s(r,e,t,i){if(e<0){e=0}e=Math.round(e);i=Math.round(i);o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+e+"px; width: "+(t==null?f-r:t)+"px;\n height: "+(i-e)+"px"))}function c(e,t,i){var o=Zr(n,e);var a=o.text.length;var c,d;function h(t,i){return bi(r,ue(e,t),"div",o,i)}function v(e,t,i){var n=Mi(r,o,null,e);var a=t=="ltr"==(i=="after")?"left":"right";var u=i=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(u,a)[a]}var m=mr(o,n.direction);cr(m,t||0,i==null?a:i,(function(r,e,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(e-1,p?"right":"left");var w=t==null&&r==0,k=i==null&&e==a;var y=o==0,x=!m||o==m.length-1;if(b.top-g.top<=3){var C=(l?w:k)&&y;var M=(l?k:w)&&x;var A=C?u:(p?g:b).left;var L=M?f:(p?b:g).right;s(A,g.top,L-A,g.bottom)}else{var S,T,N,E;if(p){S=l&&w&&y?u:g.left;T=l?f:v(r,n,"before");N=l?u:v(e,n,"after");E=l&&k&&x?f:b.right}else{S=!l?u:v(r,n,"before");T=!l&&w&&y?f:g.right;N=!l&&k&&x?u:b.left;E=!l?f:v(e,n,"after")}s(S,g.top,T-S,g.bottom);if(g.bottom<b.top){s(u,g.bottom,null,b.top)}s(N,b.top,E-N,b.bottom)}if(!c||Ki(g,c)<0){c=g}if(Ki(b,c)<0){c=b}if(!d||Ki(g,d)<0){d=g}if(Ki(b,d)<0){d=b}}));return{start:c,end:d}}var d=e.from(),h=e.to();if(d.line==h.line){c(d.line,d.ch,h.ch)}else{var v=Zr(n,d.line),m=Zr(n,h.line);var p=rt(v)==rt(m);var g=c(d.line,d.ch,p?v.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(u,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(u,g.bottom,null,b.top)}}t.appendChild(o)}function Qi(r){if(!r.state.focused){return}var e=r.display;clearInterval(e.blinker);var t=true;e.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){e.blinker=setInterval((function(){if(!r.hasFocus()){Zi(r)}e.cursorDiv.style.visibility=(t=!t)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){e.cursorDiv.style.visibility="hidden"}}function Ji(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){Xi(r)}}}function Yi(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Zi(r)}}}),100)}function Xi(r,e){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,e);r.state.focused=true;I(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(f){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Qi(r)}function Zi(r,e){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,e);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 e=r.display;var t=e.lineDiv.offsetTop;var i=Math.max(0,e.scroller.getBoundingClientRect().top);var n=e.lineDiv.getBoundingClientRect().top;var o=0;for(var f=0;f<e.view.length;f++){var l=e.view[f],s=r.options.lineWrapping;var c=void 0,d=0;if(l.hidden){continue}n+=l.line.height;if(a&&u<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-t;t=h}else{var v=l.node.getBoundingClientRect();c=v.bottom-v.top;if(!s&&l.text.firstChild){d=l.text.firstChild.getBoundingClientRect().right-v.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<i){o-=m}te(l.line,c);en(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){en(l.rest[p])}}}if(d>r.display.sizerWidth){var g=Math.ceil(d/Di(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){e.scroller.scrollTop+=o}}function en(r){if(r.widgets){for(var e=0;e<r.widgets.length;++e){var t=r.widgets[e],i=t.node.parentNode;if(i){t.height=i.offsetHeight}}}}function tn(r,e,t){var i=t&&t.top!=null?Math.max(0,t.top):r.scroller.scrollTop;i=Math.floor(i-Ht(r));var n=t&&t.bottom!=null?t.bottom:i+r.wrapper.clientHeight;var o=ne(e,i),a=ne(e,n);if(t&&t.ensure){var u=t.ensure.from.line,f=t.ensure.to.line;if(u<o){o=u;a=ne(e,ut(Zr(e,u))+r.wrapper.clientHeight)}else if(Math.min(f,e.lastLine())>=a){o=ne(e,ut(Zr(e,f))-r.wrapper.clientHeight);a=f}}return{from:o,to:Math.max(a,o+1)}}function nn(r,e){if(yr(r,"scrollCursorIntoView")){return}var t=r.display,i=t.sizer.getBoundingClientRect(),n=null;var o=t.wrapper.ownerDocument;if(e.top+i.top<0){n=true}else if(e.bottom+i.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var a=N("div","​",null,"position: absolute;\n top: "+(e.top-t.viewOffset-Ht(r.display))+"px;\n height: "+(e.bottom-e.top+Qt(r)+t.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");r.display.lineSpace.appendChild(a);a.scrollIntoView(n);r.display.lineSpace.removeChild(a)}}function on(r,e,t,i){if(i==null){i=0}var n;if(!r.options.lineWrapping&&e==t){t=e.sticky=="before"?ue(e.line,e.ch+1,"before"):e;e=e.ch?ue(e.line,e.sticky=="before"?e.ch-1:e.ch,"after"):e}for(var o=0;o<5;o++){var a=false;var u=wi(r,e);var f=!t||t==e?u:wi(r,t);n={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-i,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+i};var l=un(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){vn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){a=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){a=true}}if(!a){break}}return n}function an(r,e){var t=un(r,e);if(t.scrollTop!=null){vn(r,t.scrollTop)}if(t.scrollLeft!=null){pn(r,t.scrollLeft)}}function un(r,e){var t=r.display,i=Ei(r.display);if(e.top<0){e.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:t.scroller.scrollTop;var o=Yt(r),a={};if(e.bottom-e.top>o){e.bottom=e.top+o}var u=r.doc.height+Kt(t);var f=e.top<i,l=e.bottom>u-i;if(e.top<n){a.scrollTop=f?0:e.top}else if(e.bottom>n+o){var s=Math.min(e.top,(l?u:e.bottom)-o);if(s!=n){a.scrollTop=s}}var c=r.options.fixedGutter?0:t.gutters.offsetWidth;var d=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:t.scroller.scrollLeft-c;var h=Jt(r)-t.gutters.offsetWidth;var v=e.right-e.left>h;if(v){e.right=e.left+h}if(e.left<10){a.scrollLeft=0}else if(e.left<d){a.scrollLeft=Math.max(0,e.left+c-(v?0:10))}else if(e.right>h+d-3){a.scrollLeft=e.right+(v?0:10)-h}return a}function fn(r,e){if(e==null){return}dn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+e}function ln(r){dn(r);var e=r.getCursor();r.curOp.scrollToPos={from:e,to:e,margin:r.options.cursorScrollMargin}}function sn(r,e,t){if(e!=null||t!=null){dn(r)}if(e!=null){r.curOp.scrollLeft=e}if(t!=null){r.curOp.scrollTop=t}}function cn(r,e){dn(r);r.curOp.scrollToPos=e}function dn(r){var e=r.curOp.scrollToPos;if(e){r.curOp.scrollToPos=null;var t=ki(r,e.from),i=ki(r,e.to);hn(r,t,i,e.margin)}}function hn(r,e,t,i){var n=un(r,{left:Math.min(e.left,t.left),top:Math.min(e.top,t.top)-i,right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom)+i});sn(r,n.scrollLeft,n.scrollTop)}function vn(r,e){if(Math.abs(r.doc.scrollTop-e)<2){return}if(!t){Gn(r,{top:e})}mn(r,e,true);if(t){Gn(r)}Fn(r,100)}function mn(r,e,t){e=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,e));if(r.display.scroller.scrollTop==e&&!t){return}r.doc.scrollTop=e;r.display.scrollbars.setScrollTop(e);if(r.display.scroller.scrollTop!=e){r.display.scroller.scrollTop=e}}function pn(r,e,t,i){e=Math.max(0,Math.min(e,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((t?e==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-e)<2)&&!i){return}r.doc.scrollLeft=e;Qn(r);if(r.display.scroller.scrollLeft!=e){r.display.scroller.scrollLeft=e}r.display.scrollbars.setScrollLeft(e)}function gn(r){var e=r.display,t=e.gutters.offsetWidth;var i=Math.round(r.doc.height+Kt(r.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:r.options.fixedGutter?t:0,docHeight:i,scrollHeight:i+Qt(r)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:t}}var bn=function(r,e,t){this.cm=t;var i=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1;r(i);r(n);gr(i,"scroll",(function(){if(i.clientHeight){e(i.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){e(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(a&&u<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var e=r.scrollWidth>r.clientWidth+1;var t=r.scrollHeight>r.clientHeight+1;var i=r.nativeBarWidth;if(t){this.vert.style.display="block";this.vert.style.bottom=e?i+"px":"0";var n=r.viewHeight-(e?i: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(e){this.horiz.style.display="block";this.horiz.style.right=t?i+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(t?i: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(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:t?i:0,bottom:e?i: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&&!v?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new q;this.disableVert=new q};bn.prototype.enableZeroWidthBar=function(r,e,t){r.style.visibility="";function i(){var n=r.getBoundingClientRect();var o=t=="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{e.set(1e3,i)}}e.set(1e3,i)};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,e){if(!e){e=gn(r)}var t=r.display.barWidth,i=r.display.barHeight;yn(r,e);for(var n=0;n<4&&t!=r.display.barWidth||i!=r.display.barHeight;n++){if(t!=r.display.barWidth&&r.options.lineWrapping){rn(r)}yn(r,gn(r));t=r.display.barWidth;i=r.display.barHeight}}function yn(r,e){var t=r.display;var i=t.scrollbars.update(e);t.sizer.style.paddingRight=(t.barWidth=i.right)+"px";t.sizer.style.paddingBottom=(t.barHeight=i.bottom)+"px";t.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){t.scrollbarFiller.style.display="block";t.scrollbarFiller.style.height=i.bottom+"px";t.scrollbarFiller.style.width=i.right+"px"}else{t.scrollbarFiller.style.display=""}if(i.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){t.gutterFiller.style.display="block";t.gutterFiller.style.height=i.bottom+"px";t.gutterFiller.style.width=e.gutterWidth+"px"}else{t.gutterFiller.style.display=""}}var xn={native:bn,null:wn};function Cn(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 xn[r.options.scrollbarStyle]((function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller);gr(e,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));e.setAttribute("cm-not-content","true")}),(function(e,t){if(t=="horizontal"){pn(r,e)}else{vn(r,e)}}),r);if(r.display.scrollbars.addClass){I(r.display.wrapper,r.display.scrollbars.addClass)}}var Mn=0;function An(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:++Mn,markArrays:null};Lt(r.curOp)}function Ln(r){var e=r.curOp;if(e){Tt(e,(function(r){for(var e=0;e<r.ops.length;e++){r.ops[e].cm.curOp=null}Sn(r)}))}}function Sn(r){var e=r.ops;for(var t=0;t<e.length;t++){Tn(e[t])}for(var i=0;i<e.length;i++){Nn(e[i])}for(var n=0;n<e.length;n++){En(e[n])}for(var o=0;o<e.length;o++){Dn(e[o])}for(var a=0;a<e.length;a++){zn(e[a])}}function Tn(r){var e=r.cm,t=e.display;Pn(e);if(r.updateMaxLine){lt(e)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<t.viewFrom||r.scrollToPos.to.line>=t.viewTo)||t.maxLineChanged&&e.options.lineWrapping;r.update=r.mustUpdate&&new Un(e,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function Nn(r){r.updatedDisplay=r.mustUpdate&&Wn(r.cm,r.update)}function En(r){var e=r.cm,t=e.display;if(r.updatedDisplay){rn(e)}r.barMeasure=gn(e);if(t.maxLineChanged&&!e.options.lineWrapping){r.adjustWidthTo=ei(e,t.maxLine,t.maxLine.text.length).left+3;e.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(t.scroller.clientWidth,t.sizer.offsetLeft+r.adjustWidthTo+Qt(e)+e.display.barWidth);r.maxScrollLeft=Math.max(0,t.sizer.offsetLeft+r.adjustWidthTo-Jt(e))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=t.input.prepareSelection()}}function Dn(r){var e=r.cm;if(r.adjustWidthTo!=null){e.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<e.doc.scrollLeft){pn(e,Math.min(e.display.scroller.scrollLeft,r.maxScrollLeft),true)}e.display.maxLineChanged=false}var t=r.focus&&r.focus==j(F(e));if(r.preparedSelection){e.display.input.showSelection(r.preparedSelection,t)}if(r.updatedDisplay||r.startHeight!=e.doc.height){kn(e,r.barMeasure)}if(r.updatedDisplay){Vn(e,r.barMeasure)}if(r.selectionChanged){Qi(e)}if(e.state.focused&&r.updateInput){e.display.input.reset(r.typing)}if(t){Ji(r.cm)}}function zn(r){var e=r.cm,t=e.display,i=e.doc;if(r.updatedDisplay){$n(e,r.update)}if(t.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){t.wheelStartX=t.wheelStartY=null}if(r.scrollTop!=null){mn(e,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(e,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(e,ve(i,r.scrollToPos.from),ve(i,r.scrollToPos.to),r.scrollToPos.margin);nn(e,n)}var o=r.maybeHiddenMarkers,a=r.maybeUnhiddenMarkers;if(o){for(var u=0;u<o.length;++u){if(!o[u].lines.length){kr(o[u],"hide")}}}if(a){for(var f=0;f<a.length;++f){if(a[f].lines.length){kr(a[f],"unhide")}}}if(t.wrapper.offsetHeight){i.scrollTop=e.display.scroller.scrollTop}if(r.changeObjs){kr(e,"changes",e,r.changeObjs)}if(r.update){r.update.finish()}}function jn(r,e){if(r.curOp){return e()}An(r);try{return e()}finally{Ln(r)}}function In(r,e){return function(){if(r.curOp){return e.apply(r,arguments)}An(r);try{return e.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}An(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Rn(r){return function(){var e=this.cm;if(!e||e.curOp){return r.apply(this,arguments)}An(e);try{return r.apply(this,arguments)}finally{Ln(e)}}}function Fn(r,e){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(e,U(On,r))}}function On(r){var e=r.doc;if(e.highlightFrontier>=r.display.viewTo){return}var t=+new Date+r.options.workTime;var i=ye(r,e.highlightFrontier);var n=[];e.iter(i.line,Math.min(e.first+e.size,r.display.viewTo+500),(function(o){if(i.line>=r.display.viewFrom){var a=o.styles;var u=o.text.length>r.options.maxHighlightLength?Qr(e.mode,i.state):null;var f=we(r,o,i,true);if(u){i.state=u}o.styles=f.styles;var l=o.styleClasses,s=f.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!a||a.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var d=0;!c&&d<a.length;++d){c=a[d]!=o.styles[d]}if(c){n.push(i.line)}o.stateAfter=i.save();i.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){xe(r,o.text,i)}o.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>t){Fn(r,r.options.workDelay);return true}}));e.highlightFrontier=i.line;e.modeFrontier=Math.max(e.modeFrontier,i.line);if(n.length){jn(r,(function(){for(var e=0;e<n.length;e++){Ui(r,n[e],"text")}}))}}var Un=function(r,e,t){var i=r.display;this.viewport=e;this.visible=tn(i,r.doc,e);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=Jt(r);this.force=t;this.dims=zi(r);this.events=[]};Un.prototype.signal=function(r,e){if(Cr(r,e)){this.events.push(arguments)}};Un.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Pn(r){var e=r.display;if(!e.scrollbarsClipped&&e.scroller.offsetWidth){e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth;e.heightForcer.style.height=Qt(r)+"px";e.sizer.style.marginBottom=-e.nativeBarWidth+"px";e.sizer.style.borderRightWidth=Qt(r)+"px";e.scrollbarsClipped=true}}function _n(r){if(r.hasFocus()){return null}var e=j(F(r));if(!e||!z(r.display.lineDiv,e)){return null}var t={activeElt:e};if(window.getSelection){var i=O(r).getSelection();if(i.anchorNode&&i.extend&&z(r.display.lineDiv,i.anchorNode)){t.anchorNode=i.anchorNode;t.anchorOffset=i.anchorOffset;t.focusNode=i.focusNode;t.focusOffset=i.focusOffset}}return t}function qn(r){if(!r||!r.activeElt||r.activeElt==j(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&z(document.body,r.anchorNode)&&z(document.body,r.focusNode)){var e=r.activeElt.ownerDocument;var t=e.defaultView.getSelection(),i=e.createRange();i.setEnd(r.anchorNode,r.anchorOffset);i.collapse(false);t.removeAllRanges();t.addRange(i);t.extend(r.focusNode,r.focusOffset)}}function Wn(r,e){var t=r.display,i=r.doc;if(e.editorIsHidden){Pi(r);return false}if(!e.force&&e.visible.from>=t.viewFrom&&e.visible.to<=t.viewTo&&(t.updateLineNumbers==null||t.updateLineNumbers>=t.viewTo)&&t.renderedView==t.view&&Wi(r)==0){return false}if(Jn(r)){Pi(r);e.dims=zi(r)}var n=i.first+i.size;var o=Math.max(e.visible.from-r.options.viewportMargin,i.first);var a=Math.min(n,e.visible.to+r.options.viewportMargin);if(t.viewFrom<o&&o-t.viewFrom<20){o=Math.max(i.first,t.viewFrom)}if(t.viewTo>a&&t.viewTo-a<20){a=Math.min(n,t.viewTo)}if(ze){o=it(r.doc,o);a=nt(r.doc,a)}var u=o!=t.viewFrom||a!=t.viewTo||t.lastWrapHeight!=e.wrapperHeight||t.lastWrapWidth!=e.wrapperWidth;qi(r,o,a);t.viewOffset=ut(Zr(r.doc,t.viewFrom));r.display.mover.style.top=t.viewOffset+"px";var f=Wi(r);if(!u&&f==0&&!e.force&&t.renderedView==t.view&&(t.updateLineNumbers==null||t.updateLineNumbers>=t.viewTo)){return false}var l=_n(r);if(f>4){t.lineDiv.style.display="none"}Hn(r,t.updateLineNumbers,e.dims);if(f>4){t.lineDiv.style.display=""}t.renderedView=t.view;qn(l);S(t.cursorDiv);S(t.selectionDiv);t.gutters.style.height=t.sizer.style.minHeight=0;if(u){t.lastWrapHeight=e.wrapperHeight;t.lastWrapWidth=e.wrapperWidth;Fn(r,400)}t.updateLineNumbers=null;return true}function $n(r,e){var t=e.viewport;for(var i=true;;i=false){if(!i||!r.options.lineWrapping||e.oldDisplayWidth==Jt(r)){if(t&&t.top!=null){t={top:Math.min(r.doc.height+Kt(r.display)-Yt(r),t.top)}}e.visible=tn(r.display,r.doc,t);if(e.visible.from>=r.display.viewFrom&&e.visible.to<=r.display.viewTo){break}}else if(i){e.visible=tn(r.display,r.doc,t)}if(!Wn(r,e)){break}rn(r);var n=gn(r);$i(r);kn(r,n);Vn(r,n);e.force=false}e.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){e.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function Gn(r,e){var t=new Un(r,e);if(Wn(r,t)){rn(r);$n(r,t);var i=gn(r);$i(r);kn(r,i);Vn(r,i);t.finish()}}function Hn(r,e,t){var i=r.display,n=r.options.lineNumbers;var o=i.lineDiv,a=o.firstChild;function u(e){var t=e.nextSibling;if(f&&w&&r.display.currentWheelTarget==e){e.style.display="none"}else{e.parentNode.removeChild(e)}return t}var l=i.view,s=i.viewFrom;for(var c=0;c<l.length;c++){var d=l[c];if(d.hidden);else if(!d.node||d.node.parentNode!=o){var h=Pt(r,d,s,t);o.insertBefore(h,a)}else{while(a!=d.node){a=u(a)}var v=n&&e!=null&&e<=s&&d.lineNumber;if(d.changes){if(W(d.changes,"gutter")>-1){v=false}zt(r,d,s,t)}if(v){S(d.lineNumber);d.lineNumber.appendChild(document.createTextNode(ae(r.options,s)))}a=d.node.nextSibling}s+=d.size}while(a){a=u(a)}}function Kn(r){var e=r.gutters.offsetWidth;r.sizer.style.marginLeft=e+"px";Et(r,"gutterChanged",r)}function Vn(r,e){r.display.sizer.style.minHeight=e.docHeight+"px";r.display.heightForcer.style.top=e.docHeight+"px";r.display.gutters.style.height=e.docHeight+r.display.barHeight+Qt(r)+"px"}function Qn(r){var e=r.display,t=e.view;if(!e.alignWidgets&&(!e.gutters.firstChild||!r.options.fixedGutter)){return}var i=ji(e)-e.scroller.scrollLeft+r.doc.scrollLeft;var n=e.gutters.offsetWidth,o=i+"px";for(var a=0;a<t.length;a++){if(!t[a].hidden){if(r.options.fixedGutter){if(t[a].gutter){t[a].gutter.style.left=o}if(t[a].gutterBackground){t[a].gutterBackground.style.left=o}}var u=t[a].alignable;if(u){for(var f=0;f<u.length;f++){u[f].style.left=o}}}}if(r.options.fixedGutter){e.gutters.style.left=i+n+"px"}}function Jn(r){if(!r.options.lineNumbers){return false}var e=r.doc,t=ae(r.options,e.first+e.size-1),i=r.display;if(t.length!=i.lineNumChars){var n=i.measure.appendChild(N("div",[N("div",t)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,a=n.offsetWidth-o;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1;i.lineNumWidth=i.lineNumInnerWidth+a;i.lineNumChars=i.lineNumInnerWidth?t.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Kn(r.display);return true}return false}function Yn(r,e){var t=[],i=false;for(var n=0;n<r.length;n++){var o=r[n],a=null;if(typeof o!="string"){a=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!e){continue}else{i=true}}t.push({className:o,style:a})}if(e&&!i){t.push({className:"CodeMirror-linenumbers",style:null})}return t}function Xn(r){var e=r.gutters,t=r.gutterSpecs;S(e);r.lineGutter=null;for(var i=0;i<t.length;++i){var n=t[i];var o=n.className;var a=n.style;var u=e.appendChild(N("div",null,"CodeMirror-gutter "+o));if(a){u.style.cssText=a}if(o=="CodeMirror-linenumbers"){r.lineGutter=u;u.style.width=(r.lineNumWidth||1)+"px"}}e.style.display=t.length?"":"none";Kn(r)}function Zn(r){Xn(r.display);Oi(r);Qn(r)}function ro(r,e,i,n){var o=this;this.input=i;o.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=N("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=E("div",null,"CodeMirror-code");o.selectionDiv=N("div",null,null,"position: relative; z-index: 1");o.cursorDiv=N("div",null,"CodeMirror-cursors");o.measure=N("div",null,"CodeMirror-measure");o.lineMeasure=N("div",null,"CodeMirror-measure");o.lineSpace=E("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=E("div",[o.lineSpace],"CodeMirror-lines");o.mover=N("div",[l],null,"position: relative");o.sizer=N("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=N("div",null,null,"position: absolute; height: "+$+"px; width: 1px;");o.gutters=N("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=N("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=N("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(a&&u<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!f&&!(t&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=e.first;o.reportedViewFrom=o.reportedViewTo=e.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=Yn(n.gutters,n.lineNumbers);Xn(o);i.init(o)}var eo=0,to=null;if(a){to=-.53}else if(t){to=15}else if(s){to=-.7}else if(h){to=-1/3}function io(r){var e=r.wheelDeltaX,t=r.wheelDeltaY;if(e==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){e=r.detail}if(t==null&&r.detail&&r.axis==r.VERTICAL_AXIS){t=r.detail}else if(t==null){t=r.wheelDelta}return{x:e,y:t}}function no(r){var e=io(r);e.x*=to;e.y*=to;return e}function oo(r,e){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 i=io(e),n=i.x,o=i.y;var a=to;if(e.deltaMode===0){n=e.deltaX;o=e.deltaY;a=1}var u=r.display,l=u.scroller;var h=l.scrollWidth>l.clientWidth;var v=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&v)){return}if(o&&w&&f){r:for(var m=e.target,p=u.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&&!t&&!d&&a!=null){if(o&&v){vn(r,Math.max(0,l.scrollTop+o*a))}pn(r,Math.max(0,l.scrollLeft+n*a));if(!o||o&&v){Ar(e)}u.wheelStartX=null;return}if(o&&a!=null){var b=o*a;var k=r.doc.scrollTop,y=k+u.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{y=Math.min(r.doc.height,y+b+50)}Gn(r,{top:k,bottom:y})}if(eo<20&&e.deltaMode!==0){if(u.wheelStartX==null){u.wheelStartX=l.scrollLeft;u.wheelStartY=l.scrollTop;u.wheelDX=n;u.wheelDY=o;setTimeout((function(){if(u.wheelStartX==null){return}var r=l.scrollLeft-u.wheelStartX;var e=l.scrollTop-u.wheelStartY;var t=e&&u.wheelDY&&e/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null;if(!t){return}to=(to*eo+t)/(eo+1);++eo}),200)}else{u.wheelDX+=n;u.wheelDY+=o}}}var ao=function(r,e){this.ranges=r;this.primIndex=e};ao.prototype.primary=function(){return this.ranges[this.primIndex]};ao.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var e=0;e<this.ranges.length;e++){var t=this.ranges[e],i=r.ranges[e];if(!le(t.anchor,i.anchor)||!le(t.head,i.head)){return false}}return true};ao.prototype.deepCopy=function(){var r=[];for(var e=0;e<this.ranges.length;e++){r[e]=new uo(se(this.ranges[e].anchor),se(this.ranges[e].head))}return new ao(r,this.primIndex)};ao.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};ao.prototype.contains=function(r,e){if(!e){e=r}for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t];if(fe(e,i.from())>=0&&fe(r,i.to())<=0){return t}}return-1};var uo=function(r,e){this.anchor=r;this.head=e};uo.prototype.from=function(){return de(this.anchor,this.head)};uo.prototype.to=function(){return ce(this.anchor,this.head)};uo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function fo(r,e,t){var i=r&&r.options.selectionsMayTouch;var n=e[t];e.sort((function(r,e){return fe(r.from(),e.from())}));t=W(e,n);for(var o=1;o<e.length;o++){var a=e[o],u=e[o-1];var f=fe(u.to(),a.from());if(i&&!a.empty()?f>0:f>=0){var l=de(u.from(),a.from()),s=ce(u.to(),a.to());var c=u.empty()?a.from()==a.head:u.from()==u.head;if(o<=t){--t}e.splice(--o,2,new uo(c?s:l,c?l:s))}}return new ao(e,t)}function lo(r,e){return new ao([new uo(r,e||r)],0)}function so(r){if(!r.text){return r.to}return ue(r.from.line+r.text.length-1,X(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,e){if(fe(r,e.from)<0){return r}if(fe(r,e.to)<=0){return so(e)}var t=r.line+e.text.length-(e.to.line-e.from.line)-1,i=r.ch;if(r.line==e.to.line){i+=so(e).ch-e.to.ch}return ue(t,i)}function ho(r,e){var t=[];for(var i=0;i<r.sel.ranges.length;i++){var n=r.sel.ranges[i];t.push(new uo(co(n.anchor,e),co(n.head,e)))}return fo(r.cm,t,r.sel.primIndex)}function vo(r,e,t){if(r.line==e.line){return ue(t.line,r.ch-e.ch+t.ch)}else{return ue(t.line+(r.line-e.line),r.ch)}}function mo(r,e,t){var i=[];var n=ue(r.first,0),o=n;for(var a=0;a<e.length;a++){var u=e[a];var f=vo(u.from,n,o);var l=vo(so(u),n,o);n=u.to;o=l;if(t=="around"){var s=r.sel.ranges[a],c=fe(s.head,s.anchor)<0;i[a]=new uo(c?l:f,c?f:l)}else{i[a]=new uo(f,f)}}return new ao(i,r.sel.primIndex)}function po(r){r.doc.mode=Hr(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;Fn(r,100);r.state.modeGen++;if(r.curOp){Oi(r)}}function bo(r,e){return e.from.ch==0&&e.to.ch==0&&X(e.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,e,t,i){function n(r){return t?t[r]:null}function o(r,t,n){ct(r,t,n,i);Et(r,"change",r,e)}function a(r,e){var t=[];for(var o=r;o<e;++o){t.push(new st(l[o],n(o),i))}return t}var u=e.from,f=e.to,l=e.text;var s=Zr(r,u.line),c=Zr(r,f.line);var d=X(l),h=n(l.length-1),v=f.line-u.line;if(e.full){r.insert(0,a(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,e)){var m=a(0,l.length-1);o(c,c.text,h);if(v){r.remove(u.line,v)}if(m.length){r.insert(u.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,u.ch)+d+s.text.slice(f.ch),h)}else{var p=a(1,l.length-1);p.push(new st(d+s.text.slice(f.ch),h,i));o(s,s.text.slice(0,u.ch)+l[0],n(0));r.insert(u.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,u.ch)+l[0]+c.text.slice(f.ch),n(0));r.remove(u.line+1,v)}else{o(s,s.text.slice(0,u.ch)+l[0],n(0));o(c,d+c.text.slice(f.ch),h);var g=a(1,l.length-1);if(v>1){r.remove(u.line+1,v-1)}r.insert(u.line+1,g)}Et(r,"change",r,e)}function ko(r,e,t){function i(r,n,o){if(r.linked){for(var a=0;a<r.linked.length;++a){var u=r.linked[a];if(u.doc==n){continue}var f=o&&u.sharedHist;if(t&&!f){continue}e(u.doc,f);i(u.doc,r,f)}}}i(r,null,true)}function yo(r,e){if(e.cm){throw new Error("This document is already in use.")}r.doc=e;e.cm=r;Bi(r);po(r);xo(r);r.options.direction=e.direction;if(!r.options.lineWrapping){lt(r)}r.options.mode=e.modeOption;Oi(r)}function xo(r){(r.doc.direction=="rtl"?I:L)(r.display.lineDiv,"CodeMirror-rtl")}function Co(r){jn(r,(function(){xo(r);Oi(r)}))}function Mo(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 Ao(r,e){var t={from:se(e.from),to:so(e),text:re(r,e.from,e.to)};zo(r,t,e.from.line,e.to.line+1);ko(r,(function(r){return zo(r,t,e.from.line,e.to.line+1)}),true);return t}function Lo(r){while(r.length){var e=X(r);if(e.ranges){r.pop()}else{break}}}function So(r,e){if(e){Lo(r.done);return X(r.done)}else if(r.done.length&&!X(r.done).ranges){return X(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return X(r.done)}}function To(r,e,t,i){var n=r.history;n.undone.length=0;var o=+new Date,a;var u;if((n.lastOp==i||n.lastOrigin==e.origin&&e.origin&&(e.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||e.origin.charAt(0)=="*"))&&(a=So(n,n.lastOp==i))){u=X(a.changes);if(fe(e.from,e.to)==0&&fe(e.from,u.to)==0){u.to=so(e)}else{a.changes.push(Ao(r,e))}}else{var f=X(n.done);if(!f||!f.ranges){Do(r.sel,n.done)}a={changes:[Ao(r,e)],generation:n.generation};n.done.push(a);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(t);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=i;n.lastOrigin=n.lastSelOrigin=e.origin;if(!u){kr(r,"historyAdded")}}function No(r,e,t,i){var n=e.charAt(0);return n=="*"||n=="+"&&t.ranges.length==i.ranges.length&&t.somethingSelected()==i.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Eo(r,e,t,i){var n=r.history,o=i&&i.origin;if(t==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||No(r,o,X(n.done),e))){n.done[n.done.length-1]=e}else{Do(e,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=t;if(i&&i.clearRedo!==false){Lo(n.undone)}}function Do(r,e){var t=X(e);if(!(t&&t.ranges&&t.equals(r))){e.push(r)}}function zo(r,e,t,i){var n=e["spans_"+r.id],o=0;r.iter(Math.max(r.first,t),Math.min(r.first+r.size,i),(function(t){if(t.markedSpans){(n||(n=e["spans_"+r.id]={}))[o]=t.markedSpans}++o}))}function jo(r){if(!r){return null}var e;for(var t=0;t<r.length;++t){if(r[t].marker.explicitlyCleared){if(!e){e=r.slice(0,t)}}else if(e){e.push(r[t])}}return!e?r:e.length?e:null}function Io(r,e){var t=e["spans_"+r.id];if(!t){return null}var i=[];for(var n=0;n<e.text.length;++n){i.push(jo(t[n]))}return i}function Bo(r,e){var t=Io(r,e);var i=_e(r,e);if(!t){return i}if(!i){return t}for(var n=0;n<t.length;++n){var o=t[n],a=i[n];if(o&&a){r:for(var u=0;u<a.length;++u){var f=a[u];for(var l=0;l<o.length;++l){if(o[l].marker==f.marker){continue r}}o.push(f)}}else if(a){t[n]=a}}return t}function Ro(r,e,t){var i=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){i.push(t?ao.prototype.deepCopy.call(o):o);continue}var a=o.changes,u=[];i.push({changes:u});for(var f=0;f<a.length;++f){var l=a[f],s=void 0;u.push({from:l.from,to:l.to,text:l.text});if(e){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(W(e,Number(s[1]))>-1){X(u)[c]=l[c];delete l[c]}}}}}}return i}function Fo(r,e,t,i){if(i){var n=r.anchor;if(t){var o=fe(e,n)<0;if(o!=fe(t,n)<0){n=e;e=t}else if(o!=fe(e,t)<0){e=t}}return new uo(n,e)}else{return new uo(t||e,e)}}function Oo(r,e,t,i,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}$o(r,new ao([Fo(r.sel.primary(),e,t,n)],0),i)}function Uo(r,e,t){var i=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){i[o]=Fo(r.sel.ranges[o],e[o],null,n)}var a=fo(r.cm,i,r.sel.primIndex);$o(r,a,t)}function Po(r,e,t,i){var n=r.sel.ranges.slice(0);n[e]=t;$o(r,fo(r.cm,n,r.sel.primIndex),i)}function _o(r,e,t,i){$o(r,lo(e,t),i)}function qo(r,e,t){var i={ranges:e.ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++){this.ranges[t]=new uo(ve(r,e[t].anchor),ve(r,e[t].head))}},origin:t&&t.origin};kr(r,"beforeSelectionChange",r,i);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,i)}if(i.ranges!=e.ranges){return fo(r.cm,i.ranges,i.ranges.length-1)}else{return e}}function Wo(r,e,t){var i=r.history.done,n=X(i);if(n&&n.ranges){i[i.length-1]=e;Go(r,e,t)}else{$o(r,e,t)}}function $o(r,e,t){Go(r,e,t);Eo(r,r.sel,r.cm?r.cm.curOp.id:NaN,t)}function Go(r,e,t){if(Cr(r,"beforeSelectionChange")||r.cm&&Cr(r.cm,"beforeSelectionChange")){e=qo(r,e,t)}var i=t&&t.bias||(fe(e.primary().head,r.sel.primary().head)<0?-1:1);Ho(r,Vo(r,e,i,true));if(!(t&&t.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function Ho(r,e){if(e.equals(r.sel)){return}r.sel=e;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;xr(r.cm)}Et(r,"cursorActivity",r)}function Ko(r){Ho(r,Vo(r,r.sel,null,false))}function Vo(r,e,t,i){var n;for(var o=0;o<e.ranges.length;o++){var a=e.ranges[o];var u=e.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var f=Jo(r,a.anchor,u&&u.anchor,t,i);var l=a.head==a.anchor?f:Jo(r,a.head,u&&u.head,t,i);if(n||f!=a.anchor||l!=a.head){if(!n){n=e.ranges.slice(0,o)}n[o]=new uo(f,l)}}return n?fo(r.cm,n,e.primIndex):e}function Qo(r,e,t,i,n){var o=Zr(r,e.line);if(o.markedSpans){for(var a=0;a<o.markedSpans.length;++a){var u=o.markedSpans[a],f=u.marker;var l="selectLeft"in f?!f.selectLeft:f.inclusiveLeft;var s="selectRight"in f?!f.selectRight:f.inclusiveRight;if((u.from==null||(l?u.from<=e.ch:u.from<e.ch))&&(u.to==null||(s?u.to>=e.ch:u.to>e.ch))){if(n){kr(f,"beforeCursorEnter");if(f.explicitlyCleared){if(!o.markedSpans){break}else{--a;continue}}}if(!f.atomic){continue}if(t){var c=f.find(i<0?1:-1),d=void 0;if(i<0?s:l){c=Yo(r,c,-i,c&&c.line==e.line?o:null)}if(c&&c.line==e.line&&(d=fe(c,t))&&(i<0?d<0:d>0)){return Qo(r,c,e,i,n)}}var h=f.find(i<0?-1:1);if(i<0?l:s){h=Yo(r,h,i,h.line==e.line?o:null)}return h?Qo(r,h,e,i,n):null}}}return e}function Jo(r,e,t,i,n){var o=i||1;var a=Qo(r,e,t,o,n)||!n&&Qo(r,e,t,o,true)||Qo(r,e,t,-o,n)||!n&&Qo(r,e,t,-o,true);if(!a){r.cantEdit=true;return ue(r.first,0)}return a}function Yo(r,e,t,i){if(t<0&&e.ch==0){if(e.line>r.first){return ve(r,ue(e.line-1))}else{return null}}else if(t>0&&e.ch==(i||Zr(r,e.line)).text.length){if(e.line<r.first+r.size-1){return ue(e.line+1,0)}else{return null}}else{return new ue(e.line,e.ch+t)}}function Xo(r){r.setSelection(ue(r.firstLine(),0),ue(r.lastLine()),H)}function Zo(r,e,t){var i={canceled:false,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=true}};if(t){i.update=function(e,t,n,o){if(e){i.from=ve(r,e)}if(t){i.to=ve(r,t)}if(n){i.text=n}if(o!==undefined){i.origin=o}}}kr(r,"beforeChange",r,i);if(r.cm){kr(r.cm,"beforeChange",r.cm,i)}if(i.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ra(r,e,t){if(r.cm){if(!r.cm.curOp){return In(r.cm,ra)(r,e,t)}if(r.cm.state.suppressEdits){return}}if(Cr(r,"beforeChange")||r.cm&&Cr(r.cm,"beforeChange")){e=Zo(r,e,true);if(!e){return}}var i=De&&!t&&We(r,e.from,e.to);if(i){for(var n=i.length-1;n>=0;--n){ea(r,{from:i[n].from,to:i[n].to,text:n?[""]:e.text,origin:e.origin})}}else{ea(r,e)}}function ea(r,e){if(e.text.length==1&&e.text[0]==""&&fe(e.from,e.to)==0){return}var t=ho(r,e);To(r,e,t,r.cm?r.cm.curOp.id:NaN);na(r,e,t,_e(r,e));var i=[];ko(r,(function(r,t){if(!t&&W(i,r.history)==-1){la(r.history,e);i.push(r.history)}na(r,e,null,_e(r,e))}))}function ta(r,e,t){var i=r.cm&&r.cm.state.suppressEdits;if(i&&!t){return}var n=r.history,o,a=r.sel;var u=e=="undo"?n.done:n.undone,f=e=="undo"?n.undone:n.done;var l=0;for(;l<u.length;l++){o=u[l];if(t?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==u.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=u.pop();if(o.ranges){Do(o,f);if(t&&!o.equals(r.sel)){$o(r,o,{clearRedo:false});return}a=o}else if(i){u.push(o);return}else{break}}var s=[];Do(a,f);f.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Cr(r,"beforeChange")||r.cm&&Cr(r.cm,"beforeChange");var d=function(t){var i=o.changes[t];i.origin=e;if(c&&!Zo(r,i,false)){u.length=0;return{}}s.push(Ao(r,i));var n=t?ho(r,i):X(u);na(r,i,n,Bo(r,i));if(!t&&r.cm){r.cm.scrollIntoView({from:i.from,to:so(i)})}var a=[];ko(r,(function(r,e){if(!e&&W(a,r.history)==-1){la(r.history,i);a.push(r.history)}na(r,i,null,Bo(r,i))}))};for(var h=o.changes.length-1;h>=0;--h){var v=d(h);if(v)return v.v}}function ia(r,e){if(e==0){return}r.first+=e;r.sel=new ao(Z(r.sel.ranges,(function(r){return new uo(ue(r.anchor.line+e,r.anchor.ch),ue(r.head.line+e,r.head.ch))})),r.sel.primIndex);if(r.cm){Oi(r.cm,r.first,r.first-e,e);for(var t=r.cm.display,i=t.viewFrom;i<t.viewTo;i++){Ui(r.cm,i,"gutter")}}}function na(r,e,t,i){if(r.cm&&!r.cm.curOp){return In(r.cm,na)(r,e,t,i)}if(e.to.line<r.first){ia(r,e.text.length-1-(e.to.line-e.from.line));return}if(e.from.line>r.lastLine()){return}if(e.from.line<r.first){var n=e.text.length-1-(r.first-e.from.line);ia(r,n);e={from:ue(r.first,0),to:ue(e.to.line+n,e.to.ch),text:[X(e.text)],origin:e.origin}}var o=r.lastLine();if(e.to.line>o){e={from:e.from,to:ue(o,Zr(r,o).text.length),text:[e.text[0]],origin:e.origin}}e.removed=re(r,e.from,e.to);if(!t){t=ho(r,e)}if(r.cm){oa(r.cm,e,i)}else{wo(r,e,i)}Go(r,t,H);if(r.cantEdit&&Jo(r,ue(r.firstLine(),0))){r.cantEdit=false}}function oa(r,e,t){var i=r.doc,n=r.display,o=e.from,a=e.to;var u=false,f=o.line;if(!r.options.lineWrapping){f=ie(rt(Zr(i,o.line)));i.iter(f,a.line+1,(function(r){if(r==n.maxLine){u=true;return true}}))}if(i.sel.contains(e.from,e.to)>-1){xr(r)}wo(i,e,t,Ii(r));if(!r.options.lineWrapping){i.iter(f,o.line+e.text.length,(function(r){var e=ft(r);if(e>n.maxLineLength){n.maxLine=r;n.maxLineLength=e;n.maxLineChanged=true;u=false}}));if(u){r.curOp.updateMaxLine=true}}Ee(i,o.line);Fn(r,400);var l=e.text.length-(a.line-o.line)-1;if(e.full){Oi(r)}else if(o.line==a.line&&e.text.length==1&&!bo(r.doc,e)){Ui(r,o.line,"text")}else{Oi(r,o.line,a.line+1,l)}var s=Cr(r,"changes"),c=Cr(r,"change");if(c||s){var d={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};if(c){Et(r,"change",r,d)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(d)}}r.display.selForContextMenu=null}function aa(r,e,t,i,n){var o;if(!i){i=t}if(fe(i,t)<0){o=[i,t],t=o[0],i=o[1]}if(typeof e=="string"){e=r.splitLines(e)}ra(r,{from:t,to:i,text:e,origin:n})}function ua(r,e,t,i){if(t<r.line){r.line+=i}else if(e<r.line){r.line=e;r.ch=0}}function fa(r,e,t,i){for(var n=0;n<r.length;++n){var o=r[n],a=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var u=0;u<o.ranges.length;u++){ua(o.ranges[u].anchor,e,t,i);ua(o.ranges[u].head,e,t,i)}continue}for(var f=0;f<o.changes.length;++f){var l=o.changes[f];if(t<l.from.line){l.from=ue(l.from.line+i,l.from.ch);l.to=ue(l.to.line+i,l.to.ch)}else if(e<=l.to.line){a=false;break}}if(!a){r.splice(0,n+1);n=0}}}function la(r,e){var t=e.from.line,i=e.to.line,n=e.text.length-(i-t)-1;fa(r.done,t,i,n);fa(r.undone,t,i,n)}function sa(r,e,t,i){var n=e,o=e;if(typeof e=="number"){o=Zr(r,he(r,e))}else{n=ie(e)}if(n==null){return null}if(i(o,n)&&r.cm){Ui(r.cm,n,t)}return o}function ca(r){this.lines=r;this.parent=null;var e=0;for(var t=0;t<r.length;++t){r[t].parent=this;e+=r[t].height}this.height=e}ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,e){for(var t=r,i=r+e;t<i;++t){var n=this.lines[t];this.height-=n.height;dt(n);Et(n,"delete")}this.lines.splice(r,e)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,e,t){this.height+=t;this.lines=this.lines.slice(0,r).concat(e).concat(this.lines.slice(r));for(var i=0;i<e.length;++i){e[i].parent=this}},iterN:function(r,e,t){for(var i=r+e;r<i;++r){if(t(this.lines[r])){return true}}}};function da(r){this.children=r;var e=0,t=0;for(var i=0;i<r.length;++i){var n=r[i];e+=n.chunkSize();t+=n.height;n.parent=this}this.size=e;this.height=t;this.parent=null}da.prototype={chunkSize:function(){return this.size},removeInner:function(r,e){this.size-=e;for(var t=0;t<this.children.length;++t){var i=this.children[t],n=i.chunkSize();if(r<n){var o=Math.min(e,n-r),a=i.height;i.removeInner(r,o);this.height-=a-i.height;if(n==o){this.children.splice(t--,1);i.parent=null}if((e-=o)==0){break}r=0}else{r-=n}}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var u=[];this.collapse(u);this.children=[new ca(u)];this.children[0].parent=this}},collapse:function(r){for(var e=0;e<this.children.length;++e){this.children[e].collapse(r)}},insertInner:function(r,e,t){this.size+=e.length;this.height+=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<=o){n.insertInner(r,e,t);if(n.lines&&n.lines.length>50){var a=n.lines.length%25+25;for(var u=a;u<n.lines.length;){var f=new ca(n.lines.slice(u,u+=25));n.height-=f.height;this.children.splice(++i,0,f);f.parent=this}n.lines=n.lines.slice(0,a);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var e=r.children.splice(r.children.length-5,5);var t=new da(e);if(!r.parent){var i=new da(r.children);i.parent=r;r.children=[i,t];r=i}else{r.size-=t.size;r.height-=t.height;var n=W(r.parent.children,r);r.parent.children.splice(n+1,0,t)}t.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,e,t){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<o){var a=Math.min(e,o-r);if(n.iterN(r,a,t)){return true}if((e-=a)==0){break}r=0}else{r-=o}}}};var ha=function(r,e,t){if(t){for(var i in t){if(t.hasOwnProperty(i)){this[i]=t[i]}}}this.doc=r;this.node=e};ha.prototype.clear=function(){var r=this.doc.cm,e=this.line.widgets,t=this.line,i=ie(t);if(i==null||!e){return}for(var n=0;n<e.length;++n){if(e[n]==this){e.splice(n--,1)}}if(!e.length){t.widgets=null}var o=$t(this);te(t,Math.max(0,t.height-o));if(r){jn(r,(function(){va(r,t,-o);Ui(r,i,"widget")}));Et(r,"lineWidgetCleared",r,this,i)}};ha.prototype.changed=function(){var r=this;var e=this.height,t=this.doc.cm,i=this.line;this.height=null;var n=$t(this)-e;if(!n){return}if(!ot(this.doc,i)){te(i,i.height+n)}if(t){jn(t,(function(){t.curOp.forceUpdate=true;va(t,i,n);Et(t,"lineWidgetChanged",t,r,ie(i))}))}};Mr(ha);function va(r,e,t){if(ut(e)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){fn(r,t)}}function ma(r,e,t,i){var n=new ha(r,t,i);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}sa(r,e,"widget",(function(e){var t=e.widgets||(e.widgets=[]);if(n.insertAt==null){t.push(n)}else{t.splice(Math.min(t.length,Math.max(0,n.insertAt)),0,n)}n.line=e;if(o&&!ot(r,e)){var i=ut(e)<r.scrollTop;te(e,e.height+$t(n));if(i){fn(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){Et(o,"lineWidgetAdded",o,n,typeof e=="number"?e:ie(e))}return n}var pa=0;var ga=function(r,e){this.lines=[];this.type=e;this.doc=r;this.id=++pa};ga.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,e=r&&!r.curOp;if(e){An(r)}if(Cr(this,"clear")){var t=this.find();if(t){Et(this,"clear",t.from,t.to)}}var i=null,n=null;for(var o=0;o<this.lines.length;++o){var a=this.lines[o];var u=Re(a.markedSpans,this);if(r&&!this.collapsed){Ui(r,ie(a),"text")}else if(r){if(u.to!=null){n=ie(a)}if(u.from!=null){i=ie(a)}}a.markedSpans=Fe(a.markedSpans,u);if(u.from==null&&this.collapsed&&!ot(this.doc,a)&&r){te(a,Ei(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var f=0;f<this.lines.length;++f){var l=rt(this.lines[f]),s=ft(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(i!=null&&r&&this.collapsed){Oi(r,i,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Ko(r.doc)}}if(r){Et(r,"markerCleared",r,this,i,n)}if(e){Ln(r)}if(this.parent){this.parent.clear()}};ga.prototype.find=function(r,e){if(r==null&&this.type=="bookmark"){r=1}var t,i;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var a=Re(o.markedSpans,this);if(a.from!=null){t=ue(e?o:ie(o),a.from);if(r==-1){return t}}if(a.to!=null){i=ue(e?o:ie(o),a.to);if(r==1){return i}}}return t&&{from:t,to:i}};ga.prototype.changed=function(){var r=this;var e=this.find(-1,true),t=this,i=this.doc.cm;if(!e||!i){return}jn(i,(function(){var n=e.line,o=ie(e.line);var a=ti(i,o);if(a){si(a);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!ot(t.doc,n)&&t.height!=null){var u=t.height;t.height=null;var f=$t(t)-u;if(f){te(n,n.height+f)}}Et(i,"markerChanged",i,r)}))};ga.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;if(!e.maybeHiddenMarkers||W(e.maybeHiddenMarkers,this)==-1){(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};ga.prototype.detachLine=function(r){this.lines.splice(W(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}};Mr(ga);function ba(r,e,t,i,n){if(i&&i.shared){return ka(r,e,t,i,n)}if(r.cm&&!r.cm.curOp){return In(r.cm,ba)(r,e,t,i,n)}var o=new ga(r,n),a=fe(e,t);if(i){P(i,o,false)}if(a>0||a==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Ze(r,e.line,e,t,o)||e.line!=t.line&&Ze(r,t.line,e,t,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ie()}if(o.addToHistory){To(r,{from:e,to:t,origin:"markText"},r.sel,NaN)}var u=e.line,f=r.cm,l;r.iter(u,t.line+1,(function(i){if(f&&o.collapsed&&!f.options.lineWrapping&&rt(i)==f.display.maxLine){l=true}if(o.collapsed&&u!=e.line){te(i,0)}Oe(i,new Be(o,u==e.line?e.ch:null,u==t.line?t.ch:null),r.cm&&r.cm.curOp);++u}));if(o.collapsed){r.iter(e.line,t.line+1,(function(e){if(ot(r,e)){te(e,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){je();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++pa;o.atomic=true}if(f){if(l){f.curOp.updateMaxLine=true}if(o.collapsed){Oi(f,e.line,t.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=e.line;s<=t.line;s++){Ui(f,s,"text")}}if(o.atomic){Ko(f.doc)}Et(f,"markerAdded",f,o)}return o}var wa=function(r,e){this.markers=r;this.primary=e;for(var t=0;t<r.length;++t){r[t].parent=this}};wa.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}Et(this,"clear")};wa.prototype.find=function(r,e){return this.primary.find(r,e)};Mr(wa);function ka(r,e,t,i,n){i=P(i);i.shared=false;var o=[ba(r,e,t,i,n)],a=o[0];var u=i.widgetNode;ko(r,(function(r){if(u){i.widgetNode=u.cloneNode(true)}o.push(ba(r,ve(r,e),ve(r,t),i,n));for(var f=0;f<r.linked.length;++f){if(r.linked[f].isParent){return}}a=X(o)}));return new wa(o,a)}function ya(r){return r.findMarks(ue(r.first,0),r.clipPos(ue(r.lastLine())),(function(r){return r.parent}))}function xa(r,e){for(var t=0;t<e.length;t++){var i=e[t],n=i.find();var o=r.clipPos(n.from),a=r.clipPos(n.to);if(fe(o,a)){var u=ba(r,o,a,i.primary,i.primary.type);i.markers.push(u);u.parent=i}}}function Ca(r){var e=function(e){var t=r[e],i=[t.primary.doc];ko(t.primary.doc,(function(r){return i.push(r)}));for(var n=0;n<t.markers.length;n++){var o=t.markers[n];if(W(i,o.doc)==-1){o.parent=null;t.markers.splice(n--,1)}}};for(var t=0;t<r.length;t++)e(t)}var Ma=0;var Aa=function(r,e,t,i,n){if(!(this instanceof Aa)){return new Aa(r,e,t,i,n)}if(t==null){t=0}da.call(this,[new ca([new st("",null)])]);this.first=t;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=t;var o=ue(t,0);this.sel=lo(o);this.history=new Mo(null);this.id=++Ma;this.modeOption=e;this.lineSep=i;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});$o(this,lo(o),H)};Aa.prototype=tr(da.prototype,{constructor:Aa,iter:function(r,e,t){if(t){this.iterN(r-this.first,e-r,t)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,e){var t=0;for(var i=0;i<e.length;++i){t+=e[i].height}this.insertInner(r-this.first,e,t)},remove:function(r,e){this.removeInner(r-this.first,e)},getValue:function(r){var e=ee(this,this.first,this.first+this.size);if(r===false){return e}return e.join(r||this.lineSeparator())},setValue:Rn((function(r){var e=ue(this.first,0),t=this.first+this.size-1;ra(this,{from:e,to:ue(t,Zr(this,t).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}$o(this,lo(e),H)})),replaceRange:function(r,e,t,i){e=ve(this,e);t=t?ve(this,t):e;aa(this,r,e,t,i)},getRange:function(r,e,t){var i=re(this,ve(this,r),ve(this,e));if(t===false){return i}if(t===""){return i.join("")}return i.join(t||this.lineSeparator())},getLine:function(r){var e=this.getLineHandle(r);return e&&e.text},getLineHandle:function(r){if(oe(this,r)){return Zr(this,r)}},getLineNumber:function(r){return ie(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return rt(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return ve(this,r)},getCursor:function(r){var e=this.sel.primary(),t;if(r==null||r=="head"){t=e.head}else if(r=="anchor"){t=e.anchor}else if(r=="end"||r=="to"||r===false){t=e.to()}else{t=e.from()}return t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Rn((function(r,e,t){_o(this,ve(this,typeof r=="number"?ue(r,e||0):r),null,t)})),setSelection:Rn((function(r,e,t){_o(this,ve(this,r),ve(this,e||r),t)})),extendSelection:Rn((function(r,e,t){Oo(this,ve(this,r),e&&ve(this,e),t)})),extendSelections:Rn((function(r,e){Uo(this,pe(this,r),e)})),extendSelectionsBy:Rn((function(r,e){var t=Z(this.sel.ranges,r);Uo(this,pe(this,t),e)})),setSelections:Rn((function(r,e,t){if(!r.length){return}var i=[];for(var n=0;n<r.length;n++){i[n]=new uo(ve(this,r[n].anchor),ve(this,r[n].head||r[n].anchor))}if(e==null){e=Math.min(r.length-1,this.sel.primIndex)}$o(this,fo(this.cm,i,e),t)})),addSelection:Rn((function(r,e,t){var i=this.sel.ranges.slice(0);i.push(new uo(ve(this,r),ve(this,e||r)));$o(this,fo(this.cm,i,i.length-1),t)})),getSelection:function(r){var e=this.sel.ranges,t;for(var i=0;i<e.length;i++){var n=re(this,e[i].from(),e[i].to());t=t?t.concat(n):n}if(r===false){return t}else{return t.join(r||this.lineSeparator())}},getSelections:function(r){var e=[],t=this.sel.ranges;for(var i=0;i<t.length;i++){var n=re(this,t[i].from(),t[i].to());if(r!==false){n=n.join(r||this.lineSeparator())}e[i]=n}return e},replaceSelection:function(r,e,t){var i=[];for(var n=0;n<this.sel.ranges.length;n++){i[n]=r}this.replaceSelections(i,e,t||"+input")},replaceSelections:Rn((function(r,e,t){var i=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var a=n.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(r[o]),origin:t}}var u=e&&e!="end"&&mo(this,i,e);for(var f=i.length-1;f>=0;f--){ra(this,i[f])}if(u){Wo(this,u)}else if(this.cm){ln(this.cm)}})),undo:Rn((function(){ta(this,"undo")})),redo:Rn((function(){ta(this,"redo")})),undoSelection:Rn((function(){ta(this,"undo",true)})),redoSelection:Rn((function(){ta(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,e=0,t=0;for(var i=0;i<r.done.length;i++){if(!r.done[i].ranges){++e}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++t}}return{undo:e,redo:t}},clearHistory:function(){var r=this;this.history=new Mo(this.history);ko(this,(function(e){return e.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:Ro(this.history.done),undone:Ro(this.history.undone)}},setHistory:function(r){var e=this.history=new Mo(this.history);e.done=Ro(r.done.slice(0),null,true);e.undone=Ro(r.undone.slice(0),null,true)},setGutterMarker:Rn((function(r,e,t){return sa(this,r,"gutter",(function(r){var i=r.gutterMarkers||(r.gutterMarkers={});i[e]=t;if(!t&&ar(i)){r.gutterMarkers=null}return true}))})),clearGutter:Rn((function(r){var e=this;this.iter((function(t){if(t.gutterMarkers&&t.gutterMarkers[r]){sa(e,t,"gutter",(function(){t.gutterMarkers[r]=null;if(ar(t.gutterMarkers)){t.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var e;if(typeof r=="number"){if(!oe(this,r)){return null}e=r;r=Zr(this,r);if(!r){return null}}else{e=ie(r);if(e==null){return null}}return{line:e,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Rn((function(r,e,t){return sa(this,r,e=="gutter"?"gutter":"class",(function(r){var i=e=="text"?"textClass":e=="background"?"bgClass":e=="gutter"?"gutterClass":"wrapClass";if(!r[i]){r[i]=t}else if(A(t).test(r[i])){return false}else{r[i]+=" "+t}return true}))})),removeLineClass:Rn((function(r,e,t){return sa(this,r,e=="gutter"?"gutter":"class",(function(r){var i=e=="text"?"textClass":e=="background"?"bgClass":e=="gutter"?"gutterClass":"wrapClass";var n=r[i];if(!n){return false}else if(t==null){r[i]=null}else{var o=n.match(A(t));if(!o){return false}var a=o.index+o[0].length;r[i]=n.slice(0,o.index)+(!o.index||a==n.length?"":" ")+n.slice(a)||null}return true}))})),addLineWidget:Rn((function(r,e,t){return ma(this,r,e,t)})),removeLineWidget:function(r){r.clear()},markText:function(r,e,t){return ba(this,ve(this,r),ve(this,e),t,t&&t.type||"range")},setBookmark:function(r,e){var t={replacedWith:e&&(e.nodeType==null?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:false,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};r=ve(this,r);return ba(this,r,r,t,"bookmark")},findMarksAt:function(r){r=ve(this,r);var e=[],t=Zr(this,r.line).markedSpans;if(t){for(var i=0;i<t.length;++i){var n=t[i];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){e.push(n.marker.parent||n.marker)}}}return e},findMarks:function(r,e,t){r=ve(this,r);e=ve(this,e);var i=[],n=r.line;this.iter(r.line,e.line+1,(function(o){var a=o.markedSpans;if(a){for(var u=0;u<a.length;u++){var f=a[u];if(!(f.to!=null&&n==r.line&&r.ch>=f.to||f.from==null&&n!=r.line||f.from!=null&&n==e.line&&f.from>=e.ch)&&(!t||t(f.marker))){i.push(f.marker.parent||f.marker)}}}++n}));return i},getAllMarks:function(){var r=[];this.iter((function(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i){if(t[i].from!=null){r.push(t[i].marker)}}}}));return r},posFromIndex:function(r){var e,t=this.first,i=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+i;if(o>r){e=r;return true}r-=o;++t}));return ve(this,ue(t,e))},indexFromPos:function(r){r=ve(this,r);var e=r.ch;if(r.line<this.first||r.ch<0){return 0}var t=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){e+=r.text.length+t}));return e},copy:function(r){var e=new Aa(ee(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);e.scrollTop=this.scrollTop;e.scrollLeft=this.scrollLeft;e.sel=this.sel;e.extend=false;if(r){e.history.undoDepth=this.history.undoDepth;e.setHistory(this.getHistory())}return e},linkedDoc:function(r){if(!r){r={}}var e=this.first,t=this.first+this.size;if(r.from!=null&&r.from>e){e=r.from}if(r.to!=null&&r.to<t){t=r.to}var i=new Aa(ee(this,e,t),r.mode||this.modeOption,e,this.lineSep,this.direction);if(r.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:r.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];xa(i,ya(this));return i},unlinkDoc:function(r){if(r instanceof Uu){r=r.doc}if(this.linked){for(var e=0;e<this.linked.length;++e){var t=this.linked[e];if(t.doc!=r){continue}this.linked.splice(e,1);r.unlinkDoc(this);Ca(ya(this));break}}if(r.history==this.history){var i=[r.id];ko(r,(function(r){return i.push(r.id)}),true);r.history=new Mo(null);r.history.done=Ro(this.history.done,i);r.history.undone=Ro(this.history.undone,i)}},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 Rr(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Rn((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){Co(this.cm)}}))});Aa.prototype.eachLine=Aa.prototype.iter;var La=0;function Sa(r){var e=this;Ea(e);if(yr(e,r)||Gt(e.display,r)){return}Ar(r);if(a){La=+new Date}var t=Ri(e,r,true),i=r.dataTransfer.files;if(!t||e.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var n=i.length,o=Array(n),u=0;var f=function(){if(++u==n){In(e,(function(){t=ve(e.doc,t);var r={from:t,to:t,text:e.doc.splitLines(o.filter((function(r){return r!=null})).join(e.doc.lineSeparator())),origin:"paste"};ra(e.doc,r);Wo(e.doc,lo(ve(e.doc,t),ve(e.doc,so(r))))}))()}};var l=function(r,t){if(e.options.allowDropFileTypes&&W(e.options.allowDropFileTypes,r.type)==-1){f();return}var i=new FileReader;i.onerror=function(){return f()};i.onload=function(){var r=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){f();return}o[t]=r;f()};i.readAsText(r)};for(var s=0;s<i.length;s++){l(i[s],s)}}else{if(e.state.draggingText&&e.doc.sel.contains(t)>-1){e.state.draggingText(r);setTimeout((function(){return e.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var d;if(e.state.draggingText&&!e.state.draggingText.copy){d=e.listSelections()}Go(e.doc,lo(t,t));if(d){for(var h=0;h<d.length;++h){aa(e.doc,"",d[h].anchor,d[h].head,"drag")}}e.replaceSelection(c,"around","paste");e.display.input.focus()}}catch(r){}}}function Ta(r,e){if(a&&(!r.state.draggingText||+new Date-La<100)){Tr(e);return}if(yr(r,e)||Gt(r.display,e)){return}e.dataTransfer.setData("Text",r.getSelection());e.dataTransfer.effectAllowed="copyMove";if(e.dataTransfer.setDragImage&&!h){var t=N("img",null,null,"position: fixed; left: 0; top: 0;");t.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(d){t.width=t.height=1;r.display.wrapper.appendChild(t);t._top=t.offsetTop}e.dataTransfer.setDragImage(t,0,0);if(d){t.parentNode.removeChild(t)}}}function Na(r,e){var t=Ri(r,e);if(!t){return}var i=document.createDocumentFragment();Hi(r,t,i);if(!r.display.dragCursor){r.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}T(r.display.dragCursor,i)}function Ea(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function Da(r){if(!document.getElementsByClassName){return}var e=document.getElementsByClassName("CodeMirror"),t=[];for(var i=0;i<e.length;i++){var n=e[i].CodeMirror;if(n){t.push(n)}}if(t.length){t[0].operation((function(){for(var e=0;e<t.length;e++){r(t[e])}}))}}var za=false;function ja(){if(za){return}Ia();za=true}function Ia(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;Da(Ba)}),100)}}));gr(window,"blur",(function(){return Da(Zi)}))}function Ba(r){var e=r.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=false;r.setSize()}var Ra={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 Fa=0;Fa<10;Fa++){Ra[Fa+48]=Ra[Fa+96]=String(Fa)}for(var Oa=65;Oa<=90;Oa++){Ra[Oa]=String.fromCharCode(Oa)}for(var Ua=1;Ua<=12;Ua++){Ra[Ua+111]=Ra[Ua+63235]="F"+Ua}var Pa={};Pa.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"};Pa.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"};Pa.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"};Pa.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"]};Pa["default"]=w?Pa.macDefault:Pa.pcDefault;function _a(r){var e=r.split(/-(?!$)/);r=e[e.length-1];var t,i,n,o;for(var a=0;a<e.length-1;a++){var u=e[a];if(/^(cmd|meta|m)$/i.test(u)){o=true}else if(/^a(lt)?$/i.test(u)){t=true}else if(/^(c|ctrl|control)$/i.test(u)){i=true}else if(/^s(hift)?$/i.test(u)){n=true}else{throw new Error("Unrecognized modifier name: "+u)}}if(t){r="Alt-"+r}if(i){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function qa(r){var e={};for(var t in r){if(r.hasOwnProperty(t)){var i=r[t];if(/^(name|fallthrough|(de|at)tach)$/.test(t)){continue}if(i=="..."){delete r[t];continue}var n=Z(t.split(" "),_a);for(var o=0;o<n.length;o++){var a=void 0,u=void 0;if(o==n.length-1){u=n.join(" ");a=i}else{u=n.slice(0,o+1).join(" ");a="..."}var f=e[u];if(!f){e[u]=a}else if(f!=a){throw new Error("Inconsistent bindings for "+u)}}delete r[t]}}for(var l in e){r[l]=e[l]}return r}function Wa(r,e,t,i){e=Ka(e);var n=e.call?e.call(r,i):e[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&t(n)){return"handled"}if(e.fallthrough){if(Object.prototype.toString.call(e.fallthrough)!="[object Array]"){return Wa(r,e.fallthrough,t,i)}for(var o=0;o<e.fallthrough.length;o++){var a=Wa(r,e.fallthrough[o],t,i);if(a){return a}}}}function $a(r){var e=typeof r=="string"?r:Ra[r.keyCode];return e=="Ctrl"||e=="Alt"||e=="Shift"||e=="Mod"}function Ga(r,e,t){var i=r;if(e.altKey&&i!="Alt"){r="Alt-"+r}if((C?e.metaKey:e.ctrlKey)&&i!="Ctrl"){r="Ctrl-"+r}if((C?e.ctrlKey:e.metaKey)&&i!="Mod"){r="Cmd-"+r}if(!t&&e.shiftKey&&i!="Shift"){r="Shift-"+r}return r}function Ha(r,e){if(d&&r.keyCode==34&&r["char"]){return false}var t=Ra[r.keyCode];if(t==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){t=r.code}return Ga(t,r,e)}function Ka(r){return typeof r=="string"?Pa[r]:r}function Va(r,e){var t=r.doc.sel.ranges,i=[];for(var n=0;n<t.length;n++){var o=e(t[n]);while(i.length&&fe(o.from,X(i).to)<=0){var a=i.pop();if(fe(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}jn(r,(function(){for(var e=i.length-1;e>=0;e--){aa(r.doc,"",i[e].from,i[e].to,"+delete")}ln(r)}))}function Qa(r,e,t){var i=lr(r.text,e+t,t);return i<0||i>r.text.length?null:i}function Ja(r,e,t){var i=Qa(r,e.ch,t);return i==null?null:new ue(e.line,i,t<0?"after":"before")}function Ya(r,e,t,i,n){if(r){if(e.doc.direction=="rtl"){n=-n}var o=mr(t,e.doc.direction);if(o){var a=n<0?X(o):o[0];var u=n<0==(a.level==1);var f=u?"after":"before";var l;if(a.level>0||e.doc.direction=="rtl"){var s=ii(e,t);l=n<0?t.text.length-1:0;var c=ni(e,s,l).top;l=sr((function(r){return ni(e,s,r).top==c}),n<0==(a.level==1)?a.from:a.to-1,l);if(f=="before"){l=Qa(t,l,1)}}else{l=n<0?a.to:a.from}return new ue(i,l,f)}}return new ue(i,n<0?t.text.length:0,n<0?"before":"after")}function Xa(r,e,t,i){var n=mr(e,r.doc.direction);if(!n){return Ja(e,t,i)}if(t.ch>=e.text.length){t.ch=e.text.length;t.sticky="before"}else if(t.ch<=0){t.ch=0;t.sticky="after"}var o=hr(n,t.ch,t.sticky),a=n[o];if(r.doc.direction=="ltr"&&a.level%2==0&&(i>0?a.to>t.ch:a.from<t.ch)){return Ja(e,t,i)}var u=function(r,t){return Qa(e,r instanceof ue?r.ch:r,t)};var f;var l=function(t){if(!r.options.lineWrapping){return{begin:0,end:e.text.length}}f=f||ii(r,e);return Mi(r,e,f,t)};var s=l(t.sticky=="before"?u(t,-1):t.ch);if(r.doc.direction=="rtl"||a.level==1){var c=a.level==1==i<0;var d=u(t,c?1:-1);if(d!=null&&(!c?d>=a.from&&d>=s.begin:d<=a.to&&d<=s.end)){var h=c?"before":"after";return new ue(t.line,d,h)}}var v=function(r,e,i){var o=function(r,e){return e?new ue(t.line,u(r,1),"before"):new ue(t.line,r,"after")};for(;r>=0&&r<n.length;r+=e){var a=n[r];var f=e>0==(a.level!=1);var l=f?i.begin:u(i.end,-1);if(a.from<=l&&l<a.to){return o(l,f)}l=f?a.from:u(a.to,-1);if(i.begin<=l&&l<i.end){return o(l,f)}}};var m=v(o+i,i,s);if(m){return m}var p=i>0?s.end:u(s.begin,-1);if(p!=null&&!(i>0&&p==e.text.length)){m=v(i>0?0:n.length-1,i,l(p));if(m){return m}}return null}var Za={selectAll:Xo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),H)},killLine:function(r){return Va(r,(function(e){if(e.empty()){var t=Zr(r.doc,e.head.line).text.length;if(e.head.ch==t&&e.head.line<r.lastLine()){return{from:e.head,to:ue(e.head.line+1,0)}}else{return{from:e.head,to:ue(e.head.line,t)}}}else{return{from:e.from(),to:e.to()}}}))},deleteLine:function(r){return Va(r,(function(e){return{from:ue(e.from().line,0),to:ve(r.doc,ue(e.to().line+1,0))}}))},delLineLeft:function(r){return Va(r,(function(r){return{from:ue(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Va(r,(function(e){var t=r.charCoords(e.head,"div").top+5;var i=r.coordsChar({left:0,top:t},"div");return{from:i,to:e.from()}}))},delWrappedLineRight:function(r){return Va(r,(function(e){var t=r.charCoords(e.head,"div").top+5;var i=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:i}}))},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(ue(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ue(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(e){return ru(r,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(e){return tu(r,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(e){return eu(r,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")}),V)},goLineLeft:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")}),V)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(e){var t=r.cursorCoords(e.head,"div").top+5;var i=r.coordsChar({left:0,top:t},"div");if(i.ch<r.getLine(i.line).search(/\S/)){return tu(r,e.head)}return i}),V)},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 e=[],t=r.listSelections(),i=r.options.tabSize;for(var n=0;n<t.length;n++){var o=t[n].from();var a=_(r.getLine(o.line),o.ch,i);e.push(Y(i-a%i))}r.replaceSelections(e)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return jn(r,(function(){var e=r.listSelections(),t=[];for(var i=0;i<e.length;i++){if(!e[i].empty()){continue}var n=e[i].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ue(n.line,n.ch-1)}if(n.ch>0){n=new ue(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ue(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var a=Zr(r.doc,n.line-1).text;if(a){n=new ue(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+a.charAt(a.length-1),ue(n.line-1,a.length-1),n,"+transpose")}}}t.push(new uo(n,n))}r.setSelections(t)}))},newlineAndIndent:function(r){return jn(r,(function(){var e=r.listSelections();for(var t=e.length-1;t>=0;t--){r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,"+input")}e=r.listSelections();for(var i=0;i<e.length;i++){r.indentLine(e[i].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function ru(r,e){var t=Zr(r.doc,e);var i=rt(t);if(i!=t){e=ie(i)}return Ya(true,r,i,e,1)}function eu(r,e){var t=Zr(r.doc,e);var i=et(t);if(i!=t){e=ie(i)}return Ya(true,r,t,e,-1)}function tu(r,e){var t=ru(r,e.line);var i=Zr(r.doc,t.line);var n=mr(i,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(t.ch,i.text.search(/\S/));var a=e.line==t.line&&e.ch<=o&&e.ch;return ue(t.line,a?0:o,t.sticky)}return t}function iu(r,e,t){if(typeof e=="string"){e=Za[e];if(!e){return false}}r.display.input.ensurePolled();var i=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(t){r.display.shift=false}n=e(r)!=G}finally{r.display.shift=i;r.state.suppressEdits=false}return n}function nu(r,e,t){for(var i=0;i<r.state.keyMaps.length;i++){var n=Wa(e,r.state.keyMaps[i],t,r);if(n){return n}}return r.options.extraKeys&&Wa(e,r.options.extraKeys,t,r)||Wa(e,r.options.keyMap,t,r)}var ou=new q;function au(r,e,t,i){var n=r.state.keySeq;if(n){if($a(e)){return"handled"}if(/\'$/.test(e)){r.state.keySeq=null}else{ou.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(uu(r,n+" "+e,t,i)){return true}}return uu(r,e,t,i)}function uu(r,e,t,i){var n=nu(r,e,i);if(n=="multi"){r.state.keySeq=e}if(n=="handled"){Et(r,"keyHandled",r,e,t)}if(n=="handled"||n=="multi"){Ar(t);Qi(r)}return!!n}function fu(r,e){var t=Ha(e,true);if(!t){return false}if(e.shiftKey&&!r.state.keySeq){return au(r,"Shift-"+t,e,(function(e){return iu(r,e,true)}))||au(r,t,e,(function(e){if(typeof e=="string"?/^go[A-Z]/.test(e):e.motion){return iu(r,e)}}))}else{return au(r,t,e,(function(e){return iu(r,e)}))}}function lu(r,e,t){return au(r,"'"+t+"'",e,(function(e){return iu(r,e,true)}))}var su=null;function cu(r){var e=this;if(r.target&&r.target!=e.display.input.getField()){return}e.curOp.focus=j(F(e));if(yr(e,r)){return}if(a&&u<11&&r.keyCode==27){r.returnValue=false}var i=r.keyCode;e.display.shift=i==16||r.shiftKey;var n=fu(e,r);if(d){su=n?i:null;if(!n&&i==88&&!Or&&(w?r.metaKey:r.ctrlKey)){e.replaceSelection("",null,"cut")}}if(t&&!w&&!n&&i==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)){du(e)}}function du(r){var e=r.display.lineDiv;I(e,"CodeMirror-crosshair");function t(r){if(r.keyCode==18||!r.altKey){L(e,"CodeMirror-crosshair");wr(document,"keyup",t);wr(document,"mouseover",t)}}gr(document,"keyup",t);gr(document,"mouseover",t)}function hu(r){if(r.keyCode==16){this.doc.sel.shift=false}yr(this,r)}function vu(r){var e=this;if(r.target&&r.target!=e.display.input.getField()){return}if(Gt(e.display,r)||yr(e,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var t=r.keyCode,i=r.charCode;if(d&&t==su){su=null;Ar(r);return}if(d&&(!r.which||r.which<10)&&fu(e,r)){return}var n=String.fromCharCode(i==null?t:i);if(n=="\b"){return}if(lu(e,r,n)){return}e.display.input.onKeyPress(r)}var mu=400;var pu=function(r,e,t){this.time=r;this.pos=e;this.button=t};pu.prototype.compare=function(r,e,t){return this.time+mu>r&&fe(e,this.pos)==0&&t==this.button};var gu,bu;function wu(r,e){var t=+new Date;if(bu&&bu.compare(t,r,e)){gu=bu=null;return"triple"}else if(gu&&gu.compare(t,r,e)){bu=new pu(t,r,e);gu=null;return"double"}else{gu=new pu(t,r,e);bu=null;return"single"}}function ku(r){var e=this,t=e.display;if(yr(e,r)||t.activeTouch&&t.input.supportsTouch()){return}t.input.ensurePolled();t.shift=r.shiftKey;if(Gt(t,r)){if(!f){t.scroller.draggable=false;setTimeout((function(){return t.scroller.draggable=true}),100)}return}if(Nu(e,r)){return}var i=Ri(e,r),n=Er(r),o=i?wu(i,n):"single";O(e).focus();if(n==1&&e.state.selectingText){e.state.selectingText(r)}if(i&&yu(e,n,i,o,r)){return}if(n==1){if(i){Cu(e,i,o,r)}else if(Nr(r)==t.scroller){Ar(r)}}else if(n==2){if(i){Oo(e.doc,i)}setTimeout((function(){return t.input.focus()}),20)}else if(n==3){if(M){e.display.input.onContextMenu(r)}else{Yi(e)}}}function yu(r,e,t,i,n){var o="Click";if(i=="double"){o="Double"+o}else if(i=="triple"){o="Triple"+o}o=(e==1?"Left":e==2?"Middle":"Right")+o;return au(r,Ga(o,n),n,(function(e){if(typeof e=="string"){e=Za[e]}if(!e){return false}var i=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}i=e(r,t)!=G}finally{r.state.suppressEdits=false}return i}))}function xu(r,e,t){var i=r.getOption("configureMouse");var n=i?i(r,e,t):{};if(n.unit==null){var o=k?t.shiftKey&&t.metaKey:t.altKey;n.unit=o?"rectangle":e=="single"?"char":e=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||t.shiftKey}if(n.addNew==null){n.addNew=w?t.metaKey:t.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?t.altKey:t.ctrlKey)}return n}function Cu(r,e,t,i){if(a){setTimeout(U(Ji,r),0)}else{r.curOp.focus=j(F(r))}var n=xu(r,t,i);var o=r.doc.sel,u;if(r.options.dragDrop&&Dr&&!r.isReadOnly()&&t=="single"&&(u=o.contains(e))>-1&&(fe((u=o.ranges[u]).from(),e)<0||e.xRel>0)&&(fe(u.to(),e)>0||e.xRel<0)){Mu(r,i,e,n)}else{Lu(r,i,e,n)}}function Mu(r,e,t,i){var n=r.display,o=false;var l=In(r,(function(e){if(f){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Yi(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){Ar(e);if(!i.addNew){Oo(r.doc,t,null,null,i.extend)}if(f&&!h||a&&u==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(e.clientX-r.clientX)+Math.abs(e.clientY-r.clientY)>=10};var c=function(){return o=true};if(f){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!i.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 Au(r,e,t){if(t=="char"){return new uo(e,e)}if(t=="word"){return r.findWordAt(e)}if(t=="line"){return new uo(ue(e.line,0),ve(r.doc,ue(e.line+1,0)))}var i=t(r,e);return new uo(i.from,i.to)}function Lu(r,e,t,i){if(a){Yi(r)}var n=r.display,o=r.doc;Ar(e);var u,f,l=o.sel,s=l.ranges;if(i.addNew&&!i.extend){f=o.sel.contains(t);if(f>-1){u=s[f]}else{u=new uo(t,t)}}else{u=o.sel.primary();f=o.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){u=new uo(t,t)}t=Ri(r,e,true,true);f=-1}else{var c=Au(r,t,i.unit);if(i.extend){u=Fo(u,c.anchor,c.head,i.extend)}else{u=c}}if(!i.addNew){f=0;$o(o,new ao([u],0),K);l=o.sel}else if(f==-1){f=s.length;$o(o,fo(r,s.concat([u]),f),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[f].empty()&&i.unit=="char"&&!i.extend){$o(o,fo(r,s.slice(0,f).concat(s.slice(f+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Po(o,f,u,K)}var d=t;function h(e){if(fe(d,e)==0){return}d=e;if(i.unit=="rectangle"){var n=[],a=r.options.tabSize;var s=_(Zr(o,t.line).text,t.ch,a);var c=_(Zr(o,e.line).text,e.ch,a);var h=Math.min(s,c),v=Math.max(s,c);for(var m=Math.min(t.line,e.line),p=Math.min(r.lastLine(),Math.max(t.line,e.line));m<=p;m++){var g=Zr(o,m).text,b=Q(g,h,a);if(h==v){n.push(new uo(ue(m,b),ue(m,b)))}else if(g.length>b){n.push(new uo(ue(m,b),ue(m,Q(g,v,a))))}}if(!n.length){n.push(new uo(t,t))}$o(o,fo(r,l.ranges.slice(0,f).concat(n),f),{origin:"*mouse",scroll:false});r.scrollIntoView(e)}else{var w=u;var k=Au(r,e,i.unit);var y=w.anchor,x;if(fe(k.anchor,y)>0){x=k.head;y=de(w.from(),k.anchor)}else{x=k.anchor;y=ce(w.to(),k.head)}var C=l.ranges.slice(0);C[f]=Su(r,new uo(ve(o,y),x));$o(o,fo(r,C,f),K)}}var v=n.wrapper.getBoundingClientRect();var m=0;function p(e){var t=++m;var a=Ri(r,e,true,i.unit=="rectangle");if(!a){return}if(fe(a,d)!=0){r.curOp.focus=j(F(r));h(a);var u=tn(n,o);if(a.line>=u.to||a.line<u.from){setTimeout(In(r,(function(){if(m==t){p(e)}})),150)}}else{var f=e.clientY<v.top?-20:e.clientY>v.bottom?20:0;if(f){setTimeout(In(r,(function(){if(m!=t){return}n.scroller.scrollTop+=f;p(e)})),50)}}}function g(e){r.state.selectingText=false;m=Infinity;if(e){Ar(e);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=In(r,(function(r){if(r.buttons===0||!Er(r)){g(r)}else{p(r)}}));var w=In(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Su(r,e){var t=e.anchor;var i=e.head;var n=Zr(r.doc,t.line);if(fe(t,i)==0&&t.sticky==i.sticky){return e}var o=mr(n);if(!o){return e}var a=hr(o,t.ch,t.sticky),u=o[a];if(u.from!=t.ch&&u.to!=t.ch){return e}var f=a+(u.from==t.ch==(u.level!=1)?0:1);if(f==0||f==o.length){return e}var l;if(i.line!=t.line){l=(i.line-t.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,i.ch,i.sticky);var c=s-a||(i.ch-t.ch)*(u.level==1?-1:1);if(s==f-1||s==f){l=c<0}else{l=c>0}}var d=o[f+(l?-1:0)];var h=l==(d.level==1);var v=h?d.from:d.to,m=h?"after":"before";return t.ch==v&&t.sticky==m?e:new uo(new ue(t.line,v,m),i)}function Tu(r,e,t,i){var n,o;if(e.touches){n=e.touches[0].clientX;o=e.touches[0].clientY}else{try{n=e.clientX;o=e.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(i){Ar(e)}var a=r.display;var u=a.lineDiv.getBoundingClientRect();if(o>u.bottom||!Cr(r,t)){return Sr(e)}o-=u.top-a.viewOffset;for(var f=0;f<r.display.gutterSpecs.length;++f){var l=a.gutters.childNodes[f];if(l&&l.getBoundingClientRect().right>=n){var s=ne(r.doc,o);var c=r.display.gutterSpecs[f];kr(r,t,r,s,c.className,e);return Sr(e)}}}function Nu(r,e){return Tu(r,e,"gutterClick",true)}function Eu(r,e){if(Gt(r.display,e)||Du(r,e)){return}if(yr(r,e,"contextmenu")){return}if(!M){r.display.input.onContextMenu(e)}}function Du(r,e){if(!Cr(r,"gutterContextMenu")){return false}return Tu(r,e,"gutterContextMenu",false)}function zu(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");di(r)}var ju={toString:function(){return"CodeMirror.Init"}};var Iu={};var Bu={};function Ru(r){var e=r.optionHandlers;function t(t,i,n,o){r.defaults[t]=i;if(n){e[t]=o?function(r,e,t){if(t!=ju){n(r,e,t)}}:n}}r.defineOption=t;r.Init=ju;t("value","",(function(r,e){return r.setValue(e)}),true);t("mode",null,(function(r,e){r.doc.modeOption=e;po(r)}),true);t("indentUnit",2,po,true);t("indentWithTabs",false);t("smartIndent",true);t("tabSize",4,(function(r){go(r);di(r);Oi(r)}),true);t("lineSeparator",null,(function(r,e){r.doc.lineSep=e;if(!e){return}var t=[],i=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(e,n);if(o==-1){break}n=o+e.length;t.push(ue(i,o))}i++}));for(var n=t.length-1;n>=0;n--){aa(r.doc,e,t[n],ue(t[n].line,t[n].ch+e.length))}}));t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,e,t){r.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g");if(t!=ju){r.refresh()}}));t("specialCharPlaceholder",gt,(function(r){return r.refresh()}),true);t("electricChars",true);t("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);t("spellcheck",false,(function(r,e){return r.getInputField().spellcheck=e}),true);t("autocorrect",false,(function(r,e){return r.getInputField().autocorrect=e}),true);t("autocapitalize",false,(function(r,e){return r.getInputField().autocapitalize=e}),true);t("rtlMoveVisually",!y);t("wholeLineUpdateBefore",true);t("theme","default",(function(r){zu(r);Zn(r)}),true);t("keyMap","default",(function(r,e,t){var i=Ka(e);var n=t!=ju&&Ka(t);if(n&&n.detach){n.detach(r,i)}if(i.attach){i.attach(r,n||null)}}));t("extraKeys",null);t("configureMouse",null);t("lineWrapping",false,Ou,true);t("gutters",[],(function(r,e){r.display.gutterSpecs=Yn(e,r.options.lineNumbers);Zn(r)}),true);t("fixedGutter",true,(function(r,e){r.display.gutters.style.left=e?ji(r.display)+"px":"0";r.refresh()}),true);t("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);t("scrollbarStyle","native",(function(r){Cn(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);t("lineNumbers",false,(function(r,e){r.display.gutterSpecs=Yn(r.options.gutters,e);Zn(r)}),true);t("firstLineNumber",1,Zn,true);t("lineNumberFormatter",(function(r){return r}),Zn,true);t("showCursorWhenSelecting",false,$i,true);t("resetSelectionOnContextMenu",true);t("lineWiseCopyCut",true);t("pasteLinesPerSelection",true);t("selectionsMayTouch",false);t("readOnly",false,(function(r,e){if(e=="nocursor"){Zi(r);r.display.input.blur()}r.display.input.readOnlyChanged(e)}));t("screenReaderLabel",null,(function(r,e){e=e===""?null:e;r.display.input.screenReaderLabelChanged(e)}));t("disableInput",false,(function(r,e){if(!e){r.display.input.reset()}}),true);t("dragDrop",true,Fu);t("allowDropFileTypes",null);t("cursorBlinkRate",530);t("cursorScrollMargin",0);t("cursorHeight",1,$i,true);t("singleCursorHeightPerLine",true,$i,true);t("workTime",100);t("workDelay",100);t("flattenSpans",true,go,true);t("addModeClass",false,go,true);t("pollInterval",100);t("undoDepth",200,(function(r,e){return r.doc.history.undoDepth=e}));t("historyEventDelay",1250);t("viewportMargin",10,(function(r){return r.refresh()}),true);t("maxHighlightLength",1e4,go,true);t("moveInputWithCursor",true,(function(r,e){if(!e){r.display.input.resetPosition()}}));t("tabindex",null,(function(r,e){return r.display.input.getField().tabIndex=e||""}));t("autofocus",null);t("direction","ltr",(function(r,e){return r.doc.setDirection(e)}),true);t("phrases",null)}function Fu(r,e,t){var i=t&&t!=ju;if(!e!=!i){var n=r.display.dragFunctions;var o=e?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 Ou(r){if(r.options.lineWrapping){I(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");lt(r)}Bi(r);Oi(r);di(r);setTimeout((function(){return kn(r)}),100)}function Uu(r,e){var t=this;if(!(this instanceof Uu)){return new Uu(r,e)}this.options=e=e?P(e):{};P(Iu,e,false);var i=e.value;if(typeof i=="string"){i=new Aa(i,e.mode,null,e.lineSeparator,e.direction)}else if(e.mode){i.modeOption=e.mode}this.doc=i;var n=new Uu.inputStyles[e.inputStyle](this);var o=this.display=new ro(r,i,n,e);o.wrapper.CodeMirror=this;zu(this);if(e.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}Cn(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 q,keySeq:null,specialChars:null};if(e.autofocus&&!b){o.input.focus()}if(a&&u<11){setTimeout((function(){return t.display.input.reset(true)}),20)}Pu(this);ja();An(this);this.curOp.forceUpdate=true;yo(this,i);if(e.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(t.hasFocus()&&!t.state.focused){Xi(t)}}),20)}else{Zi(this)}for(var l in Bu){if(Bu.hasOwnProperty(l)){Bu[l](this,e[l],ju)}}Jn(this);if(e.finishInit){e.finishInit(this)}for(var s=0;s<_u.length;++s){_u[s](this)}Ln(this);if(f&&e.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Uu.defaults=Iu;Uu.optionHandlers=Bu;function Pu(r){var e=r.display;gr(e.scroller,"mousedown",In(r,ku));if(a&&u<11){gr(e.scroller,"dblclick",In(r,(function(e){if(yr(r,e)){return}var t=Ri(r,e);if(!t||Nu(r,e)||Gt(r.display,e)){return}Ar(e);var i=r.findWordAt(t);Oo(r.doc,i.anchor,i.head)})))}else{gr(e.scroller,"dblclick",(function(e){return yr(r,e)||Ar(e)}))}gr(e.scroller,"contextmenu",(function(e){return Eu(r,e)}));gr(e.input.getField(),"contextmenu",(function(t){if(!e.scroller.contains(t.target)){Eu(r,t)}}));var t,i={end:0};function n(){if(e.activeTouch){t=setTimeout((function(){return e.activeTouch=null}),1e3);i=e.activeTouch;i.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var e=r.touches[0];return e.radiusX<=1&&e.radiusY<=1}function f(r,e){if(e.left==null){return true}var t=e.left-r.left,i=e.top-r.top;return t*t+i*i>20*20}gr(e.scroller,"touchstart",(function(n){if(!yr(r,n)&&!o(n)&&!Nu(r,n)){e.input.ensurePolled();clearTimeout(t);var a=+new Date;e.activeTouch={start:a,moved:false,prev:a-i.end<=300?i:null};if(n.touches.length==1){e.activeTouch.left=n.touches[0].pageX;e.activeTouch.top=n.touches[0].pageY}}}));gr(e.scroller,"touchmove",(function(){if(e.activeTouch){e.activeTouch.moved=true}}));gr(e.scroller,"touchend",(function(t){var i=e.activeTouch;if(i&&!Gt(e,t)&&i.left!=null&&!i.moved&&new Date-i.start<300){var o=r.coordsChar(e.activeTouch,"page"),a;if(!i.prev||f(i,i.prev)){a=new uo(o,o)}else if(!i.prev.prev||f(i,i.prev.prev)){a=r.findWordAt(o)}else{a=new uo(ue(o.line,0),ve(r.doc,ue(o.line+1,0)))}r.setSelection(a.anchor,a.head);r.focus();Ar(t)}n()}));gr(e.scroller,"touchcancel",n);gr(e.scroller,"scroll",(function(){if(e.scroller.clientHeight){vn(r,e.scroller.scrollTop);pn(r,e.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(e.scroller,"mousewheel",(function(e){return oo(r,e)}));gr(e.scroller,"DOMMouseScroll",(function(e){return oo(r,e)}));gr(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0}));e.dragFunctions={enter:function(e){if(!yr(r,e)){Tr(e)}},over:function(e){if(!yr(r,e)){Na(r,e);Tr(e)}},start:function(e){return Ta(r,e)},drop:In(r,Sa),leave:function(e){if(!yr(r,e)){Ea(r)}}};var l=e.input.getField();gr(l,"keyup",(function(e){return hu.call(r,e)}));gr(l,"keydown",In(r,cu));gr(l,"keypress",In(r,vu));gr(l,"focus",(function(e){return Xi(r,e)}));gr(l,"blur",(function(e){return Zi(r,e)}))}var _u=[];Uu.defineInitHook=function(r){return _u.push(r)};function qu(r,e,t,i){var n=r.doc,o;if(t==null){t="add"}if(t=="smart"){if(!n.mode.indent){t="prev"}else{o=ye(r,e).state}}var a=r.options.tabSize;var u=Zr(n,e),f=_(u.text,null,a);if(u.stateAfter){u.stateAfter=null}var l=u.text.match(/^\s*/)[0],s;if(!i&&!/\S/.test(u.text)){s=0;t="not"}else if(t=="smart"){s=n.mode.indent(o,u.text.slice(l.length),u.text);if(s==G||s>150){if(!i){return}t="prev"}}if(t=="prev"){if(e>n.first){s=_(Zr(n,e-1).text,null,a)}else{s=0}}else if(t=="add"){s=f+r.options.indentUnit}else if(t=="subtract"){s=f-r.options.indentUnit}else if(typeof t=="number"){s=f+t}s=Math.max(0,s);var c="",d=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/a);h;--h){d+=a;c+="\t"}}if(d<s){c+=Y(s-d)}if(c!=l){aa(n,c,ue(e,0),ue(e,l.length),"+input");u.stateAfter=null;return true}else{for(var v=0;v<n.sel.ranges.length;v++){var m=n.sel.ranges[v];if(m.head.line==e&&m.head.ch<l.length){var p=ue(e,l.length);Po(n,v,new uo(p,p));break}}}}var Wu=null;function $u(r){Wu=r}function Gu(r,e,t,i,n){var o=r.doc;r.display.shift=false;if(!i){i=o.sel}var a=+new Date-200;var u=n=="paste"||r.state.pasteIncoming>a;var f=Rr(e),l=null;if(u&&i.ranges.length>1){if(Wu&&Wu.text.join("\n")==e){if(i.ranges.length%Wu.text.length==0){l=[];for(var s=0;s<Wu.text.length;s++){l.push(o.splitLines(Wu.text[s]))}}}else if(f.length==i.ranges.length&&r.options.pasteLinesPerSelection){l=Z(f,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var d=i.ranges.length-1;d>=0;d--){var h=i.ranges[d];var v=h.from(),m=h.to();if(h.empty()){if(t&&t>0){v=ue(v.line,v.ch-t)}else if(r.state.overwrite&&!u){m=ue(m.line,Math.min(Zr(o,m.line).text.length,m.ch+X(f).length))}else if(u&&Wu&&Wu.lineWise&&Wu.text.join("\n")==f.join("\n")){v=m=ue(v.line,0)}}var p={from:v,to:m,text:l?l[d%l.length]:f,origin:n||(u?"paste":r.state.cutIncoming>a?"cut":"+input")};ra(r.doc,p);Et(r,"inputRead",r,p)}if(e&&!u){Ku(r,e)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Hu(r,e){var t=r.clipboardData&&r.clipboardData.getData("Text");if(t){r.preventDefault();if(!e.isReadOnly()&&!e.options.disableInput&&e.hasFocus()){jn(e,(function(){return Gu(e,t,0,null,"paste")}))}return true}}function Ku(r,e){if(!r.options.electricChars||!r.options.smartIndent){return}var t=r.doc.sel;for(var i=t.ranges.length-1;i>=0;i--){var n=t.ranges[i];if(n.head.ch>100||i&&t.ranges[i-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var a=false;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++){if(e.indexOf(o.electricChars.charAt(u))>-1){a=qu(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))){a=qu(r,n.head.line,"smart")}}if(a){Et(r,"electricInput",r,n.head.line)}}}function Vu(r){var e=[],t=[];for(var i=0;i<r.doc.sel.ranges.length;i++){var n=r.doc.sel.ranges[i].head.line;var o={anchor:ue(n,0),head:ue(n+1,0)};t.push(o);e.push(r.getRange(o.anchor,o.head))}return{text:e,ranges:t}}function Qu(r,e,t,i){r.setAttribute("autocorrect",t?"":"off");r.setAttribute("autocapitalize",i?"":"off");r.setAttribute("spellcheck",!!e)}function Ju(){var r=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var e=N("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(f){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}Qu(r);return e}function Yu(r){var e=r.optionHandlers;var t=r.helpers={};r.prototype={constructor:r,focus:function(){O(this).focus();this.display.input.focus()},setOption:function(r,t){var i=this.options,n=i[r];if(i[r]==t&&r!="mode"){return}i[r]=t;if(e.hasOwnProperty(r)){In(this,e[r])(this,t,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,e){this.state.keyMaps[e?"push":"unshift"](Ka(r))},removeKeyMap:function(r){var e=this.state.keyMaps;for(var t=0;t<e.length;++t){if(e[t]==r||e[t].name==r){e.splice(t,1);return true}}},addOverlay:Bn((function(e,t){var i=e.token?e:r.getMode(this.options,e);if(i.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:i,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},(function(r){return r.priority}));this.state.modeGen++;Oi(this)})),removeOverlay:Bn((function(r){var e=this.state.overlays;for(var t=0;t<e.length;++t){var i=e[t].modeSpec;if(i==r||typeof r=="string"&&i.name==r){e.splice(t,1);this.state.modeGen++;Oi(this);return}}})),indentLine:Bn((function(r,e,t){if(typeof e!="string"&&typeof e!="number"){if(e==null){e=this.options.smartIndent?"smart":"prev"}else{e=e?"add":"subtract"}}if(oe(this.doc,r)){qu(this,r,e,t)}})),indentSelection:Bn((function(r){var e=this.doc.sel.ranges,t=-1;for(var i=0;i<e.length;i++){var n=e[i];if(!n.empty()){var o=n.from(),a=n.to();var u=Math.max(t,o.line);t=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var f=u;f<t;++f){qu(this,f,r)}var l=this.doc.sel.ranges;if(o.ch==0&&e.length==l.length&&l[i].from().ch>0){Po(this.doc,i,new uo(o,l[i].to()),H)}}else if(n.head.line>t){qu(this,n.head.line,r,true);t=n.head.line;if(i==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,e){return Le(this,r,e)},getLineTokens:function(r,e){return Le(this,ue(r),e,true)},getTokenTypeAt:function(r){r=ve(this.doc,r);var e=ke(this,Zr(this.doc,r.line));var t=0,i=(e.length-1)/2,n=r.ch;var o;if(n==0){o=e[2]}else{for(;;){var a=t+i>>1;if((a?e[a*2-1]:0)>=n){i=a}else if(e[a*2+1]<n){t=a+1}else{o=e[a*2+2];break}}}var u=o?o.indexOf("overlay "):-1;return u<0?o:u==0?null:o.slice(0,u-1)},getModeAt:function(e){var t=this.doc.mode;if(!t.innerMode){return t}return r.innerMode(t,this.getTokenAt(e).state).mode},getHelper:function(r,e){return this.getHelpers(r,e)[0]},getHelpers:function(r,e){var i=[];if(!t.hasOwnProperty(e)){return i}var n=t[e],o=this.getModeAt(r);if(typeof o[e]=="string"){if(n[o[e]]){i.push(n[o[e]])}}else if(o[e]){for(var a=0;a<o[e].length;a++){var u=n[o[e][a]];if(u){i.push(u)}}}else if(o.helperType&&n[o.helperType]){i.push(n[o.helperType])}else if(n[o.name]){i.push(n[o.name])}for(var f=0;f<n._global.length;f++){var l=n._global[f];if(l.pred(o,this)&&W(i,l.val)==-1){i.push(l.val)}}return i},getStateAfter:function(r,e){var t=this.doc;r=he(t,r==null?t.first+t.size-1:r);return ye(this,r+1,e).state},cursorCoords:function(r,e){var t,i=this.doc.sel.primary();if(r==null){t=i.head}else if(typeof r=="object"){t=ve(this.doc,r)}else{t=r?i.from():i.to()}return wi(this,t,e||"page")},charCoords:function(r,e){return bi(this,ve(this.doc,r),e||"page")},coordsChar:function(r,e){r=gi(this,r,e||"page");return xi(this,r.left,r.top)},lineAtHeight:function(r,e){r=gi(this,{top:r,left:0},e||"page").top;return ne(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,e,t){var i=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;i=true}n=Zr(this.doc,r)}else{n=r}return pi(this,n,{top:0,left:0},e||"page",t||i).top+(i?this.doc.height-ut(n):0)},defaultTextHeight:function(){return Ei(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,e,t,i,n){var o=this.display;r=wi(this,ve(this.doc,r));var a=r.bottom,u=r.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(e);o.sizer.appendChild(e);if(i=="over"){a=r.top}else if(i=="above"||i=="near"){var f=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((i=="above"||r.bottom+e.offsetHeight>f)&&r.top>e.offsetHeight){a=r.top-e.offsetHeight}else if(r.bottom+e.offsetHeight<=f){a=r.bottom}if(u+e.offsetWidth>l){u=l-e.offsetWidth}}e.style.top=a+"px";e.style.left=e.style.right="";if(n=="right"){u=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"}else{if(n=="left"){u=0}else if(n=="middle"){u=(o.sizer.clientWidth-e.offsetWidth)/2}e.style.left=u+"px"}if(t){an(this,{left:u,top:a,right:u+e.offsetWidth,bottom:a+e.offsetHeight})}},triggerOnKeyDown:Bn(cu),triggerOnKeyPress:Bn(vu),triggerOnKeyUp:hu,triggerOnMouseDown:Bn(ku),execCommand:function(r){if(Za.hasOwnProperty(r)){return Za[r].call(null,this)}},triggerElectric:Bn((function(r){Ku(this,r)})),findPosH:function(r,e,t,i){var n=1;if(e<0){n=-1;e=-e}var o=ve(this.doc,r);for(var a=0;a<e;++a){o=Xu(this.doc,o,n,t,i);if(o.hitSide){break}}return o},moveH:Bn((function(r,e){var t=this;this.extendSelectionsBy((function(i){if(t.display.shift||t.doc.extend||i.empty()){return Xu(t.doc,i.head,r,e,t.options.rtlMoveVisually)}else{return r<0?i.from():i.to()}}),V)})),deleteH:Bn((function(r,e){var t=this.doc.sel,i=this.doc;if(t.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Va(this,(function(t){var n=Xu(i,t.head,r,e,false);return r<0?{from:n,to:t.head}:{from:t.head,to:n}}))}})),findPosV:function(r,e,t,i){var n=1,o=i;if(e<0){n=-1;e=-e}var a=ve(this.doc,r);for(var u=0;u<e;++u){var f=wi(this,a,"div");if(o==null){o=f.left}else{f.left=o}a=Zu(this,f,n,t);if(a.hitSide){break}}return a},moveV:Bn((function(r,e){var t=this;var i=this.doc,n=[];var o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(a){if(o){return r<0?a.from():a.to()}var u=wi(t,a.head,"div");if(a.goalColumn!=null){u.left=a.goalColumn}n.push(u.left);var f=Zu(t,u,r,e);if(e=="page"&&a==i.sel.primary()){fn(t,bi(t,f,"div").top-u.top)}return f}),V);if(n.length){for(var a=0;a<i.sel.ranges.length;a++){i.sel.ranges[a].goalColumn=n[a]}}})),findWordAt:function(r){var e=this.doc,t=Zr(e,r.line).text;var i=r.ch,n=r.ch;if(t){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==t.length)&&i){--i}else{++n}var a=t.charAt(i);var u=or(a,o)?function(r){return or(r,o)}:/\s/.test(a)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(i>0&&u(t.charAt(i-1))){--i}while(n<t.length&&u(t.charAt(n))){++n}}return new uo(ue(r.line,i),ue(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){I(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()==j(F(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,e){sn(this,r,e)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Qt(this)-this.display.barHeight,width:r.scrollWidth-Qt(this)-this.display.barWidth,clientHeight:Yt(this),clientWidth:Jt(this)}},scrollIntoView:Bn((function(r,e){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(e==null){e=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ue(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=e||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,e){var t=this;var i=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=i(r)}if(e!=null){this.display.wrapper.style.height=i(e)}if(this.options.lineWrapping){ci(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var e=0;e<r.widgets.length;e++){if(r.widgets[e].noHScroll){Ui(t,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return jn(this,r)},startOperation:function(){return An(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;Oi(this);this.curOp.forceUpdate=true;di(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Kn(this.display);if(r==null||Math.abs(r-Ei(this.display))>.5||this.options.lineWrapping){Bi(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var e=this.doc;e.cm=null;if(this.state.selectingText){this.state.selectingText()}yo(this,r);di(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;Et(this,"swapDoc",this,e);return e})),phrase:function(r){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,r)?e[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}};Mr(r);r.registerHelper=function(e,i,n){if(!t.hasOwnProperty(e)){t[e]=r[e]={_global:[]}}t[e][i]=n};r.registerGlobalHelper=function(e,i,n,o){r.registerHelper(e,i,o);t[e]._global.push({pred:n,val:o})}}function Xu(r,e,t,i,n){var o=e;var a=t;var u=Zr(r,e.line);var f=n&&r.direction=="rtl"?-t:t;function l(){var t=e.line+f;if(t<r.first||t>=r.first+r.size){return false}e=new ue(t,e.ch,e.sticky);return u=Zr(r,t)}function s(o){var a;if(i=="codepoint"){var s=u.text.charCodeAt(e.ch+(t>0?0:-1));if(isNaN(s)){a=null}else{var c=t>0?s>=55296&&s<56320:s>=56320&&s<57343;a=new ue(e.line,Math.max(0,Math.min(u.text.length,e.ch+t*(c?2:1))),-t)}}else if(n){a=Xa(r.cm,u,e,t)}else{a=Ja(u,e,t)}if(a==null){if(!o&&l()){e=Ya(n,r.cm,u,e.line,f)}else{return false}}else{e=a}return true}if(i=="char"||i=="codepoint"){s()}else if(i=="column"){s(true)}else if(i=="word"||i=="group"){var c=null,d=i=="group";var h=r.cm&&r.cm.getHelper(e,"wordChars");for(var v=true;;v=false){if(t<0&&!s(!v)){break}var m=u.text.charAt(e.ch)||"\n";var p=or(m,h)?"w":d&&m=="\n"?"n":!d||/\s/.test(m)?null:"p";if(d&&!v&&!p){p="s"}if(c&&c!=p){if(t<0){t=1;s();e.sticky="after"}break}if(p){c=p}if(t>0&&!s(!v)){break}}}var g=Jo(r,e,o,a,true);if(le(o,g)){g.hitSide=true}return g}function Zu(r,e,t,i){var n=r.doc,o=e.left,a;if(i=="page"){var u=Math.min(r.display.wrapper.clientHeight,O(r).innerHeight||n(r).documentElement.clientHeight);var f=Math.max(u-.5*Ei(r.display),3);a=(t>0?e.bottom:e.top)+t*f}else if(i=="line"){a=t>0?e.bottom+3:e.top-3}var l;for(;;){l=xi(r,o,a);if(!l.outside){break}if(t<0?a<=0:a>=n.height){l.hitSide=true;break}a+=t*5}return l}var rf=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new q;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};rf.prototype.init=function(r){var e=this;var t=this,i=t.cm;var n=t.div=r.lineDiv;n.contentEditable=true;Qu(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function o(r){for(var e=r.target;e;e=e.parentNode){if(e==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(e.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||yr(i,r)||Hu(r,i)){return}if(u<=11){setTimeout(In(i,(function(){return e.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){e.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!e.composing){e.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(e.composing){if(r.data!=e.composing.data){e.readFromDOMSoon()}e.composing.done=true}}));gr(n,"touchstart",(function(){return t.forceCompositionEnd()}));gr(n,"input",(function(){if(!e.composing){e.readFromDOMSoon()}}));function a(r){if(!o(r)||yr(i,r)){return}if(i.somethingSelected()){$u({lineWise:false,text:i.getSelections()});if(r.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var e=Vu(i);$u({lineWise:true,text:e.text});if(r.type=="cut"){i.operation((function(){i.setSelections(e.ranges,0,H);i.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var a=Wu.text.join("\n");r.clipboardData.setData("Text",a);if(r.clipboardData.getData("Text")==a){r.preventDefault();return}}var u=Ju(),f=u.firstChild;i.display.lineSpace.insertBefore(u,i.display.lineSpace.firstChild);f.value=Wu.text.join("\n");var l=j(n.ownerDocument);R(f);setTimeout((function(){i.display.lineSpace.removeChild(u);l.focus();if(l==n){t.showPrimarySelection()}}),50)}gr(n,"copy",a);gr(n,"cut",a)};rf.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};rf.prototype.prepareSelection=function(){var r=Gi(this.cm,false);r.focus=j(this.div.ownerDocument)==this.div;return r};rf.prototype.showSelection=function(r,e){if(!r||!this.cm.display.view.length){return}if(r.focus||e){this.showPrimarySelection()}this.showMultipleSelections(r)};rf.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};rf.prototype.showPrimarySelection=function(){var r=this.getSelection(),e=this.cm,i=e.doc.sel.primary();var n=i.from(),o=i.to();if(e.display.viewTo==e.display.viewFrom||n.line>=e.display.viewTo||o.line<e.display.viewFrom){r.removeAllRanges();return}var a=af(e,r.anchorNode,r.anchorOffset);var u=af(e,r.focusNode,r.focusOffset);if(a&&!a.bad&&u&&!u.bad&&fe(de(a,u),n)==0&&fe(ce(a,u),o)==0){return}var f=e.display.view;var l=n.line>=e.display.viewFrom&&ef(e,n)||{node:f[0].measure.map[2],offset:0};var s=o.line<e.display.viewTo&&ef(e,o);if(!s){var c=f[f.length-1].measure;var d=c.maps?c.maps[c.maps.length-1]:c.map;s={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),v;try{v=D(l.node,l.offset,s.offset,s.node)}catch(r){}if(v){if(!t&&e.state.focused){r.collapse(l.node,l.offset);if(!v.collapsed){r.removeAllRanges();r.addRange(v)}}else{r.removeAllRanges();r.addRange(v)}if(h&&r.anchorNode==null){r.addRange(h)}else if(t){this.startGracePeriod()}}this.rememberSelection()};rf.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)};rf.prototype.showMultipleSelections=function(r){T(this.cm.display.cursorDiv,r.cursors);T(this.cm.display.selectionDiv,r.selection)};rf.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};rf.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var e=r.getRangeAt(0).commonAncestorContainer;return z(this.div,e)};rf.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||j(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};rf.prototype.blur=function(){this.div.blur()};rf.prototype.getField=function(){return this.div};rf.prototype.supportsTouch=function(){return true};rf.prototype.receivedFocus=function(){var r=this;var e=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{jn(this.cm,(function(){return e.cm.curOp.selectionChanged=true}))}function t(){if(e.cm.state.focused){e.pollSelection();e.polling.set(e.cm.options.pollInterval,t)}}this.polling.set(this.cm.options.pollInterval,t)};rf.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};rf.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),e=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&tf(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var t=af(e,r.anchorNode,r.anchorOffset);var i=af(e,r.focusNode,r.focusOffset);if(t&&i){jn(e,(function(){$o(e.doc,lo(t,i),H);if(t.bad||i.bad){e.curOp.selectionChanged=true}}))}};rf.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,e=r.display,t=r.doc.sel.primary();var i=t.from(),n=t.to();if(i.ch==0&&i.line>r.firstLine()){i=ue(i.line-1,Zr(r.doc,i.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ue(n.line+1,0)}if(i.line<e.viewFrom||n.line>e.viewTo-1){return false}var o,a,u;if(i.line==e.viewFrom||(o=Fi(r,i.line))==0){a=ie(e.view[0].line);u=e.view[0].node}else{a=ie(e.view[o].line);u=e.view[o-1].node.nextSibling}var f=Fi(r,n.line);var l,s;if(f==e.view.length-1){l=e.viewTo-1;s=e.lineDiv.lastChild}else{l=ie(e.view[f+1].line)-1;s=e.view[f+1].node.previousSibling}if(!u){return false}var c=r.doc.splitLines(of(r,u,s,a,l));var d=re(r.doc,ue(a,0),ue(l,Zr(r.doc,l).text.length));while(c.length>1&&d.length>1){if(X(c)==X(d)){c.pop();d.pop();l--}else if(c[0]==d[0]){c.shift();d.shift();a++}else{break}}var h=0,v=0;var m=c[0],p=d[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=X(c),w=X(d);var k=Math.min(b.length-(c.length==1?h:0),w.length-(d.length==1?h:0));while(v<k&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1)){++v}if(c.length==1&&d.length==1&&a==i.line){while(h&&h>i.ch&&b.charCodeAt(b.length-v-1)==w.charCodeAt(w.length-v-1)){h--;v++}}c[c.length-1]=b.slice(0,b.length-v).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var y=ue(a,h);var x=ue(l,d.length?X(d).length-v:0);if(c.length>1||c[0]||fe(y,x)){aa(r.doc,c,y,x,"+input");return true}};rf.prototype.ensurePolled=function(){this.forceCompositionEnd()};rf.prototype.reset=function(){this.forceCompositionEnd()};rf.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};rf.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)};rf.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){jn(this.cm,(function(){return Oi(r.cm)}))}};rf.prototype.setUneditable=function(r){r.contentEditable="false"};rf.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){In(this.cm,Gu)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};rf.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};rf.prototype.onContextMenu=function(){};rf.prototype.resetPosition=function(){};rf.prototype.needsContentAttribute=true;function ef(r,e){var t=ti(r,e.line);if(!t||t.hidden){return null}var i=Zr(r.doc,e.line);var n=Zt(t,i,e.line);var o=mr(i,r.doc.direction),a="left";if(o){var u=hr(o,e.ch);a=u%2?"right":"left"}var f=ai(n.map,e.ch,a);f.offset=f.collapse=="right"?f.end:f.start;return f}function tf(r){for(var e=r;e;e=e.parentNode){if(/CodeMirror-gutter-wrapper/.test(e.className)){return true}}return false}function nf(r,e){if(e){r.bad=true}return r}function of(r,e,t,i,n){var o="",a=false,u=r.doc.lineSeparator(),f=false;function l(r){return function(e){return e.id==r}}function s(){if(a){o+=u;if(f){o+=u}a=f=false}}function c(r){if(r){s();o+=r}}function d(e){if(e.nodeType==1){var t=e.getAttribute("cm-text");if(t){c(t);return}var o=e.getAttribute("cm-marker"),h;if(o){var v=r.findMarks(ue(i,0),ue(n+1,0),l(+o));if(v.length&&(h=v[0].find(0))){c(re(r.doc,h.from,h.to).join(u))}return}if(e.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&e.textContent.length==0){return}if(m){s()}for(var p=0;p<e.childNodes.length;p++){d(e.childNodes[p])}if(/^(pre|p)$/i.test(e.nodeName)){f=true}if(m){a=true}}else if(e.nodeType==3){c(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){d(e);if(e==t){break}e=e.nextSibling;f=false}return o}function af(r,e,t){var i;if(e==r.display.lineDiv){i=r.display.lineDiv.childNodes[t];if(!i){return nf(r.clipPos(ue(r.display.viewTo-1)),true)}e=null;t=0}else{for(i=e;;i=i.parentNode){if(!i||i==r.display.lineDiv){return null}if(i.parentNode&&i.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==i){return uf(o,e,t)}}}function uf(r,e,t){var i=r.text.firstChild,n=false;if(!e||!z(i,e)){return nf(ue(ie(r.line),0),true)}if(e==i){n=true;e=i.childNodes[t];t=0;if(!e){var o=r.rest?X(r.rest):r.line;return nf(ue(ie(o),o.text.length),n)}}var a=e.nodeType==3?e:null,u=e;if(!a&&e.childNodes.length==1&&e.firstChild.nodeType==3){a=e.firstChild;if(t){t=a.nodeValue.length}}while(u.parentNode!=i){u=u.parentNode}var f=r.measure,l=f.maps;function s(e,t,i){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?f.map:l[n];for(var a=0;a<o.length;a+=3){var u=o[a+2];if(u==e||u==t){var s=ie(n<0?r.line:r.rest[n]);var c=o[a]+i;if(i<0||u!=e){c=o[a+(i?1:0)]}return ue(s,c)}}}}var c=s(a,u,t);if(c){return nf(c,n)}for(var d=u.nextSibling,h=a?a.nodeValue.length-t:0;d;d=d.nextSibling){c=s(d,d.firstChild,0);if(c){return nf(ue(c.line,c.ch-h),n)}else{h+=d.textContent.length}}for(var v=u.previousSibling,m=t;v;v=v.previousSibling){c=s(v,v.firstChild,-1);if(c){return nf(ue(c.line,c.ch+m),n)}else{m+=v.textContent.length}}}var ff=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new q;this.hasSelection=false;this.composing=null;this.resetting=false};ff.prototype.init=function(r){var e=this;var t=this,i=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(a&&u>=9&&e.hasSelection){e.hasSelection=null}t.poll()}));gr(n,"paste",(function(r){if(yr(i,r)||Hu(r,i)){return}i.state.pasteIncoming=+new Date;t.fastPoll()}));function o(r){if(yr(i,r)){return}if(i.somethingSelected()){$u({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var e=Vu(i);$u({lineWise:true,text:e.text});if(r.type=="cut"){i.setSelections(e.ranges,null,H)}else{t.prevInput="";n.value=e.text.join("\n");R(n)}}if(r.type=="cut"){i.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(e){if(Gt(r,e)||yr(i,e)){return}if(!n.dispatchEvent){i.state.pasteIncoming=+new Date;t.focus();return}var o=new Event("paste");o.clipboardData=e.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(e){if(!Gt(r,e)){Ar(e)}}));gr(n,"compositionstart",(function(){var r=i.getCursor("from");if(t.composing){t.composing.range.clear()}t.composing={start:r,range:i.markText(r,i.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(t.composing){t.poll();t.composing.range.clear();t.composing=null}}))};ff.prototype.createField=function(r){this.wrapper=Ju();this.textarea=this.wrapper.firstChild};ff.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};ff.prototype.prepareSelection=function(){var r=this.cm,e=r.display,t=r.doc;var i=Gi(r);if(r.options.moveInputWithCursor){var n=wi(r,t.sel.primary().head,"div");var o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,n.top+a.top-o.top));i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,n.left+a.left-o.left))}return i};ff.prototype.showSelection=function(r){var e=this.cm,t=e.display;T(t.cursorDiv,r.cursors);T(t.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};ff.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var e=this.cm;this.resetting=true;if(e.somethingSelected()){this.prevInput="";var t=e.getSelection();this.textarea.value=t;if(e.state.focused){R(this.textarea)}if(a&&u>=9){this.hasSelection=t}}else if(!r){this.prevInput=this.textarea.value="";if(a&&u>=9){this.hasSelection=null}}this.resetting=false};ff.prototype.getField=function(){return this.textarea};ff.prototype.supportsTouch=function(){return false};ff.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||j(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};ff.prototype.blur=function(){this.textarea.blur()};ff.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ff.prototype.receivedFocus=function(){this.slowPoll()};ff.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()}}))};ff.prototype.fastPoll=function(){var r=false,e=this;e.pollingFast=true;function t(){var i=e.poll();if(!i&&!r){r=true;e.polling.set(60,t)}else{e.pollingFast=false;e.slowPoll()}}e.polling.set(20,t)};ff.prototype.poll=function(){var r=this;var e=this.cm,t=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Fr(t)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq){return false}var n=t.value;if(n==i&&!e.somethingSelected()){return false}if(a&&u>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){e.display.input.reset();return false}if(e.doc.sel==e.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!i){i="​"}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var f=0,l=Math.min(i.length,n.length);while(f<l&&i.charCodeAt(f)==n.charCodeAt(f)){++f}jn(e,(function(){Gu(e,n.slice(f),i.length-f,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){t.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=e.markText(r.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};ff.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};ff.prototype.onKeyPress=function(){if(a&&u>=9){this.hasSelection=null}this.fastPoll()};ff.prototype.onContextMenu=function(r){var e=this,t=e.cm,i=t.display,n=e.textarea;if(e.contextMenuPending){e.contextMenuPending()}var o=Ri(t,r),l=i.scroller.scrollTop;if(!o||d){return}var s=t.options.resetSelectionOnContextMenu;if(s&&t.doc.sel.contains(o)==-1){In(t,$o)(t.doc,lo(o),H)}var c=n.style.cssText,h=e.wrapper.style.cssText;var v=e.wrapper.offsetParent.getBoundingClientRect();e.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-v.top-5)+"px; left: "+(r.clientX-v.left-5)+"px;\n z-index: 1000; background: "+(a?"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(f){m=n.ownerDocument.defaultView.scrollY}i.input.focus();if(f){n.ownerDocument.defaultView.scrollTo(null,m)}i.input.reset();if(!t.somethingSelected()){n.value=e.prevInput=" "}e.contextMenuPending=g;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=t.somethingSelected();var o="​"+(r?n.value:"");n.value="⇚";n.value=o;e.prevInput=r?"":"​";n.selectionStart=1;n.selectionEnd=o.length;i.selForContextMenu=t.doc.sel}}function g(){if(e.contextMenuPending!=g){return}e.contextMenuPending=false;e.wrapper.style.cssText=h;n.style.cssText=c;if(a&&u<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!a||a&&u<9){p()}var r=0,o=function(){if(i.selForContextMenu==t.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&e.prevInput=="​"){In(t,Xo)(t)}else if(r++<10){i.detectingSelectAll=setTimeout(o,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(o,200)}}if(a&&u>=9){p()}if(M){Tr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};ff.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};ff.prototype.setUneditable=function(){};ff.prototype.needsContentAttribute=false;function lf(r,e){e=e?P(e):{};e.value=r.value;if(!e.tabindex&&r.tabIndex){e.tabindex=r.tabIndex}if(!e.placeholder&&r.placeholder){e.placeholder=r.placeholder}if(e.autofocus==null){var t=j(r.ownerDocument);e.autofocus=t==r||r.getAttribute("autofocus")!=null&&t==document.body}function i(){r.value=u.getValue()}var n;if(r.form){gr(r.form,"submit",i);if(!e.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var a=o.submit=function(){i();o.submit=n;o.submit();o.submit=a}}catch(r){}}}e.finishInit=function(t){t.save=i;t.getTextArea=function(){return r};t.toTextArea=function(){t.toTextArea=isNaN;i();r.parentNode.removeChild(t.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",i);if(!e.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var u=Uu((function(e){return r.parentNode.insertBefore(e,r.nextSibling)}),e);return u}function sf(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=Aa;r.splitLines=Rr;r.countColumn=_;r.findColumn=Q;r.isWordChar=nr;r.Pass=G;r.signal=kr;r.Line=st;r.changeEnd=so;r.scrollbarModel=xn;r.Pos=ue;r.cmpPos=fe;r.modes=_r;r.mimeModes=qr;r.resolveMode=Gr;r.getMode=Hr;r.modeExtensions=Kr;r.extendMode=Vr;r.copyState=Qr;r.startState=Yr;r.innerMode=Jr;r.commands=Za;r.keyMap=Pa;r.keyName=Ha;r.isModifierKey=$a;r.lookupKey=Wa;r.normalizeKeyMap=qa;r.StringStream=Xr;r.SharedTextMarker=wa;r.TextMarker=ga;r.LineWidget=ha;r.e_preventDefault=Ar;r.e_stopPropagation=Lr;r.e_stop=Tr;r.addClass=I;r.contains=z;r.rmClass=L;r.keyNames=Ra}Ru(Uu);Yu(Uu);var cf="iter insert remove copy getEditor constructor".split(" ");for(var df in Aa.prototype){if(Aa.prototype.hasOwnProperty(df)&&W(cf,df)<0){Uu.prototype[df]=function(r){return function(){return r.apply(this.doc,arguments)}}(Aa.prototype[df])}}Mr(Aa);Uu.inputStyles={textarea:ff,contenteditable:rf};Uu.defineMode=function(r){if(!Uu.defaults.mode&&r!="null"){Uu.defaults.mode=r}Wr.apply(this,arguments)};Uu.defineMIME=$r;Uu.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Uu.defineMIME("text/plain","null");Uu.defineExtension=function(r,e){Uu.prototype[r]=e};Uu.defineDocExtension=function(r,e){Aa.prototype[r]=e};Uu.fromTextArea=lf;sf(Uu);Uu.version="5.65.9";return Uu}))}));var s=a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("css",(function(e,t){var i=t.inline;if(!t.propertyKeywords)t=r.resolveMode("text/css");var n=e.indentUnit,o=t.tokenHooks,a=t.documentTypes||{},u=t.mediaTypes||{},f=t.mediaFeatures||{},l=t.mediaValueKeywords||{},s=t.propertyKeywords||{},c=t.nonStandardPropertyKeywords||{},d=t.fontProperties||{},h=t.counterDescriptors||{},v=t.colorKeywords||{},m=t.valueKeywords||{},p=t.allowNested,g=t.lineComment,b=t.supportsAtComponent===true,w=e.highlightNonStandardPropertyKeywords!==false;var k,y;function x(r,e){k=e;return r}function C(r,e){var t=r.next();if(o[t]){var i=o[t](r,e);if(i!==false)return i}if(t=="@"){r.eatWhile(/[\w\\\-]/);return x("def",r.current())}else if(t=="="||(t=="~"||t=="|")&&r.eat("=")){return x(null,"compare")}else if(t=='"'||t=="'"){e.tokenize=M(t);return e.tokenize(r,e)}else if(t=="#"){r.eatWhile(/[\w\\\-]/);return x("atom","hash")}else if(t=="!"){r.match(/^\s*\w*/);return x("keyword","important")}else if(/\d/.test(t)||t=="."&&r.eat(/\d/)){r.eatWhile(/[\w.%]/);return x("number","unit")}else if(t==="-"){if(/[\d.]/.test(r.peek())){r.eatWhile(/[\w.%]/);return x("number","unit")}else if(r.match(/^-[\w\\\-]*/)){r.eatWhile(/[\w\\\-]/);if(r.match(/^\s*:/,false))return x("variable-2","variable-definition");return x("variable-2","variable")}else if(r.match(/^\w+-/)){return x("meta","meta")}}else if(/[,+>*\/]/.test(t)){return x(null,"select-op")}else if(t=="."&&r.match(/^-?[_a-z][_a-z0-9-]*/i)){return x("qualifier","qualifier")}else if(/[:;{}\[\]\(\)]/.test(t)){return x(null,t)}else if(r.match(/^[\w-.]+(?=\()/)){if(/^(url(-prefix)?|domain|regexp)$/i.test(r.current())){e.tokenize=A}return x("variable callee","variable")}else if(/[\w\\\-]/.test(t)){r.eatWhile(/[\w\\\-]/);return x("property","word")}else{return x(null,null)}}function M(r){return function(e,t){var i=false,n;while((n=e.next())!=null){if(n==r&&!i){if(r==")")e.backUp(1);break}i=!i&&n=="\\"}if(n==r||!i&&r!=")")t.tokenize=null;return x("string","string")}}function A(r,e){r.next();if(!r.match(/^\s*[\"\')]/,false))e.tokenize=M(")");else e.tokenize=null;return x(null,"(")}function L(r,e,t){this.type=r;this.indent=e;this.prev=t}function S(r,e,t,i){r.context=new L(t,e.indentation()+(i===false?0:n),r.context);return t}function T(r){if(r.context.prev)r.context=r.context.prev;return r.context.type}function N(r,e,t){return z[t.context.type](r,e,t)}function E(r,e,t,i){for(var n=i||1;n>0;n--)t.context=t.context.prev;return N(r,e,t)}function D(r){var e=r.current().toLowerCase();if(m.hasOwnProperty(e))y="atom";else if(v.hasOwnProperty(e))y="keyword";else y="variable"}var z={};z.top=function(r,e,t){if(r=="{"){return S(t,e,"block")}else if(r=="}"&&t.context.prev){return T(t)}else if(b&&/@component/i.test(r)){return S(t,e,"atComponentBlock")}else if(/^@(-moz-)?document$/i.test(r)){return S(t,e,"documentTypes")}else if(/^@(media|supports|(-moz-)?document|import)$/i.test(r)){return S(t,e,"atBlock")}else if(/^@(font-face|counter-style)/i.test(r)){t.stateArg=r;return"restricted_atBlock_before"}else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(r)){return"keyframes"}else if(r&&r.charAt(0)=="@"){return S(t,e,"at")}else if(r=="hash"){y="builtin"}else if(r=="word"){y="tag"}else if(r=="variable-definition"){return"maybeprop"}else if(r=="interpolation"){return S(t,e,"interpolation")}else if(r==":"){return"pseudo"}else if(p&&r=="("){return S(t,e,"parens")}return t.context.type};z.block=function(r,e,t){if(r=="word"){var i=e.current().toLowerCase();if(s.hasOwnProperty(i)){y="property";return"maybeprop"}else if(c.hasOwnProperty(i)){y=w?"string-2":"property";return"maybeprop"}else if(p){y=e.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{y+=" error";return"maybeprop"}}else if(r=="meta"){return"block"}else if(!p&&(r=="hash"||r=="qualifier")){y="error";return"block"}else{return z.top(r,e,t)}};z.maybeprop=function(r,e,t){if(r==":")return S(t,e,"prop");return N(r,e,t)};z.prop=function(r,e,t){if(r==";")return T(t);if(r=="{"&&p)return S(t,e,"propBlock");if(r=="}"||r=="{")return E(r,e,t);if(r=="(")return S(t,e,"parens");if(r=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.current())){y+=" error"}else if(r=="word"){D(e)}else if(r=="interpolation"){return S(t,e,"interpolation")}return"prop"};z.propBlock=function(r,e,t){if(r=="}")return T(t);if(r=="word"){y="property";return"maybeprop"}return t.context.type};z.parens=function(r,e,t){if(r=="{"||r=="}")return E(r,e,t);if(r==")")return T(t);if(r=="(")return S(t,e,"parens");if(r=="interpolation")return S(t,e,"interpolation");if(r=="word")D(e);return"parens"};z.pseudo=function(r,e,t){if(r=="meta")return"pseudo";if(r=="word"){y="variable-3";return t.context.type}return N(r,e,t)};z.documentTypes=function(r,e,t){if(r=="word"&&a.hasOwnProperty(e.current())){y="tag";return t.context.type}else{return z.atBlock(r,e,t)}};z.atBlock=function(r,e,t){if(r=="(")return S(t,e,"atBlock_parens");if(r=="}"||r==";")return E(r,e,t);if(r=="{")return T(t)&&S(t,e,p?"block":"top");if(r=="interpolation")return S(t,e,"interpolation");if(r=="word"){var i=e.current().toLowerCase();if(i=="only"||i=="not"||i=="and"||i=="or")y="keyword";else if(u.hasOwnProperty(i))y="attribute";else if(f.hasOwnProperty(i))y="property";else if(l.hasOwnProperty(i))y="keyword";else if(s.hasOwnProperty(i))y="property";else if(c.hasOwnProperty(i))y=w?"string-2":"property";else if(m.hasOwnProperty(i))y="atom";else if(v.hasOwnProperty(i))y="keyword";else y="error"}return t.context.type};z.atComponentBlock=function(r,e,t){if(r=="}")return E(r,e,t);if(r=="{")return T(t)&&S(t,e,p?"block":"top",false);if(r=="word")y="error";return t.context.type};z.atBlock_parens=function(r,e,t){if(r==")")return T(t);if(r=="{"||r=="}")return E(r,e,t,2);return z.atBlock(r,e,t)};z.restricted_atBlock_before=function(r,e,t){if(r=="{")return S(t,e,"restricted_atBlock");if(r=="word"&&t.stateArg=="@counter-style"){y="variable";return"restricted_atBlock_before"}return N(r,e,t)};z.restricted_atBlock=function(r,e,t){if(r=="}"){t.stateArg=null;return T(t)}if(r=="word"){if(t.stateArg=="@font-face"&&!d.hasOwnProperty(e.current().toLowerCase())||t.stateArg=="@counter-style"&&!h.hasOwnProperty(e.current().toLowerCase()))y="error";else y="property";return"maybeprop"}return"restricted_atBlock"};z.keyframes=function(r,e,t){if(r=="word"){y="variable";return"keyframes"}if(r=="{")return S(t,e,"top");return N(r,e,t)};z.at=function(r,e,t){if(r==";")return T(t);if(r=="{"||r=="}")return E(r,e,t);if(r=="word")y="tag";else if(r=="hash")y="builtin";return"at"};z.interpolation=function(r,e,t){if(r=="}")return T(t);if(r=="{"||r==";")return E(r,e,t);if(r=="word")y="variable";else if(r!="variable"&&r!="("&&r!=")")y="error";return"interpolation"};return{startState:function(r){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new L(i?"block":"top",r||0,null)}},token:function(r,e){if(!e.tokenize&&r.eatSpace())return null;var t=(e.tokenize||C)(r,e);if(t&&typeof t=="object"){k=t[1];t=t[0]}y=t;if(k!="comment")e.state=z[e.state](k,r,e);return y},indent:function(r,e){var t=r.context,i=e&&e.charAt(0);var o=t.indent;if(t.type=="prop"&&(i=="}"||i==")"))t=t.prev;if(t.prev){if(i=="}"&&(t.type=="block"||t.type=="top"||t.type=="interpolation"||t.type=="restricted_atBlock")){t=t.prev;o=t.indent}else if(i==")"&&(t.type=="parens"||t.type=="atBlock_parens")||i=="{"&&(t.type=="at"||t.type=="atBlock")){o=Math.max(0,t.indent-n)}}return o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:g,fold:"brace"}}));function e(r){var e={};for(var t=0;t<r.length;++t){e[r[t].toLowerCase()]=true}return e}var t=["domain","regexp","url","url-prefix"],i=e(t);var n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(n);var a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],u=e(a);var f=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],l=e(f);var s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],c=e(s);var d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=e(d);var v=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=e(v);var p=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=e(p);var b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=e(b);var k=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=e(k);var x=t.concat(n).concat(a).concat(f).concat(s).concat(d).concat(b).concat(k);r.registerHelper("hintWords","css",x);function C(r,e){var t=false,i;while((i=r.next())!=null){if(t&&i=="/"){e.tokenize=null;break}t=i=="*"}return["comment","comment"]}r.defineMIME("text/css",{documentTypes:i,mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:g,colorKeywords:w,valueKeywords:y,tokenHooks:{"/":function(r,e){if(!r.eat("*"))return false;e.tokenize=C;return C(r,e)}},name:"css"});r.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:y,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(r,e){if(r.eat("/")){r.skipToEnd();return["comment","comment"]}else if(r.eat("*")){e.tokenize=C;return C(r,e)}else{return["operator","operator"]}},":":function(r){if(r.match(/^\s*\{/,false))return[null,null];return false},$:function(r){r.match(/^[\w-]+/);if(r.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"#":function(r){if(!r.eat("{"))return false;return[null,"interpolation"]}},name:"css",helperType:"scss"});r.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:u,mediaValueKeywords:l,propertyKeywords:c,nonStandardPropertyKeywords:h,colorKeywords:w,valueKeywords:y,fontProperties:m,allowNested:true,lineComment:"//",tokenHooks:{"/":function(r,e){if(r.eat("/")){r.skipToEnd();return["comment","comment"]}else if(r.eat("*")){e.tokenize=C;return C(r,e)}else{return["operator","operator"]}},"@":function(r){if(r.eat("{"))return[null,"interpolation"];if(r.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,false))return false;r.eatWhile(/[\w\\\-]/);if(r.match(/^\s*:/,false))return["variable-2","variable-definition"];return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});r.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:o,mediaFeatures:u,propertyKeywords:c,nonStandardPropertyKeywords:h,fontProperties:m,counterDescriptors:g,colorKeywords:w,valueKeywords:y,supportsAtComponent:true,tokenHooks:{"/":function(r,e){if(!r.eat("*"))return false;e.tokenize=C;return C(r,e)}},name:"css",helperType:"gss"})}))}));var c=a((function(r,e){(function(r){r(l)})((function(r){var e={autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true};var t={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,allowMissingTagName:false,caseFold:false};r.defineMode("xml",(function(i,n){var o=i.indentUnit;var a={};var u=n.htmlMode?e:t;for(var f in u)a[f]=u[f];for(var f in n)a[f]=n[f];var l,s;function c(r,e){function t(t){e.tokenize=t;return t(r,e)}var i=r.next();if(i=="<"){if(r.eat("!")){if(r.eat("[")){if(r.match("CDATA["))return t(v("atom","]]>"));else return null}else if(r.match("--")){return t(v("comment","--\x3e"))}else if(r.match("DOCTYPE",true,true)){r.eatWhile(/[\w\._\-]/);return t(m(1))}else{return null}}else if(r.eat("?")){r.eatWhile(/[\w\._\-]/);e.tokenize=v("meta","?>");return"meta"}else{l=r.eat("/")?"closeTag":"openTag";e.tokenize=d;return"tag bracket"}}else if(i=="&"){var n;if(r.eat("#")){if(r.eat("x")){n=r.eatWhile(/[a-fA-F\d]/)&&r.eat(";")}else{n=r.eatWhile(/[\d]/)&&r.eat(";")}}else{n=r.eatWhile(/[\w\.\-:]/)&&r.eat(";")}return n?"atom":"error"}else{r.eatWhile(/[^&<]/);return null}}c.isInText=true;function d(r,e){var t=r.next();if(t==">"||t=="/"&&r.eat(">")){e.tokenize=c;l=t==">"?"endTag":"selfcloseTag";return"tag bracket"}else if(t=="="){l="equals";return null}else if(t=="<"){e.tokenize=c;e.state=k;e.tagName=e.tagStart=null;var i=e.tokenize(r,e);return i?i+" tag error":"tag error"}else if(/[\'\"]/.test(t)){e.tokenize=h(t);e.stringStartCol=r.column();return e.tokenize(r,e)}else{r.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}function h(r){var e=function(e,t){while(!e.eol()){if(e.next()==r){t.tokenize=d;break}}return"string"};e.isInAttribute=true;return e}function v(r,e){return function(t,i){while(!t.eol()){if(t.match(e)){i.tokenize=c;break}t.next()}return r}}function m(r){return function(e,t){var i;while((i=e.next())!=null){if(i=="<"){t.tokenize=m(r+1);return t.tokenize(e,t)}else if(i==">"){if(r==1){t.tokenize=c;break}else{t.tokenize=m(r-1);return t.tokenize(e,t)}}}return"meta"}}function p(r){return r&&r.toLowerCase()}function g(r,e,t){this.prev=r.context;this.tagName=e||"";this.indent=r.indented;this.startOfLine=t;if(a.doNotIndent.hasOwnProperty(e)||r.context&&r.context.noIndent)this.noIndent=true}function b(r){if(r.context)r.context=r.context.prev}function w(r,e){var t;while(true){if(!r.context){return}t=r.context.tagName;if(!a.contextGrabbers.hasOwnProperty(p(t))||!a.contextGrabbers[p(t)].hasOwnProperty(p(e))){return}b(r)}}function k(r,e,t){if(r=="openTag"){t.tagStart=e.column();return y}else if(r=="closeTag"){return x}else{return k}}function y(r,e,t){if(r=="word"){t.tagName=e.current();s="tag";return A}else if(a.allowMissingTagName&&r=="endTag"){s="tag bracket";return A(r,e,t)}else{s="error";return y}}function x(r,e,t){if(r=="word"){var i=e.current();if(t.context&&t.context.tagName!=i&&a.implicitlyClosed.hasOwnProperty(p(t.context.tagName)))b(t);if(t.context&&t.context.tagName==i||a.matchClosing===false){s="tag";return C}else{s="tag error";return M}}else if(a.allowMissingTagName&&r=="endTag"){s="tag bracket";return C(r,e,t)}else{s="error";return M}}function C(r,e,t){if(r!="endTag"){s="error";return C}b(t);return k}function M(r,e,t){s="error";return C(r,e,t)}function A(r,e,t){if(r=="word"){s="attribute";return L}else if(r=="endTag"||r=="selfcloseTag"){var i=t.tagName,n=t.tagStart;t.tagName=t.tagStart=null;if(r=="selfcloseTag"||a.autoSelfClosers.hasOwnProperty(p(i))){w(t,i)}else{w(t,i);t.context=new g(t,i,n==t.indented)}return k}s="error";return A}function L(r,e,t){if(r=="equals")return S;if(!a.allowMissing)s="error";return A(r,e,t)}function S(r,e,t){if(r=="string")return T;if(r=="word"&&a.allowUnquoted){s="string";return A}s="error";return A(r,e,t)}function T(r,e,t){if(r=="string")return T;return A(r,e,t)}return{startState:function(r){var e={tokenize:c,state:k,indented:r||0,tagName:null,tagStart:null,context:null};if(r!=null)e.baseIndent=r;return e},token:function(r,e){if(!e.tagName&&r.sol())e.indented=r.indentation();if(r.eatSpace())return null;l=null;var t=e.tokenize(r,e);if((t||l)&&t!="comment"){s=null;e.state=e.state(l||t,r,e);if(s)t=s=="error"?t+" error":s}return t},indent:function(e,t,i){var n=e.context;if(e.tokenize.isInAttribute){if(e.tagStart==e.indented)return e.stringStartCol+1;else return e.indented+o}if(n&&n.noIndent)return r.Pass;if(e.tokenize!=d&&e.tokenize!=c)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName){if(a.multilineTagIndentPastTag!==false)return e.tagStart+e.tagName.length+2;else return e.tagStart+o*(a.multilineTagIndentFactor||1)}if(a.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var u=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(u&&u[1]){while(n){if(n.tagName==u[2]){n=n.prev;break}else if(a.implicitlyClosed.hasOwnProperty(p(n.tagName))){n=n.prev}else{break}}}else if(u){while(n){var f=a.contextGrabbers[p(n.tagName)];if(f&&f.hasOwnProperty(p(u[2])))n=n.prev;else break}}while(n&&n.prev&&!n.startOfLine)n=n.prev;if(n)return n.indent+o;else return e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(r){if(r.state==S)r.state=A},xmlCurrentTag:function(r){return r.tagName?{name:r.tagName,close:r.type=="closeTag"}:null},xmlCurrentContext:function(r){var e=[];for(var t=r.context;t;t=t.prev)e.push(t.tagName);return e.reverse()}}}));r.defineMIME("text/xml","xml");r.defineMIME("application/xml","xml");if(!r.mimeModes.hasOwnProperty("text/html"))r.defineMIME("text/html",{name:"xml",htmlMode:true})}))}));var d=a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("javascript",(function(e,t){var i=e.indentUnit;var n=t.statementIndent;var o=t.jsonld;var a=t.json||o;var u=t.trackScope!==false;var f=t.typescript;var l=t.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var e=r("keyword a"),t=r("keyword b"),i=r("keyword c"),n=r("keyword d");var o=r("operator"),a={type:"atom",style:"atom"};return{if:r("if"),while:e,with:e,else:t,do:t,try:t,finally:t,return:n,break:n,continue:n,new:r("new"),delete:i,void:i,throw:i,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:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:r("this"),class:r("class"),super:r("atom"),yield:i,export:r("export"),import:r("import"),extends:i,await:i}}();var c=/[+\-*&%=<>!?|~^@]/;var d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var e=false,t,i=false;while((t=r.next())!=null){if(!e){if(t=="/"&&!i)return;if(t=="[")i=true;else if(i&&t=="]")i=false}e=!e&&t=="\\"}}var v,m;function p(r,e,t){v=r;m=t;return e}function g(r,e){var t=r.next();if(t=='"'||t=="'"){e.tokenize=b(t);return e.tokenize(r,e)}else if(t=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(t=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(t)){return p(t)}else if(t=="="&&r.eat(">")){return p("=>","operator")}else if(t=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(t)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(t=="/"){if(r.eat("*")){e.tokenize=w;return w(r,e)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(ne(r,e,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(t=="`"){e.tokenize=k;return k(r,e)}else if(t=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(t=="#"&&r.eatWhile(l)){return p("variable","property")}else if(t=="<"&&r.match("!--")||t=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(t)){if(t!=">"||!e.lexical||e.lexical.type!=">"){if(r.eat("=")){if(t=="!"||t=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(t)){r.eat(t);if(t==">")r.eat(t)}}if(t=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(t)){r.eatWhile(l);var i=r.current();if(e.lastType!="."){if(s.propertyIsEnumerable(i)){var n=s[i];return p(n.type,n.style,i)}if(i=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",i)}return p("variable","variable",i)}}function b(r){return function(e,t){var i=false,n;if(o&&e.peek()=="@"&&e.match(d)){t.tokenize=g;return p("jsonld-keyword","meta")}while((n=e.next())!=null){if(n==r&&!i)break;i=!i&&n=="\\"}if(!i)t.tokenize=g;return p("string","string")}}function w(r,e){var t=false,i;while(i=r.next()){if(i=="/"&&t){e.tokenize=g;break}t=i=="*"}return p("comment","comment")}function k(r,e){var t=false,i;while((i=r.next())!=null){if(!t&&(i=="`"||i=="$"&&r.eat("{"))){e.tokenize=g;break}t=!t&&i=="\\"}return p("quasi","string-2",r.current())}var y="([{}])";function x(r,e){if(e.fatArrowAt)e.fatArrowAt=null;var t=r.string.indexOf("=>",r.start);if(t<0)return;if(f){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,t));if(i)t=i.index}var n=0,o=false;for(var a=t-1;a>=0;--a){var u=r.string.charAt(a);var s=y.indexOf(u);if(s>=0&&s<3){if(!n){++a;break}if(--n==0){if(u=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(u)){o=true}else if(/["'\/`]/.test(u)){for(;;--a){if(a==0)return;var c=r.string.charAt(a-1);if(c==u&&r.string.charAt(a-2)!="\\"){a--;break}}}else if(o&&!n){++a;break}}if(o&&!n)e.fatArrowAt=a}var C={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function M(r,e,t,i,n,o){this.indented=r;this.column=e;this.type=t;this.prev=n;this.info=o;if(i!=null)this.align=i}function A(r,e){if(!u)return false;for(var t=r.localVars;t;t=t.next)if(t.name==e)return true;for(var i=r.context;i;i=i.prev){for(var t=i.vars;t;t=t.next)if(t.name==e)return true}}function L(r,e,t,i,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=e;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var u=o.length?o.pop():a?G:W;if(u(t,i)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(t=="variable"&&A(r,i))return"variable-2";return e}}}var S={state:null,column:null,marked:null,cc:null};function T(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function N(){T.apply(null,arguments);return true}function E(r,e){for(var t=e;t;t=t.next)if(t.name==r)return true;return false}function D(r){var e=S.state;S.marked="def";if(!u)return;if(e.context){if(e.lexical.info=="var"&&e.context&&e.context.block){var i=z(r,e.context);if(i!=null){e.context=i;return}}else if(!E(r,e.localVars)){e.localVars=new B(r,e.localVars);return}}if(t.globalVars&&!E(r,e.globalVars))e.globalVars=new B(r,e.globalVars)}function z(r,e){if(!e){return null}else if(e.block){var t=z(r,e.prev);if(!t)return null;if(t==e.prev)return e;return new I(t,e.vars,true)}else if(E(r,e.vars)){return e}else{return new I(e.prev,new B(r,e.vars),false)}}function j(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function I(r,e,t){this.prev=r;this.vars=e;this.block=t}function B(r,e){this.name=r;this.next=e}var R=new B("this",new B("arguments",null));function F(){S.state.context=new I(S.state.context,S.state.localVars,false);S.state.localVars=R}function O(){S.state.context=new I(S.state.context,S.state.localVars,true);S.state.localVars=null}F.lex=O.lex=true;function U(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}U.lex=true;function P(r,e){var t=function(){var t=S.state,i=t.indented;if(t.lexical.type=="stat")i=t.lexical.indented;else for(var n=t.lexical;n&&n.type==")"&&n.align;n=n.prev)i=n.indented;t.lexical=new M(i,S.stream.column(),r,null,t.lexical,e)};t.lex=true;return t}function _(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}_.lex=true;function q(r){function e(t){if(t==r)return N();else if(r==";"||t=="}"||t==")"||t=="]")return T();else return N(e)}return e}function W(r,e){if(r=="var")return N(P("vardef",e),Tr,q(";"),_);if(r=="keyword a")return N(P("form"),K,W,_);if(r=="keyword b")return N(P("form"),W,_);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?N():N(P("stat"),Q,q(";"),_);if(r=="debugger")return N(q(";"));if(r=="{")return N(P("}"),O,dr,_,U);if(r==";")return N();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==_)S.state.cc.pop()();return N(P("form"),K,W,_,Ir)}if(r=="function")return N(Or);if(r=="for")return N(P("form"),O,Br,W,U,_);if(r=="class"||f&&e=="interface"){S.marked="keyword";return N(P("form",r=="class"?r:e),Wr,_)}if(r=="variable"){if(f&&e=="declare"){S.marked="keyword";return N(W)}else if(f&&(e=="module"||e=="enum"||e=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(e=="enum")return N(ee);else if(e=="type")return N(Pr,q("operator"),gr,q(";"));else return N(P("form"),Nr,q("{"),P("}"),dr,_,_)}else if(f&&e=="namespace"){S.marked="keyword";return N(P("form"),G,W,_)}else if(f&&e=="abstract"){S.marked="keyword";return N(W)}else{return N(P("stat"),or)}}if(r=="switch")return N(P("form"),K,q("{"),P("}","switch"),O,dr,_,_,U);if(r=="case")return N(G,q(":"));if(r=="default")return N(q(":"));if(r=="catch")return N(P("form"),F,$,W,_,U);if(r=="export")return N(P("stat"),Kr,_);if(r=="import")return N(P("stat"),Qr,_);if(r=="async")return N(W);if(e=="@")return N(G,W);return T(P("stat"),G,q(";"),_)}function $(r){if(r=="(")return N(_r,q(")"))}function G(r,e){return V(r,e,false)}function H(r,e){return V(r,e,true)}function K(r){if(r!="(")return T();return N(P(")"),Q,q(")"),_)}function V(r,e,t){if(S.state.fatArrowAt==S.stream.start){var i=t?er:rr;if(r=="(")return N(F,P(")"),sr(_r,")"),_,q("=>"),i,U);else if(r=="variable")return T(F,Nr,q("=>"),i,U)}var n=t?Y:J;if(C.hasOwnProperty(r))return N(n);if(r=="function")return N(Or,n);if(r=="class"||f&&e=="interface"){S.marked="keyword";return N(P("form"),qr,_)}if(r=="keyword c"||r=="async")return N(t?H:G);if(r=="(")return N(P(")"),Q,q(")"),_,n);if(r=="operator"||r=="spread")return N(t?H:G);if(r=="[")return N(P("]"),re,_,n);if(r=="{")return cr(ur,"}",null,n);if(r=="quasi")return T(X,n);if(r=="new")return N(tr(t));return N()}function Q(r){if(r.match(/[;\}\)\],]/))return T();return T(G)}function J(r,e){if(r==",")return N(Q);return Y(r,e,false)}function Y(r,e,t){var i=t==false?J:Y;var n=t==false?G:H;if(r=="=>")return N(F,t?er:rr,U);if(r=="operator"){if(/\+\+|--/.test(e)||f&&e=="!")return N(i);if(f&&e=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return N(P(">"),sr(gr,">"),_,i);if(e=="?")return N(G,q(":"),n);return N(n)}if(r=="quasi"){return T(X,i)}if(r==";")return;if(r=="(")return cr(H,")","call",i);if(r==".")return N(ar,i);if(r=="[")return N(P("]"),Q,q("]"),_,i);if(f&&e=="as"){S.marked="keyword";return N(gr,i)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return N(n)}}function X(r,e){if(r!="quasi")return T();if(e.slice(e.length-2)!="${")return N(X);return N(Q,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return N(X)}}function rr(r){x(S.stream,S.state);return T(r=="{"?W:G)}function er(r){x(S.stream,S.state);return T(r=="{"?W:H)}function tr(r){return function(e){if(e==".")return N(r?nr:ir);else if(e=="variable"&&f)return N(Ar,r?Y:J);else return T(r?H:G)}}function ir(r,e){if(e=="target"){S.marked="keyword";return N(J)}}function nr(r,e){if(e=="target"){S.marked="keyword";return N(Y)}}function or(r){if(r==":")return N(_,W);return T(J,q(";"),_)}function ar(r){if(r=="variable"){S.marked="property";return N()}}function ur(r,e){if(r=="async"){S.marked="property";return N(ur)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(e=="get"||e=="set")return N(fr);var t;if(f&&S.state.fatArrowAt==S.stream.start&&(t=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+t[0].length;return N(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return N(lr)}else if(r=="jsonld-keyword"){return N(lr)}else if(f&&j(e)){S.marked="keyword";return N(ur)}else if(r=="["){return N(G,hr,q("]"),lr)}else if(r=="spread"){return N(H,lr)}else if(e=="*"){S.marked="keyword";return N(ur)}else if(r==":"){return T(lr)}}function fr(r){if(r!="variable")return T(lr);S.marked="property";return N(Or)}function lr(r){if(r==":")return N(H);if(r=="(")return T(Or)}function sr(r,e,t){function i(n,o){if(t?t.indexOf(n)>-1:n==","){var a=S.state.lexical;if(a.info=="call")a.pos=(a.pos||0)+1;return N((function(t,i){if(t==e||i==e)return T();return T(r)}),i)}if(n==e||o==e)return N();if(t&&t.indexOf(";")>-1)return T(r);return N(q(e))}return function(t,n){if(t==e||n==e)return N();return T(r,i)}}function cr(r,e,t){for(var i=3;i<arguments.length;i++)S.cc.push(arguments[i]);return N(P(e,t),sr(r,e),_)}function dr(r){if(r=="}")return N();return T(W,dr)}function hr(r,e){if(f){if(r==":")return N(gr);if(e=="?")return N(hr)}}function vr(r,e){if(f&&(r==":"||e=="in"))return N(gr)}function mr(r){if(f&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return N(G,pr,gr);else return N(gr)}}function pr(r,e){if(e=="is"){S.marked="keyword";return N()}}function gr(r,e){if(e=="keyof"||e=="typeof"||e=="infer"||e=="readonly"){S.marked="keyword";return N(e=="typeof"?H:gr)}if(r=="variable"||e=="void"){S.marked="type";return N(Mr)}if(e=="|"||e=="&")return N(gr);if(r=="string"||r=="number"||r=="atom")return N(Mr);if(r=="[")return N(P("]"),sr(gr,"]",","),_,Mr);if(r=="{")return N(P("}"),wr,_,Mr);if(r=="(")return N(sr(Cr,")"),br,Mr);if(r=="<")return N(sr(gr,">"),gr);if(r=="quasi"){return T(yr,Mr)}}function br(r){if(r=="=>")return N(gr)}function wr(r){if(r.match(/[\}\)\]]/))return N();if(r==","||r==";")return N(wr);return T(kr,wr)}function kr(r,e){if(r=="variable"||S.style=="keyword"){S.marked="property";return N(kr)}else if(e=="?"||r=="number"||r=="string"){return N(kr)}else if(r==":"){return N(gr)}else if(r=="["){return N(q("variable"),vr,q("]"),kr)}else if(r=="("){return T(Ur,kr)}else if(!r.match(/[;\}\)\],]/)){return N()}}function yr(r,e){if(r!="quasi")return T();if(e.slice(e.length-2)!="${")return N(yr);return N(gr,xr)}function xr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return N(yr)}}function Cr(r,e){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||e=="?")return N(Cr);if(r==":")return N(gr);if(r=="spread")return N(Cr);return T(gr)}function Mr(r,e){if(e=="<")return N(P(">"),sr(gr,">"),_,Mr);if(e=="|"||r=="."||e=="&")return N(gr);if(r=="[")return N(gr,q("]"),Mr);if(e=="extends"||e=="implements"){S.marked="keyword";return N(gr)}if(e=="?")return N(gr,q(":"),gr)}function Ar(r,e){if(e=="<")return N(P(">"),sr(gr,">"),_,Mr)}function Lr(){return T(gr,Sr)}function Sr(r,e){if(e=="=")return N(gr)}function Tr(r,e){if(e=="enum"){S.marked="keyword";return N(ee)}return T(Nr,hr,zr,jr)}function Nr(r,e){if(f&&j(e)){S.marked="keyword";return N(Nr)}if(r=="variable"){D(e);return N()}if(r=="spread")return N(Nr);if(r=="[")return cr(Dr,"]");if(r=="{")return cr(Er,"}")}function Er(r,e){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){D(e);return N(zr)}if(r=="variable")S.marked="property";if(r=="spread")return N(Nr);if(r=="}")return T();if(r=="[")return N(G,q("]"),q(":"),Er);return N(q(":"),Nr,zr)}function Dr(){return T(Nr,zr)}function zr(r,e){if(e=="=")return N(H)}function jr(r){if(r==",")return N(Tr)}function Ir(r,e){if(r=="keyword b"&&e=="else")return N(P("form","else"),W,_)}function Br(r,e){if(e=="await")return N(Br);if(r=="(")return N(P(")"),Rr,_)}function Rr(r){if(r=="var")return N(Tr,Fr);if(r=="variable")return N(Fr);return T(Fr)}function Fr(r,e){if(r==")")return N();if(r==";")return N(Fr);if(e=="in"||e=="of"){S.marked="keyword";return N(G,Fr)}return T(G,Fr)}function Or(r,e){if(e=="*"){S.marked="keyword";return N(Or)}if(r=="variable"){D(e);return N(Or)}if(r=="(")return N(F,P(")"),sr(_r,")"),_,mr,W,U);if(f&&e=="<")return N(P(">"),sr(Lr,">"),_,Or)}function Ur(r,e){if(e=="*"){S.marked="keyword";return N(Ur)}if(r=="variable"){D(e);return N(Ur)}if(r=="(")return N(F,P(")"),sr(_r,")"),_,mr,U);if(f&&e=="<")return N(P(">"),sr(Lr,">"),_,Ur)}function Pr(r,e){if(r=="keyword"||r=="variable"){S.marked="type";return N(Pr)}else if(e=="<"){return N(P(">"),sr(Lr,">"),_)}}function _r(r,e){if(e=="@")N(G,_r);if(r=="spread")return N(_r);if(f&&j(e)){S.marked="keyword";return N(_r)}if(f&&r=="this")return N(hr,zr);return T(Nr,hr,zr)}function qr(r,e){if(r=="variable")return Wr(r,e);return $r(r,e)}function Wr(r,e){if(r=="variable"){D(e);return N($r)}}function $r(r,e){if(e=="<")return N(P(">"),sr(Lr,">"),_,$r);if(e=="extends"||e=="implements"||f&&r==","){if(e=="implements")S.marked="keyword";return N(f?gr:G,$r)}if(r=="{")return N(P("}"),Gr,_)}function Gr(r,e){if(r=="async"||r=="variable"&&(e=="static"||e=="get"||e=="set"||f&&j(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return N(Gr)}if(r=="variable"||S.style=="keyword"){S.marked="property";return N(Hr,Gr)}if(r=="number"||r=="string")return N(Hr,Gr);if(r=="[")return N(G,hr,q("]"),Hr,Gr);if(e=="*"){S.marked="keyword";return N(Gr)}if(f&&r=="(")return T(Ur,Gr);if(r==";"||r==",")return N(Gr);if(r=="}")return N();if(e=="@")return N(G,Gr)}function Hr(r,e){if(e=="!")return N(Hr);if(e=="?")return N(Hr);if(r==":")return N(gr,zr);if(e=="=")return N(H);var t=S.state.lexical.prev,i=t&&t.info=="interface";return T(i?Ur:Or)}function Kr(r,e){if(e=="*"){S.marked="keyword";return N(Zr,q(";"))}if(e=="default"){S.marked="keyword";return N(G,q(";"))}if(r=="{")return N(sr(Vr,"}"),Zr,q(";"));return T(W)}function Vr(r,e){if(e=="as"){S.marked="keyword";return N(q("variable"))}if(r=="variable")return T(H,Vr)}function Qr(r){if(r=="string")return N();if(r=="(")return T(G);if(r==".")return T(J);return T(Jr,Yr,Zr)}function Jr(r,e){if(r=="{")return cr(Jr,"}");if(r=="variable")D(e);if(e=="*")S.marked="keyword";return N(Xr)}function Yr(r){if(r==",")return N(Jr,Yr)}function Xr(r,e){if(e=="as"){S.marked="keyword";return N(Jr)}}function Zr(r,e){if(e=="from"){S.marked="keyword";return N(G)}}function re(r){if(r=="]")return N();return T(sr(H,"]"))}function ee(){return T(P("form"),Nr,q("{"),P("}"),sr(te,"}"),_,_)}function te(){return T(Nr,zr)}function ie(r,e){return r.lastType=="operator"||r.lastType==","||c.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ne(r,e,t){return e.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||e.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(t||0)))}return{startState:function(r){var e={tokenize:g,lastType:"sof",cc:[],lexical:new M((r||0)-i,0,"block",false),localVars:t.localVars,context:t.localVars&&new I(null,null,false),indented:r||0};if(t.globalVars&&typeof t.globalVars=="object")e.globalVars=t.globalVars;return e},token:function(r,e){if(r.sol()){if(!e.lexical.hasOwnProperty("align"))e.lexical.align=false;e.indented=r.indentation();x(r,e)}if(e.tokenize!=w&&r.eatSpace())return null;var t=e.tokenize(r,e);if(v=="comment")return t;e.lastType=v=="operator"&&(m=="++"||m=="--")?"incdec":v;return L(e,t,v,m,r)},indent:function(e,o){if(e.tokenize==w||e.tokenize==k)return r.Pass;if(e.tokenize!=g)return 0;var a=o&&o.charAt(0),u=e.lexical,f;if(!/^\s*else\b/.test(o))for(var l=e.cc.length-1;l>=0;--l){var s=e.cc[l];if(s==_)u=u.prev;else if(s!=Ir&&s!=U)break}while((u.type=="stat"||u.type=="form")&&(a=="}"||(f=e.cc[e.cc.length-1])&&(f==J||f==Y)&&!/^[,\.=+\-*:?[\(]/.test(o)))u=u.prev;if(n&&u.type==")"&&u.prev.type=="stat")u=u.prev;var c=u.type,d=a==c;if(c=="vardef")return u.indented+(e.lastType=="operator"||e.lastType==","?u.info.length+1:0);else if(c=="form"&&a=="{")return u.indented;else if(c=="form")return u.indented+i;else if(c=="stat")return u.indented+(ie(e,o)?n||i:0);else if(u.info=="switch"&&!d&&t.doubleIndentSwitch!=false)return u.indented+(/^(?:case|default)\b/.test(o)?i:2*i);else if(u.align)return u.column+(d?0:1);else return u.indented+(d?0:i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:o,jsonMode:a,expressionAllowed:ne,skipExpression:function(e){L(e,"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})}))}));a((function(r,e){(function(r){r(l,c,d,s)})((function(r){var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function t(r,e,t){var i=r.current(),n=i.search(e);if(n>-1){r.backUp(i.length-n)}else if(i.match(/<\/?$/)){r.backUp(i.length);if(!r.match(e,false))r.match(i)}return t}var i={};function n(r){var e=i[r];if(e)return e;return i[r]=new RegExp("\\s+"+r+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function o(r,e){var t=r.match(n(e));return t?/^\s*(.*?)\s*$/.exec(t[2])[1]:""}function a(r,e){return new RegExp((e?"^":"")+"</\\s*"+r+"\\s*>","i")}function u(r,e){for(var t in r){var i=e[t]||(e[t]=[]);var n=r[t];for(var o=n.length-1;o>=0;o--)i.unshift(n[o])}}function f(r,e){for(var t=0;t<r.length;t++){var i=r[t];if(!i[0]||i[1].test(o(e,i[0])))return i[2]}}r.defineMode("htmlmixed",(function(i,n){var o=r.getMode(i,{name:"xml",htmlMode:true,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag,allowMissingTagName:n.allowMissingTagName});var l={};var s=n&&n.tags,c=n&&n.scriptTypes;u(e,l);if(s)u(s,l);if(c)for(var d=c.length-1;d>=0;d--)l.script.unshift(["type",c[d].matches,c[d].mode]);function h(e,n){var u=o.token(e,n.htmlState),s=/\btag\b/.test(u),c;if(s&&!/[<>\s\/]/.test(e.current())&&(c=n.htmlState.tagName&&n.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(c)){n.inTag=c+" "}else if(n.inTag&&s&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(n.inTag);n.inTag=null;var v=e.current()==">"&&f(l[d[1]],d[2]);var m=r.getMode(i,v);var p=a(d[1],true),g=a(d[1],false);n.token=function(r,e){if(r.match(p,false)){e.token=h;e.localState=e.localMode=null;return null}return t(r,g,e.localMode.token(r,e.localState))};n.localMode=m;n.localState=r.startState(m,o.indent(n.htmlState,"",""))}else if(n.inTag){n.inTag+=e.current();if(e.eol())n.inTag+=" "}return u}return{startState:function(){var e=r.startState(o);return{token:h,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var t;if(e.localState){t=r.copyState(e.localMode,e.localState)}return{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:r.copyState(o,e.htmlState)}},token:function(r,e){return e.token(r,e)},indent:function(e,t,i){if(!e.localMode||/^\s*<\//.test(t))return o.indent(e.htmlState,t,i);else if(e.localMode.indent)return e.localMode.indent(e.localState,t,i);else return r.Pass},innerMode:function(r){return{state:r.localState||r.htmlState,mode:r.localMode||o}}}}),"xml","javascript","css");r.defineMIME("text/html","htmlmixed")}))}));a((function(r,e){(function(r){r(l)})((function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],e=/^[+\-*&%=<>!?|~^]/,t=/^[:\[\(\{]/,i=["true","false"],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;r=new RegExp("(("+r.join(")|(")+"))\\b");i=new RegExp("(("+i.join(")|(")+"))\\b");function o(o,a){var u=o.peek();if(a.incomment){if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);a.incomment=false}return"comment"}else if(a.intag){if(a.operator){a.operator=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(a.sign){a.sign=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(a.instring){if(u==a.instring){a.instring=false}o.next();return"string"}else if(u=="'"||u=='"'){a.instring=u;o.next();return"string"}else if(a.inbraces>0&&u==")"){o.next();a.inbraces--}else if(u=="("){o.next();a.inbraces++}else if(a.inbrackets>0&&u=="]"){o.next();a.inbrackets--}else if(u=="["){o.next();a.inbrackets++}else if(!a.lineTag&&(o.match(a.intag+"}")||o.eat("-")&&o.match(a.intag+"}"))){a.intag=false;return"tag"}else if(o.match(e)){a.operator=true;return"operator"}else if(o.match(t)){a.sign=true}else{if(o.column()==1&&a.lineTag&&o.match(r)){return"keyword"}if(o.eat(" ")||o.sol()){if(o.match(r)){return"keyword"}if(o.match(i)){return"atom"}if(o.match(n)){return"number"}if(o.sol()){o.next()}}else{o.next()}}return"variable"}else if(o.eat("{")){if(o.eat("#")){a.incomment=true;if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);a.incomment=false}return"comment"}else if(u=o.eat(/\{|%/)){a.intag=u;a.inbraces=0;a.inbrackets=0;if(u=="{"){a.intag="}"}o.eat("-");return"tag"}}else if(o.eat("#")){if(o.peek()=="#"){o.skipToEnd();return"comment"}else if(!o.eol()){a.intag=true;a.lineTag=true;a.inbraces=0;a.inbrackets=0;return"tag"}}o.next()}return{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,e){var t=e.tokenize(r,e);if(r.eol()&&e.lineTag&&!e.instring&&e.inbraces==0&&e.inbrackets==0){e.intag=false;e.lineTag=false}return t},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}}));r.defineMIME("text/jinja2","jinja2")}))}));a((function(r,e){(function(r){r(l)})((function(r){var e="CodeMirror-activeline";var t="CodeMirror-activeline-background";var i="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(e,t,i){var o=i==r.Init?false:i;if(t==o)return;if(o){e.off("beforeSelectionChange",u);n(e);delete e.state.activeLines}if(t){e.state.activeLines=[];a(e,e.listSelections());e.on("beforeSelectionChange",u)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",e);r.removeLineClass(r.state.activeLines[n],"background",t);r.removeLineClass(r.state.activeLines[n],"gutter",i)}}function o(r,e){if(r.length!=e.length)return false;for(var t=0;t<r.length;t++)if(r[t]!=e[t])return false;return true}function a(r,a){var u=[];for(var f=0;f<a.length;f++){var l=a[f];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(u[u.length-1]!=c)u.push(c)}if(o(r.state.activeLines,u))return;r.operation((function(){n(r);for(var o=0;o<u.length;o++){r.addLineClass(u[o],"wrap",e);r.addLineClass(u[o],"background",t);r.addLineClass(u[o],"gutter",i)}r.state.activeLines=u}))}function u(r,e){a(r,e.ranges)}}))}));a((function(r,e){(function(r){r(l)})((function(r){var e=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var t=r.Pos;var i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,e,o){var u=r.getLineHandle(e.line),f=e.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&&f>=0&&s.test(u.text.charAt(f))&&i[u.text.charAt(f)]||s.test(u.text.charAt(f+1))&&i[u.text.charAt(++f)];if(!c)return null;var d=c.charAt(1)==">"?1:-1;if(o&&o.strict&&d>0!=(f==e.ch))return null;var h=r.getTokenTypeAt(t(e.line,f+1));var v=a(r,t(e.line,f+(d>0?1:0)),d,h,o);if(v==null)return null;return{from:t(e.line,f),to:v&&v.pos,match:v&&v.ch==c.charAt(0),forward:d>0}}function a(r,e,o,a,u){var f=u&&u.maxScanLineLength||1e4;var l=u&&u.maxScanLines||1e3;var s=[];var c=n(u);var d=o>0?Math.min(e.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,e.line-l);for(var h=e.line;h!=d;h+=o){var v=r.getLine(h);if(!v)continue;var m=o>0?0:v.length-1,p=o>0?v.length:-1;if(v.length>f)continue;if(h==e.line)m=e.ch-(o<0?1:0);for(;m!=p;m+=o){var g=v.charAt(m);if(c.test(g)&&(a===undefined||(r.getTokenTypeAt(t(h,m+1))||"")==(a||""))){var b=i[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:t(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function u(r,i,n){var a=r.state.matchBrackets.maxHighlightLineLength||1e3,u=n&&n.highlightNonMatching;var f=[],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||u!==false)&&r.getLine(c.from.line).length<=a){var d=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";f.push(r.markText(c.from,t(c.from.line,c.from.ch+1),{className:d}));if(c.to&&r.getLine(c.to.line).length<=a)f.push(r.markText(c.to,t(c.to.line,c.to.ch+1),{className:d}))}}if(f.length){if(e&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<f.length;r++)f[r].clear()}))};if(i)setTimeout(h,800);else return h}}function f(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=u(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(e,t,i){if(i&&i!=r.Init){e.off("cursorActivity",f);e.off("focus",f);e.off("blur",l);l(e)}if(t){e.state.matchBrackets=typeof t=="object"?t:{};e.on("cursorActivity",f);e.on("focus",f);e.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){u(this,true)}));r.defineExtension("findMatchingBracket",(function(r,e,t){if(t||typeof e=="boolean"){if(!t){e=e?{strict:true}:null}else{t.strict=e;e=t}}return o(this,r,e)}));r.defineExtension("scanForBracket",(function(r,e,t,i){return a(this,r,e,t,i)}))}))}));var h=a((function(r,e){(function(r){r(l)})((function(r){var e=r.Pos;function t(r,e){return r.line-e.line||r.ch-e.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var n=i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var o=new RegExp("<(/?)(["+i+"]["+n+"]*)","g");function a(r,e,t,i){this.line=e;this.ch=t;this.cm=r;this.text=r.getLine(e);this.min=i?Math.max(i.from,r.firstLine()):r.firstLine();this.max=i?Math.min(i.to-1,r.lastLine()):r.lastLine()}function u(r,t){var i=r.cm.getTokenTypeAt(e(r.line,t));return i&&/\btag\b/.test(i)}function f(r){if(r.line>=r.max)return;r.ch=0;r.text=r.cm.getLine(++r.line);return true}function l(r){if(r.line<=r.min)return;r.text=r.cm.getLine(--r.line);r.ch=r.text.length;return true}function s(r){for(;;){var e=r.text.indexOf(">",r.ch);if(e==-1){if(f(r))continue;else return}if(!u(r,e+1)){r.ch=e+1;continue}var t=r.text.lastIndexOf("/",e);var i=t>-1&&!/\S/.test(r.text.slice(t+1,e));r.ch=e+1;return i?"selfClose":"regular"}}function c(r){for(;;){var e=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(e==-1){if(l(r))continue;else return}if(!u(r,e+1)){r.ch=e;continue}o.lastIndex=e;r.ch=e;var t=o.exec(r.text);if(t&&t.index==e)return t}}function d(r){for(;;){o.lastIndex=r.ch;var e=o.exec(r.text);if(!e){if(f(r))continue;else return}if(!u(r,e.index+1)){r.ch=e.index+1;continue}r.ch=e.index+e[0].length;return e}}function h(r){for(;;){var e=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(e==-1){if(l(r))continue;else return}if(!u(r,e+1)){r.ch=e;continue}var t=r.text.lastIndexOf("/",e);var i=t>-1&&!/\S/.test(r.text.slice(t+1,e));r.ch=e+1;return i?"selfClose":"regular"}}function v(r,t){var i=[];for(;;){var n=d(r),o,a=r.line,u=r.ch-(n?n[0].length:0);if(!n||!(o=s(r)))return;if(o=="selfClose")continue;if(n[1]){for(var f=i.length-1;f>=0;--f)if(i[f]==n[2]){i.length=f;break}if(f<0&&(!t||t==n[2]))return{tag:n[2],from:e(a,u),to:e(r.line,r.ch)}}else{i.push(n[2])}}}function m(r,t){var i=[];for(;;){var n=h(r);if(!n)return;if(n=="selfClose"){c(r);continue}var o=r.line,a=r.ch;var u=c(r);if(!u)return;if(u[1]){i.push(u[2])}else{for(var f=i.length-1;f>=0;--f)if(i[f]==u[2]){i.length=f;break}if(f<0&&(!t||t==u[2]))return{tag:u[2],from:e(r.line,r.ch),to:e(o,a)}}}}r.registerHelper("fold","xml",(function(r,i){var n=new a(r,i.line,0);for(;;){var o=d(n);if(!o||n.line!=i.line)return;var u=s(n);if(!u)return;if(!o[1]&&u!="selfClose"){var f=e(n.line,n.ch);var l=v(n,o[2]);return l&&t(l.from,f)>0?{from:f,to:l.from}:null}}}));r.findMatchingTag=function(r,i,n){var o=new a(r,i.line,i.ch,n);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var u=s(o),f=u&&e(o.line,o.ch);var l=u&&c(o);if(!u||!l||t(o,i)>0)return;var d={from:e(o.line,o.ch),to:f,tag:l[2]};if(u=="selfClose")return{open:d,close:null,at:"open"};if(l[1]){return{open:m(o,l[2]),close:d,at:"close"}}else{o=new a(r,f.line,f.ch,n);return{open:d,close:v(o,l[2]),at:"open"}}};r.findEnclosingTag=function(r,e,t,i){var n=new a(r,e.line,e.ch,t);for(;;){var o=m(n,i);if(!o)break;var u=new a(r,e.line,e.ch,t);var f=v(u,o.tag);if(f)return{open:o,close:f}}};r.scanForClosingTag=function(r,e,t,i){var n=new a(r,e.line,e.ch,i?{from:0,to:i}:null);return v(n,t)}}))}));a((function(r,e){(function(r){r(l,h)})((function(r){r.defineOption("matchTags",false,(function(n,o,a){if(a&&a!=r.Init){n.off("cursorActivity",t);n.off("viewportChange",i);e(n)}if(o){n.state.matchBothTags=typeof o=="object"&&o.bothTags;n.on("cursorActivity",t);n.on("viewportChange",i);t(n)}}));function e(r){if(r.state.tagHit)r.state.tagHit.clear();if(r.state.tagOther)r.state.tagOther.clear();r.state.tagHit=r.state.tagOther=null}function t(t){t.state.failedTagMatch=false;t.operation((function(){e(t);if(t.somethingSelected())return;var i=t.getCursor(),n=t.getViewport();n.from=Math.min(n.from,i.line);n.to=Math.max(i.line+1,n.to);var o=r.findMatchingTag(t,i,n);if(!o)return;if(t.state.matchBothTags){var a=o.at=="open"?o.open:o.close;if(a)t.state.tagHit=t.markText(a.from,a.to,{className:"CodeMirror-matchingtag"})}var u=o.at=="close"?o.open:o.close;if(u)t.state.tagOther=t.markText(u.from,u.to,{className:"CodeMirror-matchingtag"});else t.state.failedTagMatch=true}))}function i(r){if(r.state.failedTagMatch)t(r)}r.commands.toMatchingTag=function(e){var t=r.findMatchingTag(e,e.getCursor());if(t){var i=t.at=="close"?t.open:t.close;if(i)e.extendSelection(i.to,i.from)}}}))}));a((function(r,e){(function(r){r(l)})((function(r){var e="CodeMirror-lint-markers";var t="CodeMirror-lint-line-";function i(e,t,i){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+e.options.theme;n.appendChild(i.cloneNode(true));if(e.state.lint.options.selfContain)e.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(e){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,e.clientY-n.offsetHeight-5)+"px";n.style.left=e.clientX+5+"px"}r.on(document,"mousemove",o);o(t);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 a(e,t,n,a){var u=i(e,t,n);function f(){r.off(a,"mouseout",f);if(u){o(u);u=null}}var l=setInterval((function(){if(u)for(var r=a;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){f();break}}if(!u)return clearInterval(l)}),400);r.on(a,"mouseout",f)}function u(r,e,t){this.marked=[];if(e instanceof Function)e={getAnnotations:e};if(!e||e===true)e={};this.options={};this.linterOptions=e.options||{};for(var i in f)this.options[i]=f[i];for(var i in e){if(f.hasOwnProperty(i)){if(e[i]!=null)this.options[i]=e[i]}else if(!e.options){this.linterOptions[i]=e[i]}}this.timeout=null;this.hasGutter=t;this.onMouseOver=function(e){k(r,e)};this.waitingFor=0}var f={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var t=r.state.lint;if(t.hasGutter)r.clearGutter(e);if(t.options.highlightLines)s(r);for(var i=0;i<t.marked.length;++i)t.marked[i].clear();t.marked.length=0}function s(r){r.eachLine((function(e){var t=e.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass);if(t)r.removeLineClass(e,"wrap",t[0])}))}function c(e,t,i,n,o){var u=document.createElement("div"),f=u;u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i;if(n){f=u.appendChild(document.createElement("div"));f.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(f,"mouseover",(function(r){a(e,r,t,f)}));return u}function d(r,e){if(r=="error")return r;else return e}function h(r){var e=[];for(var t=0;t<r.length;++t){var i=r[t],n=i.from.line;(e[n]||(e[n]=[])).push(i)}return e}function v(r){var e=r.severity;if(!e)e="error";var t=document.createElement("div");t.className="CodeMirror-lint-message CodeMirror-lint-message-"+e;if(typeof r.messageHTML!="undefined"){t.innerHTML=r.messageHTML}else{t.appendChild(document.createTextNode(r.message))}return t}function m(e,t){var i=e.state.lint;var n=++i.waitingFor;function o(){n=-1;e.off("change",o)}e.on("change",o);t(e.getValue(),(function(t,a){e.off("change",o);if(i.waitingFor!=n)return;if(a&&t instanceof r)t=a;e.operation((function(){g(e,t)}))}),i.linterOptions,e)}function p(e){var t=e.state.lint;if(!t)return;var i=t.options;var n=i.getAnnotations||e.getHelper(r.Pos(0,0),"lint");if(!n)return;if(i.async||n.async){m(e,n)}else{var o=n(e.getValue(),t.linterOptions,e);if(!o)return;if(o.then)o.then((function(r){e.operation((function(){g(e,r)}))}));else e.operation((function(){g(e,o)}))}}function g(r,i){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var a=h(i);for(var u=0;u<a.length;++u){var f=a[u];if(!f)continue;var s=[];f=f.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<f.length;++g){var b=f[g];var w=b.severity;if(!w)w="error";m=d(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(v(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(u,e,c(r,p,m,a[u].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(u,"wrap",t+m)}if(o.onUpdateLinting)o.onUpdateLinting(i,a,r)}function b(r){var e=r.state.lint;if(!e)return;clearTimeout(e.timeout);e.timeout=setTimeout((function(){p(r)}),e.options.delay)}function w(r,e,t){var i=t.target||t.srcElement;var n=document.createDocumentFragment();for(var o=0;o<e.length;o++){var u=e[o];n.appendChild(v(u))}a(r,t,n,i)}function k(r,e){var t=e.target||e.srcElement;if(!/\bCodeMirror-lint-mark-/.test(t.className))return;var i=t.getBoundingClientRect(),n=(i.left+i.right)/2,o=(i.top+i.bottom)/2;var a=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var u=[];for(var f=0;f<a.length;++f){var l=a[f].__annotation;if(l)u.push(l)}if(u.length)w(r,u,e)}r.defineOption("lint",false,(function(t,i,n){if(n&&n!=r.Init){l(t);if(t.state.lint.options.lintOnChange!==false)t.off("change",b);r.off(t.getWrapperElement(),"mouseover",t.state.lint.onMouseOver);clearTimeout(t.state.lint.timeout);delete t.state.lint}if(i){var o=t.getOption("gutters"),a=false;for(var f=0;f<o.length;++f)if(o[f]==e)a=true;var s=t.state.lint=new u(t,i,a);if(s.options.lintOnChange)t.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(t.getWrapperElement(),"mouseover",s.onMouseOver);p(t)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));a((function(r,e){(function(r){r(l)})((function(r){r.registerHelper("lint","json",(function(e){var t=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return t}var i=window.jsonlint.parser||window.jsonlint;i.parseError=function(e,i){var n=i.loc;t.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:e})};try{i.parse(e)}catch(r){}return t}))}))}));var v=a((function(r,e){(function(r){r(l)})((function(r){function e(e,i,o,a){if(o&&o.call){var u=o;o=null}else{var u=n(e,o,"rangeFinder")}if(typeof i=="number")i=r.Pos(i,0);var f=n(e,o,"minFoldSize");function l(r){var t=u(e,i);if(!t||t.to.line-t.from.line<f)return null;if(a==="fold")return t;var n=e.findMarksAt(t.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;t.cleared=true;n[o].clear()}}return t}var s=l(true);if(n(e,o,"scanUp"))while(!s&&i.line>e.firstLine()){i=r.Pos(i.line-1,0);s=l(false)}if(!s||s.cleared||a==="unfold")return;var c=t(e,o,s);r.on(c,"mousedown",(function(e){d.clear();r.e_preventDefault(e)}));var d=e.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(e,o,"clearOnEnter"),__isFold:true});d.on("clear",(function(t,i){r.signal(e,"unfold",e,t,i)}));r.signal(e,"fold",e,s.from,s.to)}function t(r,e,t){var i=n(r,e,"widget");if(typeof i=="function"){i=i(t.from,t.to)}if(typeof i=="string"){var o=document.createTextNode(i);i=document.createElement("span");i.appendChild(o);i.className="CodeMirror-foldmarker"}else if(i){i=i.cloneNode(true)}return i}r.newFoldFunction=function(r,t){return function(i,n){e(i,n,{rangeFinder:r,widget:t})}};r.defineExtension("foldCode",(function(r,t,i){e(this,r,t,i)}));r.defineExtension("isFolded",(function(r){var e=this.findMarksAt(r);for(var t=0;t<e.length;++t)if(e[t].__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(e){e.operation((function(){for(var t=e.firstLine(),i=e.lastLine();t<=i;t++)e.foldCode(r.Pos(t,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(e){e.operation((function(){for(var t=e.firstLine(),i=e.lastLine();t<=i;t++)e.foldCode(r.Pos(t,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(e,t){for(var i=0;i<r.length;++i){var n=r[i](e,t);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,e){var t=r.getHelpers(e,"fold");for(var i=0;i<t.length;i++){var n=t[i](r,e);if(n)return n}}));var i={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,e,t){if(e&&e[t]!==undefined)return e[t];var n=r.options.foldOptions;if(n&&n[t]!==undefined)return n[t];return i[t]}r.defineExtension("foldOption",(function(r,e){return n(this,r,e)}))}))}));a((function(r,e){(function(r){r(l,v)})((function(r){r.defineOption("foldGutter",false,(function(e,n,o){if(o&&o!=r.Init){e.clearGutter(e.state.foldGutter.options.gutter);e.state.foldGutter=null;e.off("gutterClick",l);e.off("changes",c);e.off("viewportChange",d);e.off("fold",h);e.off("unfold",h);e.off("swapDoc",c);e.off("optionChange",s)}if(n){e.state.foldGutter=new t(i(n));f(e);e.on("gutterClick",l);e.on("changes",c);e.on("viewportChange",d);e.on("fold",h);e.on("unfold",h);e.on("swapDoc",c);e.on("optionChange",s)}}));var e=r.Pos;function t(r){this.options=r;this.from=this.to=0}function i(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,t){var i=r.findMarks(e(t,0),e(t+1,0));for(var n=0;n<i.length;++n){if(i[n].__isFold){var o=i[n].find(-1);if(o&&o.line===t)return i[n]}}}function o(r){if(typeof r=="string"){var e=document.createElement("div");e.className=r+" CodeMirror-guttermarker-subtle";return e}else{return r.cloneNode(true)}}function a(r,t,i){var a=r.state.foldGutter.options,f=t-1;var l=r.foldOption(a,"minFoldSize");var s=r.foldOption(a,"rangeFinder");var c=typeof a.indicatorFolded=="string"&&u(a.indicatorFolded);var d=typeof a.indicatorOpen=="string"&&u(a.indicatorOpen);r.eachLine(t,i,(function(t){++f;var i=null;var u=t.gutterMarkers;if(u)u=u[a.gutter];if(n(r,f)){if(c&&u&&c.test(u.className))return;i=o(a.indicatorFolded)}else{var h=e(f,0);var v=s&&s(r,h);if(v&&v.to.line-v.from.line>=l){if(d&&u&&d.test(u.className))return;i=o(a.indicatorOpen)}}if(!i&&!u)return;r.setGutterMarker(t,a.gutter,i)}))}function u(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function f(r){var e=r.getViewport(),t=r.state.foldGutter;if(!t)return;r.operation((function(){a(r,e.from,e.to)}));t.from=e.from;t.to=e.to}function l(r,t,i){var o=r.state.foldGutter;if(!o)return;var a=o.options;if(i!=a.gutter)return;var u=n(r,t);if(u)u.clear();else r.foldCode(e(t,0),a)}function s(r,e){if(e=="mode")c(r)}function c(r){var e=r.state.foldGutter;if(!e)return;var t=e.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout((function(){f(r)}),t.foldOnChangeTimeSpan||600)}function d(r){var e=r.state.foldGutter;if(!e)return;var t=e.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout((function(){var t=r.getViewport();if(e.from==e.to||t.from-e.to>20||e.from-t.to>20){f(r)}else{r.operation((function(){if(t.from<e.from){a(r,t.from,e.from);e.from=t.from}if(t.to>e.to){a(r,e.to,t.to);e.to=t.to}}))}}),t.updateViewportTimeSpan||400)}function h(r,e){var t=r.state.foldGutter;if(!t)return;var i=e.line;if(i>=t.from&&i<t.to)a(r,i,i+1)}}))}));a((function(r,e){(function(r){r(l)})((function(r){function e(e){return function(t,i){var n=i.line,o=t.getLine(n);function a(e){var a;for(var u=i.ch,f=0;;){var l=u<=0?-1:o.lastIndexOf(e[0],u-1);if(l==-1){if(f==1)break;f=1;u=o.length;continue}if(f==1&&l<i.ch)break;a=t.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(a))return{ch:l+1,tokenType:a,pair:e};u=l-1}}function u(e){var i=1,o=t.lastLine(),a,u=e.ch,f;r:for(var l=n;l<=o;++l){var s=t.getLine(l),c=l==n?u:0;for(;;){var d=s.indexOf(e.pair[0],c),h=s.indexOf(e.pair[1],c);if(d<0)d=s.length;if(h<0)h=s.length;c=Math.min(d,h);if(c==s.length)break;if(t.getTokenTypeAt(r.Pos(l,c+1))==e.tokenType){if(c==d)++i;else if(!--i){a=l;f=c;break r}}++c}}if(a==null||n==a)return null;return{from:r.Pos(n,u),to:r.Pos(a,f)}}var f=[];for(var l=0;l<e.length;l++){var s=a(e[l]);if(s)f.push(s)}f.sort((function(r,e){return r.ch-e.ch}));for(var l=0;l<f.length;l++){var c=u(f[l]);if(c)return c}return null}}r.registerHelper("fold","brace",e([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",e([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(e,t){function i(t){if(t<e.firstLine()||t>e.lastLine())return null;var i=e.getTokenAt(r.Pos(t,1));if(!/\S/.test(i.string))i=e.getTokenAt(r.Pos(t,i.end+1));if(i.type!="keyword"||i.string!="import")return null;for(var n=t,o=Math.min(e.lastLine(),t+10);n<=o;++n){var a=e.getLine(n),u=a.indexOf(";");if(u!=-1)return{startCh:i.end,end:r.Pos(n,u)}}}var n=t.line,o=i(n),a;if(!o||i(n-1)||(a=i(n-2))&&a.end.line==n-1)return null;for(var u=o.end;;){var f=i(u.line+1);if(f==null)break;u=f.end}return{from:e.clipPos(r.Pos(n,o.startCh+1)),to:u}}));r.registerHelper("fold","include",(function(e,t){function i(t){if(t<e.firstLine()||t>e.lastLine())return null;var i=e.getTokenAt(r.Pos(t,1));if(!/\S/.test(i.string))i=e.getTokenAt(r.Pos(t,i.end+1));if(i.type=="meta"&&i.string.slice(0,8)=="#include")return i.start+8}var n=t.line,o=i(n);if(o==null||i(n-1)!=null)return null;for(var a=n;;){var u=i(a+1);if(u==null)break;++a}return{from:r.Pos(n,o+1),to:e.clipPos(r.Pos(a))}}))}))}));var m=a((function(r){var e=function(){var r=true,e=false;var t={};var i=function(){var r;var e;var t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var i;var n=function(e){throw{name:"SyntaxError",message:e,at:r,text:i}};var o=function(t){if(t&&t!==e){n("Expected '"+t+"' instead of '"+e+"'")}e=i.charAt(r);r+=1;return e};var a=function(){var r;var t="";if(e==="-"){t="-";o("-")}while(e>="0"&&e<="9"){t+=e;o()}if(e==="."){t+=".";while(o()&&e>="0"&&e<="9"){t+=e}}if(e==="e"||e==="E"){t+=e;o();if(e==="-"||e==="+"){t+=e;o()}while(e>="0"&&e<="9"){t+=e;o()}}r=+t;if(!isFinite(r)){n("Bad number")}else{return r}};var u=function(){var r;var i;var a="";var u;if(e==='"'){while(o()){if(e==='"'){o();return a}if(e==="\\"){o();if(e==="u"){u=0;for(i=0;i<4;i+=1){r=parseInt(o(),16);if(!isFinite(r)){break}u=u*16+r}a+=String.fromCharCode(u)}else if(typeof t[e]==="string"){a+=t[e]}else{break}}else{a+=e}}}n("Bad string")};var f=function(){while(e&&e<=" "){o()}};var l=function(){switch(e){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 '"+e+"'")};var s;var c=function(){var r=[];if(e==="["){o("[");f();if(e==="]"){o("]");return r}while(e){r.push(s());f();if(e==="]"){o("]");return r}o(",");f()}}n("Bad array")};var d=function(){var r;var t={};if(e==="{"){o("{");f();if(e==="}"){o("}");return t}while(e){r=u();f();o(":");if(Object.hasOwnProperty.call(t,r)){n("Duplicate key '"+r+"'")}t[r]=s();f();if(e==="}"){o("}");return t}o(",");f()}}n("Bad object")};s=function(){f();switch(e){case"{":return d();case"[":return c();case'"':return u();case"-":return a();default:return e>="0"&&e<="9"?a():l()}};return function(t,o){var a;i=t;r=0;e=" ";a=s();f();if(e){n("Syntax error")}return typeof o==="function"?function r(e,t){var i;var n;var a=e[t];if(a&&typeof a==="object"){for(i in a){if(Object.prototype.hasOwnProperty.call(a,i)){n=r(a,i);if(n!==undefined){a[i]=n}else{delete a[i]}}}}return o.call(e,t,a)}({"":a},""):a}}();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(e,t,i,n,o,a,u){var f=a.length-1;switch(o){case 1:this.$=e.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(e);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=a[f-1];case 13:this.$={};break;case 14:this.$=a[f-1];break;case 15:this.$=[a[f-2],a[f]];break;case 16:this.$={};this.$[a[f][0]]=a[f][1];break;case 17:this.$=a[f-2];a[f-2][a[f][0]]=a[f][1];break;case 18:this.$=[];break;case 19:this.$=a[f-1];break;case 20:this.$=[a[f]];break;case 21:this.$=a[f-2];a[f-2].push(a[f]);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(e,t){throw new Error(e)},parse:function r(e){var t=this,i=[0],n=[null],o=[],a=this.table,u="",f=0,l=0,s=0,c=2,d=1;this.lexer.setInput(e);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 v(r){i.length=i.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=t.lexer.lex()||1;if(typeof r!=="number"){r=t.symbols_[r]||r}return r}var p,g,b,w,k,y={},x,C,M,A;while(true){b=i[i.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=a[b]&&a[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){A=[];for(x in a[b])if(this.terminals_[x]&&x>2){A.push("'"+this.terminals_[x]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(f+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(f+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:A})}if(s==3){if(p==d){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;u=this.lexer.yytext;f=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in a[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}v(1);b=i[i.length-1]}g=p;p=c;b=i[i.length-1];w=a[b]&&a[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:i.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);i.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;u=this.lexer.yytext;f=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:C=this.productions_[w[1]][1];y.$=n[n.length-C];y._$={first_line:o[o.length-(C||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(C||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(y,u,l,f,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(C){i=i.slice(0,-1*C*2);n=n.slice(0,-1*C);o=o.slice(0,-1*C)}i.push(this.productions_[w[1]][0]);n.push(y.$);o.push(y._$);M=a[i[i.length-2]][i[i.length-1]];i.push(M);break;case 3:return true}}return true}};var e=function(){var r={EOF:1,parseError:function r(e,t){if(this.yy.parseError){this.yy.parseError(e,t)}else{throw new Error(e)}},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 e=r.match(/\n/);if(e)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 e=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,e,t,i,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var a=0;a<o.length;a++){t=this._input.match(this.rules[o[a]]);if(t&&(!e||t[0].length>e[0].length)){e=t;i=a;if(!this.options.flex)break}}if(e){n=e[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+e[0].length};this.yytext+=e[0];this.match+=e[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(e[0].length);this.matched+=e[0];r=this.performAction.call(this,this.yy,this,o[i],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 e=this.next();if(typeof e!=="undefined"){return e}else{return this.lex()}},begin:function r(e){this.conditionStack.push(e)},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(e){this.begin(e)}};r.options={};r.performAction=function r(e,t,i,n){switch(i){case 0:break;case 1:return 6;case 2:t.yytext=t.yytext.substr(1,t.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=e;return r}();var o=n.parse;n.parse=function(e){var t=o.call(n,e);var a=typeof i==="undefined"?r("./doug-json-parse"):i;try{a(e)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var u=e.substring(0,r.at).split("\n");var f=u.length;var l=u[f-1].length-1;this.parseError(r.message,{line:f,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+f)}}return t};if(typeof t!=="undefined"){t.parser=n;t.parse=function(){return n.parse.apply(n,arguments)};t.main=function e(i){if(!i[1])throw new Error("Usage: "+i[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),i[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(i[1]).read({charset:"utf-8"})}return t.parser.parse(n)};if(r.main===e){t.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return t}();if(r.exports)r.exports=e}));const p="@charset \"UTF-8\";.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(limel-code-editor){isolation:isolate;position:relative;display:flex;flex-direction:column;width:100%;font-size:var(--code-editor-font-size, 0.8125rem);--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(limel-code-editor) .cm-attribute,:host(limel-code-editor) .cm-property,:host(limel-code-editor) .cm-keyword{color:rgb(var(--color-violet-light))}:host(limel-code-editor) .cm-operator{color:rgb(var(--color-sky-dark))}:host(limel-code-editor) .cm-variable{color:rgb(var(--color-pink-light))}:host(limel-code-editor) .cm-variable-2{color:rgb(var(--contrast-1100))}:host(limel-code-editor) .cm-variable-3,:host(limel-code-editor) .cm-type{color:rgb(var(--color-amber-darker))}:host(limel-code-editor) .cm-builtin,:host(limel-code-editor) .cm-meta{color:rgb(var(--color-amber-default))}:host(limel-code-editor) .cm-atom{color:rgb(var(--color-coral-default))}:host(limel-code-editor) .cm-tag,:host(limel-code-editor) .cm-number{color:rgb(var(--color-magenta-default))}:host(limel-code-editor) .cm-def{color:rgb(var(--color-sky-default))}:host(limel-code-editor) .cm-string{color:rgb(var(--color-green-dark))}:host(limel-code-editor) .cm-string-2{color:rgb(var(--color-pink-default))}:host(limel-code-editor) .cm-qualifier{color:rgb(var(--color-grass-default))}:host(limel-code-editor) .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host(limel-code-editor) .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%;min-height:2.5rem}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;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-lines{padding:0.25rem 0}.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 var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);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,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.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}limel-notched-outline{flex-grow:1}.copy-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);position:absolute;top:0.25rem;right:0.25rem;z-index:1;padding:0.25rem 0.5rem;border-radius:0.375rem;font-size:0.75rem;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease), opacity var(--limel-clickable-transition-speed, 0.4s) ease;opacity:0}.copy-button:hover,.copy-button:focus,.copy-button:focus-visible{will-change:color, background-color, box-shadow, transform}.copy-button:hover,.copy-button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.copy-button:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.copy-button:hover,.copy-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.copy-button:focus{outline:none}.copy-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host(limel-code-editor:hover) .copy-button,:host(limel-code-editor:focus-within) .copy-button{opacity:1}:host(limel-code-editor:focus),:host(limel-code-editor:focus-visible),:host(limel-code-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-code-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-code-editor:focus) limel-helper-line,:host(limel-code-editor:focus-visible) limel-helper-line,:host(limel-code-editor:focus-within) limel-helper-line,:host(limel-code-editor:hover) limel-helper-line{will-change:grid-template-rows}";const g=class{constructor(i){r(this,i);this.change=e(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.renderHelperLine=()=>{if(!this.helperText){return}return t("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})};this.copyCode=async()=>{var r,e,t;const i=(t=(e=(r=this.editor)===null||r===void 0?void 0:r.getValue())!==null&&e!==void 0?e:this.value)!==null&&t!==void 0?t:"";try{await navigator.clipboard.writeText(i);this.wasCopied="success";setTimeout((()=>{this.wasCopied="idle"}),2e3)}catch(r){console.error("Failed to copy to clipboard:",r);this.wasCopied="failed"}};this.value="";this.language=undefined;this.readonly=false;this.disabled=false;this.invalid=false;this.required=false;this.label=undefined;this.helperText=undefined;this.lineNumbers=false;this.lineWrapping=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.translationLanguage="en";this.random=undefined;this.wasCopied="idle";this.labelId=o();this.helperTextId=o()}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host);(r=this.editor)===null||r===void 0?void 0:r.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const e=this.host.shadowRoot.querySelector(".editor");for(const r of e===null||e===void 0?void 0:e.childNodes){r.remove()}}componentDidRender(){if(this.editor){return}this.editor=this.createEditor();this.updateInputFieldAccessibilityAttributes()}watchValue(r){if(!this.editor){return}const e=this.editor.getValue();if(r===e){return}this.editor.getDoc().setValue(r||"")}watchDisabled(){this.updateEditorReadOnlyState();this.updateInputFieldAccessibilityAttributes()}watchReadonly(){this.updateEditorReadOnlyState();this.updateInputFieldAccessibilityAttributes()}watchInvalid(){this.updateInputFieldAccessibilityAttributes()}watchRequired(){this.updateInputFieldAccessibilityAttributes()}watchHelperText(){this.updateInputFieldAccessibilityAttributes()}createEditor(){const r=this.getOptions();const e=l(this.host.shadowRoot.querySelector(".editor"),r);e.on("change",this.handleChange);e.setOption("extraKeys",{Tab:r=>{const e=" ".repeat(r.getOption("indentUnit"));r.replaceSelection(e)}});return e}getOptions(){let r=this.language;const e=4;let t="lime light";const i=[];if(this.isDarkMode()){t="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){i.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=m}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}else if(this.language==="html"){r="htmlmixed"}if(this.fold){i.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:t,readOnly:this.getReadOnlyOption(),tabSize:e,indentUnit:e,lineNumbers:this.lineNumbers,lineWrapping:this.lineWrapping,styleActiveLine:true,matchBrackets:true,matchTags:{bothTags:true},lint:this.lint,foldGutter:this.fold,gutters:i}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly||this.disabled,disabled:this.disabled,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return t(i,null,this.renderCopyButton(),t("limel-notched-outline",{labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:true},t("div",{slot:"content",class:r})),this.renderHelperLine())}forceRedraw(){this.random=Math.random()}renderCopyButton(){var r;const e=!!(((r=this.editor)===null||r===void 0?void 0:r.getValue())||this.value);if(!e||this.disabled){return}return t("button",{class:"copy-button",onClick:this.copyCode,type:"button","aria-live":"polite","aria-atomic":"true","aria-label":this.getButtonAriaLabel()},this.getButtonText())}getButtonText(){if(this.wasCopied==="success"){return f.get("code-editor.copied",this.translationLanguage)}if(this.wasCopied==="failed"){return f.get("code-editor.copy-failed",this.translationLanguage)}return f.get("code-editor.copy",this.translationLanguage)}getButtonAriaLabel(){const r=this.label||f.get("code-editor",this.translationLanguage);const e={success:"code-editor.copied-aria-label",failed:"code-editor.copy-failed-aria-label",idle:"code-editor.copy-aria-label"};const t=e[this.wasCopied];return f.get(t,this.translationLanguage,{label:r})}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}updateEditorReadOnlyState(){if(!this.editor){return}this.editor.setOption("readOnly",this.getReadOnlyOption())}getReadOnlyOption(){if(this.disabled){return"nocursor"}return this.readonly}updateInputFieldAccessibilityAttributes(){if(!this.editor){return}const r=this.editor.getInputField();if(!r){return}r.id=this.labelId;if(this.helperText){r.setAttribute("aria-describedby",this.helperTextId);r.setAttribute("aria-controls",this.helperTextId)}else{r.removeAttribute("aria-describedby");r.removeAttribute("aria-controls")}if(this.required){r.setAttribute("aria-required","true")}else{r.removeAttribute("aria-required")}if(this.invalid){r.setAttribute("aria-invalid","true")}else{r.removeAttribute("aria-invalid")}if(this.disabled){r.setAttribute("aria-disabled","true")}else{r.removeAttribute("aria-disabled")}if(this.readonly||this.disabled){r.setAttribute("aria-readonly","true")}else{r.removeAttribute("aria-readonly")}}get host(){return n(this)}static get watchers(){return{value:["watchValue"],disabled:["watchDisabled"],readonly:["watchReadonly"],invalid:["watchInvalid"],required:["watchRequired"],helperText:["watchHelperText"]}}};g.style=p;export{g as limel_code_editor};
2
+ //# sourceMappingURL=p-5ca68424.entry.js.map