easy-email-pro-theme 0.2.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 (271) hide show
  1. package/lib/VariablesEditorContent-08997e30.mjs +147384 -0
  2. package/lib/abap-e7729493.mjs +1315 -0
  3. package/lib/apex-ea0b1b44.mjs +320 -0
  4. package/lib/assets/json.worker-2db083a8.js +16634 -0
  5. package/lib/azcli-92ca1f6b.mjs +75 -0
  6. package/lib/bat-a8aff72a.mjs +96 -0
  7. package/lib/bicep-a4d73496.mjs +116 -0
  8. package/lib/cameligo-93a61573.mjs +169 -0
  9. package/lib/clojure-a4292303.mjs +755 -0
  10. package/lib/coffee-c79fd580.mjs +229 -0
  11. package/lib/cpp-4bbc4355.mjs +391 -0
  12. package/lib/csharp-8ee8b919.mjs +321 -0
  13. package/lib/csp-7ff23ab5.mjs +58 -0
  14. package/lib/css-675efd06.mjs +185 -0
  15. package/lib/cssMode-e5b02650.mjs +2031 -0
  16. package/lib/cypher-ff6c93d1.mjs +263 -0
  17. package/lib/dart-b81ee8da.mjs +271 -0
  18. package/lib/dockerfile-4d34b657.mjs +133 -0
  19. package/lib/ecl-829c6c9f.mjs +455 -0
  20. package/lib/elixir-d20ab92c.mjs +490 -0
  21. package/lib/flow9-d363677c.mjs +142 -0
  22. package/lib/freemarker2-07352200.mjs +675 -0
  23. package/lib/fsharp-e5e10937.mjs +211 -0
  24. package/lib/go-49d8dd1b.mjs +209 -0
  25. package/lib/graphql-397d36cc.mjs +142 -0
  26. package/lib/handlebars-eb587af4.mjs +403 -0
  27. package/lib/hcl-2bc5a11b.mjs +178 -0
  28. package/lib/html-805b20b1.mjs +293 -0
  29. package/lib/html2canvas.esm-858519c4.mjs +7837 -0
  30. package/lib/htmlMode-a339a06a.mjs +2047 -0
  31. package/lib/index.js +40838 -0
  32. package/lib/ini-777fd0a6.mjs +69 -0
  33. package/lib/java-88c2ae93.mjs +222 -0
  34. package/lib/javascript-b5849f55.mjs +78 -0
  35. package/lib/jsonMode-1b509c19.mjs +2607 -0
  36. package/lib/julia-7e1d65a2.mjs +497 -0
  37. package/lib/kotlin-da15198d.mjs +246 -0
  38. package/lib/less-0057666d.mjs +168 -0
  39. package/lib/lexon-4f74b04c.mjs +152 -0
  40. package/lib/liquid-d5c8a287.mjs +250 -0
  41. package/lib/lua-da0a0c60.mjs +158 -0
  42. package/lib/m3-14d67e1c.mjs +211 -0
  43. package/lib/markdown-37ba20b1.mjs +203 -0
  44. package/lib/mips-d0b2c227.mjs +195 -0
  45. package/lib/monacoeditorwork/css.worker.bundle.js +46736 -0
  46. package/lib/monacoeditorwork/editor.worker.bundle.js +9954 -0
  47. package/lib/monacoeditorwork/html.worker.bundle.js +25985 -0
  48. package/lib/monacoeditorwork/json.worker.bundle.js +17214 -0
  49. package/lib/monacoeditorwork/ts.worker.bundle.js +172133 -0
  50. package/lib/msdax-29068c66.mjs +378 -0
  51. package/lib/mysql-7833c854.mjs +877 -0
  52. package/lib/objective-c-91c200d7.mjs +189 -0
  53. package/lib/pascal-eb8fa4fd.mjs +246 -0
  54. package/lib/pascaligo-855a8af1.mjs +159 -0
  55. package/lib/perl-6aab1ca2.mjs +600 -0
  56. package/lib/pgsql-f2266c91.mjs +848 -0
  57. package/lib/php-9806c791.mjs +472 -0
  58. package/lib/pla-c1d8ec04.mjs +132 -0
  59. package/lib/postiats-04d6db22.mjs +545 -0
  60. package/lib/powerquery-ec4dd65a.mjs +891 -0
  61. package/lib/powershell-cc02a40e.mjs +234 -0
  62. package/lib/protobuf-83b8e701.mjs +423 -0
  63. package/lib/pug-06fecd70.mjs +394 -0
  64. package/lib/python-7da9e073.mjs +270 -0
  65. package/lib/qsharp-232171da.mjs +283 -0
  66. package/lib/r-c048a1d4.mjs +246 -0
  67. package/lib/razor-c88b46b3.mjs +524 -0
  68. package/lib/redis-4399e06c.mjs +299 -0
  69. package/lib/redshift-ba36da77.mjs +807 -0
  70. package/lib/restructuredtext-cac6fcb7.mjs +163 -0
  71. package/lib/ruby-dca5ee98.mjs +445 -0
  72. package/lib/rust-c0b8769e.mjs +338 -0
  73. package/lib/sb-2b0bce6c.mjs +111 -0
  74. package/lib/scala-58e9dfc7.mjs +354 -0
  75. package/lib/scheme-fdc48747.mjs +115 -0
  76. package/lib/scss-defea6f2.mjs +243 -0
  77. package/lib/shell-8e11dc85.mjs +225 -0
  78. package/lib/solidity-8d74b890.mjs +1352 -0
  79. package/lib/sophia-b97eb718.mjs +191 -0
  80. package/lib/sparql-68163824.mjs +194 -0
  81. package/lib/sql-59977475.mjs +819 -0
  82. package/lib/st-febe75da.mjs +415 -0
  83. package/lib/style.css +6503 -0
  84. package/lib/swift-b95bae51.mjs +316 -0
  85. package/lib/systemverilog-4461e8b3.mjs +557 -0
  86. package/lib/tcl-8f97c15f.mjs +233 -0
  87. package/lib/tsMode-934544e6.mjs +1216 -0
  88. package/lib/twig-a68d494c.mjs +324 -0
  89. package/lib/typescript-049ec7b9.mjs +339 -0
  90. package/lib/typings/assets/font/iconfont.d.ts +0 -0
  91. package/lib/typings/components/BlockSideBar/BlockItem/index.d.ts +9 -0
  92. package/lib/typings/components/BlockSideBar/BlockList/index.d.ts +5 -0
  93. package/lib/typings/components/BlockSideBar/BlocksPanel/index.d.ts +2 -0
  94. package/lib/typings/components/BlockSideBar/LayoutItem/index.d.ts +6 -0
  95. package/lib/typings/components/BlockSideBar/index.d.ts +5 -0
  96. package/lib/typings/components/ColumnLayout/LayoutItemList.d.ts +6 -0
  97. package/lib/typings/components/ColumnLayout/index.d.ts +5 -0
  98. package/lib/typings/components/ConfigurationDrawer/index.d.ts +5 -0
  99. package/lib/typings/components/ConfigurationPanel/Elements/Button/index.d.ts +5 -0
  100. package/lib/typings/components/ConfigurationPanel/Elements/Column/index.d.ts +5 -0
  101. package/lib/typings/components/ConfigurationPanel/Elements/Divider/index.d.ts +5 -0
  102. package/lib/typings/components/ConfigurationPanel/Elements/Hero/index.d.ts +5 -0
  103. package/lib/typings/components/ConfigurationPanel/Elements/Image/index.d.ts +5 -0
  104. package/lib/typings/components/ConfigurationPanel/Elements/Navbar/index.d.ts +5 -0
  105. package/lib/typings/components/ConfigurationPanel/Elements/Page/index.d.ts +5 -0
  106. package/lib/typings/components/ConfigurationPanel/Elements/Section/index.d.ts +5 -0
  107. package/lib/typings/components/ConfigurationPanel/Elements/Social/index.d.ts +5 -0
  108. package/lib/typings/components/ConfigurationPanel/Elements/Spacer/index.d.ts +5 -0
  109. package/lib/typings/components/ConfigurationPanel/Elements/Text/index.d.ts +5 -0
  110. package/lib/typings/components/ConfigurationPanel/Elements/Wrapper/index.d.ts +5 -0
  111. package/lib/typings/components/ConfigurationPanel/Elements/index.d.ts +5 -0
  112. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundColor.d.ts +5 -0
  113. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundImage.d.ts +8 -0
  114. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BackgroundPosition.d.ts +8 -0
  115. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Border.d.ts +11 -0
  116. package/lib/typings/components/ConfigurationPanel/components/AttributeField/BorderRadius.d.ts +5 -0
  117. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ButtonCategory.d.ts +10 -0
  118. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Buttons.d.ts +18 -0
  119. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Columns.d.ts +8 -0
  120. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Direction.d.ts +9 -0
  121. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Condition.d.ts +9 -0
  122. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/Iteration.d.ts +9 -0
  123. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DisplayOptions/index.d.ts +3 -0
  124. package/lib/typings/components/ConfigurationPanel/components/AttributeField/DividerLine.d.ts +10 -0
  125. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontFamily.d.ts +5 -0
  126. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontSize.d.ts +5 -0
  127. package/lib/typings/components/ConfigurationPanel/components/AttributeField/FontWeight.d.ts +5 -0
  128. package/lib/typings/components/ConfigurationPanel/components/AttributeField/GlobalLink.d.ts +2 -0
  129. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Heading.d.ts +7 -0
  130. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Height.d.ts +5 -0
  131. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageUrl.d.ts +6 -0
  132. package/lib/typings/components/ConfigurationPanel/components/AttributeField/ImageWidth.d.ts +7 -0
  133. package/lib/typings/components/ConfigurationPanel/components/AttributeField/LetterSpacing.d.ts +5 -0
  134. package/lib/typings/components/ConfigurationPanel/components/AttributeField/LineHeight.d.ts +7 -0
  135. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Link.d.ts +5 -0
  136. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Padding.d.ts +10 -0
  137. package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelAndPercentField.d.ts +11 -0
  138. package/lib/typings/components/ConfigurationPanel/components/AttributeField/PixelField.d.ts +3 -0
  139. package/lib/typings/components/ConfigurationPanel/components/AttributeField/StackOnMobile.d.ts +7 -0
  140. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAlign.d.ts +5 -0
  141. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingList.d.ts +6 -0
  142. package/lib/typings/components/ConfigurationPanel/components/AttributeField/TextAndHeadingStyle.d.ts +8 -0
  143. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Typography.d.ts +17 -0
  144. package/lib/typings/components/ConfigurationPanel/components/AttributeField/VerticalAlign.d.ts +5 -0
  145. package/lib/typings/components/ConfigurationPanel/components/AttributeField/WebFonts.d.ts +2 -0
  146. package/lib/typings/components/ConfigurationPanel/components/AttributeField/Width.d.ts +5 -0
  147. package/lib/typings/components/ConfigurationPanel/components/AttributeField/index.d.ts +103 -0
  148. package/lib/typings/components/ConfigurationPanel/components/AttributePanel.d.ts +2 -0
  149. package/lib/typings/components/ConfigurationPanel/components/AttributesPanelWrapper/index.d.ts +8 -0
  150. package/lib/typings/components/ConfigurationPanel/components/CollapseWrapper/index.d.ts +7 -0
  151. package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/ResponsiveField.d.ts +5 -0
  152. package/lib/typings/components/ConfigurationPanel/components/ResponsiveTabs/index.d.ts +11 -0
  153. package/lib/typings/components/ConfigurationPanel/components/SourceCodePanel/index.d.ts +2 -0
  154. package/lib/typings/components/ConfigurationPanel/components/UniversalElementPanel/index.d.ts +2 -0
  155. package/lib/typings/components/ConfigurationPanel/index.d.ts +8 -0
  156. package/lib/typings/components/Controller/index.d.ts +3 -0
  157. package/lib/typings/components/EditorTabs/components/PreviewEmail/components/DesktopEmailPreview/index.d.ts +5 -0
  158. package/lib/typings/components/EditorTabs/components/PreviewEmail/components/MobilePreview/index.d.ts +5 -0
  159. package/lib/typings/components/EditorTabs/components/PreviewEmail/index.d.ts +8 -0
  160. package/lib/typings/components/EditorTabs/components/PreviewEmailDrawer/index.d.ts +4 -0
  161. package/lib/typings/components/EditorTabs/components/TabHeader/index.d.ts +5 -0
  162. package/lib/typings/components/EditorTabs/index.d.ts +4 -0
  163. package/lib/typings/components/Form/ButtonField.d.ts +13 -0
  164. package/lib/typings/components/Form/ButtonGroupField.d.ts +15 -0
  165. package/lib/typings/components/Form/ColorPicker/ColorPickerContent.d.ts +7 -0
  166. package/lib/typings/components/Form/ColorPicker/index.d.ts +14 -0
  167. package/lib/typings/components/Form/EditPanelListField.d.ts +17 -0
  168. package/lib/typings/components/Form/EditPanelTabsField.d.ts +13 -0
  169. package/lib/typings/components/Form/ImageUploaderField/index.d.ts +20 -0
  170. package/lib/typings/components/Form/RichTextField/index.d.ts +10 -0
  171. package/lib/typings/components/Form/Select.d.ts +11 -0
  172. package/lib/typings/components/Form/SwitchField/index.d.ts +5 -0
  173. package/lib/typings/components/Form/SyncChildrenField.d.ts +11 -0
  174. package/lib/typings/components/Form/VariablesEditor/VariablesEditorContent.d.ts +7 -0
  175. package/lib/typings/components/Form/VariablesEditor/index.d.ts +2 -0
  176. package/lib/typings/components/Form/WatchField.d.ts +11 -0
  177. package/lib/typings/components/Form/adapter/JsonAdapter.d.ts +4 -0
  178. package/lib/typings/components/Form/adapter/color.adapter.d.ts +4 -0
  179. package/lib/typings/components/Form/adapter/fontStyle.adapter.d.ts +4 -0
  180. package/lib/typings/components/Form/adapter/fontWeight.adapter.d.ts +4 -0
  181. package/lib/typings/components/Form/adapter/index.d.ts +8 -0
  182. package/lib/typings/components/Form/adapter/italic.adapter.d.ts +4 -0
  183. package/lib/typings/components/Form/adapter/pixel.adapter.d.ts +4 -0
  184. package/lib/typings/components/Form/adapter/pixelNumber.adapter.d.ts +4 -0
  185. package/lib/typings/components/Form/adapter/slider.adapter.d.ts +4 -0
  186. package/lib/typings/components/Form/enhancer.d.ts +12 -0
  187. package/lib/typings/components/Form/index.d.ts +26 -0
  188. package/lib/typings/components/FullHeightOverlayScrollbars/index.d.ts +9 -0
  189. package/lib/typings/components/FullScreenLoading/index.d.ts +7 -0
  190. package/lib/typings/components/Hotkeys/index.d.ts +2 -0
  191. package/lib/typings/components/HoveringToolbar/RichTextBar.d.ts +6 -0
  192. package/lib/typings/components/HoveringToolbar/componens/BgColor.d.ts +2 -0
  193. package/lib/typings/components/HoveringToolbar/componens/FontColor.d.ts +2 -0
  194. package/lib/typings/components/HoveringToolbar/componens/FontFamily.d.ts +2 -0
  195. package/lib/typings/components/HoveringToolbar/componens/FontSize.d.ts +2 -0
  196. package/lib/typings/components/HoveringToolbar/componens/FormatButton.d.ts +9 -0
  197. package/lib/typings/components/HoveringToolbar/componens/MergeTag.d.ts +8 -0
  198. package/lib/typings/components/HoveringToolbar/componens/TextAlign.d.ts +2 -0
  199. package/lib/typings/components/HoveringToolbar/componens/TextLink.d.ts +2 -0
  200. package/lib/typings/components/HoveringToolbar/componens/TurnInto.d.ts +2 -0
  201. package/lib/typings/components/HoveringToolbar/constants.d.ts +0 -0
  202. package/lib/typings/components/HoveringToolbar/index.d.ts +3 -0
  203. package/lib/typings/components/HoveringToolbar/utils/getLinkNode.d.ts +3 -0
  204. package/lib/typings/components/IconFont/index.d.ts +10 -0
  205. package/lib/typings/components/MergeTagComponent/index.d.ts +7 -0
  206. package/lib/typings/components/MergetagPopover/index.d.ts +2 -0
  207. package/lib/typings/components/Providers/ControllerProvider.d.ts +4 -0
  208. package/lib/typings/components/Providers/DraggingProvider.d.ts +20 -0
  209. package/lib/typings/components/Providers/FormProvider.d.ts +4 -0
  210. package/lib/typings/components/Providers/UniversalElementProvider.d.ts +10 -0
  211. package/lib/typings/components/Providers/index.d.ts +6 -0
  212. package/lib/typings/components/UniversalElementEditorDrawer/index.d.ts +5 -0
  213. package/lib/typings/components/UnsplashImages/index.d.ts +206 -0
  214. package/lib/typings/components/index.d.ts +69 -0
  215. package/lib/typings/hooks/index.d.ts +6 -0
  216. package/lib/typings/hooks/useDragging.d.ts +15 -0
  217. package/lib/typings/hooks/useEditorForm.d.ts +12 -0
  218. package/lib/typings/hooks/useElementDefault.d.ts +9 -0
  219. package/lib/typings/hooks/useElementInteract.d.ts +6 -0
  220. package/lib/typings/hooks/useFontFamily.d.ts +7 -0
  221. package/lib/typings/hooks/useUniversalContent.d.ts +1 -0
  222. package/lib/typings/index.d.ts +5 -0
  223. package/lib/typings/store/ColorState.d.ts +9 -0
  224. package/lib/typings/store/EditorState.d.ts +12 -0
  225. package/lib/typings/store/Minimalist.d.ts +35 -0
  226. package/lib/typings/store/index.d.ts +49 -0
  227. package/lib/typings/themes/Minimalist/components/AutoSelectElement.d.ts +2 -0
  228. package/lib/typings/themes/Minimalist/components/BlockMenusOverlay/index.d.ts +2 -0
  229. package/lib/typings/themes/Minimalist/components/BlockResizer/index.d.ts +12 -0
  230. package/lib/typings/themes/Minimalist/components/ColumnLayoutOverlay/index.d.ts +2 -0
  231. package/lib/typings/themes/Minimalist/components/ElementHover/index.d.ts +2 -0
  232. package/lib/typings/themes/Minimalist/components/ElementPlaceholder/index.d.ts +2 -0
  233. package/lib/typings/themes/Minimalist/components/ElementSelected/index.d.ts +2 -0
  234. package/lib/typings/themes/Minimalist/components/ElementTools/index.d.ts +8 -0
  235. package/lib/typings/themes/Minimalist/components/ImageAction/MoreActionsMenusOverlay/index.d.ts +10 -0
  236. package/lib/typings/themes/Minimalist/components/ImageAction/MoreIcon/index.d.ts +5 -0
  237. package/lib/typings/themes/Minimalist/components/ImageAction/index.d.ts +7 -0
  238. package/lib/typings/themes/Minimalist/index.d.ts +10 -0
  239. package/lib/typings/themes/Minimalist/withTheme.d.ts +4 -0
  240. package/lib/typings/themes/Retro/components/AutoDeselectElement.d.ts +2 -0
  241. package/lib/typings/themes/Retro/components/ElementInteract/AddIcon/index.d.ts +2 -0
  242. package/lib/typings/themes/Retro/components/ElementInteract/DragIcon/index.d.ts +4 -0
  243. package/lib/typings/themes/Retro/components/ElementInteract/ElementHover/index.d.ts +2 -0
  244. package/lib/typings/themes/Retro/components/ElementInteract/ElementPlaceholder/index.d.ts +2 -0
  245. package/lib/typings/themes/Retro/components/ElementInteract/ElementSelected/index.d.ts +2 -0
  246. package/lib/typings/themes/Retro/components/ElementInteract/ElementTools/index.d.ts +8 -0
  247. package/lib/typings/themes/Retro/components/ElementInteract/index.d.ts +3 -0
  248. package/lib/typings/themes/Retro/index.d.ts +10 -0
  249. package/lib/typings/themes/Retro/withTheme.d.ts +2 -0
  250. package/lib/typings/themes/index.d.ts +2 -0
  251. package/lib/typings/typings/custom-types.d.ts +96 -0
  252. package/lib/typings/typings/index.d.ts +1 -0
  253. package/lib/typings/utils/Uploader.d.ts +35 -0
  254. package/lib/typings/utils/environment.d.ts +1 -0
  255. package/lib/typings/utils/generateLogic.d.ts +3 -0
  256. package/lib/typings/utils/getElementPageLayout.d.ts +16 -0
  257. package/lib/typings/utils/getFallbackValue.d.ts +7 -0
  258. package/lib/typings/utils/hideCursor.d.ts +2 -0
  259. package/lib/typings/utils/hotkeys.d.ts +18 -0
  260. package/lib/typings/utils/index.d.ts +2 -0
  261. package/lib/typings/utils/isValidHttpUrl.d.ts +1 -0
  262. package/lib/typings/utils/mjmlToJson/HtmlNodeAdapter.d.ts +2 -0
  263. package/lib/typings/utils/mjmlToJson/basicElementToStandardElement.d.ts +2 -0
  264. package/lib/typings/utils/mjmlToJson/formatPadding.d.ts +1 -0
  265. package/lib/typings/utils/mjmlToJson/index.d.ts +2 -0
  266. package/lib/typings/utils/onDrag.d.ts +10 -0
  267. package/lib/typings/utils/previewLoadImage.d.ts +1 -0
  268. package/lib/vb-dfbee74a.mjs +365 -0
  269. package/lib/xml-c6d1e274.mjs +106 -0
  270. package/lib/yaml-3c88ef61.mjs +195 -0
  271. package/package.json +44 -0
@@ -0,0 +1,2047 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { m as monaco_editor_core_star } from "./VariablesEditorContent-08997e30.mjs";
8
+ import "react";
9
+ import "easy-email-pro-core";
10
+ /*!-----------------------------------------------------------------------------
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Version: 0.36.1(6c56744c3419458f0dd48864520b759d1a3a1ca8)
13
+ * Released under the MIT license
14
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
15
+ *-----------------------------------------------------------------------------*/
16
+ var __defProp2 = Object.defineProperty;
17
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
18
+ var __getOwnPropNames = Object.getOwnPropertyNames;
19
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
+ var monaco_editor_core_exports = {};
30
+ __reExport(monaco_editor_core_exports, monaco_editor_core_star);
31
+ var STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
32
+ var WorkerManager = class {
33
+ constructor(defaults) {
34
+ __publicField(this, "_defaults");
35
+ __publicField(this, "_idleCheckInterval");
36
+ __publicField(this, "_lastUsedTime");
37
+ __publicField(this, "_configChangeListener");
38
+ __publicField(this, "_worker");
39
+ __publicField(this, "_client");
40
+ this._defaults = defaults;
41
+ this._worker = null;
42
+ this._client = null;
43
+ this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3);
44
+ this._lastUsedTime = 0;
45
+ this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
46
+ }
47
+ _stopWorker() {
48
+ if (this._worker) {
49
+ this._worker.dispose();
50
+ this._worker = null;
51
+ }
52
+ this._client = null;
53
+ }
54
+ dispose() {
55
+ clearInterval(this._idleCheckInterval);
56
+ this._configChangeListener.dispose();
57
+ this._stopWorker();
58
+ }
59
+ _checkIfIdle() {
60
+ if (!this._worker) {
61
+ return;
62
+ }
63
+ let timePassedSinceLastUsed = Date.now() - this._lastUsedTime;
64
+ if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {
65
+ this._stopWorker();
66
+ }
67
+ }
68
+ _getClient() {
69
+ this._lastUsedTime = Date.now();
70
+ if (!this._client) {
71
+ this._worker = monaco_editor_core_exports.editor.createWebWorker({
72
+ moduleId: "vs/language/html/htmlWorker",
73
+ createData: {
74
+ languageSettings: this._defaults.options,
75
+ languageId: this._defaults.languageId
76
+ },
77
+ label: this._defaults.languageId
78
+ });
79
+ this._client = this._worker.getProxy();
80
+ }
81
+ return this._client;
82
+ }
83
+ getLanguageServiceWorker(...resources) {
84
+ let _client;
85
+ return this._getClient().then((client) => {
86
+ _client = client;
87
+ }).then((_) => {
88
+ if (this._worker) {
89
+ return this._worker.withSyncedResources(resources);
90
+ }
91
+ }).then((_) => _client);
92
+ }
93
+ };
94
+ var integer;
95
+ (function(integer2) {
96
+ integer2.MIN_VALUE = -2147483648;
97
+ integer2.MAX_VALUE = 2147483647;
98
+ })(integer || (integer = {}));
99
+ var uinteger;
100
+ (function(uinteger2) {
101
+ uinteger2.MIN_VALUE = 0;
102
+ uinteger2.MAX_VALUE = 2147483647;
103
+ })(uinteger || (uinteger = {}));
104
+ var Position;
105
+ (function(Position3) {
106
+ function create(line, character) {
107
+ if (line === Number.MAX_VALUE) {
108
+ line = uinteger.MAX_VALUE;
109
+ }
110
+ if (character === Number.MAX_VALUE) {
111
+ character = uinteger.MAX_VALUE;
112
+ }
113
+ return { line, character };
114
+ }
115
+ Position3.create = create;
116
+ function is(value) {
117
+ var candidate = value;
118
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
119
+ }
120
+ Position3.is = is;
121
+ })(Position || (Position = {}));
122
+ var Range;
123
+ (function(Range3) {
124
+ function create(one, two, three, four) {
125
+ if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
126
+ return { start: Position.create(one, two), end: Position.create(three, four) };
127
+ } else if (Position.is(one) && Position.is(two)) {
128
+ return { start: one, end: two };
129
+ } else {
130
+ throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
131
+ }
132
+ }
133
+ Range3.create = create;
134
+ function is(value) {
135
+ var candidate = value;
136
+ return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
137
+ }
138
+ Range3.is = is;
139
+ })(Range || (Range = {}));
140
+ var Location;
141
+ (function(Location2) {
142
+ function create(uri, range) {
143
+ return { uri, range };
144
+ }
145
+ Location2.create = create;
146
+ function is(value) {
147
+ var candidate = value;
148
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
149
+ }
150
+ Location2.is = is;
151
+ })(Location || (Location = {}));
152
+ var LocationLink;
153
+ (function(LocationLink2) {
154
+ function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
155
+ return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
156
+ }
157
+ LocationLink2.create = create;
158
+ function is(value) {
159
+ var candidate = value;
160
+ return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
161
+ }
162
+ LocationLink2.is = is;
163
+ })(LocationLink || (LocationLink = {}));
164
+ var Color;
165
+ (function(Color2) {
166
+ function create(red, green, blue, alpha) {
167
+ return {
168
+ red,
169
+ green,
170
+ blue,
171
+ alpha
172
+ };
173
+ }
174
+ Color2.create = create;
175
+ function is(value) {
176
+ var candidate = value;
177
+ return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
178
+ }
179
+ Color2.is = is;
180
+ })(Color || (Color = {}));
181
+ var ColorInformation;
182
+ (function(ColorInformation2) {
183
+ function create(range, color) {
184
+ return {
185
+ range,
186
+ color
187
+ };
188
+ }
189
+ ColorInformation2.create = create;
190
+ function is(value) {
191
+ var candidate = value;
192
+ return Range.is(candidate.range) && Color.is(candidate.color);
193
+ }
194
+ ColorInformation2.is = is;
195
+ })(ColorInformation || (ColorInformation = {}));
196
+ var ColorPresentation;
197
+ (function(ColorPresentation2) {
198
+ function create(label, textEdit, additionalTextEdits) {
199
+ return {
200
+ label,
201
+ textEdit,
202
+ additionalTextEdits
203
+ };
204
+ }
205
+ ColorPresentation2.create = create;
206
+ function is(value) {
207
+ var candidate = value;
208
+ return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
209
+ }
210
+ ColorPresentation2.is = is;
211
+ })(ColorPresentation || (ColorPresentation = {}));
212
+ var FoldingRangeKind;
213
+ (function(FoldingRangeKind2) {
214
+ FoldingRangeKind2["Comment"] = "comment";
215
+ FoldingRangeKind2["Imports"] = "imports";
216
+ FoldingRangeKind2["Region"] = "region";
217
+ })(FoldingRangeKind || (FoldingRangeKind = {}));
218
+ var FoldingRange;
219
+ (function(FoldingRange2) {
220
+ function create(startLine, endLine, startCharacter, endCharacter, kind) {
221
+ var result = {
222
+ startLine,
223
+ endLine
224
+ };
225
+ if (Is.defined(startCharacter)) {
226
+ result.startCharacter = startCharacter;
227
+ }
228
+ if (Is.defined(endCharacter)) {
229
+ result.endCharacter = endCharacter;
230
+ }
231
+ if (Is.defined(kind)) {
232
+ result.kind = kind;
233
+ }
234
+ return result;
235
+ }
236
+ FoldingRange2.create = create;
237
+ function is(value) {
238
+ var candidate = value;
239
+ return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
240
+ }
241
+ FoldingRange2.is = is;
242
+ })(FoldingRange || (FoldingRange = {}));
243
+ var DiagnosticRelatedInformation;
244
+ (function(DiagnosticRelatedInformation2) {
245
+ function create(location, message) {
246
+ return {
247
+ location,
248
+ message
249
+ };
250
+ }
251
+ DiagnosticRelatedInformation2.create = create;
252
+ function is(value) {
253
+ var candidate = value;
254
+ return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
255
+ }
256
+ DiagnosticRelatedInformation2.is = is;
257
+ })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
258
+ var DiagnosticSeverity;
259
+ (function(DiagnosticSeverity2) {
260
+ DiagnosticSeverity2.Error = 1;
261
+ DiagnosticSeverity2.Warning = 2;
262
+ DiagnosticSeverity2.Information = 3;
263
+ DiagnosticSeverity2.Hint = 4;
264
+ })(DiagnosticSeverity || (DiagnosticSeverity = {}));
265
+ var DiagnosticTag;
266
+ (function(DiagnosticTag2) {
267
+ DiagnosticTag2.Unnecessary = 1;
268
+ DiagnosticTag2.Deprecated = 2;
269
+ })(DiagnosticTag || (DiagnosticTag = {}));
270
+ var CodeDescription;
271
+ (function(CodeDescription2) {
272
+ function is(value) {
273
+ var candidate = value;
274
+ return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
275
+ }
276
+ CodeDescription2.is = is;
277
+ })(CodeDescription || (CodeDescription = {}));
278
+ var Diagnostic;
279
+ (function(Diagnostic2) {
280
+ function create(range, message, severity, code, source, relatedInformation) {
281
+ var result = { range, message };
282
+ if (Is.defined(severity)) {
283
+ result.severity = severity;
284
+ }
285
+ if (Is.defined(code)) {
286
+ result.code = code;
287
+ }
288
+ if (Is.defined(source)) {
289
+ result.source = source;
290
+ }
291
+ if (Is.defined(relatedInformation)) {
292
+ result.relatedInformation = relatedInformation;
293
+ }
294
+ return result;
295
+ }
296
+ Diagnostic2.create = create;
297
+ function is(value) {
298
+ var _a;
299
+ var candidate = value;
300
+ return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
301
+ }
302
+ Diagnostic2.is = is;
303
+ })(Diagnostic || (Diagnostic = {}));
304
+ var Command;
305
+ (function(Command2) {
306
+ function create(title, command) {
307
+ var args = [];
308
+ for (var _i = 2; _i < arguments.length; _i++) {
309
+ args[_i - 2] = arguments[_i];
310
+ }
311
+ var result = { title, command };
312
+ if (Is.defined(args) && args.length > 0) {
313
+ result.arguments = args;
314
+ }
315
+ return result;
316
+ }
317
+ Command2.create = create;
318
+ function is(value) {
319
+ var candidate = value;
320
+ return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
321
+ }
322
+ Command2.is = is;
323
+ })(Command || (Command = {}));
324
+ var TextEdit;
325
+ (function(TextEdit2) {
326
+ function replace(range, newText) {
327
+ return { range, newText };
328
+ }
329
+ TextEdit2.replace = replace;
330
+ function insert(position, newText) {
331
+ return { range: { start: position, end: position }, newText };
332
+ }
333
+ TextEdit2.insert = insert;
334
+ function del(range) {
335
+ return { range, newText: "" };
336
+ }
337
+ TextEdit2.del = del;
338
+ function is(value) {
339
+ var candidate = value;
340
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
341
+ }
342
+ TextEdit2.is = is;
343
+ })(TextEdit || (TextEdit = {}));
344
+ var ChangeAnnotation;
345
+ (function(ChangeAnnotation2) {
346
+ function create(label, needsConfirmation, description) {
347
+ var result = { label };
348
+ if (needsConfirmation !== void 0) {
349
+ result.needsConfirmation = needsConfirmation;
350
+ }
351
+ if (description !== void 0) {
352
+ result.description = description;
353
+ }
354
+ return result;
355
+ }
356
+ ChangeAnnotation2.create = create;
357
+ function is(value) {
358
+ var candidate = value;
359
+ return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
360
+ }
361
+ ChangeAnnotation2.is = is;
362
+ })(ChangeAnnotation || (ChangeAnnotation = {}));
363
+ var ChangeAnnotationIdentifier;
364
+ (function(ChangeAnnotationIdentifier2) {
365
+ function is(value) {
366
+ var candidate = value;
367
+ return typeof candidate === "string";
368
+ }
369
+ ChangeAnnotationIdentifier2.is = is;
370
+ })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
371
+ var AnnotatedTextEdit;
372
+ (function(AnnotatedTextEdit2) {
373
+ function replace(range, newText, annotation) {
374
+ return { range, newText, annotationId: annotation };
375
+ }
376
+ AnnotatedTextEdit2.replace = replace;
377
+ function insert(position, newText, annotation) {
378
+ return { range: { start: position, end: position }, newText, annotationId: annotation };
379
+ }
380
+ AnnotatedTextEdit2.insert = insert;
381
+ function del(range, annotation) {
382
+ return { range, newText: "", annotationId: annotation };
383
+ }
384
+ AnnotatedTextEdit2.del = del;
385
+ function is(value) {
386
+ var candidate = value;
387
+ return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
388
+ }
389
+ AnnotatedTextEdit2.is = is;
390
+ })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
391
+ var TextDocumentEdit;
392
+ (function(TextDocumentEdit2) {
393
+ function create(textDocument, edits) {
394
+ return { textDocument, edits };
395
+ }
396
+ TextDocumentEdit2.create = create;
397
+ function is(value) {
398
+ var candidate = value;
399
+ return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
400
+ }
401
+ TextDocumentEdit2.is = is;
402
+ })(TextDocumentEdit || (TextDocumentEdit = {}));
403
+ var CreateFile;
404
+ (function(CreateFile2) {
405
+ function create(uri, options, annotation) {
406
+ var result = {
407
+ kind: "create",
408
+ uri
409
+ };
410
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
411
+ result.options = options;
412
+ }
413
+ if (annotation !== void 0) {
414
+ result.annotationId = annotation;
415
+ }
416
+ return result;
417
+ }
418
+ CreateFile2.create = create;
419
+ function is(value) {
420
+ var candidate = value;
421
+ return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
422
+ }
423
+ CreateFile2.is = is;
424
+ })(CreateFile || (CreateFile = {}));
425
+ var RenameFile;
426
+ (function(RenameFile2) {
427
+ function create(oldUri, newUri, options, annotation) {
428
+ var result = {
429
+ kind: "rename",
430
+ oldUri,
431
+ newUri
432
+ };
433
+ if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
434
+ result.options = options;
435
+ }
436
+ if (annotation !== void 0) {
437
+ result.annotationId = annotation;
438
+ }
439
+ return result;
440
+ }
441
+ RenameFile2.create = create;
442
+ function is(value) {
443
+ var candidate = value;
444
+ return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
445
+ }
446
+ RenameFile2.is = is;
447
+ })(RenameFile || (RenameFile = {}));
448
+ var DeleteFile;
449
+ (function(DeleteFile2) {
450
+ function create(uri, options, annotation) {
451
+ var result = {
452
+ kind: "delete",
453
+ uri
454
+ };
455
+ if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
456
+ result.options = options;
457
+ }
458
+ if (annotation !== void 0) {
459
+ result.annotationId = annotation;
460
+ }
461
+ return result;
462
+ }
463
+ DeleteFile2.create = create;
464
+ function is(value) {
465
+ var candidate = value;
466
+ return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
467
+ }
468
+ DeleteFile2.is = is;
469
+ })(DeleteFile || (DeleteFile = {}));
470
+ var WorkspaceEdit;
471
+ (function(WorkspaceEdit2) {
472
+ function is(value) {
473
+ var candidate = value;
474
+ return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
475
+ if (Is.string(change.kind)) {
476
+ return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
477
+ } else {
478
+ return TextDocumentEdit.is(change);
479
+ }
480
+ }));
481
+ }
482
+ WorkspaceEdit2.is = is;
483
+ })(WorkspaceEdit || (WorkspaceEdit = {}));
484
+ var TextEditChangeImpl = function() {
485
+ function TextEditChangeImpl2(edits, changeAnnotations) {
486
+ this.edits = edits;
487
+ this.changeAnnotations = changeAnnotations;
488
+ }
489
+ TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
490
+ var edit;
491
+ var id;
492
+ if (annotation === void 0) {
493
+ edit = TextEdit.insert(position, newText);
494
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
495
+ id = annotation;
496
+ edit = AnnotatedTextEdit.insert(position, newText, annotation);
497
+ } else {
498
+ this.assertChangeAnnotations(this.changeAnnotations);
499
+ id = this.changeAnnotations.manage(annotation);
500
+ edit = AnnotatedTextEdit.insert(position, newText, id);
501
+ }
502
+ this.edits.push(edit);
503
+ if (id !== void 0) {
504
+ return id;
505
+ }
506
+ };
507
+ TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
508
+ var edit;
509
+ var id;
510
+ if (annotation === void 0) {
511
+ edit = TextEdit.replace(range, newText);
512
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
513
+ id = annotation;
514
+ edit = AnnotatedTextEdit.replace(range, newText, annotation);
515
+ } else {
516
+ this.assertChangeAnnotations(this.changeAnnotations);
517
+ id = this.changeAnnotations.manage(annotation);
518
+ edit = AnnotatedTextEdit.replace(range, newText, id);
519
+ }
520
+ this.edits.push(edit);
521
+ if (id !== void 0) {
522
+ return id;
523
+ }
524
+ };
525
+ TextEditChangeImpl2.prototype.delete = function(range, annotation) {
526
+ var edit;
527
+ var id;
528
+ if (annotation === void 0) {
529
+ edit = TextEdit.del(range);
530
+ } else if (ChangeAnnotationIdentifier.is(annotation)) {
531
+ id = annotation;
532
+ edit = AnnotatedTextEdit.del(range, annotation);
533
+ } else {
534
+ this.assertChangeAnnotations(this.changeAnnotations);
535
+ id = this.changeAnnotations.manage(annotation);
536
+ edit = AnnotatedTextEdit.del(range, id);
537
+ }
538
+ this.edits.push(edit);
539
+ if (id !== void 0) {
540
+ return id;
541
+ }
542
+ };
543
+ TextEditChangeImpl2.prototype.add = function(edit) {
544
+ this.edits.push(edit);
545
+ };
546
+ TextEditChangeImpl2.prototype.all = function() {
547
+ return this.edits;
548
+ };
549
+ TextEditChangeImpl2.prototype.clear = function() {
550
+ this.edits.splice(0, this.edits.length);
551
+ };
552
+ TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
553
+ if (value === void 0) {
554
+ throw new Error("Text edit change is not configured to manage change annotations.");
555
+ }
556
+ };
557
+ return TextEditChangeImpl2;
558
+ }();
559
+ var ChangeAnnotations = function() {
560
+ function ChangeAnnotations2(annotations) {
561
+ this._annotations = annotations === void 0 ? /* @__PURE__ */ Object.create(null) : annotations;
562
+ this._counter = 0;
563
+ this._size = 0;
564
+ }
565
+ ChangeAnnotations2.prototype.all = function() {
566
+ return this._annotations;
567
+ };
568
+ Object.defineProperty(ChangeAnnotations2.prototype, "size", {
569
+ get: function() {
570
+ return this._size;
571
+ },
572
+ enumerable: false,
573
+ configurable: true
574
+ });
575
+ ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
576
+ var id;
577
+ if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
578
+ id = idOrAnnotation;
579
+ } else {
580
+ id = this.nextId();
581
+ annotation = idOrAnnotation;
582
+ }
583
+ if (this._annotations[id] !== void 0) {
584
+ throw new Error("Id " + id + " is already in use.");
585
+ }
586
+ if (annotation === void 0) {
587
+ throw new Error("No annotation provided for id " + id);
588
+ }
589
+ this._annotations[id] = annotation;
590
+ this._size++;
591
+ return id;
592
+ };
593
+ ChangeAnnotations2.prototype.nextId = function() {
594
+ this._counter++;
595
+ return this._counter.toString();
596
+ };
597
+ return ChangeAnnotations2;
598
+ }();
599
+ (function() {
600
+ function WorkspaceChange2(workspaceEdit) {
601
+ var _this = this;
602
+ this._textEditChanges = /* @__PURE__ */ Object.create(null);
603
+ if (workspaceEdit !== void 0) {
604
+ this._workspaceEdit = workspaceEdit;
605
+ if (workspaceEdit.documentChanges) {
606
+ this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
607
+ workspaceEdit.changeAnnotations = this._changeAnnotations.all();
608
+ workspaceEdit.documentChanges.forEach(function(change) {
609
+ if (TextDocumentEdit.is(change)) {
610
+ var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
611
+ _this._textEditChanges[change.textDocument.uri] = textEditChange;
612
+ }
613
+ });
614
+ } else if (workspaceEdit.changes) {
615
+ Object.keys(workspaceEdit.changes).forEach(function(key) {
616
+ var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
617
+ _this._textEditChanges[key] = textEditChange;
618
+ });
619
+ }
620
+ } else {
621
+ this._workspaceEdit = {};
622
+ }
623
+ }
624
+ Object.defineProperty(WorkspaceChange2.prototype, "edit", {
625
+ get: function() {
626
+ this.initDocumentChanges();
627
+ if (this._changeAnnotations !== void 0) {
628
+ if (this._changeAnnotations.size === 0) {
629
+ this._workspaceEdit.changeAnnotations = void 0;
630
+ } else {
631
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
632
+ }
633
+ }
634
+ return this._workspaceEdit;
635
+ },
636
+ enumerable: false,
637
+ configurable: true
638
+ });
639
+ WorkspaceChange2.prototype.getTextEditChange = function(key) {
640
+ if (OptionalVersionedTextDocumentIdentifier.is(key)) {
641
+ this.initDocumentChanges();
642
+ if (this._workspaceEdit.documentChanges === void 0) {
643
+ throw new Error("Workspace edit is not configured for document changes.");
644
+ }
645
+ var textDocument = { uri: key.uri, version: key.version };
646
+ var result = this._textEditChanges[textDocument.uri];
647
+ if (!result) {
648
+ var edits = [];
649
+ var textDocumentEdit = {
650
+ textDocument,
651
+ edits
652
+ };
653
+ this._workspaceEdit.documentChanges.push(textDocumentEdit);
654
+ result = new TextEditChangeImpl(edits, this._changeAnnotations);
655
+ this._textEditChanges[textDocument.uri] = result;
656
+ }
657
+ return result;
658
+ } else {
659
+ this.initChanges();
660
+ if (this._workspaceEdit.changes === void 0) {
661
+ throw new Error("Workspace edit is not configured for normal text edit changes.");
662
+ }
663
+ var result = this._textEditChanges[key];
664
+ if (!result) {
665
+ var edits = [];
666
+ this._workspaceEdit.changes[key] = edits;
667
+ result = new TextEditChangeImpl(edits);
668
+ this._textEditChanges[key] = result;
669
+ }
670
+ return result;
671
+ }
672
+ };
673
+ WorkspaceChange2.prototype.initDocumentChanges = function() {
674
+ if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
675
+ this._changeAnnotations = new ChangeAnnotations();
676
+ this._workspaceEdit.documentChanges = [];
677
+ this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
678
+ }
679
+ };
680
+ WorkspaceChange2.prototype.initChanges = function() {
681
+ if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
682
+ this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null);
683
+ }
684
+ };
685
+ WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
686
+ this.initDocumentChanges();
687
+ if (this._workspaceEdit.documentChanges === void 0) {
688
+ throw new Error("Workspace edit is not configured for document changes.");
689
+ }
690
+ var annotation;
691
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
692
+ annotation = optionsOrAnnotation;
693
+ } else {
694
+ options = optionsOrAnnotation;
695
+ }
696
+ var operation;
697
+ var id;
698
+ if (annotation === void 0) {
699
+ operation = CreateFile.create(uri, options);
700
+ } else {
701
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
702
+ operation = CreateFile.create(uri, options, id);
703
+ }
704
+ this._workspaceEdit.documentChanges.push(operation);
705
+ if (id !== void 0) {
706
+ return id;
707
+ }
708
+ };
709
+ WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
710
+ this.initDocumentChanges();
711
+ if (this._workspaceEdit.documentChanges === void 0) {
712
+ throw new Error("Workspace edit is not configured for document changes.");
713
+ }
714
+ var annotation;
715
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
716
+ annotation = optionsOrAnnotation;
717
+ } else {
718
+ options = optionsOrAnnotation;
719
+ }
720
+ var operation;
721
+ var id;
722
+ if (annotation === void 0) {
723
+ operation = RenameFile.create(oldUri, newUri, options);
724
+ } else {
725
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
726
+ operation = RenameFile.create(oldUri, newUri, options, id);
727
+ }
728
+ this._workspaceEdit.documentChanges.push(operation);
729
+ if (id !== void 0) {
730
+ return id;
731
+ }
732
+ };
733
+ WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
734
+ this.initDocumentChanges();
735
+ if (this._workspaceEdit.documentChanges === void 0) {
736
+ throw new Error("Workspace edit is not configured for document changes.");
737
+ }
738
+ var annotation;
739
+ if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
740
+ annotation = optionsOrAnnotation;
741
+ } else {
742
+ options = optionsOrAnnotation;
743
+ }
744
+ var operation;
745
+ var id;
746
+ if (annotation === void 0) {
747
+ operation = DeleteFile.create(uri, options);
748
+ } else {
749
+ id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
750
+ operation = DeleteFile.create(uri, options, id);
751
+ }
752
+ this._workspaceEdit.documentChanges.push(operation);
753
+ if (id !== void 0) {
754
+ return id;
755
+ }
756
+ };
757
+ return WorkspaceChange2;
758
+ })();
759
+ var TextDocumentIdentifier;
760
+ (function(TextDocumentIdentifier2) {
761
+ function create(uri) {
762
+ return { uri };
763
+ }
764
+ TextDocumentIdentifier2.create = create;
765
+ function is(value) {
766
+ var candidate = value;
767
+ return Is.defined(candidate) && Is.string(candidate.uri);
768
+ }
769
+ TextDocumentIdentifier2.is = is;
770
+ })(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
771
+ var VersionedTextDocumentIdentifier;
772
+ (function(VersionedTextDocumentIdentifier2) {
773
+ function create(uri, version) {
774
+ return { uri, version };
775
+ }
776
+ VersionedTextDocumentIdentifier2.create = create;
777
+ function is(value) {
778
+ var candidate = value;
779
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
780
+ }
781
+ VersionedTextDocumentIdentifier2.is = is;
782
+ })(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
783
+ var OptionalVersionedTextDocumentIdentifier;
784
+ (function(OptionalVersionedTextDocumentIdentifier2) {
785
+ function create(uri, version) {
786
+ return { uri, version };
787
+ }
788
+ OptionalVersionedTextDocumentIdentifier2.create = create;
789
+ function is(value) {
790
+ var candidate = value;
791
+ return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
792
+ }
793
+ OptionalVersionedTextDocumentIdentifier2.is = is;
794
+ })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
795
+ var TextDocumentItem;
796
+ (function(TextDocumentItem2) {
797
+ function create(uri, languageId, version, text) {
798
+ return { uri, languageId, version, text };
799
+ }
800
+ TextDocumentItem2.create = create;
801
+ function is(value) {
802
+ var candidate = value;
803
+ return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
804
+ }
805
+ TextDocumentItem2.is = is;
806
+ })(TextDocumentItem || (TextDocumentItem = {}));
807
+ var MarkupKind;
808
+ (function(MarkupKind2) {
809
+ MarkupKind2.PlainText = "plaintext";
810
+ MarkupKind2.Markdown = "markdown";
811
+ })(MarkupKind || (MarkupKind = {}));
812
+ (function(MarkupKind2) {
813
+ function is(value) {
814
+ var candidate = value;
815
+ return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
816
+ }
817
+ MarkupKind2.is = is;
818
+ })(MarkupKind || (MarkupKind = {}));
819
+ var MarkupContent;
820
+ (function(MarkupContent2) {
821
+ function is(value) {
822
+ var candidate = value;
823
+ return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
824
+ }
825
+ MarkupContent2.is = is;
826
+ })(MarkupContent || (MarkupContent = {}));
827
+ var CompletionItemKind;
828
+ (function(CompletionItemKind2) {
829
+ CompletionItemKind2.Text = 1;
830
+ CompletionItemKind2.Method = 2;
831
+ CompletionItemKind2.Function = 3;
832
+ CompletionItemKind2.Constructor = 4;
833
+ CompletionItemKind2.Field = 5;
834
+ CompletionItemKind2.Variable = 6;
835
+ CompletionItemKind2.Class = 7;
836
+ CompletionItemKind2.Interface = 8;
837
+ CompletionItemKind2.Module = 9;
838
+ CompletionItemKind2.Property = 10;
839
+ CompletionItemKind2.Unit = 11;
840
+ CompletionItemKind2.Value = 12;
841
+ CompletionItemKind2.Enum = 13;
842
+ CompletionItemKind2.Keyword = 14;
843
+ CompletionItemKind2.Snippet = 15;
844
+ CompletionItemKind2.Color = 16;
845
+ CompletionItemKind2.File = 17;
846
+ CompletionItemKind2.Reference = 18;
847
+ CompletionItemKind2.Folder = 19;
848
+ CompletionItemKind2.EnumMember = 20;
849
+ CompletionItemKind2.Constant = 21;
850
+ CompletionItemKind2.Struct = 22;
851
+ CompletionItemKind2.Event = 23;
852
+ CompletionItemKind2.Operator = 24;
853
+ CompletionItemKind2.TypeParameter = 25;
854
+ })(CompletionItemKind || (CompletionItemKind = {}));
855
+ var InsertTextFormat;
856
+ (function(InsertTextFormat2) {
857
+ InsertTextFormat2.PlainText = 1;
858
+ InsertTextFormat2.Snippet = 2;
859
+ })(InsertTextFormat || (InsertTextFormat = {}));
860
+ var CompletionItemTag;
861
+ (function(CompletionItemTag2) {
862
+ CompletionItemTag2.Deprecated = 1;
863
+ })(CompletionItemTag || (CompletionItemTag = {}));
864
+ var InsertReplaceEdit;
865
+ (function(InsertReplaceEdit2) {
866
+ function create(newText, insert, replace) {
867
+ return { newText, insert, replace };
868
+ }
869
+ InsertReplaceEdit2.create = create;
870
+ function is(value) {
871
+ var candidate = value;
872
+ return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
873
+ }
874
+ InsertReplaceEdit2.is = is;
875
+ })(InsertReplaceEdit || (InsertReplaceEdit = {}));
876
+ var InsertTextMode;
877
+ (function(InsertTextMode2) {
878
+ InsertTextMode2.asIs = 1;
879
+ InsertTextMode2.adjustIndentation = 2;
880
+ })(InsertTextMode || (InsertTextMode = {}));
881
+ var CompletionItem;
882
+ (function(CompletionItem2) {
883
+ function create(label) {
884
+ return { label };
885
+ }
886
+ CompletionItem2.create = create;
887
+ })(CompletionItem || (CompletionItem = {}));
888
+ var CompletionList;
889
+ (function(CompletionList2) {
890
+ function create(items, isIncomplete) {
891
+ return { items: items ? items : [], isIncomplete: !!isIncomplete };
892
+ }
893
+ CompletionList2.create = create;
894
+ })(CompletionList || (CompletionList = {}));
895
+ var MarkedString;
896
+ (function(MarkedString2) {
897
+ function fromPlainText(plainText) {
898
+ return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
899
+ }
900
+ MarkedString2.fromPlainText = fromPlainText;
901
+ function is(value) {
902
+ var candidate = value;
903
+ return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
904
+ }
905
+ MarkedString2.is = is;
906
+ })(MarkedString || (MarkedString = {}));
907
+ var Hover;
908
+ (function(Hover2) {
909
+ function is(value) {
910
+ var candidate = value;
911
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
912
+ }
913
+ Hover2.is = is;
914
+ })(Hover || (Hover = {}));
915
+ var ParameterInformation;
916
+ (function(ParameterInformation2) {
917
+ function create(label, documentation) {
918
+ return documentation ? { label, documentation } : { label };
919
+ }
920
+ ParameterInformation2.create = create;
921
+ })(ParameterInformation || (ParameterInformation = {}));
922
+ var SignatureInformation;
923
+ (function(SignatureInformation2) {
924
+ function create(label, documentation) {
925
+ var parameters = [];
926
+ for (var _i = 2; _i < arguments.length; _i++) {
927
+ parameters[_i - 2] = arguments[_i];
928
+ }
929
+ var result = { label };
930
+ if (Is.defined(documentation)) {
931
+ result.documentation = documentation;
932
+ }
933
+ if (Is.defined(parameters)) {
934
+ result.parameters = parameters;
935
+ } else {
936
+ result.parameters = [];
937
+ }
938
+ return result;
939
+ }
940
+ SignatureInformation2.create = create;
941
+ })(SignatureInformation || (SignatureInformation = {}));
942
+ var DocumentHighlightKind;
943
+ (function(DocumentHighlightKind2) {
944
+ DocumentHighlightKind2.Text = 1;
945
+ DocumentHighlightKind2.Read = 2;
946
+ DocumentHighlightKind2.Write = 3;
947
+ })(DocumentHighlightKind || (DocumentHighlightKind = {}));
948
+ var DocumentHighlight;
949
+ (function(DocumentHighlight2) {
950
+ function create(range, kind) {
951
+ var result = { range };
952
+ if (Is.number(kind)) {
953
+ result.kind = kind;
954
+ }
955
+ return result;
956
+ }
957
+ DocumentHighlight2.create = create;
958
+ })(DocumentHighlight || (DocumentHighlight = {}));
959
+ var SymbolKind;
960
+ (function(SymbolKind2) {
961
+ SymbolKind2.File = 1;
962
+ SymbolKind2.Module = 2;
963
+ SymbolKind2.Namespace = 3;
964
+ SymbolKind2.Package = 4;
965
+ SymbolKind2.Class = 5;
966
+ SymbolKind2.Method = 6;
967
+ SymbolKind2.Property = 7;
968
+ SymbolKind2.Field = 8;
969
+ SymbolKind2.Constructor = 9;
970
+ SymbolKind2.Enum = 10;
971
+ SymbolKind2.Interface = 11;
972
+ SymbolKind2.Function = 12;
973
+ SymbolKind2.Variable = 13;
974
+ SymbolKind2.Constant = 14;
975
+ SymbolKind2.String = 15;
976
+ SymbolKind2.Number = 16;
977
+ SymbolKind2.Boolean = 17;
978
+ SymbolKind2.Array = 18;
979
+ SymbolKind2.Object = 19;
980
+ SymbolKind2.Key = 20;
981
+ SymbolKind2.Null = 21;
982
+ SymbolKind2.EnumMember = 22;
983
+ SymbolKind2.Struct = 23;
984
+ SymbolKind2.Event = 24;
985
+ SymbolKind2.Operator = 25;
986
+ SymbolKind2.TypeParameter = 26;
987
+ })(SymbolKind || (SymbolKind = {}));
988
+ var SymbolTag;
989
+ (function(SymbolTag2) {
990
+ SymbolTag2.Deprecated = 1;
991
+ })(SymbolTag || (SymbolTag = {}));
992
+ var SymbolInformation;
993
+ (function(SymbolInformation2) {
994
+ function create(name, kind, range, uri, containerName) {
995
+ var result = {
996
+ name,
997
+ kind,
998
+ location: { uri, range }
999
+ };
1000
+ if (containerName) {
1001
+ result.containerName = containerName;
1002
+ }
1003
+ return result;
1004
+ }
1005
+ SymbolInformation2.create = create;
1006
+ })(SymbolInformation || (SymbolInformation = {}));
1007
+ var DocumentSymbol;
1008
+ (function(DocumentSymbol2) {
1009
+ function create(name, detail, kind, range, selectionRange, children) {
1010
+ var result = {
1011
+ name,
1012
+ detail,
1013
+ kind,
1014
+ range,
1015
+ selectionRange
1016
+ };
1017
+ if (children !== void 0) {
1018
+ result.children = children;
1019
+ }
1020
+ return result;
1021
+ }
1022
+ DocumentSymbol2.create = create;
1023
+ function is(value) {
1024
+ var candidate = value;
1025
+ return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
1026
+ }
1027
+ DocumentSymbol2.is = is;
1028
+ })(DocumentSymbol || (DocumentSymbol = {}));
1029
+ var CodeActionKind;
1030
+ (function(CodeActionKind2) {
1031
+ CodeActionKind2.Empty = "";
1032
+ CodeActionKind2.QuickFix = "quickfix";
1033
+ CodeActionKind2.Refactor = "refactor";
1034
+ CodeActionKind2.RefactorExtract = "refactor.extract";
1035
+ CodeActionKind2.RefactorInline = "refactor.inline";
1036
+ CodeActionKind2.RefactorRewrite = "refactor.rewrite";
1037
+ CodeActionKind2.Source = "source";
1038
+ CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
1039
+ CodeActionKind2.SourceFixAll = "source.fixAll";
1040
+ })(CodeActionKind || (CodeActionKind = {}));
1041
+ var CodeActionContext;
1042
+ (function(CodeActionContext2) {
1043
+ function create(diagnostics, only) {
1044
+ var result = { diagnostics };
1045
+ if (only !== void 0 && only !== null) {
1046
+ result.only = only;
1047
+ }
1048
+ return result;
1049
+ }
1050
+ CodeActionContext2.create = create;
1051
+ function is(value) {
1052
+ var candidate = value;
1053
+ return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
1054
+ }
1055
+ CodeActionContext2.is = is;
1056
+ })(CodeActionContext || (CodeActionContext = {}));
1057
+ var CodeAction;
1058
+ (function(CodeAction2) {
1059
+ function create(title, kindOrCommandOrEdit, kind) {
1060
+ var result = { title };
1061
+ var checkKind = true;
1062
+ if (typeof kindOrCommandOrEdit === "string") {
1063
+ checkKind = false;
1064
+ result.kind = kindOrCommandOrEdit;
1065
+ } else if (Command.is(kindOrCommandOrEdit)) {
1066
+ result.command = kindOrCommandOrEdit;
1067
+ } else {
1068
+ result.edit = kindOrCommandOrEdit;
1069
+ }
1070
+ if (checkKind && kind !== void 0) {
1071
+ result.kind = kind;
1072
+ }
1073
+ return result;
1074
+ }
1075
+ CodeAction2.create = create;
1076
+ function is(value) {
1077
+ var candidate = value;
1078
+ return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
1079
+ }
1080
+ CodeAction2.is = is;
1081
+ })(CodeAction || (CodeAction = {}));
1082
+ var CodeLens;
1083
+ (function(CodeLens2) {
1084
+ function create(range, data) {
1085
+ var result = { range };
1086
+ if (Is.defined(data)) {
1087
+ result.data = data;
1088
+ }
1089
+ return result;
1090
+ }
1091
+ CodeLens2.create = create;
1092
+ function is(value) {
1093
+ var candidate = value;
1094
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
1095
+ }
1096
+ CodeLens2.is = is;
1097
+ })(CodeLens || (CodeLens = {}));
1098
+ var FormattingOptions;
1099
+ (function(FormattingOptions2) {
1100
+ function create(tabSize, insertSpaces) {
1101
+ return { tabSize, insertSpaces };
1102
+ }
1103
+ FormattingOptions2.create = create;
1104
+ function is(value) {
1105
+ var candidate = value;
1106
+ return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
1107
+ }
1108
+ FormattingOptions2.is = is;
1109
+ })(FormattingOptions || (FormattingOptions = {}));
1110
+ var DocumentLink;
1111
+ (function(DocumentLink2) {
1112
+ function create(range, target, data) {
1113
+ return { range, target, data };
1114
+ }
1115
+ DocumentLink2.create = create;
1116
+ function is(value) {
1117
+ var candidate = value;
1118
+ return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
1119
+ }
1120
+ DocumentLink2.is = is;
1121
+ })(DocumentLink || (DocumentLink = {}));
1122
+ var SelectionRange;
1123
+ (function(SelectionRange2) {
1124
+ function create(range, parent) {
1125
+ return { range, parent };
1126
+ }
1127
+ SelectionRange2.create = create;
1128
+ function is(value) {
1129
+ var candidate = value;
1130
+ return candidate !== void 0 && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
1131
+ }
1132
+ SelectionRange2.is = is;
1133
+ })(SelectionRange || (SelectionRange = {}));
1134
+ var TextDocument;
1135
+ (function(TextDocument2) {
1136
+ function create(uri, languageId, version, content) {
1137
+ return new FullTextDocument(uri, languageId, version, content);
1138
+ }
1139
+ TextDocument2.create = create;
1140
+ function is(value) {
1141
+ var candidate = value;
1142
+ return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
1143
+ }
1144
+ TextDocument2.is = is;
1145
+ function applyEdits(document, edits) {
1146
+ var text = document.getText();
1147
+ var sortedEdits = mergeSort(edits, function(a, b) {
1148
+ var diff = a.range.start.line - b.range.start.line;
1149
+ if (diff === 0) {
1150
+ return a.range.start.character - b.range.start.character;
1151
+ }
1152
+ return diff;
1153
+ });
1154
+ var lastModifiedOffset = text.length;
1155
+ for (var i = sortedEdits.length - 1; i >= 0; i--) {
1156
+ var e = sortedEdits[i];
1157
+ var startOffset = document.offsetAt(e.range.start);
1158
+ var endOffset = document.offsetAt(e.range.end);
1159
+ if (endOffset <= lastModifiedOffset) {
1160
+ text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
1161
+ } else {
1162
+ throw new Error("Overlapping edit");
1163
+ }
1164
+ lastModifiedOffset = startOffset;
1165
+ }
1166
+ return text;
1167
+ }
1168
+ TextDocument2.applyEdits = applyEdits;
1169
+ function mergeSort(data, compare) {
1170
+ if (data.length <= 1) {
1171
+ return data;
1172
+ }
1173
+ var p = data.length / 2 | 0;
1174
+ var left = data.slice(0, p);
1175
+ var right = data.slice(p);
1176
+ mergeSort(left, compare);
1177
+ mergeSort(right, compare);
1178
+ var leftIdx = 0;
1179
+ var rightIdx = 0;
1180
+ var i = 0;
1181
+ while (leftIdx < left.length && rightIdx < right.length) {
1182
+ var ret = compare(left[leftIdx], right[rightIdx]);
1183
+ if (ret <= 0) {
1184
+ data[i++] = left[leftIdx++];
1185
+ } else {
1186
+ data[i++] = right[rightIdx++];
1187
+ }
1188
+ }
1189
+ while (leftIdx < left.length) {
1190
+ data[i++] = left[leftIdx++];
1191
+ }
1192
+ while (rightIdx < right.length) {
1193
+ data[i++] = right[rightIdx++];
1194
+ }
1195
+ return data;
1196
+ }
1197
+ })(TextDocument || (TextDocument = {}));
1198
+ var FullTextDocument = function() {
1199
+ function FullTextDocument2(uri, languageId, version, content) {
1200
+ this._uri = uri;
1201
+ this._languageId = languageId;
1202
+ this._version = version;
1203
+ this._content = content;
1204
+ this._lineOffsets = void 0;
1205
+ }
1206
+ Object.defineProperty(FullTextDocument2.prototype, "uri", {
1207
+ get: function() {
1208
+ return this._uri;
1209
+ },
1210
+ enumerable: false,
1211
+ configurable: true
1212
+ });
1213
+ Object.defineProperty(FullTextDocument2.prototype, "languageId", {
1214
+ get: function() {
1215
+ return this._languageId;
1216
+ },
1217
+ enumerable: false,
1218
+ configurable: true
1219
+ });
1220
+ Object.defineProperty(FullTextDocument2.prototype, "version", {
1221
+ get: function() {
1222
+ return this._version;
1223
+ },
1224
+ enumerable: false,
1225
+ configurable: true
1226
+ });
1227
+ FullTextDocument2.prototype.getText = function(range) {
1228
+ if (range) {
1229
+ var start = this.offsetAt(range.start);
1230
+ var end = this.offsetAt(range.end);
1231
+ return this._content.substring(start, end);
1232
+ }
1233
+ return this._content;
1234
+ };
1235
+ FullTextDocument2.prototype.update = function(event, version) {
1236
+ this._content = event.text;
1237
+ this._version = version;
1238
+ this._lineOffsets = void 0;
1239
+ };
1240
+ FullTextDocument2.prototype.getLineOffsets = function() {
1241
+ if (this._lineOffsets === void 0) {
1242
+ var lineOffsets = [];
1243
+ var text = this._content;
1244
+ var isLineStart = true;
1245
+ for (var i = 0; i < text.length; i++) {
1246
+ if (isLineStart) {
1247
+ lineOffsets.push(i);
1248
+ isLineStart = false;
1249
+ }
1250
+ var ch = text.charAt(i);
1251
+ isLineStart = ch === "\r" || ch === "\n";
1252
+ if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
1253
+ i++;
1254
+ }
1255
+ }
1256
+ if (isLineStart && text.length > 0) {
1257
+ lineOffsets.push(text.length);
1258
+ }
1259
+ this._lineOffsets = lineOffsets;
1260
+ }
1261
+ return this._lineOffsets;
1262
+ };
1263
+ FullTextDocument2.prototype.positionAt = function(offset) {
1264
+ offset = Math.max(Math.min(offset, this._content.length), 0);
1265
+ var lineOffsets = this.getLineOffsets();
1266
+ var low = 0, high = lineOffsets.length;
1267
+ if (high === 0) {
1268
+ return Position.create(0, offset);
1269
+ }
1270
+ while (low < high) {
1271
+ var mid = Math.floor((low + high) / 2);
1272
+ if (lineOffsets[mid] > offset) {
1273
+ high = mid;
1274
+ } else {
1275
+ low = mid + 1;
1276
+ }
1277
+ }
1278
+ var line = low - 1;
1279
+ return Position.create(line, offset - lineOffsets[line]);
1280
+ };
1281
+ FullTextDocument2.prototype.offsetAt = function(position) {
1282
+ var lineOffsets = this.getLineOffsets();
1283
+ if (position.line >= lineOffsets.length) {
1284
+ return this._content.length;
1285
+ } else if (position.line < 0) {
1286
+ return 0;
1287
+ }
1288
+ var lineOffset = lineOffsets[position.line];
1289
+ var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
1290
+ return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
1291
+ };
1292
+ Object.defineProperty(FullTextDocument2.prototype, "lineCount", {
1293
+ get: function() {
1294
+ return this.getLineOffsets().length;
1295
+ },
1296
+ enumerable: false,
1297
+ configurable: true
1298
+ });
1299
+ return FullTextDocument2;
1300
+ }();
1301
+ var Is;
1302
+ (function(Is2) {
1303
+ var toString = Object.prototype.toString;
1304
+ function defined(value) {
1305
+ return typeof value !== "undefined";
1306
+ }
1307
+ Is2.defined = defined;
1308
+ function undefined2(value) {
1309
+ return typeof value === "undefined";
1310
+ }
1311
+ Is2.undefined = undefined2;
1312
+ function boolean(value) {
1313
+ return value === true || value === false;
1314
+ }
1315
+ Is2.boolean = boolean;
1316
+ function string(value) {
1317
+ return toString.call(value) === "[object String]";
1318
+ }
1319
+ Is2.string = string;
1320
+ function number(value) {
1321
+ return toString.call(value) === "[object Number]";
1322
+ }
1323
+ Is2.number = number;
1324
+ function numberRange(value, min, max) {
1325
+ return toString.call(value) === "[object Number]" && min <= value && value <= max;
1326
+ }
1327
+ Is2.numberRange = numberRange;
1328
+ function integer2(value) {
1329
+ return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
1330
+ }
1331
+ Is2.integer = integer2;
1332
+ function uinteger2(value) {
1333
+ return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
1334
+ }
1335
+ Is2.uinteger = uinteger2;
1336
+ function func(value) {
1337
+ return toString.call(value) === "[object Function]";
1338
+ }
1339
+ Is2.func = func;
1340
+ function objectLiteral(value) {
1341
+ return value !== null && typeof value === "object";
1342
+ }
1343
+ Is2.objectLiteral = objectLiteral;
1344
+ function typedArray(value, check) {
1345
+ return Array.isArray(value) && value.every(check);
1346
+ }
1347
+ Is2.typedArray = typedArray;
1348
+ })(Is || (Is = {}));
1349
+ var DiagnosticsAdapter = class {
1350
+ constructor(_languageId, _worker, configChangeEvent) {
1351
+ __publicField(this, "_disposables", []);
1352
+ __publicField(this, "_listener", /* @__PURE__ */ Object.create(null));
1353
+ this._languageId = _languageId;
1354
+ this._worker = _worker;
1355
+ const onModelAdd = (model) => {
1356
+ let modeId = model.getLanguageId();
1357
+ if (modeId !== this._languageId) {
1358
+ return;
1359
+ }
1360
+ let handle;
1361
+ this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
1362
+ window.clearTimeout(handle);
1363
+ handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
1364
+ });
1365
+ this._doValidate(model.uri, modeId);
1366
+ };
1367
+ const onModelRemoved = (model) => {
1368
+ monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);
1369
+ let uriStr = model.uri.toString();
1370
+ let listener = this._listener[uriStr];
1371
+ if (listener) {
1372
+ listener.dispose();
1373
+ delete this._listener[uriStr];
1374
+ }
1375
+ };
1376
+ this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd));
1377
+ this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved));
1378
+ this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
1379
+ onModelRemoved(event.model);
1380
+ onModelAdd(event.model);
1381
+ }));
1382
+ this._disposables.push(configChangeEvent((_) => {
1383
+ monaco_editor_core_exports.editor.getModels().forEach((model) => {
1384
+ if (model.getLanguageId() === this._languageId) {
1385
+ onModelRemoved(model);
1386
+ onModelAdd(model);
1387
+ }
1388
+ });
1389
+ }));
1390
+ this._disposables.push({
1391
+ dispose: () => {
1392
+ monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);
1393
+ for (let key in this._listener) {
1394
+ this._listener[key].dispose();
1395
+ }
1396
+ }
1397
+ });
1398
+ monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);
1399
+ }
1400
+ dispose() {
1401
+ this._disposables.forEach((d) => d && d.dispose());
1402
+ this._disposables.length = 0;
1403
+ }
1404
+ _doValidate(resource, languageId) {
1405
+ this._worker(resource).then((worker) => {
1406
+ return worker.doValidation(resource.toString());
1407
+ }).then((diagnostics) => {
1408
+ const markers = diagnostics.map((d) => toDiagnostics(resource, d));
1409
+ let model = monaco_editor_core_exports.editor.getModel(resource);
1410
+ if (model && model.getLanguageId() === languageId) {
1411
+ monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);
1412
+ }
1413
+ }).then(void 0, (err) => {
1414
+ console.error(err);
1415
+ });
1416
+ }
1417
+ };
1418
+ function toSeverity(lsSeverity) {
1419
+ switch (lsSeverity) {
1420
+ case DiagnosticSeverity.Error:
1421
+ return monaco_editor_core_exports.MarkerSeverity.Error;
1422
+ case DiagnosticSeverity.Warning:
1423
+ return monaco_editor_core_exports.MarkerSeverity.Warning;
1424
+ case DiagnosticSeverity.Information:
1425
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1426
+ case DiagnosticSeverity.Hint:
1427
+ return monaco_editor_core_exports.MarkerSeverity.Hint;
1428
+ default:
1429
+ return monaco_editor_core_exports.MarkerSeverity.Info;
1430
+ }
1431
+ }
1432
+ function toDiagnostics(resource, diag) {
1433
+ let code = typeof diag.code === "number" ? String(diag.code) : diag.code;
1434
+ return {
1435
+ severity: toSeverity(diag.severity),
1436
+ startLineNumber: diag.range.start.line + 1,
1437
+ startColumn: diag.range.start.character + 1,
1438
+ endLineNumber: diag.range.end.line + 1,
1439
+ endColumn: diag.range.end.character + 1,
1440
+ message: diag.message,
1441
+ code,
1442
+ source: diag.source
1443
+ };
1444
+ }
1445
+ var CompletionAdapter = class {
1446
+ constructor(_worker, _triggerCharacters) {
1447
+ this._worker = _worker;
1448
+ this._triggerCharacters = _triggerCharacters;
1449
+ }
1450
+ get triggerCharacters() {
1451
+ return this._triggerCharacters;
1452
+ }
1453
+ provideCompletionItems(model, position, context, token) {
1454
+ const resource = model.uri;
1455
+ return this._worker(resource).then((worker) => {
1456
+ return worker.doComplete(resource.toString(), fromPosition(position));
1457
+ }).then((info) => {
1458
+ if (!info) {
1459
+ return;
1460
+ }
1461
+ const wordInfo = model.getWordUntilPosition(position);
1462
+ const wordRange = new monaco_editor_core_exports.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1463
+ const items = info.items.map((entry) => {
1464
+ const item = {
1465
+ label: entry.label,
1466
+ insertText: entry.insertText || entry.label,
1467
+ sortText: entry.sortText,
1468
+ filterText: entry.filterText,
1469
+ documentation: entry.documentation,
1470
+ detail: entry.detail,
1471
+ command: toCommand(entry.command),
1472
+ range: wordRange,
1473
+ kind: toCompletionItemKind(entry.kind)
1474
+ };
1475
+ if (entry.textEdit) {
1476
+ if (isInsertReplaceEdit(entry.textEdit)) {
1477
+ item.range = {
1478
+ insert: toRange(entry.textEdit.insert),
1479
+ replace: toRange(entry.textEdit.replace)
1480
+ };
1481
+ } else {
1482
+ item.range = toRange(entry.textEdit.range);
1483
+ }
1484
+ item.insertText = entry.textEdit.newText;
1485
+ }
1486
+ if (entry.additionalTextEdits) {
1487
+ item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
1488
+ }
1489
+ if (entry.insertTextFormat === InsertTextFormat.Snippet) {
1490
+ item.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet;
1491
+ }
1492
+ return item;
1493
+ });
1494
+ return {
1495
+ isIncomplete: info.isIncomplete,
1496
+ suggestions: items
1497
+ };
1498
+ });
1499
+ }
1500
+ };
1501
+ function fromPosition(position) {
1502
+ if (!position) {
1503
+ return void 0;
1504
+ }
1505
+ return { character: position.column - 1, line: position.lineNumber - 1 };
1506
+ }
1507
+ function fromRange(range) {
1508
+ if (!range) {
1509
+ return void 0;
1510
+ }
1511
+ return {
1512
+ start: {
1513
+ line: range.startLineNumber - 1,
1514
+ character: range.startColumn - 1
1515
+ },
1516
+ end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
1517
+ };
1518
+ }
1519
+ function toRange(range) {
1520
+ if (!range) {
1521
+ return void 0;
1522
+ }
1523
+ return new monaco_editor_core_exports.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
1524
+ }
1525
+ function isInsertReplaceEdit(edit) {
1526
+ return typeof edit.insert !== "undefined" && typeof edit.replace !== "undefined";
1527
+ }
1528
+ function toCompletionItemKind(kind) {
1529
+ const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;
1530
+ switch (kind) {
1531
+ case CompletionItemKind.Text:
1532
+ return mItemKind.Text;
1533
+ case CompletionItemKind.Method:
1534
+ return mItemKind.Method;
1535
+ case CompletionItemKind.Function:
1536
+ return mItemKind.Function;
1537
+ case CompletionItemKind.Constructor:
1538
+ return mItemKind.Constructor;
1539
+ case CompletionItemKind.Field:
1540
+ return mItemKind.Field;
1541
+ case CompletionItemKind.Variable:
1542
+ return mItemKind.Variable;
1543
+ case CompletionItemKind.Class:
1544
+ return mItemKind.Class;
1545
+ case CompletionItemKind.Interface:
1546
+ return mItemKind.Interface;
1547
+ case CompletionItemKind.Module:
1548
+ return mItemKind.Module;
1549
+ case CompletionItemKind.Property:
1550
+ return mItemKind.Property;
1551
+ case CompletionItemKind.Unit:
1552
+ return mItemKind.Unit;
1553
+ case CompletionItemKind.Value:
1554
+ return mItemKind.Value;
1555
+ case CompletionItemKind.Enum:
1556
+ return mItemKind.Enum;
1557
+ case CompletionItemKind.Keyword:
1558
+ return mItemKind.Keyword;
1559
+ case CompletionItemKind.Snippet:
1560
+ return mItemKind.Snippet;
1561
+ case CompletionItemKind.Color:
1562
+ return mItemKind.Color;
1563
+ case CompletionItemKind.File:
1564
+ return mItemKind.File;
1565
+ case CompletionItemKind.Reference:
1566
+ return mItemKind.Reference;
1567
+ }
1568
+ return mItemKind.Property;
1569
+ }
1570
+ function toTextEdit(textEdit) {
1571
+ if (!textEdit) {
1572
+ return void 0;
1573
+ }
1574
+ return {
1575
+ range: toRange(textEdit.range),
1576
+ text: textEdit.newText
1577
+ };
1578
+ }
1579
+ function toCommand(c) {
1580
+ return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
1581
+ }
1582
+ var HoverAdapter = class {
1583
+ constructor(_worker) {
1584
+ this._worker = _worker;
1585
+ }
1586
+ provideHover(model, position, token) {
1587
+ let resource = model.uri;
1588
+ return this._worker(resource).then((worker) => {
1589
+ return worker.doHover(resource.toString(), fromPosition(position));
1590
+ }).then((info) => {
1591
+ if (!info) {
1592
+ return;
1593
+ }
1594
+ return {
1595
+ range: toRange(info.range),
1596
+ contents: toMarkedStringArray(info.contents)
1597
+ };
1598
+ });
1599
+ }
1600
+ };
1601
+ function isMarkupContent(thing) {
1602
+ return thing && typeof thing === "object" && typeof thing.kind === "string";
1603
+ }
1604
+ function toMarkdownString(entry) {
1605
+ if (typeof entry === "string") {
1606
+ return {
1607
+ value: entry
1608
+ };
1609
+ }
1610
+ if (isMarkupContent(entry)) {
1611
+ if (entry.kind === "plaintext") {
1612
+ return {
1613
+ value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
1614
+ };
1615
+ }
1616
+ return {
1617
+ value: entry.value
1618
+ };
1619
+ }
1620
+ return { value: "```" + entry.language + "\n" + entry.value + "\n```\n" };
1621
+ }
1622
+ function toMarkedStringArray(contents) {
1623
+ if (!contents) {
1624
+ return void 0;
1625
+ }
1626
+ if (Array.isArray(contents)) {
1627
+ return contents.map(toMarkdownString);
1628
+ }
1629
+ return [toMarkdownString(contents)];
1630
+ }
1631
+ var DocumentHighlightAdapter = class {
1632
+ constructor(_worker) {
1633
+ this._worker = _worker;
1634
+ }
1635
+ provideDocumentHighlights(model, position, token) {
1636
+ const resource = model.uri;
1637
+ return this._worker(resource).then((worker) => worker.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
1638
+ if (!entries) {
1639
+ return;
1640
+ }
1641
+ return entries.map((entry) => {
1642
+ return {
1643
+ range: toRange(entry.range),
1644
+ kind: toDocumentHighlightKind(entry.kind)
1645
+ };
1646
+ });
1647
+ });
1648
+ }
1649
+ };
1650
+ function toDocumentHighlightKind(kind) {
1651
+ switch (kind) {
1652
+ case DocumentHighlightKind.Read:
1653
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
1654
+ case DocumentHighlightKind.Write:
1655
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
1656
+ case DocumentHighlightKind.Text:
1657
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1658
+ }
1659
+ return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
1660
+ }
1661
+ var DefinitionAdapter = class {
1662
+ constructor(_worker) {
1663
+ this._worker = _worker;
1664
+ }
1665
+ provideDefinition(model, position, token) {
1666
+ const resource = model.uri;
1667
+ return this._worker(resource).then((worker) => {
1668
+ return worker.findDefinition(resource.toString(), fromPosition(position));
1669
+ }).then((definition) => {
1670
+ if (!definition) {
1671
+ return;
1672
+ }
1673
+ return [toLocation(definition)];
1674
+ });
1675
+ }
1676
+ };
1677
+ function toLocation(location) {
1678
+ return {
1679
+ uri: monaco_editor_core_exports.Uri.parse(location.uri),
1680
+ range: toRange(location.range)
1681
+ };
1682
+ }
1683
+ var ReferenceAdapter = class {
1684
+ constructor(_worker) {
1685
+ this._worker = _worker;
1686
+ }
1687
+ provideReferences(model, position, context, token) {
1688
+ const resource = model.uri;
1689
+ return this._worker(resource).then((worker) => {
1690
+ return worker.findReferences(resource.toString(), fromPosition(position));
1691
+ }).then((entries) => {
1692
+ if (!entries) {
1693
+ return;
1694
+ }
1695
+ return entries.map(toLocation);
1696
+ });
1697
+ }
1698
+ };
1699
+ var RenameAdapter = class {
1700
+ constructor(_worker) {
1701
+ this._worker = _worker;
1702
+ }
1703
+ provideRenameEdits(model, position, newName, token) {
1704
+ const resource = model.uri;
1705
+ return this._worker(resource).then((worker) => {
1706
+ return worker.doRename(resource.toString(), fromPosition(position), newName);
1707
+ }).then((edit) => {
1708
+ return toWorkspaceEdit(edit);
1709
+ });
1710
+ }
1711
+ };
1712
+ function toWorkspaceEdit(edit) {
1713
+ if (!edit || !edit.changes) {
1714
+ return void 0;
1715
+ }
1716
+ let resourceEdits = [];
1717
+ for (let uri in edit.changes) {
1718
+ const _uri = monaco_editor_core_exports.Uri.parse(uri);
1719
+ for (let e of edit.changes[uri]) {
1720
+ resourceEdits.push({
1721
+ resource: _uri,
1722
+ versionId: void 0,
1723
+ textEdit: {
1724
+ range: toRange(e.range),
1725
+ text: e.newText
1726
+ }
1727
+ });
1728
+ }
1729
+ }
1730
+ return {
1731
+ edits: resourceEdits
1732
+ };
1733
+ }
1734
+ var DocumentSymbolAdapter = class {
1735
+ constructor(_worker) {
1736
+ this._worker = _worker;
1737
+ }
1738
+ provideDocumentSymbols(model, token) {
1739
+ const resource = model.uri;
1740
+ return this._worker(resource).then((worker) => worker.findDocumentSymbols(resource.toString())).then((items) => {
1741
+ if (!items) {
1742
+ return;
1743
+ }
1744
+ return items.map((item) => ({
1745
+ name: item.name,
1746
+ detail: "",
1747
+ containerName: item.containerName,
1748
+ kind: toSymbolKind(item.kind),
1749
+ range: toRange(item.location.range),
1750
+ selectionRange: toRange(item.location.range),
1751
+ tags: []
1752
+ }));
1753
+ });
1754
+ }
1755
+ };
1756
+ function toSymbolKind(kind) {
1757
+ let mKind = monaco_editor_core_exports.languages.SymbolKind;
1758
+ switch (kind) {
1759
+ case SymbolKind.File:
1760
+ return mKind.Array;
1761
+ case SymbolKind.Module:
1762
+ return mKind.Module;
1763
+ case SymbolKind.Namespace:
1764
+ return mKind.Namespace;
1765
+ case SymbolKind.Package:
1766
+ return mKind.Package;
1767
+ case SymbolKind.Class:
1768
+ return mKind.Class;
1769
+ case SymbolKind.Method:
1770
+ return mKind.Method;
1771
+ case SymbolKind.Property:
1772
+ return mKind.Property;
1773
+ case SymbolKind.Field:
1774
+ return mKind.Field;
1775
+ case SymbolKind.Constructor:
1776
+ return mKind.Constructor;
1777
+ case SymbolKind.Enum:
1778
+ return mKind.Enum;
1779
+ case SymbolKind.Interface:
1780
+ return mKind.Interface;
1781
+ case SymbolKind.Function:
1782
+ return mKind.Function;
1783
+ case SymbolKind.Variable:
1784
+ return mKind.Variable;
1785
+ case SymbolKind.Constant:
1786
+ return mKind.Constant;
1787
+ case SymbolKind.String:
1788
+ return mKind.String;
1789
+ case SymbolKind.Number:
1790
+ return mKind.Number;
1791
+ case SymbolKind.Boolean:
1792
+ return mKind.Boolean;
1793
+ case SymbolKind.Array:
1794
+ return mKind.Array;
1795
+ }
1796
+ return mKind.Function;
1797
+ }
1798
+ var DocumentLinkAdapter = class {
1799
+ constructor(_worker) {
1800
+ this._worker = _worker;
1801
+ }
1802
+ provideLinks(model, token) {
1803
+ const resource = model.uri;
1804
+ return this._worker(resource).then((worker) => worker.findDocumentLinks(resource.toString())).then((items) => {
1805
+ if (!items) {
1806
+ return;
1807
+ }
1808
+ return {
1809
+ links: items.map((item) => ({
1810
+ range: toRange(item.range),
1811
+ url: item.target
1812
+ }))
1813
+ };
1814
+ });
1815
+ }
1816
+ };
1817
+ var DocumentFormattingEditProvider = class {
1818
+ constructor(_worker) {
1819
+ this._worker = _worker;
1820
+ }
1821
+ provideDocumentFormattingEdits(model, options, token) {
1822
+ const resource = model.uri;
1823
+ return this._worker(resource).then((worker) => {
1824
+ return worker.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
1825
+ if (!edits || edits.length === 0) {
1826
+ return;
1827
+ }
1828
+ return edits.map(toTextEdit);
1829
+ });
1830
+ });
1831
+ }
1832
+ };
1833
+ var DocumentRangeFormattingEditProvider = class {
1834
+ constructor(_worker) {
1835
+ this._worker = _worker;
1836
+ }
1837
+ provideDocumentRangeFormattingEdits(model, range, options, token) {
1838
+ const resource = model.uri;
1839
+ return this._worker(resource).then((worker) => {
1840
+ return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
1841
+ if (!edits || edits.length === 0) {
1842
+ return;
1843
+ }
1844
+ return edits.map(toTextEdit);
1845
+ });
1846
+ });
1847
+ }
1848
+ };
1849
+ function fromFormattingOptions(options) {
1850
+ return {
1851
+ tabSize: options.tabSize,
1852
+ insertSpaces: options.insertSpaces
1853
+ };
1854
+ }
1855
+ var DocumentColorAdapter = class {
1856
+ constructor(_worker) {
1857
+ this._worker = _worker;
1858
+ }
1859
+ provideDocumentColors(model, token) {
1860
+ const resource = model.uri;
1861
+ return this._worker(resource).then((worker) => worker.findDocumentColors(resource.toString())).then((infos) => {
1862
+ if (!infos) {
1863
+ return;
1864
+ }
1865
+ return infos.map((item) => ({
1866
+ color: item.color,
1867
+ range: toRange(item.range)
1868
+ }));
1869
+ });
1870
+ }
1871
+ provideColorPresentations(model, info, token) {
1872
+ const resource = model.uri;
1873
+ return this._worker(resource).then((worker) => worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range))).then((presentations) => {
1874
+ if (!presentations) {
1875
+ return;
1876
+ }
1877
+ return presentations.map((presentation) => {
1878
+ let item = {
1879
+ label: presentation.label
1880
+ };
1881
+ if (presentation.textEdit) {
1882
+ item.textEdit = toTextEdit(presentation.textEdit);
1883
+ }
1884
+ if (presentation.additionalTextEdits) {
1885
+ item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);
1886
+ }
1887
+ return item;
1888
+ });
1889
+ });
1890
+ }
1891
+ };
1892
+ var FoldingRangeAdapter = class {
1893
+ constructor(_worker) {
1894
+ this._worker = _worker;
1895
+ }
1896
+ provideFoldingRanges(model, context, token) {
1897
+ const resource = model.uri;
1898
+ return this._worker(resource).then((worker) => worker.getFoldingRanges(resource.toString(), context)).then((ranges) => {
1899
+ if (!ranges) {
1900
+ return;
1901
+ }
1902
+ return ranges.map((range) => {
1903
+ const result = {
1904
+ start: range.startLine + 1,
1905
+ end: range.endLine + 1
1906
+ };
1907
+ if (typeof range.kind !== "undefined") {
1908
+ result.kind = toFoldingRangeKind(range.kind);
1909
+ }
1910
+ return result;
1911
+ });
1912
+ });
1913
+ }
1914
+ };
1915
+ function toFoldingRangeKind(kind) {
1916
+ switch (kind) {
1917
+ case FoldingRangeKind.Comment:
1918
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
1919
+ case FoldingRangeKind.Imports:
1920
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
1921
+ case FoldingRangeKind.Region:
1922
+ return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
1923
+ }
1924
+ return void 0;
1925
+ }
1926
+ var SelectionRangeAdapter = class {
1927
+ constructor(_worker) {
1928
+ this._worker = _worker;
1929
+ }
1930
+ provideSelectionRanges(model, positions, token) {
1931
+ const resource = model.uri;
1932
+ return this._worker(resource).then((worker) => worker.getSelectionRanges(resource.toString(), positions.map(fromPosition))).then((selectionRanges) => {
1933
+ if (!selectionRanges) {
1934
+ return;
1935
+ }
1936
+ return selectionRanges.map((selectionRange) => {
1937
+ const result = [];
1938
+ while (selectionRange) {
1939
+ result.push({ range: toRange(selectionRange.range) });
1940
+ selectionRange = selectionRange.parent;
1941
+ }
1942
+ return result;
1943
+ });
1944
+ });
1945
+ }
1946
+ };
1947
+ var HTMLCompletionAdapter = class extends CompletionAdapter {
1948
+ constructor(worker) {
1949
+ super(worker, [".", ":", "<", '"', "=", "/"]);
1950
+ }
1951
+ };
1952
+ function setupMode1(defaults) {
1953
+ const client = new WorkerManager(defaults);
1954
+ const worker = (...uris) => {
1955
+ return client.getLanguageServiceWorker(...uris);
1956
+ };
1957
+ let languageId = defaults.languageId;
1958
+ monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new HTMLCompletionAdapter(worker));
1959
+ monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker));
1960
+ monaco_editor_core_exports.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker));
1961
+ monaco_editor_core_exports.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker));
1962
+ monaco_editor_core_exports.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker));
1963
+ monaco_editor_core_exports.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker));
1964
+ monaco_editor_core_exports.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker));
1965
+ monaco_editor_core_exports.languages.registerRenameProvider(languageId, new RenameAdapter(worker));
1966
+ if (languageId === "html") {
1967
+ monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker));
1968
+ monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker));
1969
+ }
1970
+ }
1971
+ function setupMode(defaults) {
1972
+ const disposables = [];
1973
+ const providers = [];
1974
+ const client = new WorkerManager(defaults);
1975
+ disposables.push(client);
1976
+ const worker = (...uris) => {
1977
+ return client.getLanguageServiceWorker(...uris);
1978
+ };
1979
+ function registerProviders() {
1980
+ const { languageId, modeConfiguration } = defaults;
1981
+ disposeAll(providers);
1982
+ if (modeConfiguration.completionItems) {
1983
+ providers.push(monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new HTMLCompletionAdapter(worker)));
1984
+ }
1985
+ if (modeConfiguration.hovers) {
1986
+ providers.push(monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker)));
1987
+ }
1988
+ if (modeConfiguration.documentHighlights) {
1989
+ providers.push(monaco_editor_core_exports.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker)));
1990
+ }
1991
+ if (modeConfiguration.links) {
1992
+ providers.push(monaco_editor_core_exports.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker)));
1993
+ }
1994
+ if (modeConfiguration.documentSymbols) {
1995
+ providers.push(monaco_editor_core_exports.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)));
1996
+ }
1997
+ if (modeConfiguration.rename) {
1998
+ providers.push(monaco_editor_core_exports.languages.registerRenameProvider(languageId, new RenameAdapter(worker)));
1999
+ }
2000
+ if (modeConfiguration.foldingRanges) {
2001
+ providers.push(monaco_editor_core_exports.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)));
2002
+ }
2003
+ if (modeConfiguration.selectionRanges) {
2004
+ providers.push(monaco_editor_core_exports.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)));
2005
+ }
2006
+ if (modeConfiguration.documentFormattingEdits) {
2007
+ providers.push(monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)));
2008
+ }
2009
+ if (modeConfiguration.documentRangeFormattingEdits) {
2010
+ providers.push(monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)));
2011
+ }
2012
+ }
2013
+ registerProviders();
2014
+ disposables.push(asDisposable(providers));
2015
+ return asDisposable(disposables);
2016
+ }
2017
+ function asDisposable(disposables) {
2018
+ return { dispose: () => disposeAll(disposables) };
2019
+ }
2020
+ function disposeAll(disposables) {
2021
+ while (disposables.length) {
2022
+ disposables.pop().dispose();
2023
+ }
2024
+ }
2025
+ export {
2026
+ CompletionAdapter,
2027
+ DefinitionAdapter,
2028
+ DiagnosticsAdapter,
2029
+ DocumentColorAdapter,
2030
+ DocumentFormattingEditProvider,
2031
+ DocumentHighlightAdapter,
2032
+ DocumentLinkAdapter,
2033
+ DocumentRangeFormattingEditProvider,
2034
+ DocumentSymbolAdapter,
2035
+ FoldingRangeAdapter,
2036
+ HoverAdapter,
2037
+ ReferenceAdapter,
2038
+ RenameAdapter,
2039
+ SelectionRangeAdapter,
2040
+ WorkerManager,
2041
+ fromPosition,
2042
+ fromRange,
2043
+ setupMode,
2044
+ setupMode1,
2045
+ toRange,
2046
+ toTextEdit
2047
+ };