mockaton 13.9.9 → 13.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/package.json +3 -2
  2. package/src/client/app-header.js +62 -42
  3. package/src/client/app.css +22 -4
  4. package/src/client/dir/dittoSplitPaths.js +1 -1
  5. package/src/client/dir/dittoSplitPaths.test.js +9 -7
  6. package/src/server/MockBroker.js +1 -1
  7. package/src/server/cli.test.js +1 -1
  8. package/src/server/mockBrokersCollection.js +4 -2
  9. package/vite-plugin/README.md +0 -29
  10. package/vite-plugin/node_modules/.package-lock.json +0 -356
  11. package/vite-plugin/node_modules/@oxc-project/types/LICENSE +0 -22
  12. package/vite-plugin/node_modules/@oxc-project/types/README.md +0 -3
  13. package/vite-plugin/node_modules/@oxc-project/types/package.json +0 -26
  14. package/vite-plugin/node_modules/@oxc-project/types/types.d.ts +0 -1912
  15. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/README.md +0 -3
  16. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/package.json +0 -37
  17. package/vite-plugin/node_modules/@rolldown/binding-darwin-arm64/rolldown-binding.darwin-arm64.node +0 -0
  18. package/vite-plugin/node_modules/@rolldown/pluginutils/LICENSE +0 -25
  19. package/vite-plugin/node_modules/@rolldown/pluginutils/README.md +0 -83
  20. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts +0 -90
  21. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +0 -256
  22. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts +0 -28
  23. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +0 -75
  24. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts +0 -3
  25. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/index.js +0 -3
  26. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts +0 -71
  27. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +0 -70
  28. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/index.d.ts +0 -1
  29. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/index.js +0 -1
  30. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/utils.d.ts +0 -2
  31. package/vite-plugin/node_modules/@rolldown/pluginutils/dist/utils.js +0 -17
  32. package/vite-plugin/node_modules/@rolldown/pluginutils/package.json +0 -37
  33. package/vite-plugin/node_modules/detect-libc/LICENSE +0 -201
  34. package/vite-plugin/node_modules/detect-libc/README.md +0 -163
  35. package/vite-plugin/node_modules/detect-libc/index.d.ts +0 -14
  36. package/vite-plugin/node_modules/detect-libc/lib/detect-libc.js +0 -313
  37. package/vite-plugin/node_modules/detect-libc/lib/elf.js +0 -39
  38. package/vite-plugin/node_modules/detect-libc/lib/filesystem.js +0 -51
  39. package/vite-plugin/node_modules/detect-libc/lib/process.js +0 -24
  40. package/vite-plugin/node_modules/detect-libc/package.json +0 -44
  41. package/vite-plugin/node_modules/fdir/LICENSE +0 -7
  42. package/vite-plugin/node_modules/fdir/README.md +0 -91
  43. package/vite-plugin/node_modules/fdir/dist/index.cjs +0 -588
  44. package/vite-plugin/node_modules/fdir/dist/index.d.cts +0 -155
  45. package/vite-plugin/node_modules/fdir/dist/index.d.mts +0 -155
  46. package/vite-plugin/node_modules/fdir/dist/index.mjs +0 -570
  47. package/vite-plugin/node_modules/fdir/package.json +0 -103
  48. package/vite-plugin/node_modules/fsevents/LICENSE +0 -22
  49. package/vite-plugin/node_modules/fsevents/README.md +0 -89
  50. package/vite-plugin/node_modules/fsevents/fsevents.d.ts +0 -46
  51. package/vite-plugin/node_modules/fsevents/fsevents.js +0 -83
  52. package/vite-plugin/node_modules/fsevents/fsevents.node +0 -0
  53. package/vite-plugin/node_modules/fsevents/package.json +0 -62
  54. package/vite-plugin/node_modules/lightningcss/LICENSE +0 -373
  55. package/vite-plugin/node_modules/lightningcss/README.md +0 -105
  56. package/vite-plugin/node_modules/lightningcss/node/ast.d.ts +0 -9892
  57. package/vite-plugin/node_modules/lightningcss/node/ast.js.flow +0 -10539
  58. package/vite-plugin/node_modules/lightningcss/node/browserslistToTargets.js +0 -48
  59. package/vite-plugin/node_modules/lightningcss/node/composeVisitors.js +0 -450
  60. package/vite-plugin/node_modules/lightningcss/node/flags.js +0 -28
  61. package/vite-plugin/node_modules/lightningcss/node/index.d.ts +0 -494
  62. package/vite-plugin/node_modules/lightningcss/node/index.js +0 -59
  63. package/vite-plugin/node_modules/lightningcss/node/index.js.flow +0 -843
  64. package/vite-plugin/node_modules/lightningcss/node/index.mjs +0 -4
  65. package/vite-plugin/node_modules/lightningcss/node/targets.d.ts +0 -40
  66. package/vite-plugin/node_modules/lightningcss/node/targets.js.flow +0 -39
  67. package/vite-plugin/node_modules/lightningcss/package.json +0 -110
  68. package/vite-plugin/node_modules/lightningcss-darwin-arm64/LICENSE +0 -373
  69. package/vite-plugin/node_modules/lightningcss-darwin-arm64/README.md +0 -1
  70. package/vite-plugin/node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.node +0 -0
  71. package/vite-plugin/node_modules/lightningcss-darwin-arm64/package.json +0 -34
  72. package/vite-plugin/node_modules/nanoid/LICENSE +0 -20
  73. package/vite-plugin/node_modules/nanoid/README.md +0 -39
  74. package/vite-plugin/node_modules/nanoid/async/index.browser.cjs +0 -69
  75. package/vite-plugin/node_modules/nanoid/async/index.browser.js +0 -34
  76. package/vite-plugin/node_modules/nanoid/async/index.cjs +0 -71
  77. package/vite-plugin/node_modules/nanoid/async/index.d.ts +0 -56
  78. package/vite-plugin/node_modules/nanoid/async/index.js +0 -35
  79. package/vite-plugin/node_modules/nanoid/async/index.native.js +0 -26
  80. package/vite-plugin/node_modules/nanoid/async/package.json +0 -12
  81. package/vite-plugin/node_modules/nanoid/bin/nanoid.cjs +0 -55
  82. package/vite-plugin/node_modules/nanoid/index.browser.cjs +0 -72
  83. package/vite-plugin/node_modules/nanoid/index.browser.js +0 -34
  84. package/vite-plugin/node_modules/nanoid/index.cjs +0 -85
  85. package/vite-plugin/node_modules/nanoid/index.d.cts +0 -91
  86. package/vite-plugin/node_modules/nanoid/index.d.ts +0 -91
  87. package/vite-plugin/node_modules/nanoid/index.js +0 -45
  88. package/vite-plugin/node_modules/nanoid/nanoid.js +0 -1
  89. package/vite-plugin/node_modules/nanoid/non-secure/index.cjs +0 -34
  90. package/vite-plugin/node_modules/nanoid/non-secure/index.d.ts +0 -33
  91. package/vite-plugin/node_modules/nanoid/non-secure/index.js +0 -21
  92. package/vite-plugin/node_modules/nanoid/non-secure/package.json +0 -6
  93. package/vite-plugin/node_modules/nanoid/package.json +0 -89
  94. package/vite-plugin/node_modules/nanoid/url-alphabet/index.cjs +0 -7
  95. package/vite-plugin/node_modules/nanoid/url-alphabet/index.js +0 -3
  96. package/vite-plugin/node_modules/nanoid/url-alphabet/package.json +0 -6
  97. package/vite-plugin/node_modules/picocolors/LICENSE +0 -15
  98. package/vite-plugin/node_modules/picocolors/README.md +0 -21
  99. package/vite-plugin/node_modules/picocolors/package.json +0 -25
  100. package/vite-plugin/node_modules/picocolors/picocolors.browser.js +0 -4
  101. package/vite-plugin/node_modules/picocolors/picocolors.d.ts +0 -5
  102. package/vite-plugin/node_modules/picocolors/picocolors.js +0 -75
  103. package/vite-plugin/node_modules/picocolors/types.d.ts +0 -51
  104. package/vite-plugin/node_modules/picomatch/LICENSE +0 -21
  105. package/vite-plugin/node_modules/picomatch/README.md +0 -749
  106. package/vite-plugin/node_modules/picomatch/index.js +0 -17
  107. package/vite-plugin/node_modules/picomatch/lib/constants.js +0 -184
  108. package/vite-plugin/node_modules/picomatch/lib/parse.js +0 -1386
  109. package/vite-plugin/node_modules/picomatch/lib/picomatch.js +0 -349
  110. package/vite-plugin/node_modules/picomatch/lib/scan.js +0 -391
  111. package/vite-plugin/node_modules/picomatch/lib/utils.js +0 -72
  112. package/vite-plugin/node_modules/picomatch/package.json +0 -82
  113. package/vite-plugin/node_modules/picomatch/posix.js +0 -3
  114. package/vite-plugin/node_modules/postcss/LICENSE +0 -20
  115. package/vite-plugin/node_modules/postcss/README.md +0 -28
  116. package/vite-plugin/node_modules/postcss/lib/at-rule.d.ts +0 -139
  117. package/vite-plugin/node_modules/postcss/lib/at-rule.js +0 -25
  118. package/vite-plugin/node_modules/postcss/lib/comment.d.ts +0 -67
  119. package/vite-plugin/node_modules/postcss/lib/comment.js +0 -13
  120. package/vite-plugin/node_modules/postcss/lib/container.d.ts +0 -478
  121. package/vite-plugin/node_modules/postcss/lib/container.js +0 -447
  122. package/vite-plugin/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  123. package/vite-plugin/node_modules/postcss/lib/css-syntax-error.js +0 -133
  124. package/vite-plugin/node_modules/postcss/lib/declaration.d.ts +0 -150
  125. package/vite-plugin/node_modules/postcss/lib/declaration.js +0 -24
  126. package/vite-plugin/node_modules/postcss/lib/document.d.ts +0 -68
  127. package/vite-plugin/node_modules/postcss/lib/document.js +0 -33
  128. package/vite-plugin/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  129. package/vite-plugin/node_modules/postcss/lib/fromJSON.js +0 -54
  130. package/vite-plugin/node_modules/postcss/lib/input.d.ts +0 -226
  131. package/vite-plugin/node_modules/postcss/lib/input.js +0 -273
  132. package/vite-plugin/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  133. package/vite-plugin/node_modules/postcss/lib/lazy-result.js +0 -550
  134. package/vite-plugin/node_modules/postcss/lib/list.d.ts +0 -60
  135. package/vite-plugin/node_modules/postcss/lib/list.js +0 -58
  136. package/vite-plugin/node_modules/postcss/lib/map-generator.js +0 -376
  137. package/vite-plugin/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  138. package/vite-plugin/node_modules/postcss/lib/no-work-result.js +0 -137
  139. package/vite-plugin/node_modules/postcss/lib/node.d.ts +0 -555
  140. package/vite-plugin/node_modules/postcss/lib/node.js +0 -449
  141. package/vite-plugin/node_modules/postcss/lib/parse.d.ts +0 -9
  142. package/vite-plugin/node_modules/postcss/lib/parse.js +0 -42
  143. package/vite-plugin/node_modules/postcss/lib/parser.js +0 -611
  144. package/vite-plugin/node_modules/postcss/lib/postcss.d.mts +0 -66
  145. package/vite-plugin/node_modules/postcss/lib/postcss.d.ts +0 -456
  146. package/vite-plugin/node_modules/postcss/lib/postcss.js +0 -101
  147. package/vite-plugin/node_modules/postcss/lib/postcss.mjs +0 -30
  148. package/vite-plugin/node_modules/postcss/lib/previous-map.d.ts +0 -80
  149. package/vite-plugin/node_modules/postcss/lib/previous-map.js +0 -145
  150. package/vite-plugin/node_modules/postcss/lib/processor.d.ts +0 -114
  151. package/vite-plugin/node_modules/postcss/lib/processor.js +0 -67
  152. package/vite-plugin/node_modules/postcss/lib/result.d.ts +0 -204
  153. package/vite-plugin/node_modules/postcss/lib/result.js +0 -42
  154. package/vite-plugin/node_modules/postcss/lib/root.d.ts +0 -86
  155. package/vite-plugin/node_modules/postcss/lib/root.js +0 -61
  156. package/vite-plugin/node_modules/postcss/lib/rule.d.ts +0 -126
  157. package/vite-plugin/node_modules/postcss/lib/rule.js +0 -27
  158. package/vite-plugin/node_modules/postcss/lib/stringifier.d.ts +0 -45
  159. package/vite-plugin/node_modules/postcss/lib/stringifier.js +0 -370
  160. package/vite-plugin/node_modules/postcss/lib/stringify.d.ts +0 -9
  161. package/vite-plugin/node_modules/postcss/lib/stringify.js +0 -11
  162. package/vite-plugin/node_modules/postcss/lib/symbols.js +0 -5
  163. package/vite-plugin/node_modules/postcss/lib/terminal-highlight.js +0 -70
  164. package/vite-plugin/node_modules/postcss/lib/tokenize.js +0 -266
  165. package/vite-plugin/node_modules/postcss/lib/warn-once.js +0 -13
  166. package/vite-plugin/node_modules/postcss/lib/warning.d.ts +0 -146
  167. package/vite-plugin/node_modules/postcss/lib/warning.js +0 -37
  168. package/vite-plugin/node_modules/postcss/package.json +0 -88
  169. package/vite-plugin/node_modules/rolldown/LICENSE +0 -25
  170. package/vite-plugin/node_modules/rolldown/README.md +0 -11
  171. package/vite-plugin/node_modules/rolldown/bin/cli.mjs +0 -2
  172. package/vite-plugin/node_modules/rolldown/dist/cli.d.mts +0 -1
  173. package/vite-plugin/node_modules/rolldown/dist/cli.mjs +0 -1191
  174. package/vite-plugin/node_modules/rolldown/dist/config.d.mts +0 -14
  175. package/vite-plugin/node_modules/rolldown/dist/config.mjs +0 -4
  176. package/vite-plugin/node_modules/rolldown/dist/experimental-index.d.mts +0 -253
  177. package/vite-plugin/node_modules/rolldown/dist/experimental-index.mjs +0 -320
  178. package/vite-plugin/node_modules/rolldown/dist/experimental-runtime-types.d.ts +0 -98
  179. package/vite-plugin/node_modules/rolldown/dist/filter-index.d.mts +0 -196
  180. package/vite-plugin/node_modules/rolldown/dist/filter-index.mjs +0 -386
  181. package/vite-plugin/node_modules/rolldown/dist/get-log-filter.d.mts +0 -3
  182. package/vite-plugin/node_modules/rolldown/dist/get-log-filter.mjs +0 -68
  183. package/vite-plugin/node_modules/rolldown/dist/index.d.mts +0 -4
  184. package/vite-plugin/node_modules/rolldown/dist/index.mjs +0 -50
  185. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +0 -1
  186. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin-worker.mjs +0 -28
  187. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin.d.mts +0 -13
  188. package/vite-plugin/node_modules/rolldown/dist/parallel-plugin.mjs +0 -6
  189. package/vite-plugin/node_modules/rolldown/dist/parse-ast-index.d.mts +0 -32
  190. package/vite-plugin/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
  191. package/vite-plugin/node_modules/rolldown/dist/plugins-index.d.mts +0 -33
  192. package/vite-plugin/node_modules/rolldown/dist/plugins-index.mjs +0 -40
  193. package/vite-plugin/node_modules/rolldown/dist/shared/binding-BeU_1iEk.mjs +0 -582
  194. package/vite-plugin/node_modules/rolldown/dist/shared/binding-zH1vcmbM.d.mts +0 -1899
  195. package/vite-plugin/node_modules/rolldown/dist/shared/bindingify-input-options-DbbBhzky.mjs +0 -2211
  196. package/vite-plugin/node_modules/rolldown/dist/shared/constructors-C2EWPKW3.mjs +0 -68
  197. package/vite-plugin/node_modules/rolldown/dist/shared/constructors-D0W3rNfA.d.mts +0 -37
  198. package/vite-plugin/node_modules/rolldown/dist/shared/define-config-5HJ1b9vG.d.mts +0 -3829
  199. package/vite-plugin/node_modules/rolldown/dist/shared/define-config-DJOr6Iwt.mjs +0 -6
  200. package/vite-plugin/node_modules/rolldown/dist/shared/error-DL-e8-oE.mjs +0 -85
  201. package/vite-plugin/node_modules/rolldown/dist/shared/get-log-filter-semyr3Lj.d.mts +0 -35
  202. package/vite-plugin/node_modules/rolldown/dist/shared/load-config-BoVO31Un.mjs +0 -120
  203. package/vite-plugin/node_modules/rolldown/dist/shared/logging-C6h4g8dA.d.mts +0 -50
  204. package/vite-plugin/node_modules/rolldown/dist/shared/logs-D80CXhvg.mjs +0 -180
  205. package/vite-plugin/node_modules/rolldown/dist/shared/misc-DJYbNKZX.mjs +0 -21
  206. package/vite-plugin/node_modules/rolldown/dist/shared/normalize-string-or-regex-CbQQ69gT.mjs +0 -66
  207. package/vite-plugin/node_modules/rolldown/dist/shared/parse-B_ZnWxLZ.mjs +0 -74
  208. package/vite-plugin/node_modules/rolldown/dist/shared/prompt-U5ajztzG.mjs +0 -847
  209. package/vite-plugin/node_modules/rolldown/dist/shared/resolve-tsconfig-CfYpGzid.mjs +0 -113
  210. package/vite-plugin/node_modules/rolldown/dist/shared/rolldown-D3JZ9rMt.mjs +0 -40
  211. package/vite-plugin/node_modules/rolldown/dist/shared/rolldown-build-DSxL8qiP.mjs +0 -3325
  212. package/vite-plugin/node_modules/rolldown/dist/shared/transform-DgZ3paSD.d.mts +0 -149
  213. package/vite-plugin/node_modules/rolldown/dist/shared/watch-Bd8v9ewv.mjs +0 -374
  214. package/vite-plugin/node_modules/rolldown/dist/utils-index.d.mts +0 -376
  215. package/vite-plugin/node_modules/rolldown/dist/utils-index.mjs +0 -2414
  216. package/vite-plugin/node_modules/rolldown/package.json +0 -153
  217. package/vite-plugin/node_modules/source-map-js/LICENSE +0 -28
  218. package/vite-plugin/node_modules/source-map-js/README.md +0 -765
  219. package/vite-plugin/node_modules/source-map-js/lib/array-set.js +0 -121
  220. package/vite-plugin/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  221. package/vite-plugin/node_modules/source-map-js/lib/base64.js +0 -67
  222. package/vite-plugin/node_modules/source-map-js/lib/binary-search.js +0 -111
  223. package/vite-plugin/node_modules/source-map-js/lib/mapping-list.js +0 -79
  224. package/vite-plugin/node_modules/source-map-js/lib/quick-sort.js +0 -132
  225. package/vite-plugin/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  226. package/vite-plugin/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  227. package/vite-plugin/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  228. package/vite-plugin/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  229. package/vite-plugin/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  230. package/vite-plugin/node_modules/source-map-js/lib/source-node.js +0 -413
  231. package/vite-plugin/node_modules/source-map-js/lib/util.js +0 -594
  232. package/vite-plugin/node_modules/source-map-js/package.json +0 -71
  233. package/vite-plugin/node_modules/source-map-js/source-map.d.ts +0 -104
  234. package/vite-plugin/node_modules/source-map-js/source-map.js +0 -8
  235. package/vite-plugin/node_modules/tinyglobby/LICENSE +0 -21
  236. package/vite-plugin/node_modules/tinyglobby/README.md +0 -25
  237. package/vite-plugin/node_modules/tinyglobby/dist/index.cjs +0 -334
  238. package/vite-plugin/node_modules/tinyglobby/dist/index.d.cts +0 -148
  239. package/vite-plugin/node_modules/tinyglobby/dist/index.d.mts +0 -148
  240. package/vite-plugin/node_modules/tinyglobby/dist/index.mjs +0 -306
  241. package/vite-plugin/node_modules/tinyglobby/package.json +0 -73
  242. package/vite-plugin/node_modules/vite/LICENSE.md +0 -2230
  243. package/vite-plugin/node_modules/vite/README.md +0 -20
  244. package/vite-plugin/node_modules/vite/bin/openChrome.js +0 -68
  245. package/vite-plugin/node_modules/vite/bin/vite.js +0 -79
  246. package/vite-plugin/node_modules/vite/client.d.ts +0 -282
  247. package/vite-plugin/node_modules/vite/dist/client/client.mjs +0 -1237
  248. package/vite-plugin/node_modules/vite/dist/client/env.mjs +0 -18
  249. package/vite-plugin/node_modules/vite/dist/node/chunks/build.js +0 -5381
  250. package/vite-plugin/node_modules/vite/dist/node/chunks/chunk.js +0 -37
  251. package/vite-plugin/node_modules/vite/dist/node/chunks/dist.js +0 -6784
  252. package/vite-plugin/node_modules/vite/dist/node/chunks/lib.js +0 -371
  253. package/vite-plugin/node_modules/vite/dist/node/chunks/logger.js +0 -322
  254. package/vite-plugin/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +0 -96
  255. package/vite-plugin/node_modules/vite/dist/node/chunks/node.js +0 -34874
  256. package/vite-plugin/node_modules/vite/dist/node/chunks/postcss-import.js +0 -467
  257. package/vite-plugin/node_modules/vite/dist/node/cli.js +0 -837
  258. package/vite-plugin/node_modules/vite/dist/node/index.d.ts +0 -3867
  259. package/vite-plugin/node_modules/vite/dist/node/index.js +0 -3
  260. package/vite-plugin/node_modules/vite/dist/node/internal.d.ts +0 -2
  261. package/vite-plugin/node_modules/vite/dist/node/internal.js +0 -2
  262. package/vite-plugin/node_modules/vite/dist/node/module-runner.d.ts +0 -315
  263. package/vite-plugin/node_modules/vite/dist/node/module-runner.js +0 -1262
  264. package/vite-plugin/node_modules/vite/misc/false.js +0 -1
  265. package/vite-plugin/node_modules/vite/misc/true.js +0 -1
  266. package/vite-plugin/node_modules/vite/package.json +0 -192
  267. package/vite-plugin/node_modules/vite/types/customEvent.d.ts +0 -79
  268. package/vite-plugin/node_modules/vite/types/hmrPayload.d.ts +0 -80
  269. package/vite-plugin/node_modules/vite/types/hot.d.ts +0 -39
  270. package/vite-plugin/node_modules/vite/types/import-meta.d.ts +0 -5
  271. package/vite-plugin/node_modules/vite/types/importGlob.d.ts +0 -89
  272. package/vite-plugin/node_modules/vite/types/importMeta.d.ts +0 -30
  273. package/vite-plugin/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -44
  274. package/vite-plugin/node_modules/vite/types/internal/esbuildOptions.d.ts +0 -28
  275. package/vite-plugin/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  276. package/vite-plugin/node_modules/vite/types/internal/rollupTypeCompat.d.ts +0 -24
  277. package/vite-plugin/node_modules/vite/types/internal/terserOptions.d.ts +0 -11
  278. package/vite-plugin/node_modules/vite/types/metadata.d.ts +0 -47
  279. package/vite-plugin/package.json +0 -17
@@ -1,1262 +0,0 @@
1
- let SOURCEMAPPING_URL = "sourceMa";
2
- SOURCEMAPPING_URL += "ppingURL";
3
- //#endregion
4
- //#region src/shared/utils.ts
5
- const isWindows = typeof process < "u" && process.platform === "win32";
6
- /**
7
- * Undo {@link wrapId}'s `/@id/` and null byte replacements.
8
- */
9
- function unwrapId(id) {
10
- return id.startsWith("/@id/") ? id.slice(5).replace("__x00__", "\0") : id;
11
- }
12
- const windowsSlashRE = /\\/g;
13
- function slash(p) {
14
- return p.replace(windowsSlashRE, "/");
15
- }
16
- const postfixRE = /[?#].*$/;
17
- function cleanUrl(url) {
18
- return url.replace(postfixRE, "");
19
- }
20
- function isPrimitive(value) {
21
- return !value || typeof value != "object" && typeof value != "function";
22
- }
23
- const AsyncFunction = async function() {}.constructor;
24
- let asyncFunctionDeclarationPaddingLineCount;
25
- function getAsyncFunctionDeclarationPaddingLineCount() {
26
- if (asyncFunctionDeclarationPaddingLineCount === void 0) {
27
- let body = "/*code*/", source = new AsyncFunction("a", "b", body).toString();
28
- asyncFunctionDeclarationPaddingLineCount = source.slice(0, source.indexOf(body)).split("\n").length - 1;
29
- }
30
- return asyncFunctionDeclarationPaddingLineCount;
31
- }
32
- function promiseWithResolvers() {
33
- let resolve, reject;
34
- return {
35
- promise: new Promise((_resolve, _reject) => {
36
- resolve = _resolve, reject = _reject;
37
- }),
38
- resolve,
39
- reject
40
- };
41
- }
42
- //#endregion
43
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
44
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
45
- function normalizeWindowsPath(input = "") {
46
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
47
- }
48
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
49
- function cwd() {
50
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
51
- }
52
- const resolve = function(...arguments_) {
53
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
54
- let resolvedPath = "", resolvedAbsolute = !1;
55
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
56
- let path = index >= 0 ? arguments_[index] : cwd();
57
- !path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));
58
- }
59
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
60
- };
61
- function normalizeString(path, allowAboveRoot) {
62
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
63
- for (let index = 0; index <= path.length; ++index) {
64
- if (index < path.length) char = path[index];
65
- else if (char === "/") break;
66
- else char = "/";
67
- if (char === "/") {
68
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
69
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
70
- if (res.length > 2) {
71
- let lastSlashIndex = res.lastIndexOf("/");
72
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
73
- continue;
74
- } else if (res.length > 0) {
75
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
76
- continue;
77
- }
78
- }
79
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
80
- } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
81
- lastSlash = index, dots = 0;
82
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
83
- }
84
- return res;
85
- }
86
- const isAbsolute = function(p) {
87
- return _IS_ABSOLUTE_RE.test(p);
88
- }, dirname = function(p) {
89
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
90
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
91
- }, textDecoder = new TextDecoder(), decodeBase64 = typeof Buffer == "function" && typeof Buffer.from == "function" ? (base64) => Buffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0))), percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
92
- function encodePathChars(filepath) {
93
- return filepath.includes("%") && (filepath = filepath.replace(percentRegEx, "%25")), !isWindows && filepath.includes("\\") && (filepath = filepath.replace(backslashRegEx, "%5C")), filepath.includes("\n") && (filepath = filepath.replace(newlineRegEx, "%0A")), filepath.includes("\r") && (filepath = filepath.replace(carriageReturnRegEx, "%0D")), filepath.includes(" ") && (filepath = filepath.replace(tabRegEx, "%09")), filepath;
94
- }
95
- const posixDirname = dirname, posixResolve = resolve;
96
- function posixPathToFileHref(posixPath) {
97
- let resolved = posixResolve(posixPath), filePathLast = posixPath.charCodeAt(posixPath.length - 1);
98
- return (filePathLast === 47 || isWindows && filePathLast === 92) && resolved[resolved.length - 1] !== "/" && (resolved += "/"), resolved = encodePathChars(resolved), resolved.includes("?") && (resolved = resolved.replace(questionRegex, "%3F")), resolved.includes("#") && (resolved = resolved.replace(hashRegex, "%23")), new URL(`file://${resolved}`).href;
99
- }
100
- function toWindowsPath(path) {
101
- return path.replace(/\//g, "\\");
102
- }
103
- //#endregion
104
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
105
- var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
106
- for (let i = 0; i < chars.length; i++) {
107
- let c = chars.charCodeAt(i);
108
- intToChar[i] = c, charToInt[c] = i;
109
- }
110
- function decodeInteger(reader, relative) {
111
- let value = 0, shift = 0, integer = 0;
112
- do
113
- integer = charToInt[reader.next()], value |= (integer & 31) << shift, shift += 5;
114
- while (integer & 32);
115
- let shouldNegate = value & 1;
116
- return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
117
- }
118
- function hasMoreVlq(reader, max) {
119
- return reader.pos >= max ? !1 : reader.peek() !== comma;
120
- }
121
- var StringReader = class {
122
- constructor(buffer) {
123
- this.pos = 0, this.buffer = buffer;
124
- }
125
- next() {
126
- return this.buffer.charCodeAt(this.pos++);
127
- }
128
- peek() {
129
- return this.buffer.charCodeAt(this.pos);
130
- }
131
- indexOf(char) {
132
- let { buffer, pos } = this, idx = buffer.indexOf(char, pos);
133
- return idx === -1 ? buffer.length : idx;
134
- }
135
- };
136
- function decode(mappings) {
137
- let { length } = mappings, reader = new StringReader(mappings), decoded = [], genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
138
- do {
139
- let semi = reader.indexOf(";"), line = [], sorted = !0, lastCol = 0;
140
- for (genColumn = 0; reader.pos < semi;) {
141
- let seg;
142
- genColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [
143
- genColumn,
144
- sourcesIndex,
145
- sourceLine,
146
- sourceColumn,
147
- namesIndex
148
- ]) : seg = [
149
- genColumn,
150
- sourcesIndex,
151
- sourceLine,
152
- sourceColumn
153
- ]) : seg = [genColumn], line.push(seg), reader.pos++;
154
- }
155
- sorted || sort(line), decoded.push(line), reader.pos = semi + 1;
156
- } while (reader.pos <= length);
157
- return decoded;
158
- }
159
- function sort(line) {
160
- line.sort(sortComparator);
161
- }
162
- function sortComparator(a, b) {
163
- return a[0] - b[0];
164
- }
165
- //#endregion
166
- //#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
167
- var COLUMN = 0, SOURCES_INDEX = 1, SOURCE_LINE = 2, SOURCE_COLUMN = 3, NAMES_INDEX = 4, found = !1;
168
- function binarySearch(haystack, needle, low, high) {
169
- for (; low <= high;) {
170
- let mid = low + (high - low >> 1), cmp = haystack[mid][COLUMN] - needle;
171
- if (cmp === 0) return found = !0, mid;
172
- cmp < 0 ? low = mid + 1 : high = mid - 1;
173
- }
174
- return found = !1, low - 1;
175
- }
176
- function upperBound(haystack, needle, index) {
177
- for (let i = index + 1; i < haystack.length && haystack[i][COLUMN] === needle; index = i++);
178
- return index;
179
- }
180
- function lowerBound(haystack, needle, index) {
181
- for (let i = index - 1; i >= 0 && haystack[i][COLUMN] === needle; index = i--);
182
- return index;
183
- }
184
- function memoizedBinarySearch(haystack, needle, state, key) {
185
- let { lastKey, lastNeedle, lastIndex } = state, low = 0, high = haystack.length - 1;
186
- if (key === lastKey) {
187
- if (needle === lastNeedle) return found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle, lastIndex;
188
- needle >= lastNeedle ? low = lastIndex === -1 ? 0 : lastIndex : high = lastIndex;
189
- }
190
- return state.lastKey = key, state.lastNeedle = needle, state.lastIndex = binarySearch(haystack, needle, low, high);
191
- }
192
- var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)", COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
193
- function cast(map) {
194
- return map;
195
- }
196
- function decodedMappings(map) {
197
- var _a;
198
- return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
199
- }
200
- function originalPositionFor(map, needle) {
201
- let { line, column, bias } = needle;
202
- if (line--, line < 0) throw Error(LINE_GTR_ZERO);
203
- if (column < 0) throw Error(COL_GTR_EQ_ZERO);
204
- let decoded = decodedMappings(map);
205
- if (line >= decoded.length) return OMapping(null, null, null, null);
206
- let segments = decoded[line], index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || 1);
207
- if (index === -1) return OMapping(null, null, null, null);
208
- let segment = segments[index];
209
- if (segment.length === 1) return OMapping(null, null, null, null);
210
- let { names, resolvedSources } = map;
211
- return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
212
- }
213
- function OMapping(source, line, column, name) {
214
- return {
215
- source,
216
- line,
217
- column,
218
- name
219
- };
220
- }
221
- function traceSegmentInternal(segments, memo, line, column, bias) {
222
- let index = memoizedBinarySearch(segments, column, memo, line);
223
- return found ? index = (bias === -1 ? upperBound : lowerBound)(segments, column, index) : bias === -1 && index++, index === -1 || index === segments.length ? -1 : index;
224
- }
225
- //#endregion
226
- //#region src/module-runner/sourcemap/decoder.ts
227
- var DecodedMap = class {
228
- _encoded;
229
- _decoded;
230
- _decodedMemo;
231
- url;
232
- file;
233
- version;
234
- names = [];
235
- resolvedSources;
236
- constructor(map, from) {
237
- this.map = map;
238
- let { mappings, names, sources } = map;
239
- this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.file = from;
240
- let originDir = posixDirname(from);
241
- this.resolvedSources = (sources || []).map((s) => posixResolve(originDir, s || ""));
242
- }
243
- };
244
- function memoizedState() {
245
- return {
246
- lastKey: -1,
247
- lastNeedle: -1,
248
- lastIndex: -1
249
- };
250
- }
251
- function getOriginalPosition(map, needle) {
252
- let result = originalPositionFor(map, needle);
253
- return result.column == null ? null : result;
254
- }
255
- //#endregion
256
- //#region src/module-runner/evaluatedModules.ts
257
- const MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
258
- var EvaluatedModuleNode = class {
259
- importers = /* @__PURE__ */ new Set();
260
- imports = /* @__PURE__ */ new Set();
261
- evaluated = !1;
262
- meta;
263
- promise;
264
- exports;
265
- file;
266
- map;
267
- constructor(id, url) {
268
- this.id = id, this.url = url, this.file = cleanUrl(id);
269
- }
270
- }, EvaluatedModules = class {
271
- idToModuleMap = /* @__PURE__ */ new Map();
272
- fileToModulesMap = /* @__PURE__ */ new Map();
273
- urlToIdModuleMap = /* @__PURE__ */ new Map();
274
- /**
275
- * Returns the module node by the resolved module ID. Usually, module ID is
276
- * the file system path with query and/or hash. It can also be a virtual module.
277
- *
278
- * Module runner graph will have 1 to 1 mapping with the server module graph.
279
- * @param id Resolved module ID
280
- */
281
- getModuleById(id) {
282
- return this.idToModuleMap.get(id);
283
- }
284
- /**
285
- * Returns all modules related to the file system path. Different modules
286
- * might have different query parameters or hash, so it's possible to have
287
- * multiple modules for the same file.
288
- * @param file The file system path of the module
289
- */
290
- getModulesByFile(file) {
291
- return this.fileToModulesMap.get(file);
292
- }
293
- /**
294
- * Returns the module node by the URL that was used in the import statement.
295
- * Unlike module graph on the server, the URL is not resolved and is used as is.
296
- * @param url Server URL that was used in the import statement
297
- */
298
- getModuleByUrl(url) {
299
- return this.urlToIdModuleMap.get(unwrapId(url));
300
- }
301
- /**
302
- * Ensure that module is in the graph. If the module is already in the graph,
303
- * it will return the existing module node. Otherwise, it will create a new
304
- * module node and add it to the graph.
305
- * @param id Resolved module ID
306
- * @param url URL that was used in the import statement
307
- */
308
- ensureModule(id, url) {
309
- if (id = normalizeModuleId(id), this.idToModuleMap.has(id)) {
310
- let moduleNode = this.idToModuleMap.get(id);
311
- return this.urlToIdModuleMap.set(url, moduleNode), moduleNode;
312
- }
313
- let moduleNode = new EvaluatedModuleNode(id, url);
314
- this.idToModuleMap.set(id, moduleNode), this.urlToIdModuleMap.set(url, moduleNode);
315
- let fileModules = this.fileToModulesMap.get(moduleNode.file) || /* @__PURE__ */ new Set();
316
- return fileModules.add(moduleNode), this.fileToModulesMap.set(moduleNode.file, fileModules), moduleNode;
317
- }
318
- invalidateModule(node) {
319
- node.evaluated = !1, node.meta = void 0, node.map = void 0, node.promise = void 0, node.exports = void 0, node.imports.clear();
320
- }
321
- /**
322
- * Extracts the inlined source map from the module code and returns the decoded
323
- * source map. If the source map is not inlined, it will return null.
324
- * @param id Resolved module ID
325
- */
326
- getModuleSourceMapById(id) {
327
- let mod = this.getModuleById(id);
328
- if (!mod) return null;
329
- if (mod.map) return mod.map;
330
- if (!mod.meta || !("code" in mod.meta)) return null;
331
- let pattern = `//# ${SOURCEMAPPING_URL}=data:application/json;base64,`, lastIndex = mod.meta.code.lastIndexOf(pattern);
332
- if (lastIndex === -1) return null;
333
- let mapString = MODULE_RUNNER_SOURCEMAPPING_REGEXP.exec(mod.meta.code.slice(lastIndex))?.[1];
334
- return mapString ? (mod.map = new DecodedMap(JSON.parse(decodeBase64(mapString)), mod.file), mod.map) : null;
335
- }
336
- clear() {
337
- this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
338
- }
339
- };
340
- const prefixedBuiltins = new Set([
341
- "node:sea",
342
- "node:sqlite",
343
- "node:test",
344
- "node:test/reporters"
345
- ]);
346
- function normalizeModuleId(file) {
347
- return prefixedBuiltins.has(file) ? file : slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, isWindows ? "" : "/");
348
- }
349
- //#endregion
350
- //#region src/shared/hmr.ts
351
- var HMRContext = class {
352
- newListeners;
353
- constructor(hmrClient, ownerPath) {
354
- this.hmrClient = hmrClient, this.ownerPath = ownerPath, hmrClient.dataMap.has(ownerPath) || hmrClient.dataMap.set(ownerPath, {});
355
- let mod = hmrClient.hotModulesMap.get(ownerPath);
356
- mod && (mod.callbacks = []);
357
- let staleListeners = hmrClient.ctxToListenersMap.get(ownerPath);
358
- if (staleListeners) for (let [event, staleFns] of staleListeners) {
359
- let listeners = hmrClient.customListenersMap.get(event);
360
- listeners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
361
- }
362
- this.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
363
- }
364
- get data() {
365
- return this.hmrClient.dataMap.get(this.ownerPath);
366
- }
367
- accept(deps, callback) {
368
- if (typeof deps == "function" || !deps) this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod));
369
- else if (typeof deps == "string") this.acceptDeps([deps], ([mod]) => callback?.(mod));
370
- else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
371
- else throw Error("invalid hot.accept() usage.");
372
- }
373
- acceptExports(_, callback) {
374
- this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
375
- }
376
- dispose(cb) {
377
- this.hmrClient.disposeMap.set(this.ownerPath, cb);
378
- }
379
- prune(cb) {
380
- this.hmrClient.pruneMap.set(this.ownerPath, cb);
381
- }
382
- decline() {}
383
- invalidate(message) {
384
- let firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
385
- this.hmrClient.notifyListeners("vite:invalidate", {
386
- path: this.ownerPath,
387
- message,
388
- firstInvalidatedBy
389
- }), this.send("vite:invalidate", {
390
- path: this.ownerPath,
391
- message,
392
- firstInvalidatedBy
393
- }), this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`);
394
- }
395
- on(event, cb) {
396
- let addToMap = (map) => {
397
- let existing = map.get(event) || [];
398
- existing.push(cb), map.set(event, existing);
399
- };
400
- addToMap(this.hmrClient.customListenersMap), addToMap(this.newListeners);
401
- }
402
- off(event, cb) {
403
- let removeFromMap = (map) => {
404
- let existing = map.get(event);
405
- if (existing === void 0) return;
406
- let pruned = existing.filter((l) => l !== cb);
407
- if (pruned.length === 0) {
408
- map.delete(event);
409
- return;
410
- }
411
- map.set(event, pruned);
412
- };
413
- removeFromMap(this.hmrClient.customListenersMap), removeFromMap(this.newListeners);
414
- }
415
- send(event, data) {
416
- this.hmrClient.send({
417
- type: "custom",
418
- event,
419
- data
420
- });
421
- }
422
- acceptDeps(deps, callback = () => {}) {
423
- let mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
424
- id: this.ownerPath,
425
- callbacks: []
426
- };
427
- mod.callbacks.push({
428
- deps,
429
- fn: callback
430
- }), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
431
- }
432
- }, HMRClient = class {
433
- hotModulesMap = /* @__PURE__ */ new Map();
434
- disposeMap = /* @__PURE__ */ new Map();
435
- pruneMap = /* @__PURE__ */ new Map();
436
- dataMap = /* @__PURE__ */ new Map();
437
- customListenersMap = /* @__PURE__ */ new Map();
438
- ctxToListenersMap = /* @__PURE__ */ new Map();
439
- currentFirstInvalidatedBy;
440
- constructor(logger, transport, importUpdatedModule) {
441
- this.logger = logger, this.transport = transport, this.importUpdatedModule = importUpdatedModule;
442
- }
443
- async notifyListeners(event, data) {
444
- let cbs = this.customListenersMap.get(event);
445
- cbs && await Promise.allSettled(cbs.map((cb) => cb(data)));
446
- }
447
- send(payload) {
448
- this.transport.send(payload).catch((err) => {
449
- this.logger.error(err);
450
- });
451
- }
452
- clear() {
453
- this.hotModulesMap.clear(), this.disposeMap.clear(), this.pruneMap.clear(), this.dataMap.clear(), this.customListenersMap.clear(), this.ctxToListenersMap.clear();
454
- }
455
- async prunePaths(paths) {
456
- await Promise.all(paths.map((path) => {
457
- let disposer = this.disposeMap.get(path);
458
- if (disposer) return disposer(this.dataMap.get(path));
459
- })), await Promise.all(paths.map((path) => {
460
- let fn = this.pruneMap.get(path);
461
- if (fn) return fn(this.dataMap.get(path));
462
- }));
463
- }
464
- warnFailedUpdate(err, path) {
465
- (!(err instanceof Error) || !err.message.includes("fetch")) && this.logger.error(err), this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
466
- }
467
- updateQueue = [];
468
- pendingUpdateQueue = !1;
469
- /**
470
- * buffer multiple hot updates triggered by the same src change
471
- * so that they are invoked in the same order they were sent.
472
- * (otherwise the order may be inconsistent because of the http request round trip)
473
- */
474
- async queueUpdate(payload) {
475
- if (this.updateQueue.push(this.fetchUpdate(payload)), !this.pendingUpdateQueue) {
476
- this.pendingUpdateQueue = !0, await Promise.resolve(), this.pendingUpdateQueue = !1;
477
- let loading = [...this.updateQueue];
478
- this.updateQueue = [], (await Promise.all(loading)).forEach((fn) => fn && fn());
479
- }
480
- }
481
- async fetchUpdate(update) {
482
- let { path, acceptedPath, firstInvalidatedBy } = update, mod = this.hotModulesMap.get(path);
483
- if (!mod) return;
484
- let fetchedModule, isSelfUpdate = path === acceptedPath, qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));
485
- if (isSelfUpdate || qualifiedCallbacks.length > 0) {
486
- let disposer = this.disposeMap.get(acceptedPath);
487
- disposer && await disposer(this.dataMap.get(acceptedPath));
488
- try {
489
- fetchedModule = await this.importUpdatedModule(update);
490
- } catch (e) {
491
- this.warnFailedUpdate(e, acceptedPath);
492
- }
493
- }
494
- return () => {
495
- try {
496
- this.currentFirstInvalidatedBy = firstInvalidatedBy;
497
- for (let { deps, fn } of qualifiedCallbacks) fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
498
- let loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
499
- this.logger.debug(`hot updated: ${loggedPath}`);
500
- } finally {
501
- this.currentFirstInvalidatedBy = void 0;
502
- }
503
- };
504
- }
505
- };
506
- //#endregion
507
- //#region src/shared/ssrTransform.ts
508
- /**
509
- * Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
510
- * Top-level imports and dynamic imports work slightly differently in Node.js.
511
- * This function normalizes the differences so it matches prod behaviour.
512
- */
513
- function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
514
- if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
515
- let missingBindings = metadata.importedNames.filter((s) => !(s in mod));
516
- if (missingBindings.length) {
517
- let lastBinding = missingBindings[missingBindings.length - 1];
518
- throw SyntaxError(moduleType === "module" ? `[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'` : `\
519
- [vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
520
- CommonJS modules can always be imported via the default export, for example using:
521
-
522
- import pkg from '${rawId}';
523
- const {${missingBindings.join(", ")}} = pkg;
524
- `);
525
- }
526
- }
527
- }
528
- //#endregion
529
- //#region ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/non-secure/index.js
530
- let nanoid = (size = 21) => {
531
- let id = "", i = size | 0;
532
- for (; i--;) id += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
533
- return id;
534
- };
535
- //#endregion
536
- //#region src/shared/moduleRunnerTransport.ts
537
- function reviveInvokeError(e) {
538
- let error = Error(e.message || "Unknown invoke error");
539
- return Object.assign(error, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), error;
540
- }
541
- const createInvokeableTransport = (transport) => {
542
- if (transport.invoke) return {
543
- ...transport,
544
- async invoke(name, data) {
545
- let result = await transport.invoke({
546
- type: "custom",
547
- event: "vite:invoke",
548
- data: {
549
- id: "send",
550
- name,
551
- data
552
- }
553
- });
554
- if ("error" in result) throw reviveInvokeError(result.error);
555
- return result.result;
556
- }
557
- };
558
- if (!transport.send || !transport.connect) throw Error("transport must implement send and connect when invoke is not implemented");
559
- let rpcPromises = /* @__PURE__ */ new Map();
560
- return {
561
- ...transport,
562
- connect({ onMessage, onDisconnection }) {
563
- return transport.connect({
564
- onMessage(payload) {
565
- if (payload.type === "custom" && payload.event === "vite:invoke") {
566
- let data = payload.data;
567
- if (data.id.startsWith("response:")) {
568
- let invokeId = data.id.slice(9), promise = rpcPromises.get(invokeId);
569
- if (!promise) return;
570
- promise.timeoutId && clearTimeout(promise.timeoutId), rpcPromises.delete(invokeId);
571
- let { error, result } = data.data;
572
- error ? promise.reject(error) : promise.resolve(result);
573
- return;
574
- }
575
- }
576
- onMessage(payload);
577
- },
578
- onDisconnection
579
- });
580
- },
581
- disconnect() {
582
- return rpcPromises.forEach((promise) => {
583
- promise.reject(/* @__PURE__ */ Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
584
- }), rpcPromises.clear(), transport.disconnect?.();
585
- },
586
- send(data) {
587
- return transport.send(data);
588
- },
589
- async invoke(name, data) {
590
- let promiseId = nanoid(), wrappedData = {
591
- type: "custom",
592
- event: "vite:invoke",
593
- data: {
594
- name,
595
- id: `send:${promiseId}`,
596
- data
597
- }
598
- }, sendPromise = transport.send(wrappedData), { promise, resolve, reject } = promiseWithResolvers(), timeout = transport.timeout ?? 6e4, timeoutId;
599
- timeout > 0 && (timeoutId = setTimeout(() => {
600
- rpcPromises.delete(promiseId), reject(/* @__PURE__ */ Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
601
- }, timeout), timeoutId?.unref?.()), rpcPromises.set(promiseId, {
602
- resolve,
603
- reject,
604
- name,
605
- timeoutId
606
- }), sendPromise && sendPromise.catch((err) => {
607
- clearTimeout(timeoutId), rpcPromises.delete(promiseId), reject(err);
608
- });
609
- try {
610
- return await promise;
611
- } catch (err) {
612
- throw reviveInvokeError(err);
613
- }
614
- }
615
- };
616
- }, normalizeModuleRunnerTransport = (transport) => {
617
- let invokeableTransport = createInvokeableTransport(transport), isConnected = !invokeableTransport.connect, connectingPromise;
618
- return {
619
- ...transport,
620
- ...invokeableTransport.connect ? { async connect(onMessage) {
621
- if (isConnected) return;
622
- if (connectingPromise) {
623
- await connectingPromise;
624
- return;
625
- }
626
- let maybePromise = invokeableTransport.connect({
627
- onMessage: onMessage ?? (() => {}),
628
- onDisconnection() {
629
- isConnected = !1;
630
- }
631
- });
632
- maybePromise && (connectingPromise = maybePromise, await connectingPromise, connectingPromise = void 0), isConnected = !0;
633
- } } : {},
634
- ...invokeableTransport.disconnect ? { async disconnect() {
635
- isConnected && (connectingPromise && await connectingPromise, isConnected = !1, await invokeableTransport.disconnect());
636
- } } : {},
637
- async send(data) {
638
- if (invokeableTransport.send) {
639
- if (!isConnected) if (connectingPromise) await connectingPromise;
640
- else throw Error("send was called before connect");
641
- await invokeableTransport.send(data);
642
- }
643
- },
644
- async invoke(name, data) {
645
- if (!isConnected) if (connectingPromise) await connectingPromise;
646
- else throw Error("invoke was called before connect");
647
- return invokeableTransport.invoke(name, data);
648
- }
649
- };
650
- }, createWebSocketModuleRunnerTransport = (options) => {
651
- let pingInterval = options.pingInterval ?? 3e4, ws, pingIntervalId;
652
- return {
653
- async connect({ onMessage, onDisconnection }) {
654
- let socket = options.createConnection();
655
- socket.addEventListener("message", async ({ data }) => {
656
- onMessage(JSON.parse(data));
657
- });
658
- let isOpened = socket.readyState === socket.OPEN;
659
- isOpened || await new Promise((resolve, reject) => {
660
- socket.addEventListener("open", () => {
661
- isOpened = !0, resolve();
662
- }, { once: !0 }), socket.addEventListener("close", async () => {
663
- if (!isOpened) {
664
- reject(/* @__PURE__ */ Error("WebSocket closed without opened."));
665
- return;
666
- }
667
- onMessage({
668
- type: "custom",
669
- event: "vite:ws:disconnect",
670
- data: { webSocket: socket }
671
- }), onDisconnection();
672
- });
673
- }), onMessage({
674
- type: "custom",
675
- event: "vite:ws:connect",
676
- data: { webSocket: socket }
677
- }), ws = socket, pingIntervalId = setInterval(() => {
678
- socket.readyState === socket.OPEN && socket.send(JSON.stringify({ type: "ping" }));
679
- }, pingInterval);
680
- },
681
- disconnect() {
682
- clearInterval(pingIntervalId), ws?.close();
683
- },
684
- send(data) {
685
- ws.send(JSON.stringify(data));
686
- }
687
- };
688
- };
689
- //#endregion
690
- //#region src/shared/builtin.ts
691
- function createIsBuiltin(builtins) {
692
- let plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == "string")), regexBuiltins = builtins.filter((builtin) => typeof builtin != "string");
693
- return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
694
- }
695
- //#endregion
696
- //#region src/module-runner/constants.ts
697
- const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrExportNameKey = "__vite_ssr_exportName__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {}, silentConsole = {
698
- debug: noop,
699
- error: noop
700
- }, hmrLogger = {
701
- debug: (...msg) => console.log("[vite]", ...msg),
702
- error: (error) => console.log("[vite]", error)
703
- };
704
- //#endregion
705
- //#region src/shared/hmrHandler.ts
706
- function createHMRHandler(handler) {
707
- let queue = new Queue();
708
- return (payload) => queue.enqueue(() => handler(payload));
709
- }
710
- var Queue = class {
711
- queue = [];
712
- pending = !1;
713
- enqueue(promise) {
714
- return new Promise((resolve, reject) => {
715
- this.queue.push({
716
- promise,
717
- resolve,
718
- reject
719
- }), this.dequeue();
720
- });
721
- }
722
- dequeue() {
723
- if (this.pending) return !1;
724
- let item = this.queue.shift();
725
- return item ? (this.pending = !0, item.promise().then(item.resolve).catch(item.reject).finally(() => {
726
- this.pending = !1, this.dequeue();
727
- }), !0) : !1;
728
- }
729
- };
730
- //#endregion
731
- //#region src/module-runner/hmrHandler.ts
732
- function createHMRHandlerForRunner(runner) {
733
- return createHMRHandler(async (payload) => {
734
- let hmrClient = runner.hmrClient;
735
- if (!(!hmrClient || runner.isClosed())) switch (payload.type) {
736
- case "connected":
737
- hmrClient.logger.debug("connected.");
738
- break;
739
- case "update":
740
- await hmrClient.notifyListeners("vite:beforeUpdate", payload), await Promise.all(payload.updates.map(async (update) => {
741
- if (update.type === "js-update") return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);
742
- hmrClient.logger.error("css hmr is not supported in runner mode.");
743
- })), await hmrClient.notifyListeners("vite:afterUpdate", payload);
744
- break;
745
- case "custom":
746
- await hmrClient.notifyListeners(payload.event, payload.data);
747
- break;
748
- case "full-reload": {
749
- let { triggeredBy } = payload, clearEntrypointUrls = triggeredBy ? getModulesEntrypoints(runner, getModulesByFile(runner, slash(triggeredBy))) : findAllEntrypoints(runner);
750
- if (!clearEntrypointUrls.size) break;
751
- hmrClient.logger.debug("program reload"), await hmrClient.notifyListeners("vite:beforeFullReload", payload), runner.evaluatedModules.clear();
752
- for (let url of clearEntrypointUrls) {
753
- if (runner.isClosed()) break;
754
- try {
755
- await runner.import(url);
756
- } catch (err) {
757
- if (runner.isClosed()) break;
758
- err.code !== "ERR_OUTDATED_OPTIMIZED_DEP" && hmrClient.logger.error(`An error happened during full reload\n${err.message}\n${err.stack}`);
759
- }
760
- }
761
- break;
762
- }
763
- case "prune":
764
- await hmrClient.notifyListeners("vite:beforePrune", payload), await hmrClient.prunePaths(payload.paths);
765
- break;
766
- case "error": {
767
- await hmrClient.notifyListeners("vite:error", payload);
768
- let err = payload.err;
769
- hmrClient.logger.error(`Internal Server Error\n${err.message}\n${err.stack}`);
770
- break;
771
- }
772
- case "ping": break;
773
- default: return payload;
774
- }
775
- });
776
- }
777
- function getModulesByFile(runner, file) {
778
- let nodes = runner.evaluatedModules.getModulesByFile(file);
779
- return nodes ? [...nodes].map((node) => node.id) : [];
780
- }
781
- function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Set(), entrypoints = /* @__PURE__ */ new Set()) {
782
- for (let moduleId of modules) {
783
- if (visited.has(moduleId)) continue;
784
- visited.add(moduleId);
785
- let module = runner.evaluatedModules.getModuleById(moduleId);
786
- if (module) {
787
- if (!module.importers.size) {
788
- entrypoints.add(module.url);
789
- continue;
790
- }
791
- for (let importer of module.importers) getModulesEntrypoints(runner, [importer], visited, entrypoints);
792
- }
793
- }
794
- return entrypoints;
795
- }
796
- function findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {
797
- for (let mod of runner.evaluatedModules.idToModuleMap.values()) mod.importers.size || entrypoints.add(mod.url);
798
- return entrypoints;
799
- }
800
- //#endregion
801
- //#region src/module-runner/sourcemap/interceptor.ts
802
- const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {
803
- for (let handler of handlers) {
804
- let result = handler(...args);
805
- if (result) return result;
806
- }
807
- return null;
808
- }), retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers);
809
- let overridden = !1;
810
- const originalPrepare = Error.prepareStackTrace;
811
- function resetInterceptor(runner, options) {
812
- evaluatedModulesCache.delete(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), evaluatedModulesCache.size === 0 && (Error.prepareStackTrace = originalPrepare, overridden = !1);
813
- }
814
- function interceptStackTrace(runner, options = {}) {
815
- return overridden ||= (Error.prepareStackTrace = prepareStackTrace, !0), evaluatedModulesCache.add(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runner, options);
816
- }
817
- function supportRelativeURL(file, url) {
818
- if (!file) return url;
819
- let dir = posixDirname(slash(file)), match = /^\w+:\/\/[^/]*/.exec(dir), protocol = match ? match[0] : "", startPath = dir.slice(protocol.length);
820
- return protocol && /^\/\w:/.test(startPath) ? (protocol += "/", protocol + slash(posixResolve(startPath, url))) : protocol + posixResolve(startPath, url);
821
- }
822
- function getRunnerSourceMap(position) {
823
- for (let moduleGraph of evaluatedModulesCache) {
824
- let sourceMap = moduleGraph.getModuleSourceMapById(position.source);
825
- if (sourceMap) return {
826
- url: position.source,
827
- map: sourceMap,
828
- vite: !0
829
- };
830
- }
831
- return null;
832
- }
833
- function retrieveFile(path) {
834
- if (path in fileContentsCache) return fileContentsCache[path];
835
- let content = retrieveFileFromHandlers(path);
836
- return typeof content == "string" ? (fileContentsCache[path] = content, content) : null;
837
- }
838
- function retrieveSourceMapURL(source) {
839
- let fileData = retrieveFile(source);
840
- if (!fileData) return null;
841
- let re = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm, lastMatch, match;
842
- for (; match = re.exec(fileData);) lastMatch = match;
843
- return lastMatch ? lastMatch[1] : null;
844
- }
845
- const reSourceMap = /^data:application\/json[^,]+base64,/;
846
- function retrieveSourceMap(source) {
847
- let urlAndMap = retrieveSourceMapFromHandlers(source);
848
- if (urlAndMap) return urlAndMap;
849
- let sourceMappingURL = retrieveSourceMapURL(source);
850
- if (!sourceMappingURL) return null;
851
- let sourceMapData;
852
- if (reSourceMap.test(sourceMappingURL)) {
853
- let rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
854
- sourceMapData = Buffer.from(rawData, "base64").toString(), sourceMappingURL = source;
855
- } else sourceMappingURL = supportRelativeURL(source, sourceMappingURL), sourceMapData = retrieveFile(sourceMappingURL);
856
- return sourceMapData ? {
857
- url: sourceMappingURL,
858
- map: sourceMapData
859
- } : null;
860
- }
861
- function mapSourcePosition(position) {
862
- if (!position.source) return position;
863
- let sourceMap = getRunnerSourceMap(position);
864
- if (sourceMap ||= sourceMapCache[position.source], !sourceMap) {
865
- let urlAndMap = retrieveSourceMap(position.source);
866
- if (urlAndMap && urlAndMap.map) {
867
- let url = urlAndMap.url;
868
- sourceMap = sourceMapCache[position.source] = {
869
- url,
870
- map: new DecodedMap(typeof urlAndMap.map == "string" ? JSON.parse(urlAndMap.map) : urlAndMap.map, url)
871
- };
872
- let contents = sourceMap.map?.map.sourcesContent;
873
- sourceMap.map && contents && sourceMap.map.resolvedSources.forEach((source, i) => {
874
- let content = contents[i];
875
- if (content && source && url) {
876
- let contentUrl = supportRelativeURL(url, source);
877
- fileContentsCache[contentUrl] = content;
878
- }
879
- });
880
- } else sourceMap = sourceMapCache[position.source] = {
881
- url: null,
882
- map: null
883
- };
884
- }
885
- if (sourceMap.map && sourceMap.url) {
886
- let originalPosition = getOriginalPosition(sourceMap.map, position);
887
- if (originalPosition && originalPosition.source != null) return originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source), sourceMap.vite && (originalPosition._vite = !0), originalPosition;
888
- }
889
- return position;
890
- }
891
- function mapEvalOrigin(origin) {
892
- let match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
893
- if (match) {
894
- let position = mapSourcePosition({
895
- name: null,
896
- source: match[2],
897
- line: +match[3],
898
- column: match[4] - 1
899
- });
900
- return `eval at ${match[1]} (${position.source}:${position.line}:${position.column + 1})`;
901
- }
902
- return match = /^eval at ([^(]+) \((.+)\)$/.exec(origin), match ? `eval at ${match[1]} (${mapEvalOrigin(match[2])})` : origin;
903
- }
904
- function CallSiteToString() {
905
- let fileName, fileLocation = "";
906
- if (this.isNative()) fileLocation = "native";
907
- else {
908
- fileName = this.getScriptNameOrSourceURL(), !fileName && this.isEval() && (fileLocation = this.getEvalOrigin(), fileLocation += ", "), fileName ? fileLocation += fileName : fileLocation += "<anonymous>";
909
- let lineNumber = this.getLineNumber();
910
- if (lineNumber != null) {
911
- fileLocation += `:${lineNumber}`;
912
- let columnNumber = this.getColumnNumber();
913
- columnNumber && (fileLocation += `:${columnNumber}`);
914
- }
915
- }
916
- let line = "", functionName = this.getFunctionName(), addSuffix = !0, isConstructor = this.isConstructor();
917
- if (this.isToplevel() || isConstructor) isConstructor ? line += `new ${functionName || "<anonymous>"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);
918
- else {
919
- let typeName = this.getTypeName();
920
- typeName === "[object Object]" && (typeName = "null");
921
- let methodName = this.getMethodName();
922
- functionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || "<anonymous>"}`;
923
- }
924
- return addSuffix && (line += ` (${fileLocation})`), line;
925
- }
926
- function cloneCallSite(frame) {
927
- let object = {};
928
- return Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => {
929
- let key = name;
930
- object[key] = /^(?:is|get)/.test(name) ? function() {
931
- return frame[key].call(frame);
932
- } : frame[key];
933
- }), object.toString = CallSiteToString, object;
934
- }
935
- function wrapCallSite(frame, state) {
936
- if (state === void 0 && (state = {
937
- nextPosition: null,
938
- curPosition: null
939
- }), frame.isNative()) return state.curPosition = null, frame;
940
- let source = frame.getFileName() || frame.getScriptNameOrSourceURL();
941
- if (source) {
942
- let position = mapSourcePosition({
943
- name: null,
944
- source,
945
- line: frame.getLineNumber() ?? 0,
946
- column: (frame.getColumnNumber() ?? 1) - 1
947
- });
948
- state.curPosition = position, frame = cloneCallSite(frame);
949
- let originalFunctionName = frame.getFunctionName;
950
- return frame.getFunctionName = function() {
951
- let name = state.nextPosition == null ? originalFunctionName() : state.nextPosition.name || originalFunctionName();
952
- return name === "eval" && "_vite" in position ? null : name;
953
- }, frame.getFileName = function() {
954
- return position.source ?? null;
955
- }, frame.getLineNumber = function() {
956
- return position.line;
957
- }, frame.getColumnNumber = function() {
958
- return position.column + 1;
959
- }, frame.getScriptNameOrSourceURL = function() {
960
- return position.source;
961
- }, frame;
962
- }
963
- let origin = frame.isEval() && frame.getEvalOrigin();
964
- return origin ? (origin = mapEvalOrigin(origin), frame = cloneCallSite(frame), frame.getEvalOrigin = function() {
965
- return origin || void 0;
966
- }, frame) : frame;
967
- }
968
- function prepareStackTrace(error, stack) {
969
- let errorString = `${error.name || "Error"}: ${error.message || ""}`, state = {
970
- nextPosition: null,
971
- curPosition: null
972
- }, processedStack = [];
973
- for (let i = stack.length - 1; i >= 0; i--) processedStack.push(`\n at ${wrapCallSite(stack[i], state)}`), state.nextPosition = state.curPosition;
974
- return state.curPosition = state.nextPosition = null, errorString + processedStack.reverse().join("");
975
- }
976
- //#endregion
977
- //#region src/module-runner/sourcemap/index.ts
978
- function enableSourceMapSupport(runner) {
979
- if (runner.options.sourcemapInterceptor === "node") {
980
- if (typeof process > "u") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because global \"process\" variable is not available.");
981
- if (typeof process.setSourceMapsEnabled != "function") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because \"process.setSourceMapsEnabled\" function is not available. Please use Node >= 16.6.0.");
982
- let isEnabledAlready = process.sourceMapsEnabled ?? !1;
983
- return process.setSourceMapsEnabled(!0), () => !isEnabledAlready && process.setSourceMapsEnabled(!1);
984
- }
985
- return interceptStackTrace(runner, typeof runner.options.sourcemapInterceptor == "object" ? runner.options.sourcemapInterceptor : void 0);
986
- }
987
- //#endregion
988
- //#region src/module-runner/esmEvaluator.ts
989
- var ESModulesEvaluator = class {
990
- startOffset = getAsyncFunctionDeclarationPaddingLineCount();
991
- async runInlinedModule(context, code) {
992
- await new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
993
- }
994
- runExternalModule(filepath) {
995
- return import(filepath);
996
- }
997
- };
998
- //#endregion
999
- //#region src/module-runner/importMetaResolver.ts
1000
- const customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/", customizationHooksModule = `
1001
-
1002
- export async function resolve(specifier, context, nextResolve) {
1003
- if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) {
1004
- const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length)
1005
- const [parsedSpecifier, parsedImporter] = JSON.parse(data)
1006
- specifier = parsedSpecifier
1007
- context.parentURL = parsedImporter
1008
- }
1009
- return nextResolve(specifier, context)
1010
- }
1011
-
1012
- `;
1013
- function customizationHookResolve(specifier, context, nextResolve) {
1014
- if (specifier.startsWith(customizationHookNamespace)) {
1015
- let data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);
1016
- specifier = parsedSpecifier, context.parentURL = parsedImporter;
1017
- }
1018
- return nextResolve(specifier, context);
1019
- }
1020
- let isHookRegistered = !1;
1021
- function createImportMetaResolver() {
1022
- if (isHookRegistered) return importMetaResolveWithCustomHook;
1023
- let module;
1024
- try {
1025
- module = typeof process < "u" ? process.getBuiltinModule("node:module").Module : void 0;
1026
- } catch {
1027
- return;
1028
- }
1029
- if (module) {
1030
- if (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), isHookRegistered = !0, importMetaResolveWithCustomHook;
1031
- if (module.register) {
1032
- try {
1033
- let hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;
1034
- module.register(hookModuleContent);
1035
- } catch (e) {
1036
- if ("code" in e && e.code === "ERR_NETWORK_IMPORT_DISALLOWED") return;
1037
- throw e;
1038
- }
1039
- return isHookRegistered = !0, importMetaResolveWithCustomHook;
1040
- }
1041
- }
1042
- }
1043
- function importMetaResolveWithCustomHook(specifier, importer) {
1044
- return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
1045
- }
1046
- `${customizationHookNamespace}`;
1047
- //#endregion
1048
- //#region src/module-runner/createImportMeta.ts
1049
- const envProxy = new Proxy({}, { get(_, p) {
1050
- throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
1051
- } });
1052
- function createDefaultImportMeta(modulePath) {
1053
- let href = posixPathToFileHref(modulePath), filename = modulePath, dirname = posixDirname(modulePath);
1054
- return {
1055
- filename: isWindows ? toWindowsPath(filename) : filename,
1056
- dirname: isWindows ? toWindowsPath(dirname) : dirname,
1057
- url: href,
1058
- env: envProxy,
1059
- resolve(_id, _parent) {
1060
- throw Error("[module runner] \"import.meta.resolve\" is not supported.");
1061
- },
1062
- glob() {
1063
- throw Error("[module runner] \"import.meta.glob\" is statically replaced during file transformation. Make sure to reference it by the full name.");
1064
- }
1065
- };
1066
- }
1067
- /**
1068
- * Create import.meta object for Node.js.
1069
- */
1070
- function createNodeImportMeta(modulePath) {
1071
- let defaultMeta = createDefaultImportMeta(modulePath), href = defaultMeta.url, importMetaResolver = createImportMetaResolver();
1072
- return {
1073
- ...defaultMeta,
1074
- main: !1,
1075
- resolve(id, parent) {
1076
- return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
1077
- }
1078
- };
1079
- }
1080
- //#endregion
1081
- //#region src/module-runner/runner.ts
1082
- var ModuleRunner = class {
1083
- evaluatedModules;
1084
- hmrClient;
1085
- transport;
1086
- resetSourceMapSupport;
1087
- concurrentModuleNodePromises = /* @__PURE__ */ new Map();
1088
- isBuiltin;
1089
- builtinsPromise;
1090
- closed = !1;
1091
- constructor(options, evaluator = new ESModulesEvaluator(), debug) {
1092
- if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
1093
- let optionsHmr = options.hmr ?? !0, resolvedHmrLogger = optionsHmr === !0 || optionsHmr.logger === void 0 ? hmrLogger : optionsHmr.logger === !1 ? silentConsole : optionsHmr.logger;
1094
- if (this.hmrClient = new HMRClient(resolvedHmrLogger, this.transport, ({ acceptedPath }) => this.import(acceptedPath)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
1095
- this.transport.connect(createHMRHandlerForRunner(this));
1096
- } else this.transport.connect?.();
1097
- options.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));
1098
- }
1099
- /**
1100
- * URL to execute. Accepts file path, server path or id relative to the root.
1101
- */
1102
- async import(url) {
1103
- let fetchedModule = await this.cachedModule(url);
1104
- return await this.cachedRequest(url, fetchedModule);
1105
- }
1106
- /**
1107
- * Clear all caches including HMR listeners.
1108
- */
1109
- clearCache() {
1110
- this.evaluatedModules.clear(), this.hmrClient?.clear();
1111
- }
1112
- /**
1113
- * Clears all caches, removes all HMR listeners, and resets source map support.
1114
- * This method doesn't stop the HMR connection.
1115
- */
1116
- async close() {
1117
- this.resetSourceMapSupport?.(), this.clearCache(), this.hmrClient = void 0, this.closed = !0, await this.transport.disconnect?.();
1118
- }
1119
- /**
1120
- * Returns `true` if the runtime has been closed by calling `close()` method.
1121
- */
1122
- isClosed() {
1123
- return this.closed;
1124
- }
1125
- processImport(exports, fetchResult, metadata) {
1126
- if (!("externalize" in fetchResult)) return exports;
1127
- let { url, type } = fetchResult;
1128
- return type !== "module" && type !== "commonjs" || analyzeImportedModDifference(exports, url, type, metadata), exports;
1129
- }
1130
- isCircularModule(mod) {
1131
- for (let importedFile of mod.imports) if (mod.importers.has(importedFile)) return !0;
1132
- return !1;
1133
- }
1134
- isCircularImport(importers, moduleUrl, visited = /* @__PURE__ */ new Set()) {
1135
- for (let importer of importers) {
1136
- if (visited.has(importer)) continue;
1137
- if (visited.add(importer), importer === moduleUrl) return !0;
1138
- let mod = this.evaluatedModules.getModuleById(importer);
1139
- if (mod && mod.importers.size && this.isCircularImport(mod.importers, moduleUrl, visited)) return !0;
1140
- }
1141
- return !1;
1142
- }
1143
- async cachedRequest(url, mod, callstack = [], metadata) {
1144
- let meta = mod.meta, moduleId = meta.id, { importers } = mod, importee = callstack[callstack.length - 1];
1145
- if (importee && importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);
1146
- if ((callstack.includes(moduleId) || this.isCircularModule(mod) || this.isCircularImport(importers, moduleId)) && mod.exports) return this.processImport(mod.exports, meta, metadata);
1147
- let debugTimer;
1148
- this.debug && (debugTimer = setTimeout(() => {
1149
- this.debug(`[module runner] module ${moduleId} takes over 2s to load.\n${`stack:\n${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join("\n")}`}`);
1150
- }, 2e3));
1151
- try {
1152
- if (mod.promise) return this.processImport(await mod.promise, meta, metadata);
1153
- let promise = this.directRequest(url, mod, callstack);
1154
- return mod.promise = promise, mod.evaluated = !1, this.processImport(await promise, meta, metadata);
1155
- } finally {
1156
- mod.evaluated = !0, debugTimer && clearTimeout(debugTimer);
1157
- }
1158
- }
1159
- async cachedModule(url, importer) {
1160
- let cached = this.concurrentModuleNodePromises.get(url);
1161
- if (cached) this.debug?.("[module runner] using cached module info for", url);
1162
- else {
1163
- let cachedModule = this.evaluatedModules.getModuleByUrl(url);
1164
- cached = this.getModuleInformation(url, importer, cachedModule).finally(() => {
1165
- this.concurrentModuleNodePromises.delete(url);
1166
- }), this.concurrentModuleNodePromises.set(url, cached);
1167
- }
1168
- return cached;
1169
- }
1170
- ensureBuiltins() {
1171
- if (!this.isBuiltin) return this.builtinsPromise ??= (async () => {
1172
- try {
1173
- this.debug?.("[module runner] fetching builtins from server");
1174
- let builtins = (await this.transport.invoke("getBuiltins", [])).map((builtin) => typeof builtin == "object" && builtin && "type" in builtin ? builtin.type === "string" ? builtin.value : new RegExp(builtin.source, builtin.flags) : builtin);
1175
- this.isBuiltin = createIsBuiltin(builtins), this.debug?.("[module runner] builtins loaded:", builtins);
1176
- } finally {
1177
- this.builtinsPromise = void 0;
1178
- }
1179
- })(), this.builtinsPromise;
1180
- }
1181
- async getModuleInformation(url, importer, cachedModule) {
1182
- if (this.closed) throw Error("Vite module runner has been closed.");
1183
- await this.ensureBuiltins(), this.debug?.("[module runner] fetching", url);
1184
- let isCached = !!(typeof cachedModule == "object" && cachedModule.meta), fetchedModule = url.startsWith("data:") || this.isBuiltin?.(url) ? {
1185
- externalize: url,
1186
- type: "builtin"
1187
- } : await this.transport.invoke("fetchModule", [
1188
- url,
1189
- importer,
1190
- {
1191
- cached: isCached,
1192
- startOffset: this.evaluator.startOffset
1193
- }
1194
- ]);
1195
- if ("cache" in fetchedModule) {
1196
- if (!cachedModule || !cachedModule.meta) throw Error(`Module "${url}" was mistakenly invalidated during fetch phase.`);
1197
- return cachedModule;
1198
- }
1199
- let moduleId = "externalize" in fetchedModule ? fetchedModule.externalize : fetchedModule.id, moduleUrl = "url" in fetchedModule ? fetchedModule.url : url, module = this.evaluatedModules.ensureModule(moduleId, moduleUrl);
1200
- return "invalidate" in fetchedModule && fetchedModule.invalidate && this.evaluatedModules.invalidateModule(module), fetchedModule.url = moduleUrl, fetchedModule.id = moduleId, module.meta = fetchedModule, module;
1201
- }
1202
- async directRequest(url, mod, _callstack) {
1203
- let fetchResult = mod.meta, moduleId = fetchResult.id, callstack = [..._callstack, moduleId], request = async (dep, metadata) => {
1204
- let importer = "file" in fetchResult && fetchResult.file || moduleId, depMod = await this.cachedModule(dep, importer);
1205
- return depMod.importers.add(moduleId), mod.imports.add(depMod.id), this.cachedRequest(dep, depMod, callstack, metadata);
1206
- }, dynamicRequest = async (dep) => (dep = String(dep), dep[0] === "." && (dep = posixResolve(posixDirname(url), dep)), request(dep, { isDynamicImport: !0 }));
1207
- if ("externalize" in fetchResult) {
1208
- let { externalize } = fetchResult;
1209
- this.debug?.("[module runner] externalizing", externalize);
1210
- let exports = await this.evaluator.runExternalModule(externalize);
1211
- return mod.exports = exports, exports;
1212
- }
1213
- let { code, file } = fetchResult;
1214
- if (code == null) {
1215
- let importer = callstack[callstack.length - 2];
1216
- throw Error(`[module runner] Failed to load "${url}"${importer ? ` imported from ${importer}` : ""}`);
1217
- }
1218
- let createImportMeta = this.options.createImportMeta ?? createDefaultImportMeta, modulePath = cleanUrl(file || moduleId), href = posixPathToFileHref(modulePath), meta = await createImportMeta(modulePath), exports = Object.create(null);
1219
- Object.defineProperty(exports, Symbol.toStringTag, {
1220
- value: "Module",
1221
- enumerable: !1,
1222
- configurable: !1
1223
- }), mod.exports = exports;
1224
- let hotContext;
1225
- this.hmrClient && Object.defineProperty(meta, "hot", {
1226
- enumerable: !0,
1227
- get: () => {
1228
- if (!this.hmrClient) throw Error("[module runner] HMR client was closed.");
1229
- return this.debug?.("[module runner] creating hmr context for", mod.url), hotContext ||= new HMRContext(this.hmrClient, mod.url), hotContext;
1230
- },
1231
- set: (value) => {
1232
- hotContext = value;
1233
- }
1234
- });
1235
- let context = {
1236
- [ssrImportKey]: request,
1237
- [ssrDynamicImportKey]: dynamicRequest,
1238
- [ssrModuleExportsKey]: exports,
1239
- [ssrExportAllKey]: (obj) => exportAll(exports, obj),
1240
- [ssrExportNameKey]: (name, getter) => Object.defineProperty(exports, name, {
1241
- enumerable: !0,
1242
- configurable: !0,
1243
- get: getter
1244
- }),
1245
- [ssrImportMetaKey]: meta
1246
- };
1247
- return this.debug?.("[module runner] executing", href), await this.evaluator.runInlinedModule(context, code, mod), exports;
1248
- }
1249
- };
1250
- function exportAll(exports, sourceModule) {
1251
- if (exports !== sourceModule && !(isPrimitive(sourceModule) || Array.isArray(sourceModule) || sourceModule instanceof Promise)) {
1252
- for (let key in sourceModule) if (key !== "default" && key !== "__esModule" && !(key in exports)) try {
1253
- Object.defineProperty(exports, key, {
1254
- enumerable: !0,
1255
- configurable: !0,
1256
- get: () => sourceModule[key]
1257
- });
1258
- } catch {}
1259
- }
1260
- }
1261
- //#endregion
1262
- export { ESModulesEvaluator, EvaluatedModules, ModuleRunner, createDefaultImportMeta, createNodeImportMeta, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };