@codingame/monaco-vscode-api 1.79.7-next.1 → 1.79.7-next.2

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 (457) hide show
  1. package/README.md +2 -2
  2. package/dist/_virtual/index.js +2 -0
  3. package/dist/api.js +17 -15
  4. package/dist/composite.d.ts +1 -1
  5. package/dist/configurationRegistry.d.ts +1 -1
  6. package/dist/contextkey.d.ts +2 -2
  7. package/dist/createApi.js +8 -8
  8. package/dist/default-extensions/bat.js +1 -1
  9. package/dist/default-extensions/clojure.js +1 -1
  10. package/dist/default-extensions/coffeescript.js +1 -1
  11. package/dist/default-extensions/configuration-editing.js +9 -0
  12. package/dist/default-extensions/cpp.js +1 -1
  13. package/dist/default-extensions/csharp.js +1 -1
  14. package/dist/default-extensions/css-language-features.js +10 -0
  15. package/dist/default-extensions/css.js +1 -1
  16. package/dist/default-extensions/dart.js +1 -1
  17. package/dist/default-extensions/debug-auto-launch.js +6 -0
  18. package/dist/default-extensions/debug-server-ready.js +6 -0
  19. package/dist/default-extensions/diff.js +1 -1
  20. package/dist/default-extensions/docker.js +1 -1
  21. package/dist/default-extensions/emmet.js +7 -0
  22. package/dist/default-extensions/extension-editing.js +7 -0
  23. package/dist/default-extensions/fsharp.js +1 -1
  24. package/dist/default-extensions/git-base.js +16 -0
  25. package/dist/default-extensions/git.js +6 -0
  26. package/dist/default-extensions/github-authentication.js +7 -0
  27. package/dist/default-extensions/github.js +7 -0
  28. package/dist/default-extensions/go.js +1 -1
  29. package/dist/default-extensions/groovy.js +1 -1
  30. package/dist/default-extensions/grunt.js +6 -0
  31. package/dist/default-extensions/gulp.js +6 -0
  32. package/dist/default-extensions/handlebars.js +1 -1
  33. package/dist/default-extensions/hlsl.js +1 -1
  34. package/dist/default-extensions/html-language-features.js +10 -0
  35. package/dist/default-extensions/html.js +1 -1
  36. package/dist/default-extensions/ini.js +1 -1
  37. package/dist/default-extensions/ipynb.js +7 -0
  38. package/dist/default-extensions/jake.js +6 -0
  39. package/dist/default-extensions/java.js +1 -1
  40. package/dist/default-extensions/javascript.js +1 -1
  41. package/dist/default-extensions/json-language-features.js +8 -0
  42. package/dist/default-extensions/json.js +1 -1
  43. package/dist/default-extensions/julia.js +1 -1
  44. package/dist/default-extensions/latex.js +1 -1
  45. package/dist/default-extensions/less.js +1 -1
  46. package/dist/default-extensions/log.js +1 -1
  47. package/dist/default-extensions/lua.js +1 -1
  48. package/dist/default-extensions/make.js +1 -1
  49. package/dist/default-extensions/markdown-basics.js +1 -1
  50. package/dist/default-extensions/markdown-language-features.js +18 -0
  51. package/dist/default-extensions/markdown-math.js +32 -0
  52. package/dist/default-extensions/media-preview.js +16 -0
  53. package/dist/default-extensions/merge-conflict.js +7 -0
  54. package/dist/default-extensions/microsoft-authentication.js +7 -0
  55. package/dist/default-extensions/notebook-renderers.js +6 -0
  56. package/dist/default-extensions/npm.js +1 -1
  57. package/dist/default-extensions/objective-c.js +1 -1
  58. package/dist/default-extensions/perl.js +1 -1
  59. package/dist/default-extensions/php-language-features.js +6 -0
  60. package/dist/default-extensions/php.js +1 -1
  61. package/dist/default-extensions/powershell.js +1 -1
  62. package/dist/default-extensions/pug.js +1 -1
  63. package/dist/default-extensions/python.js +1 -1
  64. package/dist/default-extensions/r.js +1 -1
  65. package/dist/default-extensions/razor.js +1 -1
  66. package/dist/default-extensions/references-view.js +1 -1
  67. package/dist/default-extensions/restructuredtext.js +9 -0
  68. package/dist/default-extensions/ruby.js +1 -1
  69. package/dist/default-extensions/rust.js +1 -1
  70. package/dist/default-extensions/scss.js +1 -1
  71. package/dist/default-extensions/search-result.js +1 -1
  72. package/dist/default-extensions/shaderlab.js +1 -1
  73. package/dist/default-extensions/shellscript.js +1 -1
  74. package/dist/default-extensions/simple-browser.js +10 -0
  75. package/dist/default-extensions/sql.js +1 -1
  76. package/dist/default-extensions/swift.js +1 -1
  77. package/dist/default-extensions/theme-abyss.js +1 -1
  78. package/dist/default-extensions/theme-defaults.js +1 -1
  79. package/dist/default-extensions/theme-kimbie-dark.js +1 -1
  80. package/dist/default-extensions/theme-monokai-dimmed.js +1 -1
  81. package/dist/default-extensions/theme-monokai.js +1 -1
  82. package/dist/default-extensions/theme-quietlight.js +1 -1
  83. package/dist/default-extensions/theme-red.js +1 -1
  84. package/dist/default-extensions/theme-seti.js +1 -1
  85. package/dist/default-extensions/theme-solarized-dark.js +1 -1
  86. package/dist/default-extensions/theme-solarized-light.js +1 -1
  87. package/dist/default-extensions/theme-tomorrow-night-blue.js +1 -1
  88. package/dist/default-extensions/typescript-basics.js +1 -1
  89. package/dist/default-extensions/typescript-language-features.js +93 -0
  90. package/dist/default-extensions/vb.js +1 -1
  91. package/dist/default-extensions/vscode-api-tests.js +6 -0
  92. package/dist/default-extensions/vscode-colorize-tests.js +9 -0
  93. package/dist/default-extensions/vscode-test-resolver.js +6 -0
  94. package/dist/default-extensions/xml.js +1 -1
  95. package/dist/default-extensions/yaml.js +1 -1
  96. package/dist/editor.d.ts +2 -2
  97. package/dist/editorBrowser.d.ts +2 -2
  98. package/dist/event.d.ts +1 -1
  99. package/dist/ext-hosts/all.js +26 -0
  100. package/dist/ext-hosts/clipboard.js +12 -0
  101. package/dist/ext-hosts/commands.js +18 -0
  102. package/dist/ext-hosts/configuration.js +16 -0
  103. package/dist/ext-hosts/debug.js +16 -0
  104. package/dist/ext-hosts/decorations.js +16 -0
  105. package/dist/ext-hosts/dialogs.js +14 -0
  106. package/dist/ext-hosts/documentsAndEditors.js +34 -0
  107. package/dist/ext-hosts/editorTabs.js +17 -0
  108. package/dist/ext-hosts/filesystem.js +24 -0
  109. package/dist/ext-hosts/filesystemEvent.js +17 -0
  110. package/dist/ext-hosts/languageFeatures.js +21 -0
  111. package/dist/ext-hosts/languages.js +17 -0
  112. package/dist/ext-hosts/localization.js +16 -0
  113. package/dist/ext-hosts/messages.js +24 -0
  114. package/dist/ext-hosts/output.js +16 -0
  115. package/dist/ext-hosts/progress.js +15 -0
  116. package/dist/ext-hosts/quickopen.js +15 -0
  117. package/dist/ext-hosts/search.js +17 -0
  118. package/dist/ext-hosts/statusBar.js +15 -0
  119. package/dist/ext-hosts/storage.js +28 -0
  120. package/dist/ext-hosts/telemetry.js +17 -0
  121. package/dist/ext-hosts/terminal.js +17 -0
  122. package/dist/ext-hosts/theming.js +15 -0
  123. package/dist/ext-hosts/views.js +30 -0
  124. package/dist/ext-hosts/window.js +20 -0
  125. package/dist/ext-hosts/workspace.js +16 -0
  126. package/dist/extHost.js +271 -0
  127. package/dist/{extension-tools-98a21c83.js → extension-tools.js} +1869 -129
  128. package/dist/extensionWorker.js +80 -0
  129. package/dist/extensions.d.ts +4 -4
  130. package/dist/extensions.d2.ts +1 -1
  131. package/dist/extensions.js +6 -11
  132. package/dist/extensionsRegistry.d.ts +2 -2
  133. package/dist/files.d.ts +17 -17
  134. package/dist/instantiation.d.ts +1 -1
  135. package/dist/keybinding.d.ts +2 -2
  136. package/dist/languageFeatures.d.ts +51 -51
  137. package/dist/log.d.ts +1 -1
  138. package/dist/{vscode-services/missing-services.js → missing-services.js} +170 -109
  139. package/dist/monaco.d.ts +7 -17
  140. package/dist/monaco.js +0 -2
  141. package/dist/node_modules/toposort/index.js +76 -0
  142. package/dist/rollup-extension-directory-plugin.d.ts +3 -3
  143. package/dist/rollup-extension-directory-plugin.js +8 -4
  144. package/dist/rollup-vsix-plugin.d.ts +3 -2
  145. package/dist/rollup-vsix-plugin.js +7 -3
  146. package/dist/service-override/audioCue.js +1 -1
  147. package/dist/service-override/configuration.d.ts +4 -4
  148. package/dist/service-override/configuration.js +1 -1
  149. package/dist/service-override/debug.js +1 -1
  150. package/dist/service-override/dialogs.js +1 -1
  151. package/dist/service-override/editor.d.ts +2 -2
  152. package/dist/service-override/editor.js +1 -1
  153. package/dist/service-override/files.d.ts +60 -10
  154. package/dist/service-override/files.js +154 -60
  155. package/dist/service-override/keybindings.d.ts +1 -1
  156. package/dist/service-override/keybindings.js +1 -1
  157. package/dist/service-override/languages.d.ts +1 -1
  158. package/dist/service-override/languages.js +1 -1
  159. package/dist/service-override/layout.js +1 -1
  160. package/dist/service-override/markers.js +1 -1
  161. package/dist/service-override/model.js +1 -1
  162. package/dist/service-override/notifications.js +1 -1
  163. package/dist/service-override/output.js +1 -1
  164. package/dist/service-override/preferences.js +1 -1
  165. package/dist/service-override/quickaccess.js +1 -1
  166. package/dist/service-override/search.js +1 -1
  167. package/dist/service-override/snippets.js +1 -1
  168. package/dist/service-override/terminal.d.ts +2 -2
  169. package/dist/service-override/terminal.js +1 -1
  170. package/dist/service-override/textmate.js +1 -1
  171. package/dist/service-override/theme.d.ts +1 -1
  172. package/dist/service-override/theme.js +1 -1
  173. package/dist/service-override/tools/editor.js +6 -7
  174. package/dist/service-override/views.d.ts +6 -5
  175. package/dist/service-override/views.js +30 -6
  176. package/dist/services.d.ts +339 -339
  177. package/dist/services.js +1 -1
  178. package/dist/standaloneServices.d.ts +1 -1
  179. package/dist/views.d.ts +4 -4
  180. package/dist/vscode/vs/platform/extensions/common/extensionValidator.js +79 -0
  181. package/dist/vscode/vs/platform/tunnel/common/tunnel.js +14 -1
  182. package/dist/vscode/vs/platform/webview/common/mimeTypes.js +22 -0
  183. package/dist/vscode/vs/platform/webview/common/webviewPortMapping.js +58 -0
  184. package/dist/vscode/vs/workbench/api/browser/mainThreadCustomEditors.js +567 -0
  185. package/dist/vscode/vs/workbench/api/browser/mainThreadDialogs.js +65 -0
  186. package/dist/vscode/vs/workbench/api/browser/mainThreadLogService.js +76 -0
  187. package/dist/vscode/vs/workbench/api/browser/mainThreadUriOpeners.js +104 -0
  188. package/dist/vscode/vs/workbench/api/browser/mainThreadWebviewManager.js +27 -0
  189. package/dist/vscode/vs/workbench/api/browser/mainThreadWebviewPanels.js +281 -0
  190. package/dist/vscode/vs/workbench/api/browser/mainThreadWebviewViews.js +98 -0
  191. package/dist/vscode/vs/workbench/api/browser/mainThreadWebviews.js +130 -0
  192. package/dist/vscode/vs/workbench/api/common/extHostCommands.js +11 -11
  193. package/dist/vscode/vs/workbench/api/common/extHostCustomEditors.js +282 -0
  194. package/dist/vscode/vs/workbench/api/common/extHostDialogs.js +22 -0
  195. package/dist/vscode/vs/workbench/api/common/extHostLogService.js +17 -0
  196. package/dist/vscode/vs/workbench/api/common/extHostLoggerService.js +63 -0
  197. package/dist/vscode/vs/workbench/api/common/extHostOutput.js +1 -1
  198. package/dist/vscode/vs/workbench/api/common/extHostTextEditor.js +1 -1
  199. package/dist/vscode/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  200. package/dist/vscode/vs/workbench/api/common/extHostTypes.js +18 -1
  201. package/dist/vscode/vs/workbench/api/common/extHostUriOpener.js +44 -0
  202. package/dist/vscode/vs/workbench/api/common/extHostWebview.js +212 -0
  203. package/dist/vscode/vs/workbench/api/common/extHostWebviewMessaging.js +149 -0
  204. package/dist/vscode/vs/workbench/api/common/extHostWebviewPanels.js +225 -0
  205. package/dist/vscode/vs/workbench/api/common/extHostWebviewView.js +147 -0
  206. package/dist/vscode/vs/workbench/browser/iframe.js +16 -0
  207. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
  208. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +301 -0
  209. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +362 -0
  210. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.css.js +4 -0
  211. package/dist/vscode/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.js +281 -0
  212. package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +14 -0
  213. package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
  214. package/dist/vscode/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
  215. package/dist/vscode/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
  216. package/dist/vscode/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +72 -0
  217. package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditor.js +53 -1
  218. package/dist/vscode/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
  219. package/dist/vscode/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +70 -0
  220. package/dist/vscode/vs/workbench/contrib/customEditor/common/extensionPoint.js +106 -0
  221. package/dist/vscode/vs/workbench/contrib/externalUriOpener/common/configuration.js +68 -0
  222. package/dist/vscode/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +79 -0
  223. package/dist/vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
  224. package/dist/vscode/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +169 -1
  225. package/dist/vscode/vs/workbench/contrib/outline/browser/outline.contribution.js +261 -0
  226. package/dist/vscode/vs/workbench/contrib/outline/browser/outline.js +10 -0
  227. package/dist/vscode/vs/workbench/contrib/outline/browser/outlinePane.css.js +4 -0
  228. package/dist/vscode/vs/workbench/contrib/outline/browser/outlinePane.js +290 -0
  229. package/dist/vscode/vs/workbench/contrib/outline/browser/outlineViewState.js +66 -0
  230. package/dist/vscode/vs/workbench/contrib/url/common/urlGlob.js +60 -0
  231. package/dist/vscode/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
  232. package/dist/vscode/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
  233. package/dist/vscode/vs/workbench/contrib/webview/browser/themeing.js +86 -0
  234. package/dist/vscode/vs/workbench/contrib/webview/browser/webview.js +24 -1
  235. package/dist/vscode/vs/workbench/contrib/webview/browser/webviewElement.js +643 -0
  236. package/dist/vscode/vs/workbench/contrib/webview/browser/webviewFindWidget.js +59 -0
  237. package/dist/vscode/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
  238. package/dist/vscode/vs/workbench/contrib/webview/common/webview.js +39 -0
  239. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +120 -0
  240. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +170 -0
  241. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
  242. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +56 -0
  243. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +61 -0
  244. package/dist/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.js +174 -3
  245. package/dist/vscode/vs/workbench/contrib/webviewView/browser/webviewViewService.js +43 -1
  246. package/dist/vscode/vs/workbench/services/outline/browser/outlineService.js +35 -0
  247. package/dist/vscode/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +78 -0
  248. package/dist/{vscode-services → vscode-apis}/commands.js +1 -1
  249. package/dist/{vscode-services → vscode-apis}/debug.js +1 -1
  250. package/dist/{vscode-services → vscode-apis}/env.js +9 -11
  251. package/dist/{vscode-services → vscode-apis}/extensions.js +16 -2
  252. package/dist/{vscode-services → vscode-apis}/l10n.js +1 -1
  253. package/dist/{vscode-services → vscode-apis}/languages.js +8 -1
  254. package/dist/{vscode-services → vscode-apis}/window.js +37 -7
  255. package/dist/{vscode-services → vscode-apis}/workspace.js +3 -3
  256. package/dist/vscode-default-extensions/configuration-editing/dist/browser/configurationEditingMain.js.extensionResource.js +2 -0
  257. package/dist/vscode-default-extensions/configuration-editing/package.json.js +2 -0
  258. package/dist/vscode-default-extensions/configuration-editing/schemas/attachContainer.schema.json.extensionResource.js +2 -0
  259. package/dist/vscode-default-extensions/css-language-features/client/dist/browser/cssClientMain.js.extensionResource.js +2 -0
  260. package/dist/vscode-default-extensions/css-language-features/package.json.js +2 -0
  261. package/dist/vscode-default-extensions/css-language-features/schemas/package.schema.json.extensionResource.js +2 -0
  262. package/dist/vscode-default-extensions/css-language-features/server/dist/browser/cssServerMain.js.extensionResource.js +2 -0
  263. package/dist/vscode-default-extensions/debug-auto-launch/package.json.js +2 -0
  264. package/dist/vscode-default-extensions/debug-server-ready/package.json.js +2 -0
  265. package/dist/vscode-default-extensions/emmet/dist/browser/emmetBrowserMain.js.extensionResource.js +2 -0
  266. package/dist/vscode-default-extensions/emmet/package.json.js +2 -0
  267. package/dist/vscode-default-extensions/extension-editing/dist/browser/extensionEditingBrowserMain.js.extensionResource.js +2 -0
  268. package/dist/vscode-default-extensions/extension-editing/package.json.js +2 -0
  269. package/dist/vscode-default-extensions/git/package.json.js +2 -0
  270. package/dist/vscode-default-extensions/git-base/dist/browser/extension.js.extensionResource.js +2 -0
  271. package/dist/vscode-default-extensions/git-base/languages/git-commit.language-configuration.json.extensionResource.js +2 -0
  272. package/dist/vscode-default-extensions/git-base/languages/git-rebase.language-configuration.json.extensionResource.js +2 -0
  273. package/dist/vscode-default-extensions/git-base/languages/ignore.language-configuration.json.extensionResource.js +2 -0
  274. package/dist/vscode-default-extensions/git-base/package.json.js +2 -0
  275. package/dist/vscode-default-extensions/git-base/syntaxes/git-commit.tmLanguage.json.extensionResource.js +2 -0
  276. package/dist/vscode-default-extensions/git-base/syntaxes/git-rebase.tmLanguage.json.extensionResource.js +2 -0
  277. package/dist/vscode-default-extensions/git-base/syntaxes/ignore.tmLanguage.json.extensionResource.js +2 -0
  278. package/dist/vscode-default-extensions/github/markdown.css.extensionResource.js +2 -0
  279. package/dist/vscode-default-extensions/github/package.json.js +2 -0
  280. package/dist/vscode-default-extensions/github-authentication/dist/browser/extension.js.extensionResource.js +2 -0
  281. package/dist/vscode-default-extensions/github-authentication/package.json.js +2 -0
  282. package/dist/vscode-default-extensions/grunt/package.json.js +2 -0
  283. package/dist/vscode-default-extensions/gulp/package.json.js +2 -0
  284. package/dist/vscode-default-extensions/html-language-features/client/dist/browser/htmlClientMain.js.extensionResource.js +2 -0
  285. package/dist/vscode-default-extensions/html-language-features/package.json.js +2 -0
  286. package/dist/vscode-default-extensions/html-language-features/schemas/package.schema.json.extensionResource.js +2 -0
  287. package/dist/vscode-default-extensions/html-language-features/server/dist/browser/htmlServerMain.js.extensionResource.js +2 -0
  288. package/dist/vscode-default-extensions/ipynb/dist/browser/ipynbMain.js.extensionResource.js +2 -0
  289. package/dist/vscode-default-extensions/ipynb/package.json.js +2 -0
  290. package/dist/vscode-default-extensions/jake/package.json.js +2 -0
  291. package/dist/vscode-default-extensions/json-language-features/client/dist/browser/jsonClientMain.js.extensionResource.js +2 -0
  292. package/dist/vscode-default-extensions/json-language-features/package.json.js +2 -0
  293. package/dist/vscode-default-extensions/json-language-features/server/dist/browser/jsonServerMain.js.extensionResource.js +2 -0
  294. package/dist/vscode-default-extensions/markdown-language-features/dist/browser/extension.js.extensionResource.js +2 -0
  295. package/dist/vscode-default-extensions/markdown-language-features/media/highlight.css.extensionResource.js +2 -0
  296. package/dist/vscode-default-extensions/markdown-language-features/media/index.js.extensionResource.js +2 -0
  297. package/dist/vscode-default-extensions/markdown-language-features/media/markdown.css.extensionResource.js +2 -0
  298. package/dist/vscode-default-extensions/markdown-language-features/media/pre.js.extensionResource.js +2 -0
  299. package/dist/vscode-default-extensions/markdown-language-features/media/preview-dark.svg.extensionResource.js +2 -0
  300. package/dist/vscode-default-extensions/markdown-language-features/media/preview-light.svg.extensionResource.js +2 -0
  301. package/dist/vscode-default-extensions/markdown-language-features/package.json.js +2 -0
  302. package/dist/vscode-default-extensions/markdown-language-features/schemas/package.schema.json.extensionResource.js +2 -0
  303. package/dist/vscode-default-extensions/markdown-language-features/server/dist/browser/workerMain.js.extensionResource.js +2 -0
  304. package/dist/vscode-default-extensions/markdown-math/dist/browser/extension.js.extensionResource.js +2 -0
  305. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_AMS-Regular.woff2.extensionResource.js +2 -0
  306. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Caligraphic-Bold.woff2.extensionResource.js +2 -0
  307. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Caligraphic-Regular.woff2.extensionResource.js +2 -0
  308. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Fraktur-Bold.woff2.extensionResource.js +2 -0
  309. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Fraktur-Regular.woff2.extensionResource.js +2 -0
  310. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Main-Bold.woff2.extensionResource.js +2 -0
  311. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Main-BoldItalic.woff2.extensionResource.js +2 -0
  312. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Main-Italic.woff2.extensionResource.js +2 -0
  313. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Main-Regular.woff2.extensionResource.js +2 -0
  314. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Math-BoldItalic.woff2.extensionResource.js +2 -0
  315. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Math-Italic.woff2.extensionResource.js +2 -0
  316. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_SansSerif-Bold.woff2.extensionResource.js +2 -0
  317. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_SansSerif-Italic.woff2.extensionResource.js +2 -0
  318. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_SansSerif-Regular.woff2.extensionResource.js +2 -0
  319. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Script-Regular.woff2.extensionResource.js +2 -0
  320. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Size1-Regular.woff2.extensionResource.js +2 -0
  321. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Size2-Regular.woff2.extensionResource.js +2 -0
  322. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Size3-Regular.woff2.extensionResource.js +2 -0
  323. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Size4-Regular.woff2.extensionResource.js +2 -0
  324. package/dist/vscode-default-extensions/markdown-math/notebook-out/fonts/KaTeX_Typewriter-Regular.woff2.extensionResource.js +2 -0
  325. package/dist/vscode-default-extensions/markdown-math/notebook-out/katex.min.css.extensionResource.js +2 -0
  326. package/dist/vscode-default-extensions/markdown-math/package.json.js +2 -0
  327. package/dist/vscode-default-extensions/markdown-math/preview-styles/index.css.extensionResource.js +2 -0
  328. package/dist/vscode-default-extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json.extensionResource.js +2 -0
  329. package/dist/vscode-default-extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json.extensionResource.js +2 -0
  330. package/dist/vscode-default-extensions/markdown-math/syntaxes/md-math.tmLanguage.json.extensionResource.js +2 -0
  331. package/dist/vscode-default-extensions/media-preview/dist/browser/extension.js.extensionResource.js +2 -0
  332. package/dist/vscode-default-extensions/media-preview/media/audioPreview.css.extensionResource.js +2 -0
  333. package/dist/vscode-default-extensions/media-preview/media/audioPreview.js.extensionResource.js +2 -0
  334. package/dist/vscode-default-extensions/media-preview/media/imagePreview.css.extensionResource.js +2 -0
  335. package/dist/vscode-default-extensions/media-preview/media/imagePreview.js.extensionResource.js +2 -0
  336. package/dist/vscode-default-extensions/media-preview/media/loading-dark.svg.extensionResource.js +2 -0
  337. package/dist/vscode-default-extensions/media-preview/media/loading-hc.svg.extensionResource.js +2 -0
  338. package/dist/vscode-default-extensions/media-preview/media/loading.svg.extensionResource.js +2 -0
  339. package/dist/vscode-default-extensions/media-preview/media/videoPreview.css.extensionResource.js +2 -0
  340. package/dist/vscode-default-extensions/media-preview/media/videoPreview.js.extensionResource.js +2 -0
  341. package/dist/vscode-default-extensions/media-preview/package.json.js +2 -0
  342. package/dist/vscode-default-extensions/merge-conflict/dist/browser/mergeConflictMain.js.extensionResource.js +2 -0
  343. package/dist/vscode-default-extensions/merge-conflict/package.json.js +2 -0
  344. package/dist/vscode-default-extensions/microsoft-authentication/dist/browser/extension.js.extensionResource.js +2 -0
  345. package/dist/vscode-default-extensions/microsoft-authentication/package.json.js +2 -0
  346. package/dist/vscode-default-extensions/notebook-renderers/package.json.js +2 -0
  347. package/dist/vscode-default-extensions/npm/dist/browser/npmBrowserMain.js.extensionResource.js +1 -1
  348. package/dist/vscode-default-extensions/php-language-features/package.json.js +2 -0
  349. package/dist/vscode-default-extensions/references-view/dist/extension.js.extensionResource.js +1 -1
  350. package/dist/vscode-default-extensions/restructuredtext/language-configuration.json.extensionResource.js +2 -0
  351. package/dist/vscode-default-extensions/restructuredtext/package.json.js +2 -0
  352. package/dist/vscode-default-extensions/restructuredtext/syntaxes/rst.tmLanguage.json.extensionResource.js +2 -0
  353. package/dist/vscode-default-extensions/search-result/dist/extension.js.extensionResource.js +1 -1
  354. package/dist/vscode-default-extensions/simple-browser/dist/browser/extension.js.extensionResource.js +2 -0
  355. package/dist/vscode-default-extensions/simple-browser/media/codicon.css.extensionResource.js +2 -0
  356. package/dist/vscode-default-extensions/simple-browser/media/index.js.extensionResource.js +2 -0
  357. package/dist/vscode-default-extensions/simple-browser/media/main.css.extensionResource.js +2 -0
  358. package/dist/vscode-default-extensions/simple-browser/package.json.js +2 -0
  359. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/extension.js.extensionResource.js +2 -0
  360. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.d.ts.extensionResource.js +2 -0
  361. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.decorators.d.ts.extensionResource.js +2 -0
  362. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.decorators.legacy.d.ts.extensionResource.js +2 -0
  363. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.dom.d.ts.extensionResource.js +2 -0
  364. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.dom.iterable.d.ts.extensionResource.js +2 -0
  365. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.collection.d.ts.extensionResource.js +2 -0
  366. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.core.d.ts.extensionResource.js +2 -0
  367. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.d.ts.extensionResource.js +2 -0
  368. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.generator.d.ts.extensionResource.js +2 -0
  369. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.iterable.d.ts.extensionResource.js +2 -0
  370. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.promise.d.ts.extensionResource.js +2 -0
  371. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.proxy.d.ts.extensionResource.js +2 -0
  372. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.reflect.d.ts.extensionResource.js +2 -0
  373. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.symbol.d.ts.extensionResource.js +2 -0
  374. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2015.symbol.wellknown.d.ts.extensionResource.js +2 -0
  375. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2016.array.include.d.ts.extensionResource.js +2 -0
  376. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2016.d.ts.extensionResource.js +2 -0
  377. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2016.full.d.ts.extensionResource.js +2 -0
  378. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.d.ts.extensionResource.js +2 -0
  379. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.full.d.ts.extensionResource.js +2 -0
  380. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.intl.d.ts.extensionResource.js +2 -0
  381. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.object.d.ts.extensionResource.js +2 -0
  382. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.sharedmemory.d.ts.extensionResource.js +2 -0
  383. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.string.d.ts.extensionResource.js +2 -0
  384. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2017.typedarrays.d.ts.extensionResource.js +2 -0
  385. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.asyncgenerator.d.ts.extensionResource.js +2 -0
  386. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.asynciterable.d.ts.extensionResource.js +2 -0
  387. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.d.ts.extensionResource.js +2 -0
  388. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.full.d.ts.extensionResource.js +2 -0
  389. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.intl.d.ts.extensionResource.js +2 -0
  390. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.promise.d.ts.extensionResource.js +2 -0
  391. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2018.regexp.d.ts.extensionResource.js +2 -0
  392. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.array.d.ts.extensionResource.js +2 -0
  393. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.d.ts.extensionResource.js +2 -0
  394. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.full.d.ts.extensionResource.js +2 -0
  395. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.intl.d.ts.extensionResource.js +2 -0
  396. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.object.d.ts.extensionResource.js +2 -0
  397. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.string.d.ts.extensionResource.js +2 -0
  398. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2019.symbol.d.ts.extensionResource.js +2 -0
  399. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.bigint.d.ts.extensionResource.js +2 -0
  400. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.d.ts.extensionResource.js +2 -0
  401. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.date.d.ts.extensionResource.js +2 -0
  402. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.full.d.ts.extensionResource.js +2 -0
  403. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.intl.d.ts.extensionResource.js +2 -0
  404. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.number.d.ts.extensionResource.js +2 -0
  405. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.promise.d.ts.extensionResource.js +2 -0
  406. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.sharedmemory.d.ts.extensionResource.js +2 -0
  407. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.string.d.ts.extensionResource.js +2 -0
  408. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2020.symbol.wellknown.d.ts.extensionResource.js +2 -0
  409. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.d.ts.extensionResource.js +2 -0
  410. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.full.d.ts.extensionResource.js +2 -0
  411. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.intl.d.ts.extensionResource.js +2 -0
  412. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.promise.d.ts.extensionResource.js +2 -0
  413. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.string.d.ts.extensionResource.js +2 -0
  414. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2021.weakref.d.ts.extensionResource.js +2 -0
  415. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.array.d.ts.extensionResource.js +2 -0
  416. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.d.ts.extensionResource.js +2 -0
  417. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.error.d.ts.extensionResource.js +2 -0
  418. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.full.d.ts.extensionResource.js +2 -0
  419. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.intl.d.ts.extensionResource.js +2 -0
  420. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.object.d.ts.extensionResource.js +2 -0
  421. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.regexp.d.ts.extensionResource.js +2 -0
  422. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.sharedmemory.d.ts.extensionResource.js +2 -0
  423. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2022.string.d.ts.extensionResource.js +2 -0
  424. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2023.array.d.ts.extensionResource.js +2 -0
  425. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2023.d.ts.extensionResource.js +2 -0
  426. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es2023.full.d.ts.extensionResource.js +2 -0
  427. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es5.d.ts.extensionResource.js +2 -0
  428. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.es6.d.ts.extensionResource.js +2 -0
  429. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.esnext.d.ts.extensionResource.js +2 -0
  430. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.esnext.full.d.ts.extensionResource.js +2 -0
  431. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.esnext.intl.d.ts.extensionResource.js +2 -0
  432. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.scripthost.d.ts.extensionResource.js +2 -0
  433. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.webworker.d.ts.extensionResource.js +2 -0
  434. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.webworker.importscripts.d.ts.extensionResource.js +2 -0
  435. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/lib.webworker.iterable.d.ts.extensionResource.js +2 -0
  436. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/tsserver.web.js.extensionResource.js +2 -0
  437. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/tsserver.web.js.map.extensionResource.js +2 -0
  438. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/typesMap.json.extensionResource.js +2 -0
  439. package/dist/vscode-default-extensions/typescript-language-features/dist/browser/typescript/typescript.d.ts.extensionResource.js +2 -0
  440. package/dist/vscode-default-extensions/typescript-language-features/package.json.js +2 -0
  441. package/dist/vscode-default-extensions/typescript-language-features/schemas/jsconfig.schema.json.extensionResource.js +2 -0
  442. package/dist/vscode-default-extensions/typescript-language-features/schemas/package.schema.json.extensionResource.js +2 -0
  443. package/dist/vscode-default-extensions/typescript-language-features/schemas/tsconfig.schema.json.extensionResource.js +2 -0
  444. package/dist/vscode-default-extensions/vscode-api-tests/package.json.js +2 -0
  445. package/dist/vscode-default-extensions/vscode-colorize-tests/package.json.js +2 -0
  446. package/dist/vscode-default-extensions/vscode-colorize-tests/producticons/ElegantIcons.woff.extensionResource.js +2 -0
  447. package/dist/vscode-default-extensions/vscode-colorize-tests/producticons/test-product-icon-theme.json.extensionResource.js +2 -0
  448. package/dist/vscode-default-extensions/vscode-test-resolver/package.json.js +2 -0
  449. package/dist/workbenchThemeService.d.ts +1 -1
  450. package/dist/workspace.d.ts +1 -1
  451. package/monaco-editor-treemending.patch +531 -531
  452. package/package.json +19 -93
  453. package/dist/json.js +0 -101
  454. package/dist/typescript.js +0 -27
  455. package/dist/vscode-services/extHost.js +0 -393
  456. package/dist/workers/outputLinkComputer.worker.d.ts +0 -2
  457. package/dist/workers/textMate.worker.d.ts +0 -2
@@ -1,14 +1,15 @@
1
1
  import require$$0$1__default from 'fs';
2
2
  import require$$2 from 'util';
3
3
  import * as path from 'path';
4
- import path__default from 'path';
4
+ import path__default, { sep } from 'path';
5
5
  import { resolve, dirname, extname, basename, relative as relative$1 } from 'node:path';
6
6
  import process$1, { env as env$1 } from 'node:process';
7
7
  import { performance } from 'node:perf_hooks';
8
8
  import { createHash as createHash$1 } from 'node:crypto';
9
9
  import { mkdir, writeFile, readFile, lstat, realpath, readdir } from 'node:fs/promises';
10
10
  import * as tty from 'tty';
11
- import { addExtension } from '@rollup/pluginutils';
11
+ import { createFilter, attachScopes, makeLegalIdentifier, addExtension } from '@rollup/pluginutils';
12
+ import * as url from 'url';
12
13
 
13
14
  /*---------------------------------------------------------------------------------------------
14
15
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,7 @@ function isString$1(str) {
24
25
  * @returns whether the provided parameter is of type `object` but **not**
25
26
  * `null`, an `array`, a `regexp`, nor a `date`.
26
27
  */
27
- function isObject(obj) {
28
+ function isObject$2(obj) {
28
29
  // The method can't do a type cast since there are type (like strings) which
29
30
  // are subclasses of any put not positvely matched by the function. Hence type
30
31
  // narrowing results in wrong results.
@@ -114,7 +115,7 @@ function replaceNLStrings(extensionManifest, messages, originalMessages) {
114
115
  }
115
116
  }
116
117
  }
117
- else if (isObject(value)) {
118
+ else if (isObject$2(value)) {
118
119
  for (const k in value) {
119
120
  if (value.hasOwnProperty(k)) {
120
121
  k === 'commands' ? processEntry(value, k, true) : processEntry(value, k, command);
@@ -136,6 +137,10 @@ function replaceNLStrings(extensionManifest, messages, originalMessages) {
136
137
 
137
138
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
138
139
 
140
+ function getDefaultExportFromCjs$1 (x) {
141
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
142
+ }
143
+
139
144
  var lib = {};
140
145
 
141
146
  var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -1431,18 +1436,18 @@ function getParseErrorMessage(errorCode) {
1431
1436
 
1432
1437
  var version$1 = "3.25.1";
1433
1438
 
1434
- const comma = ','.charCodeAt(0);
1435
- const semicolon = ';'.charCodeAt(0);
1439
+ const comma$1 = ','.charCodeAt(0);
1440
+ const semicolon$1 = ';'.charCodeAt(0);
1436
1441
  const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
1437
- const intToChar = new Uint8Array(64); // 64 possible chars.
1438
- const charToInt = new Uint8Array(128); // z is 122 in ASCII
1442
+ const intToChar$1 = new Uint8Array(64); // 64 possible chars.
1443
+ const charToInt$1 = new Uint8Array(128); // z is 122 in ASCII
1439
1444
  for (let i = 0; i < chars$1.length; i++) {
1440
1445
  const c = chars$1.charCodeAt(i);
1441
- intToChar[i] = c;
1442
- charToInt[c] = i;
1446
+ intToChar$1[i] = c;
1447
+ charToInt$1[c] = i;
1443
1448
  }
1444
1449
  // Provide a fallback for older environments.
1445
- const td = typeof TextDecoder !== 'undefined'
1450
+ const td$1 = typeof TextDecoder !== 'undefined'
1446
1451
  ? /* #__PURE__ */ new TextDecoder()
1447
1452
  : typeof Buffer !== 'undefined'
1448
1453
  ? {
@@ -1511,7 +1516,7 @@ function decodeInteger(mappings, pos, state, j) {
1511
1516
  let integer = 0;
1512
1517
  do {
1513
1518
  const c = mappings.charCodeAt(pos++);
1514
- integer = charToInt[c];
1519
+ integer = charToInt$1[c];
1515
1520
  value |= (integer & 31) << shift;
1516
1521
  shift += 5;
1517
1522
  } while (integer & 32);
@@ -1526,7 +1531,7 @@ function decodeInteger(mappings, pos, state, j) {
1526
1531
  function hasMoreVlq(mappings, i, length) {
1527
1532
  if (i >= length)
1528
1533
  return false;
1529
- return mappings.charCodeAt(i) !== comma;
1534
+ return mappings.charCodeAt(i) !== comma$1;
1530
1535
  }
1531
1536
  function sort(line) {
1532
1537
  line.sort(sortComparator);
@@ -1534,7 +1539,7 @@ function sort(line) {
1534
1539
  function sortComparator(a, b) {
1535
1540
  return a[0] - b[0];
1536
1541
  }
1537
- function encode(decoded) {
1542
+ function encode$1(decoded) {
1538
1543
  const state = new Int32Array(5);
1539
1544
  const bufLength = 1024 * 16;
1540
1545
  const subLength = bufLength - 36;
@@ -1546,10 +1551,10 @@ function encode(decoded) {
1546
1551
  const line = decoded[i];
1547
1552
  if (i > 0) {
1548
1553
  if (pos === bufLength) {
1549
- out += td.decode(buf);
1554
+ out += td$1.decode(buf);
1550
1555
  pos = 0;
1551
1556
  }
1552
- buf[pos++] = semicolon;
1557
+ buf[pos++] = semicolon$1;
1553
1558
  }
1554
1559
  if (line.length === 0)
1555
1560
  continue;
@@ -1559,26 +1564,26 @@ function encode(decoded) {
1559
1564
  // We can push up to 5 ints, each int can take at most 7 chars, and we
1560
1565
  // may push a comma.
1561
1566
  if (pos > subLength) {
1562
- out += td.decode(sub);
1567
+ out += td$1.decode(sub);
1563
1568
  buf.copyWithin(0, subLength, pos);
1564
1569
  pos -= subLength;
1565
1570
  }
1566
1571
  if (j > 0)
1567
- buf[pos++] = comma;
1568
- pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
1572
+ buf[pos++] = comma$1;
1573
+ pos = encodeInteger$1(buf, pos, state, segment, 0); // genColumn
1569
1574
  if (segment.length === 1)
1570
1575
  continue;
1571
- pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
1572
- pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
1573
- pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
1576
+ pos = encodeInteger$1(buf, pos, state, segment, 1); // sourcesIndex
1577
+ pos = encodeInteger$1(buf, pos, state, segment, 2); // sourceLine
1578
+ pos = encodeInteger$1(buf, pos, state, segment, 3); // sourceColumn
1574
1579
  if (segment.length === 4)
1575
1580
  continue;
1576
- pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
1581
+ pos = encodeInteger$1(buf, pos, state, segment, 4); // namesIndex
1577
1582
  }
1578
1583
  }
1579
- return out + td.decode(buf.subarray(0, pos));
1584
+ return out + td$1.decode(buf.subarray(0, pos));
1580
1585
  }
1581
- function encodeInteger(buf, pos, state, segment, j) {
1586
+ function encodeInteger$1(buf, pos, state, segment, j) {
1582
1587
  const next = segment[j];
1583
1588
  let num = next - state[j];
1584
1589
  state[j] = next;
@@ -1588,12 +1593,12 @@ function encodeInteger(buf, pos, state, segment, j) {
1588
1593
  num >>>= 5;
1589
1594
  if (num > 0)
1590
1595
  clamped |= 0b100000;
1591
- buf[pos++] = intToChar[clamped];
1596
+ buf[pos++] = intToChar$1[clamped];
1592
1597
  } while (num > 0);
1593
1598
  return pos;
1594
1599
  }
1595
1600
 
1596
- class BitSet {
1601
+ let BitSet$1 = class BitSet {
1597
1602
  constructor(arg) {
1598
1603
  this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
1599
1604
  }
@@ -1605,7 +1610,7 @@ class BitSet {
1605
1610
  has(n) {
1606
1611
  return !!(this.bits[n >> 5] & (1 << (n & 31)));
1607
1612
  }
1608
- }
1613
+ };
1609
1614
 
1610
1615
  let Chunk$1 = class Chunk {
1611
1616
  constructor(start, end, content) {
@@ -1761,7 +1766,7 @@ let Chunk$1 = class Chunk {
1761
1766
  }
1762
1767
  };
1763
1768
 
1764
- function getBtoa () {
1769
+ function getBtoa$1 () {
1765
1770
  if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
1766
1771
  return (str) => window.btoa(unescape(encodeURIComponent(str)));
1767
1772
  } else if (typeof Buffer === 'function') {
@@ -1773,16 +1778,16 @@ function getBtoa () {
1773
1778
  }
1774
1779
  }
1775
1780
 
1776
- const btoa = /*#__PURE__*/ getBtoa();
1781
+ const btoa$1 = /*#__PURE__*/ getBtoa$1();
1777
1782
 
1778
- class SourceMap {
1783
+ let SourceMap$1 = class SourceMap {
1779
1784
  constructor(properties) {
1780
1785
  this.version = 3;
1781
1786
  this.file = properties.file;
1782
1787
  this.sources = properties.sources;
1783
1788
  this.sourcesContent = properties.sourcesContent;
1784
1789
  this.names = properties.names;
1785
- this.mappings = encode(properties.mappings);
1790
+ this.mappings = encode$1(properties.mappings);
1786
1791
  if (typeof properties.x_google_ignoreList !== 'undefined') {
1787
1792
  this.x_google_ignoreList = properties.x_google_ignoreList;
1788
1793
  }
@@ -1793,11 +1798,11 @@ class SourceMap {
1793
1798
  }
1794
1799
 
1795
1800
  toUrl() {
1796
- return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());
1801
+ return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString());
1797
1802
  }
1798
- }
1803
+ };
1799
1804
 
1800
- function guessIndent(code) {
1805
+ function guessIndent$1(code) {
1801
1806
  const lines = code.split('\n');
1802
1807
 
1803
1808
  const tabbed = lines.filter((line) => /^\t+/.test(line));
@@ -1823,7 +1828,7 @@ function guessIndent(code) {
1823
1828
  return new Array(min + 1).join(' ');
1824
1829
  }
1825
1830
 
1826
- function getRelativePath(from, to) {
1831
+ function getRelativePath$1(from, to) {
1827
1832
  const fromParts = from.split(/[/\\]/);
1828
1833
  const toParts = to.split(/[/\\]/);
1829
1834
 
@@ -1874,7 +1879,7 @@ function getLocator$1(source) {
1874
1879
  };
1875
1880
  }
1876
1881
 
1877
- class Mappings {
1882
+ let Mappings$1 = class Mappings {
1878
1883
  constructor(hires) {
1879
1884
  this.hires = hires;
1880
1885
  this.generatedCodeLine = 0;
@@ -1942,17 +1947,17 @@ class Mappings {
1942
1947
 
1943
1948
  this.generatedCodeColumn += lines[lines.length - 1].length;
1944
1949
  }
1945
- }
1950
+ };
1946
1951
 
1947
- const n = '\n';
1952
+ const n$1 = '\n';
1948
1953
 
1949
- const warned = {
1954
+ const warned$1 = {
1950
1955
  insertLeft: false,
1951
1956
  insertRight: false,
1952
1957
  storeName: false,
1953
1958
  };
1954
1959
 
1955
- class MagicString {
1960
+ let MagicString$1 = class MagicString {
1956
1961
  constructor(string, options = {}) {
1957
1962
  const chunk = new Chunk$1(0, string.length, string);
1958
1963
 
@@ -1967,7 +1972,7 @@ class MagicString {
1967
1972
  byEnd: { writable: true, value: {} },
1968
1973
  filename: { writable: true, value: options.filename },
1969
1974
  indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
1970
- sourcemapLocations: { writable: true, value: new BitSet() },
1975
+ sourcemapLocations: { writable: true, value: new BitSet$1() },
1971
1976
  storedNames: { writable: true, value: {} },
1972
1977
  indentStr: { writable: true, value: undefined },
1973
1978
  ignoreList: { writable: true, value: options.ignoreList },
@@ -2047,7 +2052,7 @@ class MagicString {
2047
2052
  cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
2048
2053
  }
2049
2054
 
2050
- cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
2055
+ cloned.sourcemapLocations = new BitSet$1(this.sourcemapLocations);
2051
2056
 
2052
2057
  cloned.intro = this.intro;
2053
2058
  cloned.outro = this.outro;
@@ -2060,7 +2065,7 @@ class MagicString {
2060
2065
 
2061
2066
  const sourceIndex = 0;
2062
2067
  const names = Object.keys(this.storedNames);
2063
- const mappings = new Mappings(options.hires);
2068
+ const mappings = new Mappings$1(options.hires);
2064
2069
 
2065
2070
  const locate = getLocator$1(this.original);
2066
2071
 
@@ -2089,7 +2094,7 @@ class MagicString {
2089
2094
 
2090
2095
  return {
2091
2096
  file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
2092
- sources: [options.source ? getRelativePath(options.file || '', options.source) : (options.file || '')],
2097
+ sources: [options.source ? getRelativePath$1(options.file || '', options.source) : (options.file || '')],
2093
2098
  sourcesContent: options.includeContent ? [this.original] : undefined,
2094
2099
  names,
2095
2100
  mappings: mappings.raw,
@@ -2098,12 +2103,12 @@ class MagicString {
2098
2103
  }
2099
2104
 
2100
2105
  generateMap(options) {
2101
- return new SourceMap(this.generateDecodedMap(options));
2106
+ return new SourceMap$1(this.generateDecodedMap(options));
2102
2107
  }
2103
2108
 
2104
2109
  _ensureindentStr() {
2105
2110
  if (this.indentStr === undefined) {
2106
- this.indentStr = guessIndent(this.original);
2111
+ this.indentStr = guessIndent$1(this.original);
2107
2112
  }
2108
2113
  }
2109
2114
 
@@ -2212,22 +2217,22 @@ class MagicString {
2212
2217
  }
2213
2218
 
2214
2219
  insertLeft(index, content) {
2215
- if (!warned.insertLeft) {
2220
+ if (!warned$1.insertLeft) {
2216
2221
  console.warn(
2217
2222
  'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
2218
2223
  ); // eslint-disable-line no-console
2219
- warned.insertLeft = true;
2224
+ warned$1.insertLeft = true;
2220
2225
  }
2221
2226
 
2222
2227
  return this.appendLeft(index, content);
2223
2228
  }
2224
2229
 
2225
2230
  insertRight(index, content) {
2226
- if (!warned.insertRight) {
2231
+ if (!warned$1.insertRight) {
2227
2232
  console.warn(
2228
2233
  'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
2229
2234
  ); // eslint-disable-line no-console
2230
- warned.insertRight = true;
2235
+ warned$1.insertRight = true;
2231
2236
  }
2232
2237
 
2233
2238
  return this.prependRight(index, content);
@@ -2291,11 +2296,11 @@ class MagicString {
2291
2296
  this._split(end);
2292
2297
 
2293
2298
  if (options === true) {
2294
- if (!warned.storeName) {
2299
+ if (!warned$1.storeName) {
2295
2300
  console.warn(
2296
2301
  'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
2297
2302
  ); // eslint-disable-line no-console
2298
- warned.storeName = true;
2303
+ warned$1.storeName = true;
2299
2304
  }
2300
2305
 
2301
2306
  options = { storeName: true };
@@ -2411,30 +2416,30 @@ class MagicString {
2411
2416
  }
2412
2417
 
2413
2418
  lastLine() {
2414
- let lineIndex = this.outro.lastIndexOf(n);
2419
+ let lineIndex = this.outro.lastIndexOf(n$1);
2415
2420
  if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
2416
2421
  let lineStr = this.outro;
2417
2422
  let chunk = this.lastChunk;
2418
2423
  do {
2419
2424
  if (chunk.outro.length > 0) {
2420
- lineIndex = chunk.outro.lastIndexOf(n);
2425
+ lineIndex = chunk.outro.lastIndexOf(n$1);
2421
2426
  if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
2422
2427
  lineStr = chunk.outro + lineStr;
2423
2428
  }
2424
2429
 
2425
2430
  if (chunk.content.length > 0) {
2426
- lineIndex = chunk.content.lastIndexOf(n);
2431
+ lineIndex = chunk.content.lastIndexOf(n$1);
2427
2432
  if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
2428
2433
  lineStr = chunk.content + lineStr;
2429
2434
  }
2430
2435
 
2431
2436
  if (chunk.intro.length > 0) {
2432
- lineIndex = chunk.intro.lastIndexOf(n);
2437
+ lineIndex = chunk.intro.lastIndexOf(n$1);
2433
2438
  if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
2434
2439
  lineStr = chunk.intro + lineStr;
2435
2440
  }
2436
2441
  } while ((chunk = chunk.previous));
2437
- lineIndex = this.intro.lastIndexOf(n);
2442
+ lineIndex = this.intro.lastIndexOf(n$1);
2438
2443
  if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
2439
2444
  return this.intro + lineStr;
2440
2445
  }
@@ -2735,7 +2740,7 @@ class MagicString {
2735
2740
 
2736
2741
  return this._replaceRegexp(searchValue, replacement);
2737
2742
  }
2738
- }
2743
+ };
2739
2744
 
2740
2745
  const hasOwnProp = Object.prototype.hasOwnProperty;
2741
2746
 
@@ -2749,7 +2754,7 @@ let Bundle$1 = class Bundle {
2749
2754
  }
2750
2755
 
2751
2756
  addSource(source) {
2752
- if (source instanceof MagicString) {
2757
+ if (source instanceof MagicString$1) {
2753
2758
  return this.addSource({
2754
2759
  content: source,
2755
2760
  filename: source.filename,
@@ -2790,7 +2795,7 @@ let Bundle$1 = class Bundle {
2790
2795
 
2791
2796
  append(str, options) {
2792
2797
  this.addSource({
2793
- content: new MagicString(str),
2798
+ content: new MagicString$1(str),
2794
2799
  separator: (options && options.separator) || '',
2795
2800
  });
2796
2801
 
@@ -2823,7 +2828,7 @@ let Bundle$1 = class Bundle {
2823
2828
  });
2824
2829
  });
2825
2830
 
2826
- const mappings = new Mappings(options.hires);
2831
+ const mappings = new Mappings$1(options.hires);
2827
2832
 
2828
2833
  if (this.intro) {
2829
2834
  mappings.advance(this.intro);
@@ -2886,7 +2891,7 @@ let Bundle$1 = class Bundle {
2886
2891
  return {
2887
2892
  file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
2888
2893
  sources: this.uniqueSources.map((source) => {
2889
- return options.file ? getRelativePath(options.file, source.filename) : source.filename;
2894
+ return options.file ? getRelativePath$1(options.file, source.filename) : source.filename;
2890
2895
  }),
2891
2896
  sourcesContent: this.uniqueSources.map((source) => {
2892
2897
  return options.includeContent ? source.content : null;
@@ -2898,7 +2903,7 @@ let Bundle$1 = class Bundle {
2898
2903
  }
2899
2904
 
2900
2905
  generateMap(options) {
2901
- return new SourceMap(this.generateDecodedMap(options));
2906
+ return new SourceMap$1(this.generateDecodedMap(options));
2902
2907
  }
2903
2908
 
2904
2909
  getIndentString() {
@@ -3468,7 +3473,7 @@ const logLevelPriority = {
3468
3473
  [LOGLEVEL_WARN]: 2
3469
3474
  };
3470
3475
 
3471
- function getLocator(source, options) {
3476
+ function getLocator$2(source, options) {
3472
3477
  if (options === void 0) { options = {}; }
3473
3478
  var offsetLine = options.offsetLine || 0;
3474
3479
  var offsetColumn = options.offsetColumn || 0;
@@ -3506,7 +3511,7 @@ function locate(source, search, options) {
3506
3511
  if (typeof options === 'number') {
3507
3512
  throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');
3508
3513
  }
3509
- return getLocator(source, options)(search, options && options.startIndex);
3514
+ return getLocator$2(source, options)(search, options && options.startIndex);
3510
3515
  }
3511
3516
 
3512
3517
  function spaces(index) {
@@ -6414,14 +6419,14 @@ class ParameterVariable extends LocalVariable {
6414
6419
  }
6415
6420
  }
6416
6421
 
6417
- const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
6422
+ const chars$2 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
6418
6423
  const base = 64;
6419
6424
  function toBase64(value) {
6420
6425
  let outString = '';
6421
6426
  do {
6422
6427
  const currentDigit = value % base;
6423
6428
  value = (value / base) | 0;
6424
- outString = chars[currentDigit] + outString;
6429
+ outString = chars$2[currentDigit] + outString;
6425
6430
  } while (value !== 0);
6426
6431
  return outString;
6427
6432
  }
@@ -13370,7 +13375,7 @@ class Module {
13370
13375
  // By default, `id` is the file name. Custom resolvers and loaders
13371
13376
  // can change that, but it makes sense to use it for the source file name
13372
13377
  const fileName = this.id;
13373
- this.magicString = new MagicString(code, {
13378
+ this.magicString = new MagicString$1(code, {
13374
13379
  filename: (this.excludeFromSourcemap ? null : fileName),
13375
13380
  indentExclusionRanges: []
13376
13381
  });
@@ -14993,7 +14998,7 @@ function getGlobalName(chunk, globals, hasExports, log) {
14993
14998
  return chunk.variableName;
14994
14999
  }
14995
15000
  }
14996
- class Chunk {
15001
+ let Chunk$2 = class Chunk {
14997
15002
  constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, externalChunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias, getPlaceholder, bundle, inputBase, snippets) {
14998
15003
  this.orderedModules = orderedModules;
14999
15004
  this.inputOptions = inputOptions;
@@ -15816,7 +15821,7 @@ class Chunk {
15816
15821
  if (namespace.renderFirst())
15817
15822
  hoistedSource += n + rendered;
15818
15823
  else
15819
- magicString.addSource(new MagicString(rendered));
15824
+ magicString.addSource(new MagicString$1(rendered));
15820
15825
  }
15821
15826
  const accessedGlobalVariables = accessedGlobalsByScope.get(module.scope);
15822
15827
  if (accessedGlobalVariables) {
@@ -15975,7 +15980,7 @@ class Chunk {
15975
15980
  }
15976
15981
  }
15977
15982
  }
15978
- }
15983
+ };
15979
15984
  function getChunkNameFromModule(module) {
15980
15985
  return getPredefinedChunkNameFromModule(module) ?? getAliasName(module.id);
15981
15986
  }
@@ -16910,7 +16915,7 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon
16910
16915
  file = basename(file);
16911
16916
  }
16912
16917
  sourcesContent = (excludeContent ? null : sourcesContent);
16913
- return new SourceMap({ file, mappings, names, sources, sourcesContent });
16918
+ return new SourceMap$1({ file, mappings, names, sources, sourcesContent });
16914
16919
  }
16915
16920
  function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) {
16916
16921
  if (sourcemapChain.length === 0) {
@@ -17253,7 +17258,7 @@ class Bundle {
17253
17258
  ? includedModules.map(module => ({ alias: null, modules: [module] }))
17254
17259
  : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, this.inputOptions.onLog)) {
17255
17260
  sortByExecutionOrder(modules);
17256
- const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets);
17261
+ const chunk = new Chunk$2(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets);
17257
17262
  chunks.push(chunk);
17258
17263
  }
17259
17264
  for (const chunk of chunks) {
@@ -17574,14 +17579,14 @@ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
17574
17579
 
17575
17580
  var ref = Object.prototype;
17576
17581
  var hasOwnProperty = ref.hasOwnProperty;
17577
- var toString = ref.toString;
17582
+ var toString$2 = ref.toString;
17578
17583
 
17579
17584
  var hasOwn = Object.hasOwn || (function (obj, propName) { return (
17580
17585
  hasOwnProperty.call(obj, propName)
17581
17586
  ); });
17582
17587
 
17583
17588
  var isArray = Array.isArray || (function (obj) { return (
17584
- toString.call(obj) === "[object Array]"
17589
+ toString$2.call(obj) === "[object Array]"
17585
17590
  ); });
17586
17591
 
17587
17592
  function wordsRegexp(words) {
@@ -23338,14 +23343,14 @@ async function transform(source, module, pluginDriver, log) {
23338
23343
  getCombinedSourcemap() {
23339
23344
  const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log);
23340
23345
  if (!combinedMap) {
23341
- const magicString = new MagicString(originalCode);
23346
+ const magicString = new MagicString$1(originalCode);
23342
23347
  return magicString.generateMap({ hires: true, includeContent: true, source: id });
23343
23348
  }
23344
23349
  if (originalSourcemap !== combinedMap) {
23345
23350
  originalSourcemap = combinedMap;
23346
23351
  sourcemapChain.length = 0;
23347
23352
  }
23348
- return new SourceMap({
23353
+ return new SourceMap$1({
23349
23354
  ...combinedMap,
23350
23355
  file: null,
23351
23356
  sourcesContent: combinedMap.sourcesContent
@@ -25806,64 +25811,1730 @@ createColors({
25806
25811
  useColor: env$1.FORCE_COLOR !== '0' && !env$1.NO_COLOR
25807
25812
  });
25808
25813
 
25809
- function extractCommandResources(command) {
25810
- if (Array.isArray(command)) {
25811
- return command.flatMap(extractCommandResources);
25812
- }
25813
- if (command.icon != null) {
25814
- if (typeof command.icon === 'object') {
25815
- return [{ path: command.icon.light, sync: false }, { path: command.icon.dark, sync: false }];
25816
- }
25817
- else {
25818
- return [{ path: command.icon, sync: false }];
25819
- }
25820
- }
25821
- return [];
25814
+ // @ts-check
25815
+ /** @typedef { import('estree').BaseNode} BaseNode */
25816
+
25817
+ /** @typedef {{
25818
+ skip: () => void;
25819
+ remove: () => void;
25820
+ replace: (node: BaseNode) => void;
25821
+ }} WalkerContext */
25822
+
25823
+ class WalkerBase {
25824
+ constructor() {
25825
+ /** @type {boolean} */
25826
+ this.should_skip = false;
25827
+
25828
+ /** @type {boolean} */
25829
+ this.should_remove = false;
25830
+
25831
+ /** @type {BaseNode | null} */
25832
+ this.replacement = null;
25833
+
25834
+ /** @type {WalkerContext} */
25835
+ this.context = {
25836
+ skip: () => (this.should_skip = true),
25837
+ remove: () => (this.should_remove = true),
25838
+ replace: (node) => (this.replacement = node)
25839
+ };
25840
+ }
25841
+
25842
+ /**
25843
+ *
25844
+ * @param {any} parent
25845
+ * @param {string} prop
25846
+ * @param {number} index
25847
+ * @param {BaseNode} node
25848
+ */
25849
+ replace(parent, prop, index, node) {
25850
+ if (parent) {
25851
+ if (index !== null) {
25852
+ parent[prop][index] = node;
25853
+ } else {
25854
+ parent[prop] = node;
25855
+ }
25856
+ }
25857
+ }
25858
+
25859
+ /**
25860
+ *
25861
+ * @param {any} parent
25862
+ * @param {string} prop
25863
+ * @param {number} index
25864
+ */
25865
+ remove(parent, prop, index) {
25866
+ if (parent) {
25867
+ if (index !== null) {
25868
+ parent[prop].splice(index, 1);
25869
+ } else {
25870
+ delete parent[prop];
25871
+ }
25872
+ }
25873
+ }
25822
25874
  }
25823
- function extractGrammarResources(grammar) {
25824
- return [{ path: grammar.path, sync: false }];
25875
+
25876
+ // @ts-check
25877
+
25878
+ /** @typedef { import('estree').BaseNode} BaseNode */
25879
+ /** @typedef { import('./walker.js').WalkerContext} WalkerContext */
25880
+
25881
+ /** @typedef {(
25882
+ * this: WalkerContext,
25883
+ * node: BaseNode,
25884
+ * parent: BaseNode,
25885
+ * key: string,
25886
+ * index: number
25887
+ * ) => void} SyncHandler */
25888
+
25889
+ class SyncWalker extends WalkerBase {
25890
+ /**
25891
+ *
25892
+ * @param {SyncHandler} enter
25893
+ * @param {SyncHandler} leave
25894
+ */
25895
+ constructor(enter, leave) {
25896
+ super();
25897
+
25898
+ /** @type {SyncHandler} */
25899
+ this.enter = enter;
25900
+
25901
+ /** @type {SyncHandler} */
25902
+ this.leave = leave;
25903
+ }
25904
+
25905
+ /**
25906
+ *
25907
+ * @param {BaseNode} node
25908
+ * @param {BaseNode} parent
25909
+ * @param {string} [prop]
25910
+ * @param {number} [index]
25911
+ * @returns {BaseNode}
25912
+ */
25913
+ visit(node, parent, prop, index) {
25914
+ if (node) {
25915
+ if (this.enter) {
25916
+ const _should_skip = this.should_skip;
25917
+ const _should_remove = this.should_remove;
25918
+ const _replacement = this.replacement;
25919
+ this.should_skip = false;
25920
+ this.should_remove = false;
25921
+ this.replacement = null;
25922
+
25923
+ this.enter.call(this.context, node, parent, prop, index);
25924
+
25925
+ if (this.replacement) {
25926
+ node = this.replacement;
25927
+ this.replace(parent, prop, index, node);
25928
+ }
25929
+
25930
+ if (this.should_remove) {
25931
+ this.remove(parent, prop, index);
25932
+ }
25933
+
25934
+ const skipped = this.should_skip;
25935
+ const removed = this.should_remove;
25936
+
25937
+ this.should_skip = _should_skip;
25938
+ this.should_remove = _should_remove;
25939
+ this.replacement = _replacement;
25940
+
25941
+ if (skipped) return node;
25942
+ if (removed) return null;
25943
+ }
25944
+
25945
+ for (const key in node) {
25946
+ const value = node[key];
25947
+
25948
+ if (typeof value !== "object") {
25949
+ continue;
25950
+ } else if (Array.isArray(value)) {
25951
+ for (let i = 0; i < value.length; i += 1) {
25952
+ if (value[i] !== null && typeof value[i].type === 'string') {
25953
+ if (!this.visit(value[i], node, key, i)) {
25954
+ // removed
25955
+ i--;
25956
+ }
25957
+ }
25958
+ }
25959
+ } else if (value !== null && typeof value.type === "string") {
25960
+ this.visit(value, node, key, null);
25961
+ }
25962
+ }
25963
+
25964
+ if (this.leave) {
25965
+ const _replacement = this.replacement;
25966
+ const _should_remove = this.should_remove;
25967
+ this.replacement = null;
25968
+ this.should_remove = false;
25969
+
25970
+ this.leave.call(this.context, node, parent, prop, index);
25971
+
25972
+ if (this.replacement) {
25973
+ node = this.replacement;
25974
+ this.replace(parent, prop, index, node);
25975
+ }
25976
+
25977
+ if (this.should_remove) {
25978
+ this.remove(parent, prop, index);
25979
+ }
25980
+
25981
+ const removed = this.should_remove;
25982
+
25983
+ this.replacement = _replacement;
25984
+ this.should_remove = _should_remove;
25985
+
25986
+ if (removed) return null;
25987
+ }
25988
+ }
25989
+
25990
+ return node;
25991
+ }
25825
25992
  }
25826
- function extractLanguageResources(language) {
25827
- const paths = [];
25828
- if (language.icon != null) {
25829
- paths.push({ path: language.icon.dark, sync: true }, { path: language.icon.light, sync: true });
25830
- }
25831
- if (language.configuration != null) {
25832
- paths.push({ path: language.configuration, sync: true });
25833
- }
25834
- return paths;
25993
+
25994
+ // @ts-check
25995
+
25996
+ /** @typedef { import('estree').BaseNode} BaseNode */
25997
+ /** @typedef { import('./sync.js').SyncHandler} SyncHandler */
25998
+ /** @typedef { import('./async.js').AsyncHandler} AsyncHandler */
25999
+
26000
+ /**
26001
+ *
26002
+ * @param {BaseNode} ast
26003
+ * @param {{
26004
+ * enter?: SyncHandler
26005
+ * leave?: SyncHandler
26006
+ * }} walker
26007
+ * @returns {BaseNode}
26008
+ */
26009
+ function walk(ast, { enter, leave }) {
26010
+ const instance = new SyncWalker(enter, leave);
26011
+ return instance.visit(ast, null);
25835
26012
  }
25836
- function extractSnippetsResources(snippet) {
25837
- return [{ path: snippet.path, sync: false }];
26013
+
26014
+ const comma = ','.charCodeAt(0);
26015
+ const semicolon = ';'.charCodeAt(0);
26016
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
26017
+ const intToChar = new Uint8Array(64); // 64 possible chars.
26018
+ const charToInt = new Uint8Array(128); // z is 122 in ASCII
26019
+ for (let i = 0; i < chars.length; i++) {
26020
+ const c = chars.charCodeAt(i);
26021
+ intToChar[i] = c;
26022
+ charToInt[c] = i;
25838
26023
  }
25839
- async function extractThemeResources(theme, getFileContent) {
25840
- const themeContent = await getFileContent(theme.path);
25841
- const themeDocument = parseJson(theme.path, themeContent.toString('utf8'));
25842
- const paths = [{ path: theme.path, sync: false }];
25843
- if (themeDocument.fonts != null) {
25844
- for (const font of themeDocument.fonts) {
25845
- for (const src of font.src) {
25846
- paths.push({ path: path.join(path.dirname(theme.path), src.path), sync: true });
26024
+ // Provide a fallback for older environments.
26025
+ const td = typeof TextDecoder !== 'undefined'
26026
+ ? /* #__PURE__ */ new TextDecoder()
26027
+ : typeof Buffer !== 'undefined'
26028
+ ? {
26029
+ decode(buf) {
26030
+ const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
26031
+ return out.toString();
26032
+ },
26033
+ }
26034
+ : {
26035
+ decode(buf) {
26036
+ let out = '';
26037
+ for (let i = 0; i < buf.length; i++) {
26038
+ out += String.fromCharCode(buf[i]);
26039
+ }
26040
+ return out;
26041
+ },
26042
+ };
26043
+ function encode(decoded) {
26044
+ const state = new Int32Array(5);
26045
+ const bufLength = 1024 * 16;
26046
+ const subLength = bufLength - 36;
26047
+ const buf = new Uint8Array(bufLength);
26048
+ const sub = buf.subarray(0, subLength);
26049
+ let pos = 0;
26050
+ let out = '';
26051
+ for (let i = 0; i < decoded.length; i++) {
26052
+ const line = decoded[i];
26053
+ if (i > 0) {
26054
+ if (pos === bufLength) {
26055
+ out += td.decode(buf);
26056
+ pos = 0;
25847
26057
  }
26058
+ buf[pos++] = semicolon;
25848
26059
  }
25849
- }
25850
- if (themeDocument.iconDefinitions != null) {
25851
- for (const iconDefinition of Object.values(themeDocument.iconDefinitions)) {
25852
- if (iconDefinition.iconPath != null) {
25853
- paths.push({ path: path.join(path.dirname(theme.path), iconDefinition.iconPath), sync: true });
26060
+ if (line.length === 0)
26061
+ continue;
26062
+ state[0] = 0;
26063
+ for (let j = 0; j < line.length; j++) {
26064
+ const segment = line[j];
26065
+ // We can push up to 5 ints, each int can take at most 7 chars, and we
26066
+ // may push a comma.
26067
+ if (pos > subLength) {
26068
+ out += td.decode(sub);
26069
+ buf.copyWithin(0, subLength, pos);
26070
+ pos -= subLength;
25854
26071
  }
26072
+ if (j > 0)
26073
+ buf[pos++] = comma;
26074
+ pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
26075
+ if (segment.length === 1)
26076
+ continue;
26077
+ pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
26078
+ pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
26079
+ pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
26080
+ if (segment.length === 4)
26081
+ continue;
26082
+ pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
25855
26083
  }
25856
26084
  }
25857
- return paths;
26085
+ return out + td.decode(buf.subarray(0, pos));
25858
26086
  }
25859
- function extractJsonValidationResources(jsonValidation) {
25860
- if (jsonValidation.url.startsWith('./')) {
25861
- return [{
25862
- path: jsonValidation.url,
25863
- sync: true
25864
- }];
25865
- }
25866
- return [];
26087
+ function encodeInteger(buf, pos, state, segment, j) {
26088
+ const next = segment[j];
26089
+ let num = next - state[j];
26090
+ state[j] = next;
26091
+ num = num < 0 ? (-num << 1) | 1 : num << 1;
26092
+ do {
26093
+ let clamped = num & 0b011111;
26094
+ num >>>= 5;
26095
+ if (num > 0)
26096
+ clamped |= 0b100000;
26097
+ buf[pos++] = intToChar[clamped];
26098
+ } while (num > 0);
26099
+ return pos;
26100
+ }
26101
+
26102
+ class BitSet {
26103
+ constructor(arg) {
26104
+ this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
26105
+ }
26106
+
26107
+ add(n) {
26108
+ this.bits[n >> 5] |= 1 << (n & 31);
26109
+ }
26110
+
26111
+ has(n) {
26112
+ return !!(this.bits[n >> 5] & (1 << (n & 31)));
26113
+ }
26114
+ }
26115
+
26116
+ class Chunk {
26117
+ constructor(start, end, content) {
26118
+ this.start = start;
26119
+ this.end = end;
26120
+ this.original = content;
26121
+
26122
+ this.intro = '';
26123
+ this.outro = '';
26124
+
26125
+ this.content = content;
26126
+ this.storeName = false;
26127
+ this.edited = false;
26128
+
26129
+ {
26130
+ this.previous = null;
26131
+ this.next = null;
26132
+ }
26133
+ }
26134
+
26135
+ appendLeft(content) {
26136
+ this.outro += content;
26137
+ }
26138
+
26139
+ appendRight(content) {
26140
+ this.intro = this.intro + content;
26141
+ }
26142
+
26143
+ clone() {
26144
+ const chunk = new Chunk(this.start, this.end, this.original);
26145
+
26146
+ chunk.intro = this.intro;
26147
+ chunk.outro = this.outro;
26148
+ chunk.content = this.content;
26149
+ chunk.storeName = this.storeName;
26150
+ chunk.edited = this.edited;
26151
+
26152
+ return chunk;
26153
+ }
26154
+
26155
+ contains(index) {
26156
+ return this.start < index && index < this.end;
26157
+ }
26158
+
26159
+ eachNext(fn) {
26160
+ let chunk = this;
26161
+ while (chunk) {
26162
+ fn(chunk);
26163
+ chunk = chunk.next;
26164
+ }
26165
+ }
26166
+
26167
+ eachPrevious(fn) {
26168
+ let chunk = this;
26169
+ while (chunk) {
26170
+ fn(chunk);
26171
+ chunk = chunk.previous;
26172
+ }
26173
+ }
26174
+
26175
+ edit(content, storeName, contentOnly) {
26176
+ this.content = content;
26177
+ if (!contentOnly) {
26178
+ this.intro = '';
26179
+ this.outro = '';
26180
+ }
26181
+ this.storeName = storeName;
26182
+
26183
+ this.edited = true;
26184
+
26185
+ return this;
26186
+ }
26187
+
26188
+ prependLeft(content) {
26189
+ this.outro = content + this.outro;
26190
+ }
26191
+
26192
+ prependRight(content) {
26193
+ this.intro = content + this.intro;
26194
+ }
26195
+
26196
+ split(index) {
26197
+ const sliceIndex = index - this.start;
26198
+
26199
+ const originalBefore = this.original.slice(0, sliceIndex);
26200
+ const originalAfter = this.original.slice(sliceIndex);
26201
+
26202
+ this.original = originalBefore;
26203
+
26204
+ const newChunk = new Chunk(index, this.end, originalAfter);
26205
+ newChunk.outro = this.outro;
26206
+ this.outro = '';
26207
+
26208
+ this.end = index;
26209
+
26210
+ if (this.edited) {
26211
+ // TODO is this block necessary?...
26212
+ newChunk.edit('', false);
26213
+ this.content = '';
26214
+ } else {
26215
+ this.content = originalBefore;
26216
+ }
26217
+
26218
+ newChunk.next = this.next;
26219
+ if (newChunk.next) newChunk.next.previous = newChunk;
26220
+ newChunk.previous = this;
26221
+ this.next = newChunk;
26222
+
26223
+ return newChunk;
26224
+ }
26225
+
26226
+ toString() {
26227
+ return this.intro + this.content + this.outro;
26228
+ }
26229
+
26230
+ trimEnd(rx) {
26231
+ this.outro = this.outro.replace(rx, '');
26232
+ if (this.outro.length) return true;
26233
+
26234
+ const trimmed = this.content.replace(rx, '');
26235
+
26236
+ if (trimmed.length) {
26237
+ if (trimmed !== this.content) {
26238
+ this.split(this.start + trimmed.length).edit('', undefined, true);
26239
+ }
26240
+ return true;
26241
+ } else {
26242
+ this.edit('', undefined, true);
26243
+
26244
+ this.intro = this.intro.replace(rx, '');
26245
+ if (this.intro.length) return true;
26246
+ }
26247
+ }
26248
+
26249
+ trimStart(rx) {
26250
+ this.intro = this.intro.replace(rx, '');
26251
+ if (this.intro.length) return true;
26252
+
26253
+ const trimmed = this.content.replace(rx, '');
26254
+
26255
+ if (trimmed.length) {
26256
+ if (trimmed !== this.content) {
26257
+ this.split(this.end - trimmed.length);
26258
+ this.edit('', undefined, true);
26259
+ }
26260
+ return true;
26261
+ } else {
26262
+ this.edit('', undefined, true);
26263
+
26264
+ this.outro = this.outro.replace(rx, '');
26265
+ if (this.outro.length) return true;
26266
+ }
26267
+ }
26268
+ }
26269
+
26270
+ function getBtoa () {
26271
+ if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
26272
+ return (str) => window.btoa(unescape(encodeURIComponent(str)));
26273
+ } else if (typeof Buffer === 'function') {
26274
+ return (str) => Buffer.from(str, 'utf-8').toString('base64');
26275
+ } else {
26276
+ return () => {
26277
+ throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
26278
+ };
26279
+ }
26280
+ }
26281
+
26282
+ const btoa = /*#__PURE__*/ getBtoa();
26283
+
26284
+ class SourceMap {
26285
+ constructor(properties) {
26286
+ this.version = 3;
26287
+ this.file = properties.file;
26288
+ this.sources = properties.sources;
26289
+ this.sourcesContent = properties.sourcesContent;
26290
+ this.names = properties.names;
26291
+ this.mappings = encode(properties.mappings);
26292
+ }
26293
+
26294
+ toString() {
26295
+ return JSON.stringify(this);
26296
+ }
26297
+
26298
+ toUrl() {
26299
+ return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());
26300
+ }
26301
+ }
26302
+
26303
+ function guessIndent(code) {
26304
+ const lines = code.split('\n');
26305
+
26306
+ const tabbed = lines.filter((line) => /^\t+/.test(line));
26307
+ const spaced = lines.filter((line) => /^ {2,}/.test(line));
26308
+
26309
+ if (tabbed.length === 0 && spaced.length === 0) {
26310
+ return null;
26311
+ }
26312
+
26313
+ // More lines tabbed than spaced? Assume tabs, and
26314
+ // default to tabs in the case of a tie (or nothing
26315
+ // to go on)
26316
+ if (tabbed.length >= spaced.length) {
26317
+ return '\t';
26318
+ }
26319
+
26320
+ // Otherwise, we need to guess the multiple
26321
+ const min = spaced.reduce((previous, current) => {
26322
+ const numSpaces = /^ +/.exec(current)[0].length;
26323
+ return Math.min(numSpaces, previous);
26324
+ }, Infinity);
26325
+
26326
+ return new Array(min + 1).join(' ');
26327
+ }
26328
+
26329
+ function getRelativePath(from, to) {
26330
+ const fromParts = from.split(/[/\\]/);
26331
+ const toParts = to.split(/[/\\]/);
26332
+
26333
+ fromParts.pop(); // get dirname
26334
+
26335
+ while (fromParts[0] === toParts[0]) {
26336
+ fromParts.shift();
26337
+ toParts.shift();
26338
+ }
26339
+
26340
+ if (fromParts.length) {
26341
+ let i = fromParts.length;
26342
+ while (i--) fromParts[i] = '..';
26343
+ }
26344
+
26345
+ return fromParts.concat(toParts).join('/');
26346
+ }
26347
+
26348
+ const toString = Object.prototype.toString;
26349
+
26350
+ function isObject(thing) {
26351
+ return toString.call(thing) === '[object Object]';
26352
+ }
26353
+
26354
+ function getLocator(source) {
26355
+ const originalLines = source.split('\n');
26356
+ const lineOffsets = [];
26357
+
26358
+ for (let i = 0, pos = 0; i < originalLines.length; i++) {
26359
+ lineOffsets.push(pos);
26360
+ pos += originalLines[i].length + 1;
26361
+ }
26362
+
26363
+ return function locate(index) {
26364
+ let i = 0;
26365
+ let j = lineOffsets.length;
26366
+ while (i < j) {
26367
+ const m = (i + j) >> 1;
26368
+ if (index < lineOffsets[m]) {
26369
+ j = m;
26370
+ } else {
26371
+ i = m + 1;
26372
+ }
26373
+ }
26374
+ const line = i - 1;
26375
+ const column = index - lineOffsets[line];
26376
+ return { line, column };
26377
+ };
26378
+ }
26379
+
26380
+ class Mappings {
26381
+ constructor(hires) {
26382
+ this.hires = hires;
26383
+ this.generatedCodeLine = 0;
26384
+ this.generatedCodeColumn = 0;
26385
+ this.raw = [];
26386
+ this.rawSegments = this.raw[this.generatedCodeLine] = [];
26387
+ this.pending = null;
26388
+ }
26389
+
26390
+ addEdit(sourceIndex, content, loc, nameIndex) {
26391
+ if (content.length) {
26392
+ const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
26393
+ if (nameIndex >= 0) {
26394
+ segment.push(nameIndex);
26395
+ }
26396
+ this.rawSegments.push(segment);
26397
+ } else if (this.pending) {
26398
+ this.rawSegments.push(this.pending);
26399
+ }
26400
+
26401
+ this.advance(content);
26402
+ this.pending = null;
26403
+ }
26404
+
26405
+ addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
26406
+ let originalCharIndex = chunk.start;
26407
+ let first = true;
26408
+
26409
+ while (originalCharIndex < chunk.end) {
26410
+ if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
26411
+ this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
26412
+ }
26413
+
26414
+ if (original[originalCharIndex] === '\n') {
26415
+ loc.line += 1;
26416
+ loc.column = 0;
26417
+ this.generatedCodeLine += 1;
26418
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
26419
+ this.generatedCodeColumn = 0;
26420
+ first = true;
26421
+ } else {
26422
+ loc.column += 1;
26423
+ this.generatedCodeColumn += 1;
26424
+ first = false;
26425
+ }
26426
+
26427
+ originalCharIndex += 1;
26428
+ }
26429
+
26430
+ this.pending = null;
26431
+ }
26432
+
26433
+ advance(str) {
26434
+ if (!str) return;
26435
+
26436
+ const lines = str.split('\n');
26437
+
26438
+ if (lines.length > 1) {
26439
+ for (let i = 0; i < lines.length - 1; i++) {
26440
+ this.generatedCodeLine++;
26441
+ this.raw[this.generatedCodeLine] = this.rawSegments = [];
26442
+ }
26443
+ this.generatedCodeColumn = 0;
26444
+ }
26445
+
26446
+ this.generatedCodeColumn += lines[lines.length - 1].length;
26447
+ }
26448
+ }
26449
+
26450
+ const n = '\n';
26451
+
26452
+ const warned = {
26453
+ insertLeft: false,
26454
+ insertRight: false,
26455
+ storeName: false,
26456
+ };
26457
+
26458
+ class MagicString {
26459
+ constructor(string, options = {}) {
26460
+ const chunk = new Chunk(0, string.length, string);
26461
+
26462
+ Object.defineProperties(this, {
26463
+ original: { writable: true, value: string },
26464
+ outro: { writable: true, value: '' },
26465
+ intro: { writable: true, value: '' },
26466
+ firstChunk: { writable: true, value: chunk },
26467
+ lastChunk: { writable: true, value: chunk },
26468
+ lastSearchedChunk: { writable: true, value: chunk },
26469
+ byStart: { writable: true, value: {} },
26470
+ byEnd: { writable: true, value: {} },
26471
+ filename: { writable: true, value: options.filename },
26472
+ indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
26473
+ sourcemapLocations: { writable: true, value: new BitSet() },
26474
+ storedNames: { writable: true, value: {} },
26475
+ indentStr: { writable: true, value: undefined },
26476
+ });
26477
+
26478
+ this.byStart[0] = chunk;
26479
+ this.byEnd[string.length] = chunk;
26480
+ }
26481
+
26482
+ addSourcemapLocation(char) {
26483
+ this.sourcemapLocations.add(char);
26484
+ }
26485
+
26486
+ append(content) {
26487
+ if (typeof content !== 'string') throw new TypeError('outro content must be a string');
26488
+
26489
+ this.outro += content;
26490
+ return this;
26491
+ }
26492
+
26493
+ appendLeft(index, content) {
26494
+ if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
26495
+
26496
+ this._split(index);
26497
+
26498
+ const chunk = this.byEnd[index];
26499
+
26500
+ if (chunk) {
26501
+ chunk.appendLeft(content);
26502
+ } else {
26503
+ this.intro += content;
26504
+ }
26505
+ return this;
26506
+ }
26507
+
26508
+ appendRight(index, content) {
26509
+ if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
26510
+
26511
+ this._split(index);
26512
+
26513
+ const chunk = this.byStart[index];
26514
+
26515
+ if (chunk) {
26516
+ chunk.appendRight(content);
26517
+ } else {
26518
+ this.outro += content;
26519
+ }
26520
+ return this;
26521
+ }
26522
+
26523
+ clone() {
26524
+ const cloned = new MagicString(this.original, { filename: this.filename });
26525
+
26526
+ let originalChunk = this.firstChunk;
26527
+ let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
26528
+
26529
+ while (originalChunk) {
26530
+ cloned.byStart[clonedChunk.start] = clonedChunk;
26531
+ cloned.byEnd[clonedChunk.end] = clonedChunk;
26532
+
26533
+ const nextOriginalChunk = originalChunk.next;
26534
+ const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
26535
+
26536
+ if (nextClonedChunk) {
26537
+ clonedChunk.next = nextClonedChunk;
26538
+ nextClonedChunk.previous = clonedChunk;
26539
+
26540
+ clonedChunk = nextClonedChunk;
26541
+ }
26542
+
26543
+ originalChunk = nextOriginalChunk;
26544
+ }
26545
+
26546
+ cloned.lastChunk = clonedChunk;
26547
+
26548
+ if (this.indentExclusionRanges) {
26549
+ cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
26550
+ }
26551
+
26552
+ cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
26553
+
26554
+ cloned.intro = this.intro;
26555
+ cloned.outro = this.outro;
26556
+
26557
+ return cloned;
26558
+ }
26559
+
26560
+ generateDecodedMap(options) {
26561
+ options = options || {};
26562
+
26563
+ const sourceIndex = 0;
26564
+ const names = Object.keys(this.storedNames);
26565
+ const mappings = new Mappings(options.hires);
26566
+
26567
+ const locate = getLocator(this.original);
26568
+
26569
+ if (this.intro) {
26570
+ mappings.advance(this.intro);
26571
+ }
26572
+
26573
+ this.firstChunk.eachNext((chunk) => {
26574
+ const loc = locate(chunk.start);
26575
+
26576
+ if (chunk.intro.length) mappings.advance(chunk.intro);
26577
+
26578
+ if (chunk.edited) {
26579
+ mappings.addEdit(
26580
+ sourceIndex,
26581
+ chunk.content,
26582
+ loc,
26583
+ chunk.storeName ? names.indexOf(chunk.original) : -1
26584
+ );
26585
+ } else {
26586
+ mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
26587
+ }
26588
+
26589
+ if (chunk.outro.length) mappings.advance(chunk.outro);
26590
+ });
26591
+
26592
+ return {
26593
+ file: options.file ? options.file.split(/[/\\]/).pop() : null,
26594
+ sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
26595
+ sourcesContent: options.includeContent ? [this.original] : [null],
26596
+ names,
26597
+ mappings: mappings.raw,
26598
+ };
26599
+ }
26600
+
26601
+ generateMap(options) {
26602
+ return new SourceMap(this.generateDecodedMap(options));
26603
+ }
26604
+
26605
+ _ensureindentStr() {
26606
+ if (this.indentStr === undefined) {
26607
+ this.indentStr = guessIndent(this.original);
26608
+ }
26609
+ }
26610
+
26611
+ _getRawIndentString() {
26612
+ this._ensureindentStr();
26613
+ return this.indentStr;
26614
+ }
26615
+
26616
+ getIndentString() {
26617
+ this._ensureindentStr();
26618
+ return this.indentStr === null ? '\t' : this.indentStr;
26619
+ }
26620
+
26621
+ indent(indentStr, options) {
26622
+ const pattern = /^[^\r\n]/gm;
26623
+
26624
+ if (isObject(indentStr)) {
26625
+ options = indentStr;
26626
+ indentStr = undefined;
26627
+ }
26628
+
26629
+ if (indentStr === undefined) {
26630
+ this._ensureindentStr();
26631
+ indentStr = this.indentStr || '\t';
26632
+ }
26633
+
26634
+ if (indentStr === '') return this; // noop
26635
+
26636
+ options = options || {};
26637
+
26638
+ // Process exclusion ranges
26639
+ const isExcluded = {};
26640
+
26641
+ if (options.exclude) {
26642
+ const exclusions =
26643
+ typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
26644
+ exclusions.forEach((exclusion) => {
26645
+ for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
26646
+ isExcluded[i] = true;
26647
+ }
26648
+ });
26649
+ }
26650
+
26651
+ let shouldIndentNextCharacter = options.indentStart !== false;
26652
+ const replacer = (match) => {
26653
+ if (shouldIndentNextCharacter) return `${indentStr}${match}`;
26654
+ shouldIndentNextCharacter = true;
26655
+ return match;
26656
+ };
26657
+
26658
+ this.intro = this.intro.replace(pattern, replacer);
26659
+
26660
+ let charIndex = 0;
26661
+ let chunk = this.firstChunk;
26662
+
26663
+ while (chunk) {
26664
+ const end = chunk.end;
26665
+
26666
+ if (chunk.edited) {
26667
+ if (!isExcluded[charIndex]) {
26668
+ chunk.content = chunk.content.replace(pattern, replacer);
26669
+
26670
+ if (chunk.content.length) {
26671
+ shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
26672
+ }
26673
+ }
26674
+ } else {
26675
+ charIndex = chunk.start;
26676
+
26677
+ while (charIndex < end) {
26678
+ if (!isExcluded[charIndex]) {
26679
+ const char = this.original[charIndex];
26680
+
26681
+ if (char === '\n') {
26682
+ shouldIndentNextCharacter = true;
26683
+ } else if (char !== '\r' && shouldIndentNextCharacter) {
26684
+ shouldIndentNextCharacter = false;
26685
+
26686
+ if (charIndex === chunk.start) {
26687
+ chunk.prependRight(indentStr);
26688
+ } else {
26689
+ this._splitChunk(chunk, charIndex);
26690
+ chunk = chunk.next;
26691
+ chunk.prependRight(indentStr);
26692
+ }
26693
+ }
26694
+ }
26695
+
26696
+ charIndex += 1;
26697
+ }
26698
+ }
26699
+
26700
+ charIndex = chunk.end;
26701
+ chunk = chunk.next;
26702
+ }
26703
+
26704
+ this.outro = this.outro.replace(pattern, replacer);
26705
+
26706
+ return this;
26707
+ }
26708
+
26709
+ insert() {
26710
+ throw new Error(
26711
+ 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'
26712
+ );
26713
+ }
26714
+
26715
+ insertLeft(index, content) {
26716
+ if (!warned.insertLeft) {
26717
+ console.warn(
26718
+ 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'
26719
+ ); // eslint-disable-line no-console
26720
+ warned.insertLeft = true;
26721
+ }
26722
+
26723
+ return this.appendLeft(index, content);
26724
+ }
26725
+
26726
+ insertRight(index, content) {
26727
+ if (!warned.insertRight) {
26728
+ console.warn(
26729
+ 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'
26730
+ ); // eslint-disable-line no-console
26731
+ warned.insertRight = true;
26732
+ }
26733
+
26734
+ return this.prependRight(index, content);
26735
+ }
26736
+
26737
+ move(start, end, index) {
26738
+ if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');
26739
+
26740
+ this._split(start);
26741
+ this._split(end);
26742
+ this._split(index);
26743
+
26744
+ const first = this.byStart[start];
26745
+ const last = this.byEnd[end];
26746
+
26747
+ const oldLeft = first.previous;
26748
+ const oldRight = last.next;
26749
+
26750
+ const newRight = this.byStart[index];
26751
+ if (!newRight && last === this.lastChunk) return this;
26752
+ const newLeft = newRight ? newRight.previous : this.lastChunk;
26753
+
26754
+ if (oldLeft) oldLeft.next = oldRight;
26755
+ if (oldRight) oldRight.previous = oldLeft;
26756
+
26757
+ if (newLeft) newLeft.next = first;
26758
+ if (newRight) newRight.previous = last;
26759
+
26760
+ if (!first.previous) this.firstChunk = last.next;
26761
+ if (!last.next) {
26762
+ this.lastChunk = first.previous;
26763
+ this.lastChunk.next = null;
26764
+ }
26765
+
26766
+ first.previous = newLeft;
26767
+ last.next = newRight || null;
26768
+
26769
+ if (!newLeft) this.firstChunk = first;
26770
+ if (!newRight) this.lastChunk = last;
26771
+ return this;
26772
+ }
26773
+
26774
+ overwrite(start, end, content, options) {
26775
+ options = options || {};
26776
+ return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
26777
+ }
26778
+
26779
+ update(start, end, content, options) {
26780
+ if (typeof content !== 'string') throw new TypeError('replacement content must be a string');
26781
+
26782
+ while (start < 0) start += this.original.length;
26783
+ while (end < 0) end += this.original.length;
26784
+
26785
+ if (end > this.original.length) throw new Error('end is out of bounds');
26786
+ if (start === end)
26787
+ throw new Error(
26788
+ 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'
26789
+ );
26790
+
26791
+ this._split(start);
26792
+ this._split(end);
26793
+
26794
+ if (options === true) {
26795
+ if (!warned.storeName) {
26796
+ console.warn(
26797
+ 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'
26798
+ ); // eslint-disable-line no-console
26799
+ warned.storeName = true;
26800
+ }
26801
+
26802
+ options = { storeName: true };
26803
+ }
26804
+ const storeName = options !== undefined ? options.storeName : false;
26805
+ const overwrite = options !== undefined ? options.overwrite : false;
26806
+
26807
+ if (storeName) {
26808
+ const original = this.original.slice(start, end);
26809
+ Object.defineProperty(this.storedNames, original, {
26810
+ writable: true,
26811
+ value: true,
26812
+ enumerable: true,
26813
+ });
26814
+ }
26815
+
26816
+ const first = this.byStart[start];
26817
+ const last = this.byEnd[end];
26818
+
26819
+ if (first) {
26820
+ let chunk = first;
26821
+ while (chunk !== last) {
26822
+ if (chunk.next !== this.byStart[chunk.end]) {
26823
+ throw new Error('Cannot overwrite across a split point');
26824
+ }
26825
+ chunk = chunk.next;
26826
+ chunk.edit('', false);
26827
+ }
26828
+
26829
+ first.edit(content, storeName, !overwrite);
26830
+ } else {
26831
+ // must be inserting at the end
26832
+ const newChunk = new Chunk(start, end, '').edit(content, storeName);
26833
+
26834
+ // TODO last chunk in the array may not be the last chunk, if it's moved...
26835
+ last.next = newChunk;
26836
+ newChunk.previous = last;
26837
+ }
26838
+ return this;
26839
+ }
26840
+
26841
+ prepend(content) {
26842
+ if (typeof content !== 'string') throw new TypeError('outro content must be a string');
26843
+
26844
+ this.intro = content + this.intro;
26845
+ return this;
26846
+ }
26847
+
26848
+ prependLeft(index, content) {
26849
+ if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
26850
+
26851
+ this._split(index);
26852
+
26853
+ const chunk = this.byEnd[index];
26854
+
26855
+ if (chunk) {
26856
+ chunk.prependLeft(content);
26857
+ } else {
26858
+ this.intro = content + this.intro;
26859
+ }
26860
+ return this;
26861
+ }
26862
+
26863
+ prependRight(index, content) {
26864
+ if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
26865
+
26866
+ this._split(index);
26867
+
26868
+ const chunk = this.byStart[index];
26869
+
26870
+ if (chunk) {
26871
+ chunk.prependRight(content);
26872
+ } else {
26873
+ this.outro = content + this.outro;
26874
+ }
26875
+ return this;
26876
+ }
26877
+
26878
+ remove(start, end) {
26879
+ while (start < 0) start += this.original.length;
26880
+ while (end < 0) end += this.original.length;
26881
+
26882
+ if (start === end) return this;
26883
+
26884
+ if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
26885
+ if (start > end) throw new Error('end must be greater than start');
26886
+
26887
+ this._split(start);
26888
+ this._split(end);
26889
+
26890
+ let chunk = this.byStart[start];
26891
+
26892
+ while (chunk) {
26893
+ chunk.intro = '';
26894
+ chunk.outro = '';
26895
+ chunk.edit('');
26896
+
26897
+ chunk = end > chunk.end ? this.byStart[chunk.end] : null;
26898
+ }
26899
+ return this;
26900
+ }
26901
+
26902
+ lastChar() {
26903
+ if (this.outro.length) return this.outro[this.outro.length - 1];
26904
+ let chunk = this.lastChunk;
26905
+ do {
26906
+ if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
26907
+ if (chunk.content.length) return chunk.content[chunk.content.length - 1];
26908
+ if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
26909
+ } while ((chunk = chunk.previous));
26910
+ if (this.intro.length) return this.intro[this.intro.length - 1];
26911
+ return '';
26912
+ }
26913
+
26914
+ lastLine() {
26915
+ let lineIndex = this.outro.lastIndexOf(n);
26916
+ if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
26917
+ let lineStr = this.outro;
26918
+ let chunk = this.lastChunk;
26919
+ do {
26920
+ if (chunk.outro.length > 0) {
26921
+ lineIndex = chunk.outro.lastIndexOf(n);
26922
+ if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
26923
+ lineStr = chunk.outro + lineStr;
26924
+ }
26925
+
26926
+ if (chunk.content.length > 0) {
26927
+ lineIndex = chunk.content.lastIndexOf(n);
26928
+ if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
26929
+ lineStr = chunk.content + lineStr;
26930
+ }
26931
+
26932
+ if (chunk.intro.length > 0) {
26933
+ lineIndex = chunk.intro.lastIndexOf(n);
26934
+ if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
26935
+ lineStr = chunk.intro + lineStr;
26936
+ }
26937
+ } while ((chunk = chunk.previous));
26938
+ lineIndex = this.intro.lastIndexOf(n);
26939
+ if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
26940
+ return this.intro + lineStr;
26941
+ }
26942
+
26943
+ slice(start = 0, end = this.original.length) {
26944
+ while (start < 0) start += this.original.length;
26945
+ while (end < 0) end += this.original.length;
26946
+
26947
+ let result = '';
26948
+
26949
+ // find start chunk
26950
+ let chunk = this.firstChunk;
26951
+ while (chunk && (chunk.start > start || chunk.end <= start)) {
26952
+ // found end chunk before start
26953
+ if (chunk.start < end && chunk.end >= end) {
26954
+ return result;
26955
+ }
26956
+
26957
+ chunk = chunk.next;
26958
+ }
26959
+
26960
+ if (chunk && chunk.edited && chunk.start !== start)
26961
+ throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
26962
+
26963
+ const startChunk = chunk;
26964
+ while (chunk) {
26965
+ if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
26966
+ result += chunk.intro;
26967
+ }
26968
+
26969
+ const containsEnd = chunk.start < end && chunk.end >= end;
26970
+ if (containsEnd && chunk.edited && chunk.end !== end)
26971
+ throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
26972
+
26973
+ const sliceStart = startChunk === chunk ? start - chunk.start : 0;
26974
+ const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
26975
+
26976
+ result += chunk.content.slice(sliceStart, sliceEnd);
26977
+
26978
+ if (chunk.outro && (!containsEnd || chunk.end === end)) {
26979
+ result += chunk.outro;
26980
+ }
26981
+
26982
+ if (containsEnd) {
26983
+ break;
26984
+ }
26985
+
26986
+ chunk = chunk.next;
26987
+ }
26988
+
26989
+ return result;
26990
+ }
26991
+
26992
+ // TODO deprecate this? not really very useful
26993
+ snip(start, end) {
26994
+ const clone = this.clone();
26995
+ clone.remove(0, start);
26996
+ clone.remove(end, clone.original.length);
26997
+
26998
+ return clone;
26999
+ }
27000
+
27001
+ _split(index) {
27002
+ if (this.byStart[index] || this.byEnd[index]) return;
27003
+
27004
+ let chunk = this.lastSearchedChunk;
27005
+ const searchForward = index > chunk.end;
27006
+
27007
+ while (chunk) {
27008
+ if (chunk.contains(index)) return this._splitChunk(chunk, index);
27009
+
27010
+ chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
27011
+ }
27012
+ }
27013
+
27014
+ _splitChunk(chunk, index) {
27015
+ if (chunk.edited && chunk.content.length) {
27016
+ // zero-length edited chunks are a special case (overlapping replacements)
27017
+ const loc = getLocator(this.original)(index);
27018
+ throw new Error(
27019
+ `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
27020
+ );
27021
+ }
27022
+
27023
+ const newChunk = chunk.split(index);
27024
+
27025
+ this.byEnd[index] = chunk;
27026
+ this.byStart[index] = newChunk;
27027
+ this.byEnd[newChunk.end] = newChunk;
27028
+
27029
+ if (chunk === this.lastChunk) this.lastChunk = newChunk;
27030
+
27031
+ this.lastSearchedChunk = chunk;
27032
+ return true;
27033
+ }
27034
+
27035
+ toString() {
27036
+ let str = this.intro;
27037
+
27038
+ let chunk = this.firstChunk;
27039
+ while (chunk) {
27040
+ str += chunk.toString();
27041
+ chunk = chunk.next;
27042
+ }
27043
+
27044
+ return str + this.outro;
27045
+ }
27046
+
27047
+ isEmpty() {
27048
+ let chunk = this.firstChunk;
27049
+ do {
27050
+ if (
27051
+ (chunk.intro.length && chunk.intro.trim()) ||
27052
+ (chunk.content.length && chunk.content.trim()) ||
27053
+ (chunk.outro.length && chunk.outro.trim())
27054
+ )
27055
+ return false;
27056
+ } while ((chunk = chunk.next));
27057
+ return true;
27058
+ }
27059
+
27060
+ length() {
27061
+ let chunk = this.firstChunk;
27062
+ let length = 0;
27063
+ do {
27064
+ length += chunk.intro.length + chunk.content.length + chunk.outro.length;
27065
+ } while ((chunk = chunk.next));
27066
+ return length;
27067
+ }
27068
+
27069
+ trimLines() {
27070
+ return this.trim('[\\r\\n]');
27071
+ }
27072
+
27073
+ trim(charType) {
27074
+ return this.trimStart(charType).trimEnd(charType);
27075
+ }
27076
+
27077
+ trimEndAborted(charType) {
27078
+ const rx = new RegExp((charType || '\\s') + '+$');
27079
+
27080
+ this.outro = this.outro.replace(rx, '');
27081
+ if (this.outro.length) return true;
27082
+
27083
+ let chunk = this.lastChunk;
27084
+
27085
+ do {
27086
+ const end = chunk.end;
27087
+ const aborted = chunk.trimEnd(rx);
27088
+
27089
+ // if chunk was trimmed, we have a new lastChunk
27090
+ if (chunk.end !== end) {
27091
+ if (this.lastChunk === chunk) {
27092
+ this.lastChunk = chunk.next;
27093
+ }
27094
+
27095
+ this.byEnd[chunk.end] = chunk;
27096
+ this.byStart[chunk.next.start] = chunk.next;
27097
+ this.byEnd[chunk.next.end] = chunk.next;
27098
+ }
27099
+
27100
+ if (aborted) return true;
27101
+ chunk = chunk.previous;
27102
+ } while (chunk);
27103
+
27104
+ return false;
27105
+ }
27106
+
27107
+ trimEnd(charType) {
27108
+ this.trimEndAborted(charType);
27109
+ return this;
27110
+ }
27111
+ trimStartAborted(charType) {
27112
+ const rx = new RegExp('^' + (charType || '\\s') + '+');
27113
+
27114
+ this.intro = this.intro.replace(rx, '');
27115
+ if (this.intro.length) return true;
27116
+
27117
+ let chunk = this.firstChunk;
27118
+
27119
+ do {
27120
+ const end = chunk.end;
27121
+ const aborted = chunk.trimStart(rx);
27122
+
27123
+ if (chunk.end !== end) {
27124
+ // special case...
27125
+ if (chunk === this.lastChunk) this.lastChunk = chunk.next;
27126
+
27127
+ this.byEnd[chunk.end] = chunk;
27128
+ this.byStart[chunk.next.start] = chunk.next;
27129
+ this.byEnd[chunk.next.end] = chunk.next;
27130
+ }
27131
+
27132
+ if (aborted) return true;
27133
+ chunk = chunk.next;
27134
+ } while (chunk);
27135
+
27136
+ return false;
27137
+ }
27138
+
27139
+ trimStart(charType) {
27140
+ this.trimStartAborted(charType);
27141
+ return this;
27142
+ }
27143
+
27144
+ hasChanged() {
27145
+ return this.original !== this.toString();
27146
+ }
27147
+
27148
+ _replaceRegexp(searchValue, replacement) {
27149
+ function getReplacement(match, str) {
27150
+ if (typeof replacement === 'string') {
27151
+ return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
27152
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter
27153
+ if (i === '$') return '$';
27154
+ if (i === '&') return match[0];
27155
+ const num = +i;
27156
+ if (num < match.length) return match[+i];
27157
+ return `$${i}`;
27158
+ });
27159
+ } else {
27160
+ return replacement(...match, match.index, str, match.groups);
27161
+ }
27162
+ }
27163
+ function matchAll(re, str) {
27164
+ let match;
27165
+ const matches = [];
27166
+ while ((match = re.exec(str))) {
27167
+ matches.push(match);
27168
+ }
27169
+ return matches;
27170
+ }
27171
+ if (searchValue.global) {
27172
+ const matches = matchAll(searchValue, this.original);
27173
+ matches.forEach((match) => {
27174
+ if (match.index != null)
27175
+ this.overwrite(
27176
+ match.index,
27177
+ match.index + match[0].length,
27178
+ getReplacement(match, this.original)
27179
+ );
27180
+ });
27181
+ } else {
27182
+ const match = this.original.match(searchValue);
27183
+ if (match && match.index != null)
27184
+ this.overwrite(
27185
+ match.index,
27186
+ match.index + match[0].length,
27187
+ getReplacement(match, this.original)
27188
+ );
27189
+ }
27190
+ return this;
27191
+ }
27192
+
27193
+ _replaceString(string, replacement) {
27194
+ const { original } = this;
27195
+ const index = original.indexOf(string);
27196
+
27197
+ if (index !== -1) {
27198
+ this.overwrite(index, index + string.length, replacement);
27199
+ }
27200
+
27201
+ return this;
27202
+ }
27203
+
27204
+ replace(searchValue, replacement) {
27205
+ if (typeof searchValue === 'string') {
27206
+ return this._replaceString(searchValue, replacement);
27207
+ }
27208
+
27209
+ return this._replaceRegexp(searchValue, replacement);
27210
+ }
27211
+
27212
+ _replaceAllString(string, replacement) {
27213
+ const { original } = this;
27214
+ const stringLength = string.length;
27215
+ for (
27216
+ let index = original.indexOf(string);
27217
+ index !== -1;
27218
+ index = original.indexOf(string, index + stringLength)
27219
+ ) {
27220
+ this.overwrite(index, index + stringLength, replacement);
27221
+ }
27222
+
27223
+ return this;
27224
+ }
27225
+
27226
+ replaceAll(searchValue, replacement) {
27227
+ if (typeof searchValue === 'string') {
27228
+ return this._replaceAllString(searchValue, replacement);
27229
+ }
27230
+
27231
+ if (!searchValue.global) {
27232
+ throw new TypeError(
27233
+ 'MagicString.prototype.replaceAll called with a non-global RegExp argument'
27234
+ );
27235
+ }
27236
+
27237
+ return this._replaceRegexp(searchValue, replacement);
27238
+ }
27239
+ }
27240
+
27241
+ var escape = function (str) { return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); };
27242
+
27243
+ var isReference = function (node, parent) {
27244
+ if (node.type === 'MemberExpression') {
27245
+ return !node.computed && isReference(node.object, node);
27246
+ }
27247
+
27248
+ if (node.type === 'Identifier') {
27249
+ // TODO is this right?
27250
+ if (parent.type === 'MemberExpression') { return parent.computed || node === parent.object; }
27251
+
27252
+ // disregard the `bar` in { bar: foo }
27253
+ if (parent.type === 'Property' && node !== parent.value) { return false; }
27254
+
27255
+ // disregard the `bar` in `class Foo { bar () {...} }`
27256
+ if (parent.type === 'MethodDefinition') { return false; }
27257
+
27258
+ // disregard the `bar` in `export { foo as bar }`
27259
+ if (parent.type === 'ExportSpecifier' && node !== parent.local) { return false; }
27260
+
27261
+ // disregard the `bar` in `import { bar as foo }`
27262
+ if (parent.type === 'ImportSpecifier' && node === parent.imported) {
27263
+ return false;
27264
+ }
27265
+
27266
+ return true;
27267
+ }
27268
+
27269
+ return false;
27270
+ };
27271
+
27272
+ var flatten = function (startNode) {
27273
+ var parts = [];
27274
+ var node = startNode;
27275
+
27276
+ while (node.type === 'MemberExpression') {
27277
+ parts.unshift(node.property.name);
27278
+ node = node.object;
27279
+ }
27280
+
27281
+ var name = node.name;
27282
+ parts.unshift(name);
27283
+
27284
+ return { name: name, keypath: parts.join('.') };
27285
+ };
27286
+
27287
+ function inject(options) {
27288
+ if (!options) { throw new Error('Missing options'); }
27289
+
27290
+ var filter = createFilter(options.include, options.exclude);
27291
+
27292
+ var modules = options.modules;
27293
+
27294
+ if (!modules) {
27295
+ modules = Object.assign({}, options);
27296
+ delete modules.include;
27297
+ delete modules.exclude;
27298
+ delete modules.sourceMap;
27299
+ delete modules.sourcemap;
27300
+ }
27301
+
27302
+ var modulesMap = new Map(Object.entries(modules));
27303
+
27304
+ // Fix paths on Windows
27305
+ if (sep !== '/') {
27306
+ modulesMap.forEach(function (mod, key) {
27307
+ modulesMap.set(
27308
+ key,
27309
+ Array.isArray(mod) ? [mod[0].split(sep).join('/'), mod[1]] : mod.split(sep).join('/')
27310
+ );
27311
+ });
27312
+ }
27313
+
27314
+ var firstpass = new RegExp(("(?:" + (Array.from(modulesMap.keys()).map(escape).join('|')) + ")"), 'g');
27315
+ var sourceMap = options.sourceMap !== false && options.sourcemap !== false;
27316
+
27317
+ return {
27318
+ name: 'inject',
27319
+
27320
+ transform: function transform(code, id) {
27321
+ if (!filter(id)) { return null; }
27322
+ if (code.search(firstpass) === -1) { return null; }
27323
+
27324
+ if (sep !== '/') { id = id.split(sep).join('/'); } // eslint-disable-line no-param-reassign
27325
+
27326
+ var ast = null;
27327
+ try {
27328
+ ast = this.parse(code);
27329
+ } catch (err) {
27330
+ this.warn({
27331
+ code: 'PARSE_ERROR',
27332
+ message: ("rollup-plugin-inject: failed to parse " + id + ". Consider restricting the plugin to particular files via options.include")
27333
+ });
27334
+ }
27335
+ if (!ast) {
27336
+ return null;
27337
+ }
27338
+
27339
+ var imports = new Set();
27340
+ ast.body.forEach(function (node) {
27341
+ if (node.type === 'ImportDeclaration') {
27342
+ node.specifiers.forEach(function (specifier) {
27343
+ imports.add(specifier.local.name);
27344
+ });
27345
+ }
27346
+ });
27347
+
27348
+ // analyse scopes
27349
+ var scope = attachScopes(ast, 'scope');
27350
+
27351
+ var magicString = new MagicString(code);
27352
+
27353
+ var newImports = new Map();
27354
+
27355
+ function handleReference(node, name, keypath) {
27356
+ var mod = modulesMap.get(keypath);
27357
+ if (mod && !imports.has(name) && !scope.contains(name)) {
27358
+ if (typeof mod === 'string') { mod = [mod, 'default']; }
27359
+
27360
+ // prevent module from importing itself
27361
+ if (mod[0] === id) { return false; }
27362
+
27363
+ var hash = keypath + ":" + (mod[0]) + ":" + (mod[1]);
27364
+
27365
+ var importLocalName =
27366
+ name === keypath ? name : makeLegalIdentifier(("$inject_" + keypath));
27367
+
27368
+ if (!newImports.has(hash)) {
27369
+ // escape apostrophes and backslashes for use in single-quoted string literal
27370
+ var modName = mod[0].replace(/[''\\]/g, '\\$&');
27371
+ if (mod[1] === '*') {
27372
+ newImports.set(hash, ("import * as " + importLocalName + " from '" + modName + "';"));
27373
+ } else {
27374
+ newImports.set(hash, ("import { " + (mod[1]) + " as " + importLocalName + " } from '" + modName + "';"));
27375
+ }
27376
+ }
27377
+
27378
+ if (name !== keypath) {
27379
+ magicString.overwrite(node.start, node.end, importLocalName, {
27380
+ storeName: true
27381
+ });
27382
+ }
27383
+
27384
+ return true;
27385
+ }
27386
+
27387
+ return false;
27388
+ }
27389
+
27390
+ walk(ast, {
27391
+ enter: function enter(node, parent) {
27392
+ if (sourceMap) {
27393
+ magicString.addSourcemapLocation(node.start);
27394
+ magicString.addSourcemapLocation(node.end);
27395
+ }
27396
+
27397
+ if (node.scope) {
27398
+ scope = node.scope; // eslint-disable-line prefer-destructuring
27399
+ }
27400
+
27401
+ // special case – shorthand properties. because node.key === node.value,
27402
+ // we can't differentiate once we've descended into the node
27403
+ if (node.type === 'Property' && node.shorthand && node.value.type === 'Identifier') {
27404
+ var ref = node.key;
27405
+ var name = ref.name;
27406
+ handleReference(node, name, name);
27407
+ this.skip();
27408
+ return;
27409
+ }
27410
+
27411
+ if (isReference(node, parent)) {
27412
+ var ref$1 = flatten(node);
27413
+ var name$1 = ref$1.name;
27414
+ var keypath = ref$1.keypath;
27415
+ var handled = handleReference(node, name$1, keypath);
27416
+ if (handled) {
27417
+ this.skip();
27418
+ }
27419
+ }
27420
+ },
27421
+ leave: function leave(node) {
27422
+ if (node.scope) {
27423
+ scope = scope.parent;
27424
+ }
27425
+ }
27426
+ });
27427
+
27428
+ if (newImports.size === 0) {
27429
+ return {
27430
+ code: code,
27431
+ ast: ast,
27432
+ map: sourceMap ? magicString.generateMap({ hires: true }) : null
27433
+ };
27434
+ }
27435
+ var importBlock = Array.from(newImports.values()).join('\n\n');
27436
+
27437
+ magicString.prepend((importBlock + "\n\n"));
27438
+
27439
+ return {
27440
+ code: magicString.toString(),
27441
+ map: sourceMap ? magicString.generateMap({ hires: true }) : null
27442
+ };
27443
+ }
27444
+ };
27445
+ }
27446
+
27447
+ var embeddedRegexp = /^data:(.*?),(.*?)/;
27448
+ var commentRegexp = /\/\*([\s\S]*?)\*\//g;
27449
+ var urlsRegexp = /(?:@import\s+)?url\s*\(\s*(("(.*?)")|('(.*?)')|(.*?))\s*\)|(?:@import\s+)(("(.*?)")|('(.*?)')|(.*?))[\s;]/ig;
27450
+
27451
+ function isEmbedded (src) {
27452
+ return embeddedRegexp.test(src.trim());
27453
+ }
27454
+
27455
+ function getUrls (text) {
27456
+ var urls = [];
27457
+ var urlMatch, url;
27458
+
27459
+ text = text.replace(commentRegexp, '');
27460
+
27461
+ while ((urlMatch = urlsRegexp.exec(text))) {
27462
+ // Match 3, 5, 6 group if '[@import] url(path)', match 9, 11, 12 group if '@import path'
27463
+ url = urlMatch[3] || urlMatch[5] || urlMatch[6] || urlMatch[9] || urlMatch[11] || urlMatch[12];
27464
+
27465
+ if (url && !isEmbedded(url) && urls.indexOf(url) === -1) {
27466
+ urls.push(url);
27467
+ }
27468
+ }
27469
+
27470
+ return urls;
27471
+ }
27472
+
27473
+ var cssParser = getUrls;
27474
+
27475
+ var parseCssUrls = cssParser;
27476
+ var cssUrlParser = parseCssUrls;
27477
+
27478
+ var parseCssUrl = /*@__PURE__*/getDefaultExportFromCjs$1(cssUrlParser);
27479
+
27480
+ function extractCommandResources(command) {
27481
+ if (Array.isArray(command)) {
27482
+ return command.flatMap(extractCommandResources);
27483
+ }
27484
+ if (command.icon != null) {
27485
+ if (typeof command.icon === 'object') {
27486
+ return [{ path: command.icon.light, sync: true }, { path: command.icon.dark, sync: true }];
27487
+ }
27488
+ else {
27489
+ return [{ path: command.icon, sync: true }];
27490
+ }
27491
+ }
27492
+ return [];
27493
+ }
27494
+ function extractGrammarResources(grammar) {
27495
+ return [{ path: grammar.path, sync: false }];
27496
+ }
27497
+ function extractLanguageResources(language) {
27498
+ const paths = [];
27499
+ if (language.icon != null) {
27500
+ paths.push({ path: language.icon.dark, sync: true }, { path: language.icon.light, sync: true });
27501
+ }
27502
+ if (language.configuration != null) {
27503
+ paths.push({ path: language.configuration, sync: true });
27504
+ }
27505
+ return paths;
27506
+ }
27507
+ function extractSnippetsResources(snippet) {
27508
+ return [{ path: snippet.path, sync: false }];
27509
+ }
27510
+ async function extractThemeResources(theme, getFileContent) {
27511
+ const themeContent = await getFileContent(theme.path);
27512
+ const themeDocument = parseJson(theme.path, themeContent.toString('utf8'));
27513
+ const paths = [{ path: theme.path, sync: false }];
27514
+ if (themeDocument.fonts != null) {
27515
+ for (const font of themeDocument.fonts) {
27516
+ for (const src of font.src) {
27517
+ paths.push({ path: path.join(path.dirname(theme.path), src.path), sync: true });
27518
+ }
27519
+ }
27520
+ }
27521
+ if (themeDocument.iconDefinitions != null) {
27522
+ for (const iconDefinition of Object.values(themeDocument.iconDefinitions)) {
27523
+ if (iconDefinition.iconPath != null) {
27524
+ paths.push({ path: path.join(path.dirname(theme.path), iconDefinition.iconPath), sync: true });
27525
+ }
27526
+ }
27527
+ }
27528
+ return paths;
27529
+ }
27530
+ function extractJsonValidationResources(jsonValidation) {
27531
+ if (jsonValidation.url.startsWith('./')) {
27532
+ return [{
27533
+ path: jsonValidation.url,
27534
+ sync: true
27535
+ }];
27536
+ }
27537
+ return [];
25867
27538
  }
25868
27539
  function extractViewsContainerResources(viewContainers) {
25869
27540
  return Object.values(viewContainers).flatMap(containers => containers.map(container => ({
@@ -25891,6 +27562,18 @@ async function extractResourcesFromExtensionManifestContribute(contribute, getFi
25891
27562
  resources.push(...contribute.jsonValidation.flatMap(extractJsonValidationResources));
25892
27563
  if (contribute.viewsContainers != null)
25893
27564
  resources.push(...extractViewsContainerResources(contribute.viewsContainers));
27565
+ if (contribute['markdown.previewStyles'] != null) {
27566
+ resources.push(...(await Promise.all(contribute['markdown.previewStyles'].map(async (path) => [
27567
+ { path, sync: false },
27568
+ ...(await extractResources(path, getFileContent))
27569
+ ]))).flat());
27570
+ }
27571
+ if (contribute['markdown.previewScripts'] != null) {
27572
+ resources.push(...(await Promise.all(contribute['markdown.previewScripts'].map(async (path) => [
27573
+ { path, sync: false },
27574
+ ...(await extractResources(path, getFileContent))
27575
+ ]))).flat());
27576
+ }
25894
27577
  return resources.filter((resource, index, list) => !resource.path.startsWith('$(') && !list.slice(0, index).some(o => o.path === resource.path));
25895
27578
  }
25896
27579
  async function extractResourcesFromExtensionManifest(manifest, getFileContent) {
@@ -25899,10 +27582,64 @@ async function extractResourcesFromExtensionManifest(manifest, getFileContent) {
25899
27582
  resources.push(...await extractResourcesFromExtensionManifestContribute(manifest.contributes, getFileContent));
25900
27583
  }
25901
27584
  if (manifest.browser != null) {
27585
+ const jsPath = addExtension(manifest.browser, '.js');
25902
27586
  resources.push({
25903
- path: addExtension(manifest.browser, '.js'),
27587
+ path: jsPath,
25904
27588
  sync: false
25905
27589
  });
27590
+ resources.push(...(await extractResources(jsPath, getFileContent)));
27591
+ }
27592
+ return resources;
27593
+ }
27594
+ async function extractResources(resourcePath, getFileContent) {
27595
+ const resources = [];
27596
+ const content = (await getFileContent(resourcePath)).toString('utf-8');
27597
+ if (resourcePath.endsWith('.js')) {
27598
+ for (const match of content.matchAll(/Uri\.joinPath\(context\.extensionUri, '([^']+)'\)/g)) {
27599
+ resources.push({
27600
+ path: match[1],
27601
+ sync: false
27602
+ });
27603
+ resources.push(...(await extractResources(match[1], getFileContent)));
27604
+ }
27605
+ for (const match of content.matchAll(/this.extensionResource\('media', '(.*)'\)/g)) {
27606
+ resources.push({
27607
+ path: `./media/${match[1]}`,
27608
+ sync: false
27609
+ });
27610
+ resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
27611
+ }
27612
+ for (const match of content.matchAll(/this\._extensionResourcePath\(resourceProvider, '(.*)'\)/g)) {
27613
+ resources.push({
27614
+ path: `./media/${match[1]}`,
27615
+ sync: false
27616
+ });
27617
+ resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
27618
+ }
27619
+ for (const match of content.matchAll(/this\.extensionResourceUrl\('media', '(.*)'\)/g)) {
27620
+ resources.push({
27621
+ path: `./media/${match[1]}`,
27622
+ sync: false
27623
+ });
27624
+ resources.push(...(await extractResources(`./media/${match[1]}`, getFileContent)));
27625
+ }
27626
+ }
27627
+ if (resourcePath.endsWith('.css')) {
27628
+ const urls = parseCssUrl(content);
27629
+ for (const url of urls) {
27630
+ const assetPath = './' + path.join(path.dirname(resourcePath), url);
27631
+ try {
27632
+ await getFileContent(assetPath);
27633
+ resources.push({
27634
+ path: assetPath,
27635
+ sync: false
27636
+ });
27637
+ }
27638
+ catch (err) {
27639
+ // ignore, the file doesn't exist
27640
+ // It happens for the markdown-math extension without consequences
27641
+ }
27642
+ }
25906
27643
  }
25907
27644
  return resources;
25908
27645
  }
@@ -25914,9 +27651,9 @@ function parseJson(path, text) {
25914
27651
  }
25915
27652
  return result;
25916
27653
  }
25917
- async function buildExtensionCode(path, rollupPlugins, getFileContent) {
27654
+ async function buildExtensionCode(extPath, rollupPlugins, getFileContent) {
25918
27655
  const build = await rollup({
25919
- input: path,
27656
+ input: extPath,
25920
27657
  external: ['vscode'],
25921
27658
  plugins: [
25922
27659
  ...(getFileContent != null
@@ -25930,6 +27667,9 @@ async function buildExtensionCode(path, rollupPlugins, getFileContent) {
25930
27667
  }
25931
27668
  }]
25932
27669
  : []),
27670
+ inject({
27671
+ Worker: url.fileURLToPath(new URL('./extensionWorker.js', import.meta.url))
27672
+ }),
25933
27673
  ...rollupPlugins
25934
27674
  ]
25935
27675
  });