rebrowser-playwright-core 1.49.1 → 1.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/ThirdPartyNotices.txt +7 -1228
  2. package/bin/install_webkit_wsl.ps1 +33 -0
  3. package/bin/reinstall_chrome_beta_linux.sh +1 -1
  4. package/bin/reinstall_chrome_beta_mac.sh +1 -1
  5. package/bin/reinstall_chrome_stable_linux.sh +1 -1
  6. package/bin/reinstall_chrome_stable_mac.sh +1 -1
  7. package/bin/reinstall_msedge_beta_linux.sh +7 -1
  8. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  9. package/bin/reinstall_msedge_dev_linux.sh +7 -1
  10. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  11. package/bin/reinstall_msedge_stable_linux.sh +7 -1
  12. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  13. package/browsers.json +21 -34
  14. package/cli.js +5 -1
  15. package/index.js +2 -18
  16. package/lib/bootstrap.js +149 -0
  17. package/lib/coreBundle.js +78218 -0
  18. package/lib/entry/cliDaemon.js +5 -0
  19. package/lib/entry/dashboardApp.js +3 -0
  20. package/lib/entry/mcp.js +10 -0
  21. package/lib/entry/oopBrowserDownload.js +3 -0
  22. package/lib/package.js +50 -0
  23. package/lib/server/electron/loader.js +109 -43
  24. package/lib/serverRegistry.js +1939 -0
  25. package/lib/serverRegistry.js.LICENSE +65 -0
  26. package/lib/tools/cli-client/channelSessions.js +141 -0
  27. package/lib/tools/cli-client/cli.js +7 -0
  28. package/lib/tools/cli-client/help.json +808 -0
  29. package/lib/tools/cli-client/minimist.js +128 -0
  30. package/lib/tools/cli-client/output.js +352 -0
  31. package/lib/tools/cli-client/program.js +422 -0
  32. package/lib/tools/cli-client/registry.js +180 -0
  33. package/lib/tools/cli-client/session.js +261 -0
  34. package/lib/tools/dashboard/appIcon.png +0 -0
  35. package/lib/tools/skills/playwright-cli/SKILL.md +493 -0
  36. package/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
  37. package/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
  38. package/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
  39. package/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
  40. package/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
  41. package/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
  42. package/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
  43. package/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
  44. package/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
  45. package/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
  46. package/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
  47. package/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
  48. package/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
  49. package/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
  50. package/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
  51. package/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
  52. package/lib/tools/skills/playwright-trace/SKILL.md +174 -0
  53. package/lib/tools/utils/extension.js +112 -0
  54. package/lib/tools/utils/socketConnection.js +108 -0
  55. package/lib/utilsBundle.js +86076 -79
  56. package/lib/utilsBundle.js.LICENSE +1890 -0
  57. package/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
  58. package/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
  59. package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  60. package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  61. package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  62. package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  63. package/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
  64. package/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
  65. package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  66. package/lib/vite/dashboard/index.html +29 -0
  67. package/lib/vite/dashboard/playwright-logo.svg +24 -0
  68. package/lib/vite/htmlReport/index.html +3 -56
  69. package/lib/vite/htmlReport/report.css +2 -0
  70. package/lib/vite/htmlReport/report.js +32 -0
  71. package/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  72. package/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +32 -0
  73. package/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
  74. package/lib/vite/recorder/assets/index-Cn0mmDuv.js +129 -0
  75. package/lib/vite/recorder/index.html +3 -3
  76. package/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +32 -0
  77. package/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +184 -0
  78. package/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  79. package/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +7 -0
  80. package/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  81. package/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
  82. package/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  83. package/lib/vite/traceViewer/index.html +9 -11
  84. package/lib/vite/traceViewer/index.oNry3Hjv.js +1 -0
  85. package/lib/vite/traceViewer/manifest.webmanifest +16 -0
  86. package/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  87. package/lib/vite/traceViewer/snapshot.html +4 -15
  88. package/lib/vite/traceViewer/sw.bundle.js +4 -3
  89. package/lib/vite/traceViewer/uiMode.CYwC_gH1.js +5 -0
  90. package/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
  91. package/lib/vite/traceViewer/uiMode.html +6 -8
  92. package/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  93. package/lib/webp_codec.LICENSE +173 -0
  94. package/lib/webp_codec.wasm +0 -0
  95. package/lib/{utilsBundleImpl/xdg-open → xdg-open} +338 -137
  96. package/package.json +6 -16
  97. package/types/protocol.d.ts +9357 -6200
  98. package/types/structs.d.ts +8 -1
  99. package/types/types.d.ts +9490 -4947
  100. package/bin/PrintDeps.exe +0 -0
  101. package/bin/README.md +0 -2
  102. package/lib/androidServerImpl.js +0 -69
  103. package/lib/browserServerImpl.js +0 -92
  104. package/lib/cli/driver.js +0 -95
  105. package/lib/cli/program.js +0 -607
  106. package/lib/cli/programWithTestStub.js +0 -67
  107. package/lib/client/accessibility.js +0 -50
  108. package/lib/client/android.js +0 -473
  109. package/lib/client/api.js +0 -285
  110. package/lib/client/artifact.js +0 -79
  111. package/lib/client/browser.js +0 -145
  112. package/lib/client/browserContext.js +0 -559
  113. package/lib/client/browserType.js +0 -241
  114. package/lib/client/cdpSession.js +0 -53
  115. package/lib/client/channelOwner.js +0 -235
  116. package/lib/client/clientHelper.js +0 -57
  117. package/lib/client/clientInstrumentation.js +0 -50
  118. package/lib/client/clock.js +0 -68
  119. package/lib/client/connection.js +0 -333
  120. package/lib/client/consoleMessage.js +0 -55
  121. package/lib/client/coverage.js +0 -41
  122. package/lib/client/dialog.js +0 -57
  123. package/lib/client/download.js +0 -62
  124. package/lib/client/electron.js +0 -135
  125. package/lib/client/elementHandle.js +0 -321
  126. package/lib/client/errors.js +0 -77
  127. package/lib/client/eventEmitter.js +0 -314
  128. package/lib/client/events.js +0 -94
  129. package/lib/client/fetch.js +0 -391
  130. package/lib/client/fileChooser.js +0 -45
  131. package/lib/client/frame.js +0 -504
  132. package/lib/client/harRouter.js +0 -99
  133. package/lib/client/input.js +0 -111
  134. package/lib/client/jsHandle.js +0 -121
  135. package/lib/client/jsonPipe.js +0 -35
  136. package/lib/client/localUtils.js +0 -36
  137. package/lib/client/locator.js +0 -448
  138. package/lib/client/network.js +0 -767
  139. package/lib/client/page.js +0 -748
  140. package/lib/client/playwright.js +0 -80
  141. package/lib/client/selectors.js +0 -67
  142. package/lib/client/stream.js +0 -54
  143. package/lib/client/tracing.js +0 -147
  144. package/lib/client/types.js +0 -24
  145. package/lib/client/video.js +0 -51
  146. package/lib/client/waiter.js +0 -162
  147. package/lib/client/webError.js +0 -37
  148. package/lib/client/worker.js +0 -71
  149. package/lib/client/writableStream.js +0 -54
  150. package/lib/common/socksProxy.js +0 -569
  151. package/lib/common/timeoutSettings.js +0 -73
  152. package/lib/common/types.js +0 -5
  153. package/lib/generated/clockSource.js +0 -7
  154. package/lib/generated/consoleApiSource.js +0 -7
  155. package/lib/generated/injectedScriptSource.js +0 -7
  156. package/lib/generated/pollingRecorderSource.js +0 -7
  157. package/lib/generated/utilityScriptSource.js +0 -7
  158. package/lib/generated/webSocketMockSource.js +0 -7
  159. package/lib/image_tools/colorUtils.js +0 -98
  160. package/lib/image_tools/compare.js +0 -108
  161. package/lib/image_tools/imageChannel.js +0 -70
  162. package/lib/image_tools/stats.js +0 -102
  163. package/lib/inProcessFactory.js +0 -54
  164. package/lib/inprocess.js +0 -20
  165. package/lib/outofprocess.js +0 -67
  166. package/lib/protocol/debug.js +0 -27
  167. package/lib/protocol/serializers.js +0 -173
  168. package/lib/protocol/transport.js +0 -82
  169. package/lib/protocol/validator.js +0 -2780
  170. package/lib/protocol/validatorPrimitives.js +0 -139
  171. package/lib/remote/playwrightConnection.js +0 -274
  172. package/lib/remote/playwrightServer.js +0 -110
  173. package/lib/server/accessibility.js +0 -62
  174. package/lib/server/android/android.js +0 -441
  175. package/lib/server/android/backendAdb.js +0 -172
  176. package/lib/server/ariaSnapshot.js +0 -33
  177. package/lib/server/artifact.js +0 -104
  178. package/lib/server/bidi/bidiBrowser.js +0 -311
  179. package/lib/server/bidi/bidiChromium.js +0 -124
  180. package/lib/server/bidi/bidiConnection.js +0 -204
  181. package/lib/server/bidi/bidiExecutionContext.js +0 -156
  182. package/lib/server/bidi/bidiFirefox.js +0 -104
  183. package/lib/server/bidi/bidiInput.js +0 -158
  184. package/lib/server/bidi/bidiNetworkManager.js +0 -338
  185. package/lib/server/bidi/bidiOverCdp.js +0 -103
  186. package/lib/server/bidi/bidiPage.js +0 -529
  187. package/lib/server/bidi/bidiPdf.js +0 -140
  188. package/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
  189. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -238
  190. package/lib/server/bidi/third_party/bidiProtocol.js +0 -139
  191. package/lib/server/bidi/third_party/bidiSerializer.js +0 -144
  192. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -221
  193. package/lib/server/browser.js +0 -148
  194. package/lib/server/browserContext.js +0 -667
  195. package/lib/server/browserType.js +0 -338
  196. package/lib/server/chromium/chromium.js +0 -354
  197. package/lib/server/chromium/chromiumSwitches.js +0 -46
  198. package/lib/server/chromium/crAccessibility.js +0 -237
  199. package/lib/server/chromium/crBrowser.js +0 -516
  200. package/lib/server/chromium/crConnection.js +0 -381
  201. package/lib/server/chromium/crCoverage.js +0 -246
  202. package/lib/server/chromium/crDevTools.js +0 -108
  203. package/lib/server/chromium/crDragDrop.js +0 -143
  204. package/lib/server/chromium/crExecutionContext.js +0 -136
  205. package/lib/server/chromium/crInput.js +0 -171
  206. package/lib/server/chromium/crNetworkManager.js +0 -767
  207. package/lib/server/chromium/crPage.js +0 -1143
  208. package/lib/server/chromium/crPdf.js +0 -153
  209. package/lib/server/chromium/crProtocolHelper.js +0 -133
  210. package/lib/server/chromium/crServiceWorker.js +0 -114
  211. package/lib/server/chromium/defaultFontFamilies.js +0 -145
  212. package/lib/server/chromium/videoRecorder.js +0 -155
  213. package/lib/server/clock.js +0 -125
  214. package/lib/server/codegen/csharp.js +0 -294
  215. package/lib/server/codegen/java.js +0 -232
  216. package/lib/server/codegen/javascript.js +0 -245
  217. package/lib/server/codegen/jsonl.js +0 -47
  218. package/lib/server/codegen/language.js +0 -88
  219. package/lib/server/codegen/languages.js +0 -30
  220. package/lib/server/codegen/python.js +0 -261
  221. package/lib/server/codegen/types.js +0 -5
  222. package/lib/server/console.js +0 -57
  223. package/lib/server/cookieStore.js +0 -185
  224. package/lib/server/debugController.js +0 -237
  225. package/lib/server/debugger.js +0 -132
  226. package/lib/server/deviceDescriptors.js +0 -26
  227. package/lib/server/deviceDescriptorsSource.json +0 -1669
  228. package/lib/server/dialog.js +0 -71
  229. package/lib/server/dispatchers/androidDispatcher.js +0 -204
  230. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  231. package/lib/server/dispatchers/browserContextDispatcher.js +0 -368
  232. package/lib/server/dispatchers/browserDispatcher.js +0 -170
  233. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
  234. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
  235. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -103
  236. package/lib/server/dispatchers/dialogDispatcher.js +0 -44
  237. package/lib/server/dispatchers/dispatcher.js +0 -395
  238. package/lib/server/dispatchers/electronDispatcher.js +0 -93
  239. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
  240. package/lib/server/dispatchers/frameDispatcher.js +0 -293
  241. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -97
  242. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
  243. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
  244. package/lib/server/dispatchers/networkDispatchers.js +0 -221
  245. package/lib/server/dispatchers/pageDispatcher.js +0 -367
  246. package/lib/server/dispatchers/playwrightDispatcher.js +0 -107
  247. package/lib/server/dispatchers/selectorsDispatcher.js +0 -36
  248. package/lib/server/dispatchers/streamDispatcher.js +0 -62
  249. package/lib/server/dispatchers/tracingDispatcher.js +0 -64
  250. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -189
  251. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
  252. package/lib/server/dom.js +0 -888
  253. package/lib/server/download.js +0 -60
  254. package/lib/server/electron/electron.js +0 -296
  255. package/lib/server/errors.js +0 -68
  256. package/lib/server/fetch.js +0 -669
  257. package/lib/server/fileChooser.js +0 -42
  258. package/lib/server/fileUploadUtils.js +0 -75
  259. package/lib/server/firefox/ffAccessibility.js +0 -216
  260. package/lib/server/firefox/ffBrowser.js +0 -460
  261. package/lib/server/firefox/ffConnection.js +0 -168
  262. package/lib/server/firefox/ffExecutionContext.js +0 -123
  263. package/lib/server/firefox/ffInput.js +0 -150
  264. package/lib/server/firefox/ffNetworkManager.js +0 -233
  265. package/lib/server/firefox/ffPage.js +0 -559
  266. package/lib/server/firefox/firefox.js +0 -99
  267. package/lib/server/formData.js +0 -75
  268. package/lib/server/frameSelectors.js +0 -171
  269. package/lib/server/frames.js +0 -1691
  270. package/lib/server/har/harRecorder.js +0 -139
  271. package/lib/server/har/harTracer.js +0 -542
  272. package/lib/server/helper.js +0 -103
  273. package/lib/server/index.js +0 -108
  274. package/lib/server/input.js +0 -310
  275. package/lib/server/instrumentation.js +0 -70
  276. package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
  277. package/lib/server/javascript.js +0 -293
  278. package/lib/server/launchApp.js +0 -91
  279. package/lib/server/macEditingCommands.js +0 -139
  280. package/lib/server/network.js +0 -617
  281. package/lib/server/page.js +0 -873
  282. package/lib/server/pipeTransport.js +0 -85
  283. package/lib/server/playwright.js +0 -88
  284. package/lib/server/progress.js +0 -99
  285. package/lib/server/protocolError.js +0 -49
  286. package/lib/server/recorder/contextRecorder.js +0 -299
  287. package/lib/server/recorder/recorderApp.js +0 -187
  288. package/lib/server/recorder/recorderCollection.js +0 -116
  289. package/lib/server/recorder/recorderFrontend.js +0 -5
  290. package/lib/server/recorder/recorderInTraceViewer.js +0 -144
  291. package/lib/server/recorder/recorderRunner.js +0 -155
  292. package/lib/server/recorder/recorderUtils.js +0 -113
  293. package/lib/server/recorder/throttledFile.js +0 -46
  294. package/lib/server/recorder.js +0 -364
  295. package/lib/server/registry/browserFetcher.js +0 -168
  296. package/lib/server/registry/dependencies.js +0 -322
  297. package/lib/server/registry/index.js +0 -1052
  298. package/lib/server/registry/nativeDeps.js +0 -493
  299. package/lib/server/registry/oopDownloadBrowserMain.js +0 -138
  300. package/lib/server/screenshotter.js +0 -348
  301. package/lib/server/selectors.js +0 -73
  302. package/lib/server/socksClientCertificatesInterceptor.js +0 -340
  303. package/lib/server/socksInterceptor.js +0 -100
  304. package/lib/server/trace/recorder/snapshotter.js +0 -161
  305. package/lib/server/trace/recorder/snapshotterInjected.js +0 -511
  306. package/lib/server/trace/recorder/tracing.js +0 -596
  307. package/lib/server/trace/test/inMemorySnapshotter.js +0 -93
  308. package/lib/server/trace/viewer/traceViewer.js +0 -214
  309. package/lib/server/transport.js +0 -191
  310. package/lib/server/types.js +0 -24
  311. package/lib/server/usKeyboardLayout.js +0 -555
  312. package/lib/server/webkit/webkit.js +0 -87
  313. package/lib/server/webkit/wkAccessibility.js +0 -194
  314. package/lib/server/webkit/wkBrowser.js +0 -329
  315. package/lib/server/webkit/wkConnection.js +0 -173
  316. package/lib/server/webkit/wkExecutionContext.js +0 -130
  317. package/lib/server/webkit/wkInput.js +0 -169
  318. package/lib/server/webkit/wkInterceptableRequest.js +0 -162
  319. package/lib/server/webkit/wkPage.js +0 -1225
  320. package/lib/server/webkit/wkProvisionalPage.js +0 -94
  321. package/lib/server/webkit/wkWorkers.js +0 -104
  322. package/lib/third_party/pixelmatch.js +0 -255
  323. package/lib/utils/ascii.js +0 -31
  324. package/lib/utils/comparators.js +0 -153
  325. package/lib/utils/crypto.js +0 -171
  326. package/lib/utils/debug.js +0 -46
  327. package/lib/utils/debugLogger.js +0 -91
  328. package/lib/utils/env.js +0 -49
  329. package/lib/utils/eventsHelper.js +0 -38
  330. package/lib/utils/expectUtils.js +0 -33
  331. package/lib/utils/fileUtils.js +0 -205
  332. package/lib/utils/happy-eyeballs.js +0 -194
  333. package/lib/utils/headers.js +0 -52
  334. package/lib/utils/hostPlatform.js +0 -139
  335. package/lib/utils/httpServer.js +0 -237
  336. package/lib/utils/index.js +0 -368
  337. package/lib/utils/isomorphic/ariaSnapshot.js +0 -267
  338. package/lib/utils/isomorphic/cssParser.js +0 -250
  339. package/lib/utils/isomorphic/cssTokenizer.js +0 -979
  340. package/lib/utils/isomorphic/locatorGenerators.js +0 -660
  341. package/lib/utils/isomorphic/locatorParser.js +0 -179
  342. package/lib/utils/isomorphic/locatorUtils.js +0 -62
  343. package/lib/utils/isomorphic/mimeType.js +0 -29
  344. package/lib/utils/isomorphic/recorderUtils.js +0 -227
  345. package/lib/utils/isomorphic/selectorParser.js +0 -397
  346. package/lib/utils/isomorphic/stringUtils.js +0 -169
  347. package/lib/utils/isomorphic/traceUtils.js +0 -39
  348. package/lib/utils/isomorphic/urlMatch.js +0 -124
  349. package/lib/utils/linuxUtils.js +0 -78
  350. package/lib/utils/manualPromise.js +0 -109
  351. package/lib/utils/multimap.js +0 -75
  352. package/lib/utils/network.js +0 -160
  353. package/lib/utils/processLauncher.js +0 -248
  354. package/lib/utils/profiler.js +0 -53
  355. package/lib/utils/rtti.js +0 -44
  356. package/lib/utils/semaphore.js +0 -51
  357. package/lib/utils/sequence.js +0 -64
  358. package/lib/utils/spawnAsync.js +0 -45
  359. package/lib/utils/stackTrace.js +0 -134
  360. package/lib/utils/task.js +0 -58
  361. package/lib/utils/time.js +0 -37
  362. package/lib/utils/timeoutRunner.js +0 -66
  363. package/lib/utils/traceUtils.js +0 -44
  364. package/lib/utils/userAgent.js +0 -105
  365. package/lib/utils/wsServer.js +0 -127
  366. package/lib/utils/zipFile.js +0 -75
  367. package/lib/utils/zones.js +0 -71
  368. package/lib/utilsBundleImpl/index.js +0 -210
  369. package/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js +0 -24
  370. package/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
  371. package/lib/vite/recorder/assets/index-iA1aAGZg.css +0 -1
  372. package/lib/vite/recorder/assets/index-m0XdVJHe.js +0 -184
  373. package/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js +0 -24
  374. package/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js +0 -68
  375. package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
  376. package/lib/vite/traceViewer/assets/workbench-DFlGYqou.js +0 -9
  377. package/lib/vite/traceViewer/assets/xtermModule-BeNbaIVa.js +0 -9
  378. package/lib/vite/traceViewer/codeMirrorModule.ez37Vkbh.css +0 -1
  379. package/lib/vite/traceViewer/embedded.CmarehFk.js +0 -2
  380. package/lib/vite/traceViewer/embedded.html +0 -18
  381. package/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
  382. package/lib/vite/traceViewer/index.CrbWWHbf.css +0 -1
  383. package/lib/vite/traceViewer/index.FBucu_gE.js +0 -2
  384. package/lib/vite/traceViewer/inspectorTab.DEOUW62d.css +0 -1
  385. package/lib/vite/traceViewer/recorder.B_SY1GJM.css +0 -0
  386. package/lib/vite/traceViewer/recorder.CW_rzcEp.js +0 -2
  387. package/lib/vite/traceViewer/recorder.html +0 -17
  388. package/lib/vite/traceViewer/uiMode.CDUVjusr.js +0 -5
  389. package/lib/vite/traceViewer/uiMode.voC1ZiOQ.css +0 -1
  390. package/lib/vite/traceViewer/workbench.C-zR9ysA.css +0 -1
  391. package/lib/vite/traceViewer/xtermModule.DSXBckUd.css +0 -32
  392. package/lib/zipBundle.js +0 -25
  393. package/lib/zipBundleImpl.js +0 -5
@@ -1,979 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WhitespaceToken = exports.URLToken = exports.SuffixMatchToken = exports.SubstringMatchToken = exports.StringValuedToken = exports.StringToken = exports.SemicolonToken = exports.PrefixMatchToken = exports.PercentageToken = exports.OpenSquareToken = exports.OpenParenToken = exports.OpenCurlyToken = exports.NumberToken = exports.InvalidCharacterError = exports.IncludeMatchToken = exports.IdentToken = exports.HashToken = exports.GroupingToken = exports.FunctionToken = exports.EOFToken = exports.DimensionToken = exports.DelimToken = exports.DashMatchToken = exports.CommaToken = exports.ColumnToken = exports.ColonToken = exports.CloseSquareToken = exports.CloseParenToken = exports.CloseCurlyToken = exports.CSSParserToken = exports.CDOToken = exports.CDCToken = exports.BadURLToken = exports.BadStringToken = exports.AtKeywordToken = void 0;
7
- exports.tokenize = tokenize;
8
- /* eslint-disable notice/notice */
9
-
10
- /*
11
- * The code in this file is licensed under the CC0 license.
12
- * http://creativecommons.org/publicdomain/zero/1.0/
13
- * It is free to use for any purpose. No attribution, permission, or reproduction of this license is required.
14
- */
15
-
16
- // Original at https://github.com/tabatkins/parse-css
17
- // Changes:
18
- // - JS is replaced with TS.
19
- // - Universal Module Definition wrapper is removed.
20
- // - Everything not related to tokenizing - below the first exports block - is removed.
21
-
22
- const between = function (num, first, last) {
23
- return num >= first && num <= last;
24
- };
25
- function digit(code) {
26
- return between(code, 0x30, 0x39);
27
- }
28
- function hexdigit(code) {
29
- return digit(code) || between(code, 0x41, 0x46) || between(code, 0x61, 0x66);
30
- }
31
- function uppercaseletter(code) {
32
- return between(code, 0x41, 0x5a);
33
- }
34
- function lowercaseletter(code) {
35
- return between(code, 0x61, 0x7a);
36
- }
37
- function letter(code) {
38
- return uppercaseletter(code) || lowercaseletter(code);
39
- }
40
- function nonascii(code) {
41
- return code >= 0x80;
42
- }
43
- function namestartchar(code) {
44
- return letter(code) || nonascii(code) || code === 0x5f;
45
- }
46
- function namechar(code) {
47
- return namestartchar(code) || digit(code) || code === 0x2d;
48
- }
49
- function nonprintable(code) {
50
- return between(code, 0, 8) || code === 0xb || between(code, 0xe, 0x1f) || code === 0x7f;
51
- }
52
- function newline(code) {
53
- return code === 0xa;
54
- }
55
- function whitespace(code) {
56
- return newline(code) || code === 9 || code === 0x20;
57
- }
58
- const maximumallowedcodepoint = 0x10ffff;
59
- class InvalidCharacterError extends Error {
60
- constructor(message) {
61
- super(message);
62
- this.name = 'InvalidCharacterError';
63
- }
64
- }
65
- exports.InvalidCharacterError = InvalidCharacterError;
66
- function preprocess(str) {
67
- // Turn a string into an array of code points,
68
- // following the preprocessing cleanup rules.
69
- const codepoints = [];
70
- for (let i = 0; i < str.length; i++) {
71
- let code = str.charCodeAt(i);
72
- if (code === 0xd && str.charCodeAt(i + 1) === 0xa) {
73
- code = 0xa;
74
- i++;
75
- }
76
- if (code === 0xd || code === 0xc) code = 0xa;
77
- if (code === 0x0) code = 0xfffd;
78
- if (between(code, 0xd800, 0xdbff) && between(str.charCodeAt(i + 1), 0xdc00, 0xdfff)) {
79
- // Decode a surrogate pair into an astral codepoint.
80
- const lead = code - 0xd800;
81
- const trail = str.charCodeAt(i + 1) - 0xdc00;
82
- code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
83
- i++;
84
- }
85
- codepoints.push(code);
86
- }
87
- return codepoints;
88
- }
89
- function stringFromCode(code) {
90
- if (code <= 0xffff) return String.fromCharCode(code);
91
- // Otherwise, encode astral char as surrogate pair.
92
- code -= Math.pow(2, 16);
93
- const lead = Math.floor(code / Math.pow(2, 10)) + 0xd800;
94
- const trail = code % Math.pow(2, 10) + 0xdc00;
95
- return String.fromCharCode(lead) + String.fromCharCode(trail);
96
- }
97
- function tokenize(str1) {
98
- const str = preprocess(str1);
99
- let i = -1;
100
- const tokens = [];
101
- let code;
102
-
103
- // Line number information.
104
- let line = 0;
105
- let column = 0;
106
- // The only use of lastLineLength is in reconsume().
107
- let lastLineLength = 0;
108
- const incrLineno = function () {
109
- line += 1;
110
- lastLineLength = column;
111
- column = 0;
112
- };
113
- const locStart = {
114
- line: line,
115
- column: column
116
- };
117
- const codepoint = function (i) {
118
- if (i >= str.length) return -1;
119
- return str[i];
120
- };
121
- const next = function (num) {
122
- if (num === undefined) num = 1;
123
- if (num > 3) throw 'Spec Error: no more than three codepoints of lookahead.';
124
- return codepoint(i + num);
125
- };
126
- const consume = function (num) {
127
- if (num === undefined) num = 1;
128
- i += num;
129
- code = codepoint(i);
130
- if (newline(code)) incrLineno();else column += num;
131
- // console.log('Consume '+i+' '+String.fromCharCode(code) + ' 0x' + code.toString(16));
132
- return true;
133
- };
134
- const reconsume = function () {
135
- i -= 1;
136
- if (newline(code)) {
137
- line -= 1;
138
- column = lastLineLength;
139
- } else {
140
- column -= 1;
141
- }
142
- locStart.line = line;
143
- locStart.column = column;
144
- return true;
145
- };
146
- const eof = function (codepoint) {
147
- if (codepoint === undefined) codepoint = code;
148
- return codepoint === -1;
149
- };
150
- const donothing = function () {};
151
- const parseerror = function () {
152
- // Language bindings don't like writing to stdout!
153
- // console.log('Parse error at index ' + i + ', processing codepoint 0x' + code.toString(16) + '.'); return true;
154
- };
155
- const consumeAToken = function () {
156
- consumeComments();
157
- consume();
158
- if (whitespace(code)) {
159
- while (whitespace(next())) consume();
160
- return new WhitespaceToken();
161
- } else if (code === 0x22) {
162
- return consumeAStringToken();
163
- } else if (code === 0x23) {
164
- if (namechar(next()) || areAValidEscape(next(1), next(2))) {
165
- const token = new HashToken('');
166
- if (wouldStartAnIdentifier(next(1), next(2), next(3))) token.type = 'id';
167
- token.value = consumeAName();
168
- return token;
169
- } else {
170
- return new DelimToken(code);
171
- }
172
- } else if (code === 0x24) {
173
- if (next() === 0x3d) {
174
- consume();
175
- return new SuffixMatchToken();
176
- } else {
177
- return new DelimToken(code);
178
- }
179
- } else if (code === 0x27) {
180
- return consumeAStringToken();
181
- } else if (code === 0x28) {
182
- return new OpenParenToken();
183
- } else if (code === 0x29) {
184
- return new CloseParenToken();
185
- } else if (code === 0x2a) {
186
- if (next() === 0x3d) {
187
- consume();
188
- return new SubstringMatchToken();
189
- } else {
190
- return new DelimToken(code);
191
- }
192
- } else if (code === 0x2b) {
193
- if (startsWithANumber()) {
194
- reconsume();
195
- return consumeANumericToken();
196
- } else {
197
- return new DelimToken(code);
198
- }
199
- } else if (code === 0x2c) {
200
- return new CommaToken();
201
- } else if (code === 0x2d) {
202
- if (startsWithANumber()) {
203
- reconsume();
204
- return consumeANumericToken();
205
- } else if (next(1) === 0x2d && next(2) === 0x3e) {
206
- consume(2);
207
- return new CDCToken();
208
- } else if (startsWithAnIdentifier()) {
209
- reconsume();
210
- return consumeAnIdentlikeToken();
211
- } else {
212
- return new DelimToken(code);
213
- }
214
- } else if (code === 0x2e) {
215
- if (startsWithANumber()) {
216
- reconsume();
217
- return consumeANumericToken();
218
- } else {
219
- return new DelimToken(code);
220
- }
221
- } else if (code === 0x3a) {
222
- return new ColonToken();
223
- } else if (code === 0x3b) {
224
- return new SemicolonToken();
225
- } else if (code === 0x3c) {
226
- if (next(1) === 0x21 && next(2) === 0x2d && next(3) === 0x2d) {
227
- consume(3);
228
- return new CDOToken();
229
- } else {
230
- return new DelimToken(code);
231
- }
232
- } else if (code === 0x40) {
233
- if (wouldStartAnIdentifier(next(1), next(2), next(3))) return new AtKeywordToken(consumeAName());else return new DelimToken(code);
234
- } else if (code === 0x5b) {
235
- return new OpenSquareToken();
236
- } else if (code === 0x5c) {
237
- if (startsWithAValidEscape()) {
238
- reconsume();
239
- return consumeAnIdentlikeToken();
240
- } else {
241
- parseerror();
242
- return new DelimToken(code);
243
- }
244
- } else if (code === 0x5d) {
245
- return new CloseSquareToken();
246
- } else if (code === 0x5e) {
247
- if (next() === 0x3d) {
248
- consume();
249
- return new PrefixMatchToken();
250
- } else {
251
- return new DelimToken(code);
252
- }
253
- } else if (code === 0x7b) {
254
- return new OpenCurlyToken();
255
- } else if (code === 0x7c) {
256
- if (next() === 0x3d) {
257
- consume();
258
- return new DashMatchToken();
259
- } else if (next() === 0x7c) {
260
- consume();
261
- return new ColumnToken();
262
- } else {
263
- return new DelimToken(code);
264
- }
265
- } else if (code === 0x7d) {
266
- return new CloseCurlyToken();
267
- } else if (code === 0x7e) {
268
- if (next() === 0x3d) {
269
- consume();
270
- return new IncludeMatchToken();
271
- } else {
272
- return new DelimToken(code);
273
- }
274
- } else if (digit(code)) {
275
- reconsume();
276
- return consumeANumericToken();
277
- } else if (namestartchar(code)) {
278
- reconsume();
279
- return consumeAnIdentlikeToken();
280
- } else if (eof()) {
281
- return new EOFToken();
282
- } else {
283
- return new DelimToken(code);
284
- }
285
- };
286
- const consumeComments = function () {
287
- while (next(1) === 0x2f && next(2) === 0x2a) {
288
- consume(2);
289
- while (true) {
290
- consume();
291
- if (code === 0x2a && next() === 0x2f) {
292
- consume();
293
- break;
294
- } else if (eof()) {
295
- parseerror();
296
- return;
297
- }
298
- }
299
- }
300
- };
301
- const consumeANumericToken = function () {
302
- const num = consumeANumber();
303
- if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
304
- const token = new DimensionToken();
305
- token.value = num.value;
306
- token.repr = num.repr;
307
- token.type = num.type;
308
- token.unit = consumeAName();
309
- return token;
310
- } else if (next() === 0x25) {
311
- consume();
312
- const token = new PercentageToken();
313
- token.value = num.value;
314
- token.repr = num.repr;
315
- return token;
316
- } else {
317
- const token = new NumberToken();
318
- token.value = num.value;
319
- token.repr = num.repr;
320
- token.type = num.type;
321
- return token;
322
- }
323
- };
324
- const consumeAnIdentlikeToken = function () {
325
- const str = consumeAName();
326
- if (str.toLowerCase() === 'url' && next() === 0x28) {
327
- consume();
328
- while (whitespace(next(1)) && whitespace(next(2))) consume();
329
- if (next() === 0x22 || next() === 0x27) return new FunctionToken(str);else if (whitespace(next()) && (next(2) === 0x22 || next(2) === 0x27)) return new FunctionToken(str);else return consumeAURLToken();
330
- } else if (next() === 0x28) {
331
- consume();
332
- return new FunctionToken(str);
333
- } else {
334
- return new IdentToken(str);
335
- }
336
- };
337
- const consumeAStringToken = function (endingCodePoint) {
338
- if (endingCodePoint === undefined) endingCodePoint = code;
339
- let string = '';
340
- while (consume()) {
341
- if (code === endingCodePoint || eof()) {
342
- return new StringToken(string);
343
- } else if (newline(code)) {
344
- parseerror();
345
- reconsume();
346
- return new BadStringToken();
347
- } else if (code === 0x5c) {
348
- if (eof(next())) donothing();else if (newline(next())) consume();else string += stringFromCode(consumeEscape());
349
- } else {
350
- string += stringFromCode(code);
351
- }
352
- }
353
- throw new Error('Internal error');
354
- };
355
- const consumeAURLToken = function () {
356
- const token = new URLToken('');
357
- while (whitespace(next())) consume();
358
- if (eof(next())) return token;
359
- while (consume()) {
360
- if (code === 0x29 || eof()) {
361
- return token;
362
- } else if (whitespace(code)) {
363
- while (whitespace(next())) consume();
364
- if (next() === 0x29 || eof(next())) {
365
- consume();
366
- return token;
367
- } else {
368
- consumeTheRemnantsOfABadURL();
369
- return new BadURLToken();
370
- }
371
- } else if (code === 0x22 || code === 0x27 || code === 0x28 || nonprintable(code)) {
372
- parseerror();
373
- consumeTheRemnantsOfABadURL();
374
- return new BadURLToken();
375
- } else if (code === 0x5c) {
376
- if (startsWithAValidEscape()) {
377
- token.value += stringFromCode(consumeEscape());
378
- } else {
379
- parseerror();
380
- consumeTheRemnantsOfABadURL();
381
- return new BadURLToken();
382
- }
383
- } else {
384
- token.value += stringFromCode(code);
385
- }
386
- }
387
- throw new Error('Internal error');
388
- };
389
- const consumeEscape = function () {
390
- // Assume the current character is the \
391
- // and the next code point is not a newline.
392
- consume();
393
- if (hexdigit(code)) {
394
- // Consume 1-6 hex digits
395
- const digits = [code];
396
- for (let total = 0; total < 5; total++) {
397
- if (hexdigit(next())) {
398
- consume();
399
- digits.push(code);
400
- } else {
401
- break;
402
- }
403
- }
404
- if (whitespace(next())) consume();
405
- let value = parseInt(digits.map(function (x) {
406
- return String.fromCharCode(x);
407
- }).join(''), 16);
408
- if (value > maximumallowedcodepoint) value = 0xfffd;
409
- return value;
410
- } else if (eof()) {
411
- return 0xfffd;
412
- } else {
413
- return code;
414
- }
415
- };
416
- const areAValidEscape = function (c1, c2) {
417
- if (c1 !== 0x5c) return false;
418
- if (newline(c2)) return false;
419
- return true;
420
- };
421
- const startsWithAValidEscape = function () {
422
- return areAValidEscape(code, next());
423
- };
424
- const wouldStartAnIdentifier = function (c1, c2, c3) {
425
- if (c1 === 0x2d) return namestartchar(c2) || c2 === 0x2d || areAValidEscape(c2, c3);else if (namestartchar(c1)) return true;else if (c1 === 0x5c) return areAValidEscape(c1, c2);else return false;
426
- };
427
- const startsWithAnIdentifier = function () {
428
- return wouldStartAnIdentifier(code, next(1), next(2));
429
- };
430
- const wouldStartANumber = function (c1, c2, c3) {
431
- if (c1 === 0x2b || c1 === 0x2d) {
432
- if (digit(c2)) return true;
433
- if (c2 === 0x2e && digit(c3)) return true;
434
- return false;
435
- } else if (c1 === 0x2e) {
436
- if (digit(c2)) return true;
437
- return false;
438
- } else if (digit(c1)) {
439
- return true;
440
- } else {
441
- return false;
442
- }
443
- };
444
- const startsWithANumber = function () {
445
- return wouldStartANumber(code, next(1), next(2));
446
- };
447
- const consumeAName = function () {
448
- let result = '';
449
- while (consume()) {
450
- if (namechar(code)) {
451
- result += stringFromCode(code);
452
- } else if (startsWithAValidEscape()) {
453
- result += stringFromCode(consumeEscape());
454
- } else {
455
- reconsume();
456
- return result;
457
- }
458
- }
459
- throw new Error('Internal parse error');
460
- };
461
- const consumeANumber = function () {
462
- let repr = '';
463
- let type = 'integer';
464
- if (next() === 0x2b || next() === 0x2d) {
465
- consume();
466
- repr += stringFromCode(code);
467
- }
468
- while (digit(next())) {
469
- consume();
470
- repr += stringFromCode(code);
471
- }
472
- if (next(1) === 0x2e && digit(next(2))) {
473
- consume();
474
- repr += stringFromCode(code);
475
- consume();
476
- repr += stringFromCode(code);
477
- type = 'number';
478
- while (digit(next())) {
479
- consume();
480
- repr += stringFromCode(code);
481
- }
482
- }
483
- const c1 = next(1),
484
- c2 = next(2),
485
- c3 = next(3);
486
- if ((c1 === 0x45 || c1 === 0x65) && digit(c2)) {
487
- consume();
488
- repr += stringFromCode(code);
489
- consume();
490
- repr += stringFromCode(code);
491
- type = 'number';
492
- while (digit(next())) {
493
- consume();
494
- repr += stringFromCode(code);
495
- }
496
- } else if ((c1 === 0x45 || c1 === 0x65) && (c2 === 0x2b || c2 === 0x2d) && digit(c3)) {
497
- consume();
498
- repr += stringFromCode(code);
499
- consume();
500
- repr += stringFromCode(code);
501
- consume();
502
- repr += stringFromCode(code);
503
- type = 'number';
504
- while (digit(next())) {
505
- consume();
506
- repr += stringFromCode(code);
507
- }
508
- }
509
- const value = convertAStringToANumber(repr);
510
- return {
511
- type: type,
512
- value: value,
513
- repr: repr
514
- };
515
- };
516
- const convertAStringToANumber = function (string) {
517
- // CSS's number rules are identical to JS, afaik.
518
- return +string;
519
- };
520
- const consumeTheRemnantsOfABadURL = function () {
521
- while (consume()) {
522
- if (code === 0x29 || eof()) {
523
- return;
524
- } else if (startsWithAValidEscape()) {
525
- consumeEscape();
526
- donothing();
527
- } else {
528
- donothing();
529
- }
530
- }
531
- };
532
- let iterationCount = 0;
533
- while (!eof(next())) {
534
- tokens.push(consumeAToken());
535
- iterationCount++;
536
- if (iterationCount > str.length * 2) throw new Error("I'm infinite-looping!");
537
- }
538
- return tokens;
539
- }
540
- class CSSParserToken {
541
- constructor() {
542
- this.tokenType = '';
543
- this.value = void 0;
544
- }
545
- toJSON() {
546
- return {
547
- token: this.tokenType
548
- };
549
- }
550
- toString() {
551
- return this.tokenType;
552
- }
553
- toSource() {
554
- return '' + this;
555
- }
556
- }
557
- exports.CSSParserToken = CSSParserToken;
558
- class BadStringToken extends CSSParserToken {
559
- constructor(...args) {
560
- super(...args);
561
- this.tokenType = 'BADSTRING';
562
- }
563
- }
564
- exports.BadStringToken = BadStringToken;
565
- class BadURLToken extends CSSParserToken {
566
- constructor(...args) {
567
- super(...args);
568
- this.tokenType = 'BADURL';
569
- }
570
- }
571
- exports.BadURLToken = BadURLToken;
572
- class WhitespaceToken extends CSSParserToken {
573
- constructor(...args) {
574
- super(...args);
575
- this.tokenType = 'WHITESPACE';
576
- }
577
- toString() {
578
- return 'WS';
579
- }
580
- toSource() {
581
- return ' ';
582
- }
583
- }
584
- exports.WhitespaceToken = WhitespaceToken;
585
- class CDOToken extends CSSParserToken {
586
- constructor(...args) {
587
- super(...args);
588
- this.tokenType = 'CDO';
589
- }
590
- toSource() {
591
- return '<!--';
592
- }
593
- }
594
- exports.CDOToken = CDOToken;
595
- class CDCToken extends CSSParserToken {
596
- constructor(...args) {
597
- super(...args);
598
- this.tokenType = 'CDC';
599
- }
600
- toSource() {
601
- return '-->';
602
- }
603
- }
604
- exports.CDCToken = CDCToken;
605
- class ColonToken extends CSSParserToken {
606
- constructor(...args) {
607
- super(...args);
608
- this.tokenType = ':';
609
- }
610
- }
611
- exports.ColonToken = ColonToken;
612
- class SemicolonToken extends CSSParserToken {
613
- constructor(...args) {
614
- super(...args);
615
- this.tokenType = ';';
616
- }
617
- }
618
- exports.SemicolonToken = SemicolonToken;
619
- class CommaToken extends CSSParserToken {
620
- constructor(...args) {
621
- super(...args);
622
- this.tokenType = ',';
623
- }
624
- }
625
- exports.CommaToken = CommaToken;
626
- class GroupingToken extends CSSParserToken {
627
- constructor(...args) {
628
- super(...args);
629
- this.value = '';
630
- this.mirror = '';
631
- }
632
- }
633
- exports.GroupingToken = GroupingToken;
634
- class OpenCurlyToken extends GroupingToken {
635
- constructor() {
636
- super();
637
- this.tokenType = '{';
638
- this.value = '{';
639
- this.mirror = '}';
640
- }
641
- }
642
- exports.OpenCurlyToken = OpenCurlyToken;
643
- class CloseCurlyToken extends GroupingToken {
644
- constructor() {
645
- super();
646
- this.tokenType = '}';
647
- this.value = '}';
648
- this.mirror = '{';
649
- }
650
- }
651
- exports.CloseCurlyToken = CloseCurlyToken;
652
- class OpenSquareToken extends GroupingToken {
653
- constructor() {
654
- super();
655
- this.tokenType = '[';
656
- this.value = '[';
657
- this.mirror = ']';
658
- }
659
- }
660
- exports.OpenSquareToken = OpenSquareToken;
661
- class CloseSquareToken extends GroupingToken {
662
- constructor() {
663
- super();
664
- this.tokenType = ']';
665
- this.value = ']';
666
- this.mirror = '[';
667
- }
668
- }
669
- exports.CloseSquareToken = CloseSquareToken;
670
- class OpenParenToken extends GroupingToken {
671
- constructor() {
672
- super();
673
- this.tokenType = '(';
674
- this.value = '(';
675
- this.mirror = ')';
676
- }
677
- }
678
- exports.OpenParenToken = OpenParenToken;
679
- class CloseParenToken extends GroupingToken {
680
- constructor() {
681
- super();
682
- this.tokenType = ')';
683
- this.value = ')';
684
- this.mirror = '(';
685
- }
686
- }
687
- exports.CloseParenToken = CloseParenToken;
688
- class IncludeMatchToken extends CSSParserToken {
689
- constructor(...args) {
690
- super(...args);
691
- this.tokenType = '~=';
692
- }
693
- }
694
- exports.IncludeMatchToken = IncludeMatchToken;
695
- class DashMatchToken extends CSSParserToken {
696
- constructor(...args) {
697
- super(...args);
698
- this.tokenType = '|=';
699
- }
700
- }
701
- exports.DashMatchToken = DashMatchToken;
702
- class PrefixMatchToken extends CSSParserToken {
703
- constructor(...args) {
704
- super(...args);
705
- this.tokenType = '^=';
706
- }
707
- }
708
- exports.PrefixMatchToken = PrefixMatchToken;
709
- class SuffixMatchToken extends CSSParserToken {
710
- constructor(...args) {
711
- super(...args);
712
- this.tokenType = '$=';
713
- }
714
- }
715
- exports.SuffixMatchToken = SuffixMatchToken;
716
- class SubstringMatchToken extends CSSParserToken {
717
- constructor(...args) {
718
- super(...args);
719
- this.tokenType = '*=';
720
- }
721
- }
722
- exports.SubstringMatchToken = SubstringMatchToken;
723
- class ColumnToken extends CSSParserToken {
724
- constructor(...args) {
725
- super(...args);
726
- this.tokenType = '||';
727
- }
728
- }
729
- exports.ColumnToken = ColumnToken;
730
- class EOFToken extends CSSParserToken {
731
- constructor(...args) {
732
- super(...args);
733
- this.tokenType = 'EOF';
734
- }
735
- toSource() {
736
- return '';
737
- }
738
- }
739
- exports.EOFToken = EOFToken;
740
- class DelimToken extends CSSParserToken {
741
- constructor(code) {
742
- super();
743
- this.tokenType = 'DELIM';
744
- this.value = '';
745
- this.value = stringFromCode(code);
746
- }
747
- toString() {
748
- return 'DELIM(' + this.value + ')';
749
- }
750
- toJSON() {
751
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
752
- json.value = this.value;
753
- return json;
754
- }
755
- toSource() {
756
- if (this.value === '\\') return '\\\n';else return this.value;
757
- }
758
- }
759
- exports.DelimToken = DelimToken;
760
- class StringValuedToken extends CSSParserToken {
761
- constructor(...args) {
762
- super(...args);
763
- this.value = '';
764
- }
765
- ASCIIMatch(str) {
766
- return this.value.toLowerCase() === str.toLowerCase();
767
- }
768
- toJSON() {
769
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
770
- json.value = this.value;
771
- return json;
772
- }
773
- }
774
- exports.StringValuedToken = StringValuedToken;
775
- class IdentToken extends StringValuedToken {
776
- constructor(val) {
777
- super();
778
- this.tokenType = 'IDENT';
779
- this.value = val;
780
- }
781
- toString() {
782
- return 'IDENT(' + this.value + ')';
783
- }
784
- toSource() {
785
- return escapeIdent(this.value);
786
- }
787
- }
788
- exports.IdentToken = IdentToken;
789
- class FunctionToken extends StringValuedToken {
790
- constructor(val) {
791
- super();
792
- this.tokenType = 'FUNCTION';
793
- this.mirror = void 0;
794
- this.value = val;
795
- this.mirror = ')';
796
- }
797
- toString() {
798
- return 'FUNCTION(' + this.value + ')';
799
- }
800
- toSource() {
801
- return escapeIdent(this.value) + '(';
802
- }
803
- }
804
- exports.FunctionToken = FunctionToken;
805
- class AtKeywordToken extends StringValuedToken {
806
- constructor(val) {
807
- super();
808
- this.tokenType = 'AT-KEYWORD';
809
- this.value = val;
810
- }
811
- toString() {
812
- return 'AT(' + this.value + ')';
813
- }
814
- toSource() {
815
- return '@' + escapeIdent(this.value);
816
- }
817
- }
818
- exports.AtKeywordToken = AtKeywordToken;
819
- class HashToken extends StringValuedToken {
820
- constructor(val) {
821
- super();
822
- this.tokenType = 'HASH';
823
- this.type = void 0;
824
- this.value = val;
825
- this.type = 'unrestricted';
826
- }
827
- toString() {
828
- return 'HASH(' + this.value + ')';
829
- }
830
- toJSON() {
831
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
832
- json.value = this.value;
833
- json.type = this.type;
834
- return json;
835
- }
836
- toSource() {
837
- if (this.type === 'id') return '#' + escapeIdent(this.value);else return '#' + escapeHash(this.value);
838
- }
839
- }
840
- exports.HashToken = HashToken;
841
- class StringToken extends StringValuedToken {
842
- constructor(val) {
843
- super();
844
- this.tokenType = 'STRING';
845
- this.value = val;
846
- }
847
- toString() {
848
- return '"' + escapeString(this.value) + '"';
849
- }
850
- }
851
- exports.StringToken = StringToken;
852
- class URLToken extends StringValuedToken {
853
- constructor(val) {
854
- super();
855
- this.tokenType = 'URL';
856
- this.value = val;
857
- }
858
- toString() {
859
- return 'URL(' + this.value + ')';
860
- }
861
- toSource() {
862
- return 'url("' + escapeString(this.value) + '")';
863
- }
864
- }
865
- exports.URLToken = URLToken;
866
- class NumberToken extends CSSParserToken {
867
- constructor() {
868
- super();
869
- this.tokenType = 'NUMBER';
870
- this.type = void 0;
871
- this.repr = void 0;
872
- this.type = 'integer';
873
- this.repr = '';
874
- }
875
- toString() {
876
- if (this.type === 'integer') return 'INT(' + this.value + ')';
877
- return 'NUMBER(' + this.value + ')';
878
- }
879
- toJSON() {
880
- const json = super.toJSON();
881
- json.value = this.value;
882
- json.type = this.type;
883
- json.repr = this.repr;
884
- return json;
885
- }
886
- toSource() {
887
- return this.repr;
888
- }
889
- }
890
- exports.NumberToken = NumberToken;
891
- class PercentageToken extends CSSParserToken {
892
- constructor() {
893
- super();
894
- this.tokenType = 'PERCENTAGE';
895
- this.repr = void 0;
896
- this.repr = '';
897
- }
898
- toString() {
899
- return 'PERCENTAGE(' + this.value + ')';
900
- }
901
- toJSON() {
902
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
903
- json.value = this.value;
904
- json.repr = this.repr;
905
- return json;
906
- }
907
- toSource() {
908
- return this.repr + '%';
909
- }
910
- }
911
- exports.PercentageToken = PercentageToken;
912
- class DimensionToken extends CSSParserToken {
913
- constructor() {
914
- super();
915
- this.tokenType = 'DIMENSION';
916
- this.type = void 0;
917
- this.repr = void 0;
918
- this.unit = void 0;
919
- this.type = 'integer';
920
- this.repr = '';
921
- this.unit = '';
922
- }
923
- toString() {
924
- return 'DIM(' + this.value + ',' + this.unit + ')';
925
- }
926
- toJSON() {
927
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
928
- json.value = this.value;
929
- json.type = this.type;
930
- json.repr = this.repr;
931
- json.unit = this.unit;
932
- return json;
933
- }
934
- toSource() {
935
- const source = this.repr;
936
- let unit = escapeIdent(this.unit);
937
- if (unit[0].toLowerCase() === 'e' && (unit[1] === '-' || between(unit.charCodeAt(1), 0x30, 0x39))) {
938
- // Unit is ambiguous with scinot
939
- // Remove the leading "e", replace with escape.
940
- unit = '\\65 ' + unit.slice(1, unit.length);
941
- }
942
- return source + unit;
943
- }
944
- }
945
- exports.DimensionToken = DimensionToken;
946
- function escapeIdent(string) {
947
- string = '' + string;
948
- let result = '';
949
- const firstcode = string.charCodeAt(0);
950
- for (let i = 0; i < string.length; i++) {
951
- const code = string.charCodeAt(i);
952
- if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
953
- if (between(code, 0x1, 0x1f) || code === 0x7f || i === 0 && between(code, 0x30, 0x39) || i === 1 && between(code, 0x30, 0x39) && firstcode === 0x2d) result += '\\' + code.toString(16) + ' ';else if (code >= 0x80 || code === 0x2d || code === 0x5f || between(code, 0x30, 0x39) || between(code, 0x41, 0x5a) || between(code, 0x61, 0x7a)) result += string[i];else result += '\\' + string[i];
954
- }
955
- return result;
956
- }
957
- function escapeHash(string) {
958
- // Escapes the contents of "unrestricted"-type hash tokens.
959
- // Won't preserve the ID-ness of "id"-type hash tokens;
960
- // use escapeIdent() for that.
961
- string = '' + string;
962
- let result = '';
963
- for (let i = 0; i < string.length; i++) {
964
- const code = string.charCodeAt(i);
965
- if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
966
- if (code >= 0x80 || code === 0x2d || code === 0x5f || between(code, 0x30, 0x39) || between(code, 0x41, 0x5a) || between(code, 0x61, 0x7a)) result += string[i];else result += '\\' + code.toString(16) + ' ';
967
- }
968
- return result;
969
- }
970
- function escapeString(string) {
971
- string = '' + string;
972
- let result = '';
973
- for (let i = 0; i < string.length; i++) {
974
- const code = string.charCodeAt(i);
975
- if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
976
- if (between(code, 0x1, 0x1f) || code === 0x7f) result += '\\' + code.toString(16) + ' ';else if (code === 0x22 || code === 0x5c) result += '\\' + string[i];else result += string[i];
977
- }
978
- return result;
979
- }