@dooc-dev/dooc 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +26 -2
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +311 -0
  4. package/dist/code.global.js +285 -0
  5. package/dist/compiler/bundle-urls.d.ts +3 -0
  6. package/dist/compiler/bundle-urls.js +294 -0
  7. package/dist/compiler/bundle.d.ts +2 -0
  8. package/dist/compiler/bundle.js +100 -0
  9. package/dist/compiler/check-prose.d.ts +11 -0
  10. package/dist/compiler/check-prose.js +138 -0
  11. package/dist/compiler/check-types.d.ts +44 -0
  12. package/dist/compiler/check-types.js +1 -0
  13. package/dist/compiler/check.d.ts +5 -0
  14. package/dist/compiler/check.js +450 -0
  15. package/dist/compiler/code-blocks.d.ts +17 -0
  16. package/dist/compiler/code-blocks.js +198 -0
  17. package/dist/compiler/code-languages.d.ts +10 -0
  18. package/dist/compiler/code-languages.js +109 -0
  19. package/dist/compiler/compile.d.ts +95 -0
  20. package/dist/compiler/compile.js +410 -0
  21. package/dist/compiler/config.d.ts +7 -0
  22. package/dist/compiler/config.js +52 -0
  23. package/dist/compiler/dialect.d.ts +24 -0
  24. package/dist/compiler/dialect.js +198 -0
  25. package/dist/compiler/drawio.d.ts +26 -0
  26. package/dist/compiler/drawio.js +176 -0
  27. package/dist/compiler/figures.d.ts +14 -0
  28. package/dist/compiler/figures.js +221 -0
  29. package/dist/compiler/file-cache.d.ts +14 -0
  30. package/dist/compiler/file-cache.js +61 -0
  31. package/dist/compiler/files.d.ts +29 -0
  32. package/dist/compiler/files.js +431 -0
  33. package/dist/compiler/fonts.d.ts +10 -0
  34. package/dist/compiler/fonts.js +54 -0
  35. package/dist/compiler/format.d.ts +1 -0
  36. package/dist/compiler/format.js +42 -0
  37. package/dist/compiler/from-mdast.d.ts +16 -0
  38. package/dist/compiler/from-mdast.js +142 -0
  39. package/dist/compiler/icons.d.ts +14 -0
  40. package/dist/compiler/icons.js +85 -0
  41. package/dist/compiler/language-codes.d.ts +7 -0
  42. package/dist/compiler/language-codes.js +17 -0
  43. package/dist/compiler/locales.d.ts +7 -0
  44. package/dist/compiler/locales.js +67 -0
  45. package/dist/compiler/manifest.d.ts +6 -0
  46. package/dist/compiler/manifest.js +30 -0
  47. package/dist/compiler/ops.d.ts +44 -0
  48. package/dist/compiler/ops.js +362 -0
  49. package/dist/compiler/public-file.d.ts +2 -0
  50. package/dist/compiler/public-file.js +93 -0
  51. package/dist/compiler/serialize.d.ts +3 -0
  52. package/dist/compiler/serialize.js +16 -0
  53. package/dist/compiler/terms.d.ts +9 -0
  54. package/dist/compiler/terms.js +44 -0
  55. package/dist/compiler/textfile-remote.d.ts +12 -0
  56. package/dist/compiler/textfile-remote.js +124 -0
  57. package/dist/compiler/textfile.d.ts +9 -0
  58. package/dist/compiler/textfile.js +113 -0
  59. package/dist/compiler/theme-variants.d.ts +4 -0
  60. package/dist/compiler/theme-variants.js +22 -0
  61. package/dist/compiler/zip.d.ts +6 -0
  62. package/dist/compiler/zip.js +48 -0
  63. package/dist/core/blocks.d.ts +99 -0
  64. package/dist/core/blocks.js +29 -0
  65. package/dist/core/code-file.d.ts +12 -0
  66. package/dist/core/code-file.js +68 -0
  67. package/dist/core/content-metadata.d.ts +48 -0
  68. package/dist/core/content-metadata.js +264 -0
  69. package/dist/core/content-types.d.ts +45 -0
  70. package/dist/core/content-types.js +1 -0
  71. package/dist/core/extension-package.d.ts +34 -0
  72. package/dist/core/extension-package.js +147 -0
  73. package/dist/core/figure-frame.d.ts +12 -0
  74. package/dist/core/figure-frame.js +108 -0
  75. package/dist/core/file-embed.d.ts +13 -0
  76. package/dist/core/file-embed.js +43 -0
  77. package/dist/core/files.d.ts +15 -0
  78. package/dist/core/files.js +59 -0
  79. package/dist/core/flow-base-css.generated.d.ts +1 -0
  80. package/dist/core/flow-base-css.generated.js +4 -0
  81. package/dist/core/flow-css.d.ts +9 -0
  82. package/dist/core/flow-css.js +54 -0
  83. package/dist/core/graph-common.d.ts +32 -0
  84. package/dist/core/graph-common.js +113 -0
  85. package/dist/core/graph.d.ts +117 -0
  86. package/dist/core/graph.js +480 -0
  87. package/dist/core/html.d.ts +29 -0
  88. package/dist/core/html.js +444 -0
  89. package/dist/core/icons.d.ts +2 -0
  90. package/dist/core/icons.js +2 -0
  91. package/dist/core/inline.d.ts +27 -0
  92. package/dist/core/inline.js +42 -0
  93. package/dist/core/language.d.ts +41 -0
  94. package/dist/core/language.js +44 -0
  95. package/dist/core/languages/ja.d.ts +2 -0
  96. package/dist/core/languages/ja.js +5 -0
  97. package/dist/core/markdown.d.ts +27 -0
  98. package/dist/core/markdown.js +154 -0
  99. package/dist/core/previewers.d.ts +37 -0
  100. package/dist/core/previewers.js +103 -0
  101. package/dist/core/routing.d.ts +20 -0
  102. package/dist/core/routing.js +64 -0
  103. package/dist/core/schema-comments.d.ts +14 -0
  104. package/dist/core/schema-comments.js +52 -0
  105. package/dist/core/schema-graph-flow.d.ts +9 -0
  106. package/dist/core/schema-graph-flow.js +379 -0
  107. package/dist/core/schema-graph-mount.d.ts +9 -0
  108. package/dist/core/schema-graph-mount.js +105 -0
  109. package/dist/core/schema-graph.d.ts +254 -0
  110. package/dist/core/schema-graph.js +981 -0
  111. package/dist/core/table-ui.d.ts +2 -0
  112. package/dist/core/table-ui.js +180 -0
  113. package/dist/core/taxonomy.d.ts +12 -0
  114. package/dist/core/taxonomy.js +49 -0
  115. package/dist/core/term-reference.d.ts +5 -0
  116. package/dist/core/term-reference.js +19 -0
  117. package/dist/core/terms-ui.d.ts +6 -0
  118. package/dist/core/terms-ui.js +22 -0
  119. package/dist/core/textfile.d.ts +10 -0
  120. package/dist/core/textfile.js +39 -0
  121. package/dist/core/theme-variants.d.ts +3 -0
  122. package/dist/core/theme-variants.js +37 -0
  123. package/dist/core/toc-ui.d.ts +2 -0
  124. package/dist/core/toc-ui.js +161 -0
  125. package/dist/core/video-ui.d.ts +2 -0
  126. package/dist/core/video-ui.js +253 -0
  127. package/dist/core/workspace.d.ts +15 -0
  128. package/dist/core/workspace.js +28 -0
  129. package/dist/edit.global.js +306 -0
  130. package/dist/flow.global.js +4959 -0
  131. package/dist/index.d.ts +17 -0
  132. package/dist/index.js +31 -0
  133. package/dist/mcp.d.ts +24 -0
  134. package/dist/mcp.js +467 -0
  135. package/dist/plugins/actions.d.ts +45 -0
  136. package/dist/plugins/actions.js +125 -0
  137. package/dist/plugins/blocks.d.ts +93 -0
  138. package/dist/plugins/blocks.js +100 -0
  139. package/dist/plugins/index.d.ts +4 -0
  140. package/dist/plugins/index.js +1 -0
  141. package/dist/plugins/local-storage.d.ts +18 -0
  142. package/dist/plugins/local-storage.js +115 -0
  143. package/dist/plugins/oauth.d.ts +14 -0
  144. package/dist/plugins/oauth.js +170 -0
  145. package/dist/plugins/runtime.d.ts +26 -0
  146. package/dist/plugins/runtime.js +395 -0
  147. package/dist/plugins/types.d.ts +59 -0
  148. package/dist/plugins/types.js +1 -0
  149. package/dist/plugins/view.d.ts +7 -0
  150. package/dist/plugins/view.js +21 -0
  151. package/dist/ui.global.js +78 -0
  152. package/dist/viewer/assets.d.ts +2 -0
  153. package/dist/viewer/assets.js +3 -0
  154. package/dist/viewer/build.d.ts +12 -0
  155. package/dist/viewer/build.js +55 -0
  156. package/dist/viewer/bundle-network.d.ts +2 -0
  157. package/dist/viewer/bundle-network.js +88 -0
  158. package/dist/viewer/code-file.d.ts +20 -0
  159. package/dist/viewer/code-file.js +42 -0
  160. package/dist/viewer/editor-tools.d.ts +38 -0
  161. package/dist/viewer/editor-tools.js +211 -0
  162. package/dist/viewer/extension-pack.d.ts +2 -0
  163. package/dist/viewer/extension-pack.js +36 -0
  164. package/dist/viewer/extensions.d.ts +10 -0
  165. package/dist/viewer/extensions.js +302 -0
  166. package/dist/viewer/file-references.d.ts +14 -0
  167. package/dist/viewer/file-references.js +38 -0
  168. package/dist/viewer/font-picker.d.ts +4 -0
  169. package/dist/viewer/font-picker.js +145 -0
  170. package/dist/viewer/font-settings.d.ts +11 -0
  171. package/dist/viewer/font-settings.js +50 -0
  172. package/dist/viewer/fonts/LICENSE.txt +119 -0
  173. package/dist/viewer/fonts/udev-gothic-regular.woff2 +0 -0
  174. package/dist/viewer/fonts.d.ts +2 -0
  175. package/dist/viewer/fonts.js +13 -0
  176. package/dist/viewer/git-diff.d.ts +3 -0
  177. package/dist/viewer/git-diff.js +33 -0
  178. package/dist/viewer/git-types.d.ts +73 -0
  179. package/dist/viewer/git-types.js +1 -0
  180. package/dist/viewer/git.d.ts +5 -0
  181. package/dist/viewer/git.js +337 -0
  182. package/dist/viewer/hmr.d.ts +53 -0
  183. package/dist/viewer/hmr.js +337 -0
  184. package/dist/viewer/i18n.d.ts +6 -0
  185. package/dist/viewer/i18n.js +65 -0
  186. package/dist/viewer/ja-lint.d.ts +3 -0
  187. package/dist/viewer/ja-lint.js +44 -0
  188. package/dist/viewer/language-picker.d.ts +2 -0
  189. package/dist/viewer/language-picker.js +233 -0
  190. package/dist/viewer/languages.d.ts +11 -0
  191. package/dist/viewer/languages.js +20 -0
  192. package/dist/viewer/locales/eng.json +317 -0
  193. package/dist/viewer/locales/jpn.json +317 -0
  194. package/dist/viewer/locales/zho.json +317 -0
  195. package/dist/viewer/nav-focus.d.ts +2 -0
  196. package/dist/viewer/nav-focus.js +64 -0
  197. package/dist/viewer/plugin-blocks.d.ts +3 -0
  198. package/dist/viewer/plugin-blocks.js +115 -0
  199. package/dist/viewer/plugin-config.d.ts +35 -0
  200. package/dist/viewer/plugin-config.js +57 -0
  201. package/dist/viewer/plugin-view.d.ts +2 -0
  202. package/dist/viewer/plugin-view.js +6 -0
  203. package/dist/viewer/plugins.d.ts +12 -0
  204. package/dist/viewer/plugins.js +267 -0
  205. package/dist/viewer/resize.d.ts +4 -0
  206. package/dist/viewer/resize.js +238 -0
  207. package/dist/viewer/resource-library.d.ts +29 -0
  208. package/dist/viewer/resource-library.js +104 -0
  209. package/dist/viewer/search.d.ts +16 -0
  210. package/dist/viewer/search.js +358 -0
  211. package/dist/viewer/serve.d.ts +210 -0
  212. package/dist/viewer/serve.js +3312 -0
  213. package/dist/viewer/site-icon.d.ts +8 -0
  214. package/dist/viewer/site-icon.js +56 -0
  215. package/dist/viewer/textfile.d.ts +9 -0
  216. package/dist/viewer/textfile.js +50 -0
  217. package/dist/viewer/theme-picker.d.ts +2 -0
  218. package/dist/viewer/theme-picker.js +135 -0
  219. package/dist/viewer/workspace.d.ts +4 -0
  220. package/dist/viewer/workspace.js +47 -0
  221. package/package.json +128 -5
@@ -0,0 +1,285 @@
1
+ "use strict";(()=>{var Tl=Object.defineProperty;var di=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var Pr=(t,e)=>{for(var n in e)Tl(t,n,{get:e[n],enumerable:!0})};var _l={};Pr(_l,{default:()=>rh});var rh,vl=di(()=>{rh=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#fff","activityBar.border":"#e1e4e8","activityBar.foreground":"#2f363d","activityBar.inactiveForeground":"#959da5","activityBarBadge.background":"#2188ff","activityBarBadge.foreground":"#fff","badge.background":"#dbedff","badge.foreground":"#005cc5","breadcrumb.activeSelectionForeground":"#586069","breadcrumb.focusForeground":"#2f363d","breadcrumb.foreground":"#6a737d","breadcrumbPicker.background":"#fafbfc","button.background":"#159739","button.foreground":"#fff","button.hoverBackground":"#138934","button.secondaryBackground":"#e1e4e8","button.secondaryForeground":"#1b1f23","button.secondaryHoverBackground":"#d1d5da","checkbox.background":"#fafbfc","checkbox.border":"#d1d5da","debugToolBar.background":"#fff","descriptionForeground":"#6a737d","diffEditor.insertedTextBackground":"#34d05822","diffEditor.removedTextBackground":"#d73a4922","dropdown.background":"#fafbfc","dropdown.border":"#e1e4e8","dropdown.foreground":"#2f363d","dropdown.listBackground":"#fff","editor.background":"#fff","editor.findMatchBackground":"#ffdf5d","editor.findMatchHighlightBackground":"#ffdf5d66","editor.focusedStackFrameHighlightBackground":"#28a74525","editor.foldBackground":"#d1d5da11","editor.foreground":"#24292e","editor.inactiveSelectionBackground":"#0366d611","editor.lineHighlightBackground":"#f6f8fa","editor.linkedEditingBackground":"#0366d611","editor.selectionBackground":"#0366d625","editor.selectionHighlightBackground":"#34d05840","editor.selectionHighlightBorder":"#34d05800","editor.stackFrameHighlightBackground":"#ffd33d33","editor.wordHighlightBackground":"#34d05800","editor.wordHighlightBorder":"#24943e99","editor.wordHighlightStrongBackground":"#34d05800","editor.wordHighlightStrongBorder":"#24943e50","editorBracketHighlight.foreground1":"#005cc5","editorBracketHighlight.foreground2":"#e36209","editorBracketHighlight.foreground3":"#5a32a3","editorBracketHighlight.foreground4":"#005cc5","editorBracketHighlight.foreground5":"#e36209","editorBracketHighlight.foreground6":"#5a32a3","editorBracketMatch.background":"#34d05840","editorBracketMatch.border":"#34d05800","editorCursor.foreground":"#044289","editorError.foreground":"#cb2431","editorGroup.border":"#e1e4e8","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#e1e4e8","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#d73a49","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#d7dbe0","editorIndentGuide.background":"#eff2f6","editorLineNumber.activeForeground":"#24292e","editorLineNumber.foreground":"#1b1f234d","editorOverviewRuler.border":"#fff","editorWarning.foreground":"#f9c513","editorWhitespace.foreground":"#d1d5da","editorWidget.background":"#f6f8fa","errorForeground":"#cb2431","focusBorder":"#2188ff","foreground":"#444d56","gitDecoration.addedResourceForeground":"#28a745","gitDecoration.conflictingResourceForeground":"#e36209","gitDecoration.deletedResourceForeground":"#d73a49","gitDecoration.ignoredResourceForeground":"#959da5","gitDecoration.modifiedResourceForeground":"#005cc5","gitDecoration.submoduleResourceForeground":"#959da5","gitDecoration.untrackedResourceForeground":"#28a745","input.background":"#fafbfc","input.border":"#e1e4e8","input.foreground":"#2f363d","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#e2e5e9","list.activeSelectionForeground":"#2f363d","list.focusBackground":"#cce5ff","list.hoverBackground":"#ebf0f4","list.hoverForeground":"#2f363d","list.inactiveFocusBackground":"#dbedff","list.inactiveSelectionBackground":"#e8eaed","list.inactiveSelectionForeground":"#2f363d","notificationCenterHeader.background":"#e1e4e8","notificationCenterHeader.foreground":"#6a737d","notifications.background":"#fafbfc","notifications.border":"#e1e4e8","notifications.foreground":"#2f363d","notificationsErrorIcon.foreground":"#d73a49","notificationsInfoIcon.foreground":"#005cc5","notificationsWarningIcon.foreground":"#e36209","panel.background":"#f6f8fa","panel.border":"#e1e4e8","panelInput.border":"#e1e4e8","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#2f363d","panelTitle.inactiveForeground":"#6a737d","pickerGroup.border":"#e1e4e8","pickerGroup.foreground":"#2f363d","progressBar.background":"#2188ff","quickInput.background":"#fafbfc","quickInput.foreground":"#2f363d","scrollbar.shadow":"#6a737d33","scrollbarSlider.activeBackground":"#959da588","scrollbarSlider.background":"#959da533","scrollbarSlider.hoverBackground":"#959da544","settings.headerForeground":"#2f363d","settings.modifiedItemIndicator":"#2188ff","sideBar.background":"#f6f8fa","sideBar.border":"#e1e4e8","sideBar.foreground":"#586069","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#e1e4e8","sideBarSectionHeader.foreground":"#2f363d","sideBarTitle.foreground":"#2f363d","statusBar.background":"#fff","statusBar.border":"#e1e4e8","statusBar.debuggingBackground":"#f9826c","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#586069","statusBar.noFolderBackground":"#fff","statusBarItem.prominentBackground":"#e8eaed","statusBarItem.remoteBackground":"#fff","statusBarItem.remoteForeground":"#586069","tab.activeBackground":"#fff","tab.activeBorder":"#fff","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#2f363d","tab.border":"#e1e4e8","tab.hoverBackground":"#fff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#6a737d","tab.unfocusedActiveBorder":"#fff","tab.unfocusedActiveBorderTop":"#e1e4e8","tab.unfocusedHoverBackground":"#fff","terminal.ansiBlack":"#24292e","terminal.ansiBlue":"#0366d6","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#005cc5","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#22863a","terminal.ansiBrightMagenta":"#5a32a3","terminal.ansiBrightRed":"#cb2431","terminal.ansiBrightWhite":"#d1d5da","terminal.ansiBrightYellow":"#b08800","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#28a745","terminal.ansiMagenta":"#5a32a3","terminal.ansiRed":"#d73a49","terminal.ansiWhite":"#6a737d","terminal.ansiYellow":"#dbab09","terminal.foreground":"#586069","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#d1d5da","terminalCursor.foreground":"#005cc5","textBlockQuote.background":"#fafbfc","textBlockQuote.border":"#e1e4e8","textCodeBlock.background":"#f6f8fa","textLink.activeForeground":"#005cc5","textLink.foreground":"#0366d6","textPreformat.foreground":"#586069","textSeparator.foreground":"#d1d5da","titleBar.activeBackground":"#fff","titleBar.activeForeground":"#2f363d","titleBar.border":"#e1e4e8","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#6a737d","tree.indentGuidesStroke":"#e1e4e8","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#e1e4e8"},"displayName":"GitHub Light","name":"github-light","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#005cc5"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#6f42c1"}},{"scope":"variable.parameter.function","settings":{"foreground":"#24292e"}},{"scope":"entity.name.tag","settings":{"foreground":"#22863a"}},{"scope":"keyword","settings":{"foreground":"#d73a49"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#d73a49"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#24292e"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#032f62"}},{"scope":"support","settings":{"foreground":"#005cc5"}},{"scope":"meta.property-name","settings":{"foreground":"#005cc5"}},{"scope":"variable","settings":{"foreground":"#e36209"}},{"scope":"variable.other","settings":{"foreground":"#24292e"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"carriage-return","settings":{"background":"#d73a49","content":"^M","fontStyle":"italic underline","foreground":"#fafbfc"}},{"scope":"message.error","settings":{"foreground":"#b31d28"}},{"scope":"string variable","settings":{"foreground":"#005cc5"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#032f62"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#032f62"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#22863a"}},{"scope":"support.constant","settings":{"foreground":"#005cc5"}},{"scope":"support.variable","settings":{"foreground":"#005cc5"}},{"scope":"meta.module-reference","settings":{"foreground":"#005cc5"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e36209"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"markup.quote","settings":{"foreground":"#22863a"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#24292e"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#24292e"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#005cc5"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffeef0","foreground":"#b31d28"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#f0fff4","foreground":"#22863a"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffebda","foreground":"#e36209"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#005cc5","foreground":"#f6f8fa"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#6f42c1"}},{"scope":"meta.diff.header","settings":{"foreground":"#005cc5"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"meta.output","settings":{"foreground":"#005cc5"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#586069"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#b31d28"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#032f62"}}],"type":"light"}'))});var El={};Pr(El,{default:()=>sh});var sh,Al=di(()=>{sh=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#24292e","activityBar.border":"#1b1f23","activityBar.foreground":"#e1e4e8","activityBar.inactiveForeground":"#6a737d","activityBarBadge.background":"#0366d6","activityBarBadge.foreground":"#fff","badge.background":"#044289","badge.foreground":"#c8e1ff","breadcrumb.activeSelectionForeground":"#d1d5da","breadcrumb.focusForeground":"#e1e4e8","breadcrumb.foreground":"#959da5","breadcrumbPicker.background":"#2b3036","button.background":"#176f2c","button.foreground":"#dcffe4","button.hoverBackground":"#22863a","button.secondaryBackground":"#444d56","button.secondaryForeground":"#fff","button.secondaryHoverBackground":"#586069","checkbox.background":"#444d56","checkbox.border":"#1b1f23","debugToolBar.background":"#2b3036","descriptionForeground":"#959da5","diffEditor.insertedTextBackground":"#28a74530","diffEditor.removedTextBackground":"#d73a4930","dropdown.background":"#2f363d","dropdown.border":"#1b1f23","dropdown.foreground":"#e1e4e8","dropdown.listBackground":"#24292e","editor.background":"#24292e","editor.findMatchBackground":"#ffd33d44","editor.findMatchHighlightBackground":"#ffd33d22","editor.focusedStackFrameHighlightBackground":"#2b6a3033","editor.foldBackground":"#58606915","editor.foreground":"#e1e4e8","editor.inactiveSelectionBackground":"#3392FF22","editor.lineHighlightBackground":"#2b3036","editor.linkedEditingBackground":"#3392FF22","editor.selectionBackground":"#3392FF44","editor.selectionHighlightBackground":"#17E5E633","editor.selectionHighlightBorder":"#17E5E600","editor.stackFrameHighlightBackground":"#C6902625","editor.wordHighlightBackground":"#17E5E600","editor.wordHighlightBorder":"#17E5E699","editor.wordHighlightStrongBackground":"#17E5E600","editor.wordHighlightStrongBorder":"#17E5E666","editorBracketHighlight.foreground1":"#79b8ff","editorBracketHighlight.foreground2":"#ffab70","editorBracketHighlight.foreground3":"#b392f0","editorBracketHighlight.foreground4":"#79b8ff","editorBracketHighlight.foreground5":"#ffab70","editorBracketHighlight.foreground6":"#b392f0","editorBracketMatch.background":"#17E5E650","editorBracketMatch.border":"#17E5E600","editorCursor.foreground":"#c8e1ff","editorError.foreground":"#f97583","editorGroup.border":"#1b1f23","editorGroupHeader.tabsBackground":"#1f2428","editorGroupHeader.tabsBorder":"#1b1f23","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#ea4a5a","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#444d56","editorIndentGuide.background":"#2f363d","editorLineNumber.activeForeground":"#e1e4e8","editorLineNumber.foreground":"#444d56","editorOverviewRuler.border":"#1b1f23","editorWarning.foreground":"#ffea7f","editorWhitespace.foreground":"#444d56","editorWidget.background":"#1f2428","errorForeground":"#f97583","focusBorder":"#005cc5","foreground":"#d1d5da","gitDecoration.addedResourceForeground":"#34d058","gitDecoration.conflictingResourceForeground":"#ffab70","gitDecoration.deletedResourceForeground":"#ea4a5a","gitDecoration.ignoredResourceForeground":"#6a737d","gitDecoration.modifiedResourceForeground":"#79b8ff","gitDecoration.submoduleResourceForeground":"#6a737d","gitDecoration.untrackedResourceForeground":"#34d058","input.background":"#2f363d","input.border":"#1b1f23","input.foreground":"#e1e4e8","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#39414a","list.activeSelectionForeground":"#e1e4e8","list.focusBackground":"#044289","list.hoverBackground":"#282e34","list.hoverForeground":"#e1e4e8","list.inactiveFocusBackground":"#1d2d3e","list.inactiveSelectionBackground":"#282e34","list.inactiveSelectionForeground":"#e1e4e8","notificationCenterHeader.background":"#24292e","notificationCenterHeader.foreground":"#959da5","notifications.background":"#2f363d","notifications.border":"#1b1f23","notifications.foreground":"#e1e4e8","notificationsErrorIcon.foreground":"#ea4a5a","notificationsInfoIcon.foreground":"#79b8ff","notificationsWarningIcon.foreground":"#ffab70","panel.background":"#1f2428","panel.border":"#1b1f23","panelInput.border":"#2f363d","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#e1e4e8","panelTitle.inactiveForeground":"#959da5","peekViewEditor.background":"#1f242888","peekViewEditor.matchHighlightBackground":"#ffd33d33","peekViewResult.background":"#1f2428","peekViewResult.matchHighlightBackground":"#ffd33d33","pickerGroup.border":"#444d56","pickerGroup.foreground":"#e1e4e8","progressBar.background":"#0366d6","quickInput.background":"#24292e","quickInput.foreground":"#e1e4e8","scrollbar.shadow":"#0008","scrollbarSlider.activeBackground":"#6a737d88","scrollbarSlider.background":"#6a737d33","scrollbarSlider.hoverBackground":"#6a737d44","settings.headerForeground":"#e1e4e8","settings.modifiedItemIndicator":"#0366d6","sideBar.background":"#1f2428","sideBar.border":"#1b1f23","sideBar.foreground":"#d1d5da","sideBarSectionHeader.background":"#1f2428","sideBarSectionHeader.border":"#1b1f23","sideBarSectionHeader.foreground":"#e1e4e8","sideBarTitle.foreground":"#e1e4e8","statusBar.background":"#24292e","statusBar.border":"#1b1f23","statusBar.debuggingBackground":"#931c06","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#d1d5da","statusBar.noFolderBackground":"#24292e","statusBarItem.prominentBackground":"#282e34","statusBarItem.remoteBackground":"#24292e","statusBarItem.remoteForeground":"#d1d5da","tab.activeBackground":"#24292e","tab.activeBorder":"#24292e","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#e1e4e8","tab.border":"#1b1f23","tab.hoverBackground":"#24292e","tab.inactiveBackground":"#1f2428","tab.inactiveForeground":"#959da5","tab.unfocusedActiveBorder":"#24292e","tab.unfocusedActiveBorderTop":"#1b1f23","tab.unfocusedHoverBackground":"#24292e","terminal.ansiBlack":"#586069","terminal.ansiBlue":"#2188ff","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#79b8ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#85e89d","terminal.ansiBrightMagenta":"#b392f0","terminal.ansiBrightRed":"#f97583","terminal.ansiBrightWhite":"#fafbfc","terminal.ansiBrightYellow":"#ffea7f","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#34d058","terminal.ansiMagenta":"#b392f0","terminal.ansiRed":"#ea4a5a","terminal.ansiWhite":"#d1d5da","terminal.ansiYellow":"#ffea7f","terminal.foreground":"#d1d5da","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#586069","terminalCursor.foreground":"#79b8ff","textBlockQuote.background":"#24292e","textBlockQuote.border":"#444d56","textCodeBlock.background":"#2f363d","textLink.activeForeground":"#c8e1ff","textLink.foreground":"#79b8ff","textPreformat.foreground":"#d1d5da","textSeparator.foreground":"#586069","titleBar.activeBackground":"#24292e","titleBar.activeForeground":"#e1e4e8","titleBar.border":"#1b1f23","titleBar.inactiveBackground":"#1f2428","titleBar.inactiveForeground":"#959da5","tree.indentGuidesStroke":"#2f363d","welcomePage.buttonBackground":"#2f363d","welcomePage.buttonHoverBackground":"#444d56"},"displayName":"GitHub Dark","name":"github-dark","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#79b8ff"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#b392f0"}},{"scope":"variable.parameter.function","settings":{"foreground":"#e1e4e8"}},{"scope":"entity.name.tag","settings":{"foreground":"#85e89d"}},{"scope":"keyword","settings":{"foreground":"#f97583"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#f97583"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e1e4e8"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#9ecbff"}},{"scope":"support","settings":{"foreground":"#79b8ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79b8ff"}},{"scope":"variable","settings":{"foreground":"#ffab70"}},{"scope":"variable.other","settings":{"foreground":"#e1e4e8"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"carriage-return","settings":{"background":"#f97583","content":"^M","fontStyle":"italic underline","foreground":"#24292e"}},{"scope":"message.error","settings":{"foreground":"#fdaeb7"}},{"scope":"string variable","settings":{"foreground":"#79b8ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#dbedff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#dbedff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#85e89d"}},{"scope":"support.constant","settings":{"foreground":"#79b8ff"}},{"scope":"support.variable","settings":{"foreground":"#79b8ff"}},{"scope":"meta.module-reference","settings":{"foreground":"#79b8ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffab70"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"markup.quote","settings":{"foreground":"#85e89d"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e1e4e8"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e1e4e8"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79b8ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#86181d","foreground":"#fdaeb7"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#144620","foreground":"#85e89d"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#c24e00","foreground":"#ffab70"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79b8ff","foreground":"#2f363d"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#b392f0"}},{"scope":"meta.diff.header","settings":{"foreground":"#79b8ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"meta.output","settings":{"foreground":"#79b8ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#d1d5da"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#fdaeb7"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#dbedff"}}],"type":"dark"}'))});var yn=Symbol.for("yaml.alias"),bn=Symbol.for("yaml.document"),ce=Symbol.for("yaml.map"),$r=Symbol.for("yaml.pair"),ee=Symbol.for("yaml.scalar"),Ne=Symbol.for("yaml.seq"),Y=Symbol.for("yaml.node.type"),ue=t=>!!t&&typeof t=="object"&&t[Y]===yn,be=t=>!!t&&typeof t=="object"&&t[Y]===bn,fe=t=>!!t&&typeof t=="object"&&t[Y]===ce,L=t=>!!t&&typeof t=="object"&&t[Y]===$r,I=t=>!!t&&typeof t=="object"&&t[Y]===ee,te=t=>!!t&&typeof t=="object"&&t[Y]===Ne;function B(t){if(t&&typeof t=="object")switch(t[Y]){case ce:case Ne:return!0}return!1}function T(t){if(t&&typeof t=="object")switch(t[Y]){case yn:case ce:case ee:case Ne:return!0}return!1}var wn=t=>(I(t)||B(t))&&!!t.anchor;var Q=Symbol("break visit"),hi=Symbol("skip children"),we=Symbol("remove node");function se(t,e){let n=pi(e);be(t)?ft(null,t.contents,n,Object.freeze([t]))===we&&(t.contents=null):ft(null,t,n,Object.freeze([]))}se.BREAK=Q;se.SKIP=hi;se.REMOVE=we;function ft(t,e,n,r){let s=gi(t,e,n,r);if(T(s)||L(s))return mi(t,r,s),ft(t,s,n,r);if(typeof s!="symbol"){if(B(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=ft(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Q)return Q;o===we&&(e.items.splice(i,1),i-=1)}}}else if(L(e)){r=Object.freeze(r.concat(e));let i=ft("key",e.key,n,r);if(i===Q)return Q;i===we&&(e.key=null);let o=ft("value",e.value,n,r);if(o===Q)return Q;o===we&&(e.value=null)}}return s}async function kn(t,e){let n=pi(e);be(t)?await dt(null,t.contents,n,Object.freeze([t]))===we&&(t.contents=null):await dt(null,t,n,Object.freeze([]))}kn.BREAK=Q;kn.SKIP=hi;kn.REMOVE=we;async function dt(t,e,n,r){let s=await gi(t,e,n,r);if(T(s)||L(s))return mi(t,r,s),dt(t,s,n,r);if(typeof s!="symbol"){if(B(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await dt(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Q)return Q;o===we&&(e.items.splice(i,1),i-=1)}}}else if(L(e)){r=Object.freeze(r.concat(e));let i=await dt("key",e.key,n,r);if(i===Q)return Q;i===we&&(e.key=null);let o=await dt("value",e.value,n,r);if(o===Q)return Q;o===we&&(e.value=null)}}return s}function pi(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function gi(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(fe(e))return n.Map?.(t,e,r);if(te(e))return n.Seq?.(t,e,r);if(L(e))return n.Pair?.(t,e,r);if(I(e))return n.Scalar?.(t,e,r);if(ue(e))return n.Alias?.(t,e,r)}function mi(t,e,n){let r=e[e.length-1];if(B(r))r.items[t]=n;else if(L(r))t==="key"?r.key=n:r.value=n;else if(be(r))r.contents=n;else{let s=ue(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}var Ll={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Bl=t=>t.replace(/[!,[\]{}]/g,e=>Ll[e]),ke=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Bl(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&T(e.contents)){let i={};se(e.contents,(o,a)=>{T(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
2
+ `)}};ke.defaultYaml={explicit:!1,version:"1.2"};ke.defaultTags={"!!":"tag:yaml.org,2002:"};function Sn(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function Mr(t){let e=new Set;return se(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Fr(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function yi(t,e){let n=[],r=new Map,s=null;return{onAnchor:i=>{n.push(i),s??(s=Mr(t));let o=Fr(e,s);return s.add(o),o},setAnchors:()=>{for(let i of n){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(I(o.node)||B(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function Ge(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=Ge(t,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=Ge(t,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=Ge(t,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=Ge(t,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return t.call(e,n,r)}function q(t,e,n){if(Array.isArray(t))return t.map((r,s)=>q(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!wn(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};let s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}var je=class{constructor(e){Object.defineProperty(this,Y,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!be(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=q(this,"",o);if(typeof s=="function")for(let{count:l,res:c}of o.anchors.values())s(c,l);return typeof i=="function"?Ge(i,{"":a},"",a):a}};var xe=class extends je{constructor(e){super(yn),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],se(e,{Node:(i,o)=>{(ue(o)||wn(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(let i of r){if(i===this)break;i.anchor===this.source&&(s=i)}if(s&&n){let{anchors:i,doc:o,maxAliasCount:a}=n,l=i.get(s);if(l||(q(s,null,n),l=i.get(s)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Cn(o,s,i)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return s}toJSON(e,n){if(!n)return{source:this.source};let r=this.resolve(n.doc,n);if(!r){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(s)}return n.anchors.get(r).res}toString(e,n,r){let s=`*${this.source}`;if(e){if(Sn(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function Cn(t,e,n){if(ue(e)){let r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(B(e)){let r=0;for(let s of e.items){let i=Cn(t,s,n);i>r&&(r=i)}return r}else if(L(e)){let r=Cn(t,e.key,n),s=Cn(t,e.value,n);return Math.max(r,s)}return 1}var _n=t=>!t||typeof t!="function"&&typeof t!="object",v=class extends je{constructor(e){super(ee),this.value=e}toJSON(e,n){return n?.keep?this.value:q(this.value,e,n)}toString(){return String(this.value)}};v.BLOCK_FOLDED="BLOCK_FOLDED";v.BLOCK_LITERAL="BLOCK_LITERAL";v.PLAIN="PLAIN";v.QUOTE_DOUBLE="QUOTE_DOUBLE";v.QUOTE_SINGLE="QUOTE_SINGLE";var Ol="tag:yaml.org,2002:";function Rl(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function Ie(t,e,n){if(be(t)&&(t=t.contents),T(t))return t;if(L(t)){let f=n.schema[ce].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=s(t)),new xe(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=Ol+e.slice(2));let c=Rl(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new v(t);return l&&(l.node=f),f}c=t instanceof Map?o[ce]:Symbol.iterator in Object(t)?o[Ne]:o[ce]}i&&(i(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new v(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Tt(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Ie(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var pt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ht=class extends je{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>T(r)||L(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(pt(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(B(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Tt(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let s=this.get(n,!0);if(B(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&I(i)?i.value:i:B(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!L(n))return!1;let r=n.value;return r==null||e&&I(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let s=this.get(n,!0);return B(s)?s.hasIn(r):!1}setIn(e,n){let[r,...s]=e;if(s.length===0)this.set(r,n);else{let i=this.get(r,!0);if(B(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Tt(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};var bi=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ie(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Se=(t,e,n)=>t.endsWith(`
3
+ `)?ie(n,e):n.includes(`
4
+ `)?`
5
+ `+ie(n,e):(t.endsWith(" ")?"":" ")+n;var Dr="flow",vn="block",Lt="quoted";function Bt(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;s<i&&(i=0);let l=Math.max(1+i,1+s-e.length);if(t.length<=l)return t;let c=[],u={},f=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?c.push(0):f=s-r);let d,h,p=!1,g=-1,m=-1,y=-1;n===vn&&(g=wi(t,g,e.length),g!==-1&&(f=g+l));for(let w;w=t[g+=1];){if(n===Lt&&w==="\\"){switch(m=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if(w===`
6
+ `)n===vn&&(g=wi(t,g,e.length)),f=g+e.length+l,d=void 0;else{if(w===" "&&h&&h!==" "&&h!==`
7
+ `&&h!==" "){let S=t[g+1];S&&S!==" "&&S!==`
8
+ `&&S!==" "&&(d=g)}if(g>=f)if(d)c.push(d),f=d+l,d=void 0;else if(n===Lt){for(;h===" "||h===" ";)h=w,w=t[g+=1],p=!0;let S=g>y+1?g-2:m-1;if(u[S])return t;c.push(S),u[S]=!0,f=S+l,d=void 0}else p=!0}h=w}if(p&&a&&a(),c.length===0)return t;o&&o();let b=t.slice(0,c[0]);for(let w=0;w<c.length;++w){let S=c[w],C=c[w+1]||t.length;S===0?b=`
9
+ ${e}${t.slice(0,C)}`:(n===Lt&&u[S]&&(b+=`${t[S]}\\`),b+=`
10
+ ${e}${t.slice(S+1,C)}`)}return b}function wi(t,e,n){let r=e,s=e+1,i=t[s];for(;i===" "||i===" ";)if(e<s+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
11
+ `);r=e,s=e+1,i=t[s]}return r}var An=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Nn=t=>/^(%|---|\.\.\.)/m.test(t);function Pl(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(t[i]===`
12
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function Ot(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Nn(t)?" ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
13
+
14
+ `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
15
+ `,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,r?o:Bt(o,i,Lt,An(e,!1))}function Gr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
16
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Ot(t,e);let n=e.indent||(Nn(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
17
+ ${n}`)+"'";return e.implicitKey?r:Bt(r,n,Dr,An(e,!1))}function gt(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=Ot;else{let s=t.includes('"'),i=t.includes("'");s&&!i?r=Gr:i&&!s?r=Ot:r=n?Gr:Ot}return r(t,e)}var jr;try{jr=new RegExp(`(^|(?<!
18
+ ))
19
+ +(?!
20
+ |$)`,"g")}catch{jr=/\n+(?!\n|$)/g}function En({comment:t,type:e,value:n},r,s,i){let{blockQuote:o,commentString:a,lineWidth:l}=r.options;if(!o||/\n[\t ]+$/.test(n))return gt(n,r);let c=r.indent||(r.forceBlockIndent||Nn(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===v.BLOCK_FOLDED?!1:e===v.BLOCK_LITERAL?!0:!Pl(n,l,c.length);if(!n)return u?`|
21
+ `:`>
22
+ `;let f,d;for(d=n.length;d>0;--d){let C=n[d-1];if(C!==`
23
+ `&&C!==" "&&C!==" ")break}let h=n.substring(d),p=h.indexOf(`
24
+ `);p===-1?f="-":n===h||p!==h.length-1?(f="+",i&&i()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
25
+ `&&(h=h.slice(0,-1)),h=h.replace(jr,`$&${c}`));let g=!1,m,y=-1;for(m=0;m<n.length;++m){let C=n[m];if(C===" ")g=!0;else if(C===`
26
+ `)y=m;else break}let b=n.substring(0,y<m?y+1:m);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let S=(g?c?"2":"1":"")+f;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let C=n.replace(/\n+/g,`
27
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),E=!1,x=An(r,!0);o!=="folded"&&e!==v.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let _=Bt(`${b}${C}${h}`,c,vn,x);if(!E)return`>${S}
28
+ ${c}${_}`}return n=n.replace(/\n+/g,`$&${c}`),`|${S}
29
+ ${c}${b}${n}${h}`}function $l(t,e,n,r){let{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&i.includes(`
30
+ `)||u&&/[[\]{},]/.test(i))return gt(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
31
+ `)?gt(i,e):En(t,e,n,r);if(!a&&!u&&s!==v.PLAIN&&i.includes(`
32
+ `))return En(t,e,n,r);if(Nn(i)){if(l==="")return e.forceBlockIndent=!0,En(t,e,n,r);if(a&&l===c)return gt(i,e)}let f=i.replace(/\n+/g,`$&
33
+ ${l}`);if(o){let d=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:h,tags:p}=e.doc.schema;if(p.some(d)||h?.some(d))return gt(i,e)}return a?f:Bt(f,l,Dr,An(e,!1))}function Xe(t,e,n,r){let{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==v.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=v.QUOTE_DOUBLE);let l=u=>{switch(u){case v.BLOCK_FOLDED:case v.BLOCK_LITERAL:return s||i?gt(o.value,e):En(o,e,n,r);case v.QUOTE_DOUBLE:return Ot(o.value,e);case v.QUOTE_SINGLE:return Gr(o.value,e);case v.PLAIN:return $l(o,e,n,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=s&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}function xn(t,e){let n=Object.assign({blockQuote:!0,commentString:bi,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Ml(t,e){if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if(I(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function Fl(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let s=[],i=(I(t)||B(t))&&t.anchor;i&&Sn(i)&&(n.add(i),s.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function Te(t,e,n,r){if(L(t))return t.toString(e,n,r);if(ue(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s,i=T(t)?t:e.doc.createNode(t,{onTagObj:l=>s=l});s??(s=Ml(e.doc.schema.tags,i));let o=Fl(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,n,r):I(i)?Xe(i,e,n,r):i.toString(e,n,r);return o?I(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
34
+ ${e.indent}${a}`:a}function ki({key:t,value:e},n,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=T(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(B(t)||!T(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||B(t)||(I(t)?t.type===v.BLOCK_FOLDED||t.type===v.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!i),indent:a+l});let p=!1,g=!1,m=Te(t,n,()=>p=!0,()=>g=!0);if(!h&&!n.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(i||e==null)return p&&r&&r(),m===""?"?":h?`? ${m}`:m}else if(i&&!f||e==null&&h)return m=`? ${m}`,d&&!p?m+=Se(m,n.indent,c(d)):g&&s&&s(),m;p&&(d=null),h?(d&&(m+=Se(m,n.indent,c(d))),m=`? ${m}
35
+ ${a}:`):(m=`${m}:`,d&&(m+=Se(m,n.indent,c(d))));let y,b,w;T(e)?(y=!!e.spaceBefore,b=e.commentBefore,w=e.comment):(y=!1,b=null,w=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&I(e)&&(n.indentAtStart=m.length+1),g=!1,!u&&l.length>=2&&!n.inFlow&&!h&&te(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Te(e,n,()=>S=!0,()=>g=!0),E=" ";if(d||y||b){if(E=y?`
36
+ `:"",b){let x=c(b);E+=`
37
+ ${ie(x,n.indent)}`}C===""&&!n.inFlow?E===`
38
+ `&&w&&(E=`
39
+
40
+ `):E+=`
41
+ ${n.indent}`}else if(!h&&B(e)){let x=C[0],_=C.indexOf(`
42
+ `),$=_!==-1,re=n.inFlow??e.flow??e.items.length===0;if($||!re){let ye=!1;if($&&(x==="&"||x==="!")){let O=C.indexOf(" ");x==="&"&&O!==-1&&O<_&&C[O+1]==="!"&&(O=C.indexOf(" ",O+1)),(O===-1||_<O)&&(ye=!0)}ye||(E=`
43
+ ${n.indent}`)}}else(C===""||C[0]===`
44
+ `)&&(E="");return m+=E+C,n.inFlow?S&&r&&r():w&&!S?m+=Se(m,n.indent,c(w)):g&&s&&s(),m}function Ur(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var In="<<",de={identify:t=>t===In||typeof t=="symbol"&&t.description===In,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new v(Symbol(In)),{addToJSMap:Hr}),stringify:()=>In},Si=(t,e)=>(de.identify(e)||I(e)&&(!e.type||e.type===v.PLAIN)&&de.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===de.tag&&n.default);function Hr(t,e,n){let r=Ci(t,n);if(te(r))for(let s of r.items)qr(t,e,s);else if(Array.isArray(r))for(let s of r)qr(t,e,s);else qr(t,e,r)}function qr(t,e,n){let r=Ci(t,n);if(!fe(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,t,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ci(t,e){return t&&ue(e)?e.resolve(t.doc,t):e}function Tn(t,e,{key:n,value:r}){if(T(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(Si(t,n))Hr(t,e,r);else{let s=q(n,"",t);if(e instanceof Map)e.set(s,q(r,s,t));else if(e instanceof Set)e.add(s);else{let i=Dl(n,s,t),o=q(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Dl(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(T(t)&&n?.doc){let r=xn(n.doc,{});r.anchors=new Set;for(let i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),Ur(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}function mt(t,e,n){let r=Ie(t,void 0,n),s=Ie(e,void 0,n);return new M(r,s)}var M=class t{constructor(e,n=null){Object.defineProperty(this,Y,{value:$r}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return T(n)&&(n=n.clone(e)),T(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Tn(n,r,this)}toString(e,n,r){return e?.doc?ki(this,e,n,r):JSON.stringify(this)}};function Bn(t,e,n){return(e.inFlow??t.flow?jl:Gl)(t,e,n)}function Gl({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null}),f=!1,d=[];for(let p=0;p<e.length;++p){let g=e[p],m=null;if(T(g))!f&&g.spaceBefore&&d.push(""),Ln(n,d,g.commentBefore,f),g.comment&&(m=g.comment);else if(L(g)){let b=T(g.key)?g.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Ln(n,d,b.commentBefore,f))}f=!1;let y=Te(g,u,()=>m=null,()=>f=!0);m&&(y+=Se(y,i,c(m))),f&&m&&(f=!1),d.push(r+y)}let h;if(d.length===0)h=s.start+s.end;else{h=d[0];for(let p=1;p<d.length;++p){let g=d[p];h+=g?`
45
+ ${l}${g}`:`
46
+ `}}return t?(h+=`
47
+ `+ie(c(t),l),a&&a()):f&&o&&o(),h}function jl({items:t},e,{flowChars:n,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let p=0;p<t.length;++p){let g=t[p],m=null;if(T(g))g.spaceBefore&&f.push(""),Ln(e,f,g.commentBefore,!1),g.comment&&(m=g.comment);else if(L(g)){let b=T(g.key)?g.key:null;b&&(b.spaceBefore&&f.push(""),Ln(e,f,b.commentBefore,!1),b.comment&&(c=!0));let w=T(g.value)?g.value:null;w?(w.comment&&(m=w.comment),w.commentBefore&&(c=!0)):g.value==null&&b?.comment&&(m=b.comment)}m&&(c=!0);let y=Te(g,l,()=>m=null);c||(c=f.length>u||y.includes(`
48
+ `)),p<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((b,w)=>b+w.length+2,2)+(y.length+2)>e.options.lineWidth)),c&&(y+=",")),m&&(y+=Se(y,r,a(m))),f.push(y),u=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!c){let p=f.reduce((g,m)=>g+m.length+2,2);c=e.options.lineWidth>0&&p>e.options.lineWidth}if(c){let p=d;for(let g of f)p+=g?`
49
+ ${i}${s}${g}`:`
50
+ `;return`${p}
51
+ ${s}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Ln({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=ie(e(r),t);n.push(i.trimStart())}}function Ue(t,e){let n=I(e)?e.value:e;for(let r of t)if(L(r)&&(r.key===e||r.key===n||I(r.key)&&r.key.value===n))return r}var D=class extends ht{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ce,e),this.items=[]}static from(e,n,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||s)&&o.items.push(mt(l,c,r))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;L(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new M(e,e?.value):r=new M(e.key,e.value);let s=Ue(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);I(s.value)&&_n(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=Ue(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let s=Ue(this.items,e)?.value;return(!n&&I(s)?s.value:s)??void 0}has(e){return!!Ue(this.items,e)}set(e,n){this.add(new M(e,n),!0)}toJSON(e,n,r){let s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(let i of this.items)Tn(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!L(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Bn(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};var he={collection:"map",default:!0,nodeClass:D,tag:"tag:yaml.org,2002:map",resolve(t,e){return fe(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>D.from(t,e,n)};var V=class extends ht{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ne,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=On(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=On(e);if(typeof r!="number")return;let s=this.items[r];return!n&&I(s)?s.value:s}has(e){let n=On(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=On(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];I(s)&&_n(n)?s.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let s=0;for(let i of this.items)r.push(q(i,String(s++),n));return r}toString(e,n,r){return e?Bn(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){let l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}i.items.push(Ie(a,void 0,r))}}return i}};function On(t){let e=I(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var pe={collection:"seq",default:!0,nodeClass:V,tag:"tag:yaml.org,2002:seq",resolve(t,e){return te(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>V.from(t,e,n)};var qe={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Xe(t,e,n,r)}};var Ze={identify:t=>t==null,createNode:()=>new v(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new v(null),stringify:({source:t},e)=>typeof t=="string"&&Ze.test.test(t)?t:e.options.nullStr};var Rt={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new v(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Rt.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};function z({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}var Rn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z},Pn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():z(t)}},$n={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new v(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:z};var Mn=t=>typeof t=="bigint"||Number.isInteger(t),Wr=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function _i(t,e,n){let{value:r}=t;return Mn(r)&&r>=0?n+r.toString(e):z(t)}var Fn={identify:t=>Mn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Wr(t,2,8,n),stringify:t=>_i(t,8,"0o")},Dn={identify:Mn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Wr(t,0,10,n),stringify:z},Gn={identify:t=>Mn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Wr(t,2,16,n),stringify:t=>_i(t,16,"0x")};var vi=[he,pe,qe,Ze,Rt,Fn,Dn,Gn,Rn,Pn,$n];function Ei(t){return typeof t=="bigint"||Number.isInteger(t)}var jn=({value:t})=>JSON.stringify(t),Ul=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:jn},{identify:t=>t==null,createNode:()=>new v(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:jn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:jn},{identify:Ei,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ei(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:jn}],ql={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ai=[he,pe].concat(Ul,ql);var Pt={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,s,i){if(!n)return"";let o=n,a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=v.BLOCK_LITERAL),e!==v.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(e===v.BLOCK_LITERAL?`
52
+ `:" ")}return Xe({comment:t,type:e,value:a},r,s,i)}};function Kr(t,e){if(te(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!L(r)){if(fe(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new M(new v(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
53
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
54
+ ${i.comment}`:r.comment}r=s}t.items[n]=L(r)?r:new M(r)}}else e("Expected a sequence for this tag");return t}function Vr(t,e,n){let{replacer:r}=n,s=new V(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(mt(a,l,n))}return s}var $t={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Kr,createNode:Vr};var yt=class t extends V{constructor(){super(),this.add=D.prototype.add.bind(this),this.delete=D.prototype.delete.bind(this),this.get=D.prototype.get.bind(this),this.has=D.prototype.has.bind(this),this.set=D.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(L(s)?(i=q(s.key,"",n),o=q(s.value,i,n)):i=q(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){let s=Vr(e,n,r),i=new this;return i.items=s.items,i}};yt.tag="tag:yaml.org,2002:omap";var Mt={collection:"seq",identify:t=>t instanceof Map,nodeClass:yt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Kr(t,e),r=[];for(let{key:s}of n.items)I(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new yt,n)},createNode:(t,e,n)=>yt.from(t,e,n)};function Ni({value:t,source:e},n){return e&&(t?zr:Jr).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var zr={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new v(!0),stringify:Ni},Jr={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new v(!1),stringify:Ni};var xi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:z},Ii={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():z(t)}},Ti={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new v(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:z};var Ft=t=>typeof t=="bigint"||Number.isInteger(t);function Un(t,e,n,{intAsBigInt:r}){let s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return s==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return s==="-"?-1*i:i}function Yr(t,e,n){let{value:r}=t;if(Ft(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return z(t)}var Li={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Un(t,2,2,n),stringify:t=>Yr(t,2,"0b")},Bi={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Un(t,1,8,n),stringify:t=>Yr(t,8,"0")},Oi={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Un(t,0,10,n),stringify:z},Ri={identify:Ft,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Un(t,2,16,n),stringify:t=>Yr(t,16,"0x")};var bt=class t extends D{constructor(e){super(e),this.tag=t.tag}add(e){let n;L(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new M(e.key,null):n=new M(e,null),Ue(this.items,n.key)||this.items.push(n)}get(e,n){let r=Ue(this.items,e);return!n&&L(r)?I(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Ue(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new M(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(mt(o,null,r));return i}};bt.tag="tag:yaml.org,2002:set";var Dt={collection:"map",identify:t=>t instanceof Set,nodeClass:bt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>bt.from(t,e,n),resolve(t,e){if(fe(t)){if(t.hasAllNullValues(!0))return Object.assign(new bt,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Qr(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function Pi(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return z(t);let r="";e<0&&(r="-",e*=n(-1));let s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var qn={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Qr(t,n),stringify:Pi},Hn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Qr(t,!1),stringify:Pi},wt={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(wt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,s,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,r-1,s,i||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=Qr(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var Xr=[he,pe,qe,Ze,zr,Jr,Li,Bi,Oi,Ri,xi,Ii,Ti,Pt,de,Mt,$t,Dt,qn,Hn,wt];var $i=new Map([["core",vi],["failsafe",[he,pe,qe]],["json",Ai],["yaml11",Xr],["yaml-1.1",Xr]]),Mi={binary:Pt,bool:Rt,float:$n,floatExp:Pn,floatNaN:Rn,floatTime:Hn,int:Dn,intHex:Gn,intOct:Fn,intTime:qn,map:he,merge:de,null:Ze,omap:Mt,pairs:$t,seq:pe,set:Dt,timestamp:wt},Fi={"tag:yaml.org,2002:binary":Pt,"tag:yaml.org,2002:merge":de,"tag:yaml.org,2002:omap":Mt,"tag:yaml.org,2002:pairs":$t,"tag:yaml.org,2002:set":Dt,"tag:yaml.org,2002:timestamp":wt};function Wn(t,e,n){let r=$i.get(e);if(r&&!t)return n&&!r.includes(de)?r.concat(de):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{let i=Array.from($i.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(de)),s.reduce((i,o)=>{let a=typeof o=="string"?Mi[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Mi).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}var Hl=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Gt=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Wn(e,"compat"):e?Wn(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Fi:{},this.tags=Wn(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,ce,{value:he}),Object.defineProperty(this,ee,{value:qe}),Object.defineProperty(this,Ne,{value:pe}),this.sortMapEntries=typeof o=="function"?o:o===!0?Hl:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Di(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let s=xn(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(ie(l,""))}let o=!1,a=null;if(t.contents){if(T(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=i(t.contents.commentBefore);n.push(ie(u,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Te(t.contents,s,()=>a=null,l);a&&(c+=Se(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Te(t.contents,s));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
55
+ `)?(n.push("..."),n.push(ie(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ie(i(l),"")))}return n.join(`
56
+ `)+`
57
+ `}var He=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y,{value:bn});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new ke({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(t.prototype,{[Y]:{value:bn}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=T(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){kt(this.contents)&&this.contents.add(e)}addIn(e,n){kt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=Mr(this);e.anchor=!n||r.has(n)?Fr(n||"a",r):n}return new xe(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){let m=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(m).map(String);y.length>0&&(n=n.concat(y)),s=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=yi(this,o||"a"),p={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:h},g=Ie(e,u,p);return a&&B(g)&&(g.flow=!0),d(),g}createPair(e,n,r={}){let s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new M(s,i)}delete(e){return kt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return pt(e)?this.contents==null?!1:(this.contents=null,!0):kt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return B(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return pt(e)?!n&&I(this.contents)?this.contents.value:this.contents:B(this.contents)?this.contents.getIn(e,n):void 0}has(e){return B(this.contents)?this.contents.has(e):!1}hasIn(e){return pt(e)?this.contents!==void 0:B(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Tt(this.schema,[e],n):kt(this.contents)&&this.contents.set(e,n)}setIn(e,n){pt(e)?this.contents=n:this.contents==null?this.contents=Tt(this.schema,Array.from(e),n):kt(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ke({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ke({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Gt(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=q(this.contents,n??"",a);if(typeof i=="function")for(let{count:c,res:u}of a.anchors.values())i(u,c);return typeof o=="function"?Ge(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Di(this,e)}};function kt(t){if(B(t))return!0;throw new Error("Expected a YAML collection as document contents")}var jt=class extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}},Ce=class extends jt{constructor(e,n,r){super("YAMLParseError",e,n,r)}},Ut=class extends jt{constructor(e,n,r){super("YAMLWarning",e,n,r)}},Zr=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
58
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,l=n.linePos[1];l?.line===r&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-i)));let c=" ".repeat(i)+"^".repeat(a);n.message+=`:
59
+
60
+ ${o}
61
+ ${c}
62
+ `}};function _e(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",h=!1,p=!1,g=null,m=null,y=null,b=null,w=null,S=null,C=null;for(let _ of t)switch(p&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&i(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),g&&(c&&_.type!=="comment"&&_.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),_.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&_.source.includes(" ")&&(g=_),u=!0;break;case"comment":{u||i(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=_.source.substring(1)||" ";f?f+=d+$:f=$,d="",c=!1;break}case"newline":c?f?f+=_.source:(!S||n!=="seq-item-ind")&&(l=!0):d+=_.source,c=!0,h=!0,(m||y)&&(b=_),u=!0;break;case"anchor":m&&i(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&i(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=_,C??(C=_.offset),c=!1,u=!1,p=!0;break;case"tag":{y&&i(_,"MULTIPLE_TAGS","A node can have at most one tag"),y=_,C??(C=_.offset),c=!1,u=!1,p=!0;break}case n:(m||y)&&i(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),S&&i(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${e??"collection"}`),S=_,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){w&&i(_,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),w=_,c=!1,u=!1;break}default:i(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),c=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:s;return p&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:S,spaceBefore:l,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:b,end:x,start:C??x}}function We(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
63
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(We(e.key)||We(e.value))return!0}return!1;default:return!0}}function qt(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&We(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Kn(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||I(i)&&I(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}var Gi="All mapping items must start at the same column";function ji({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??D,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(let u of r.items){let{start:f,key:d,sep:h,value:p}=u,g=_e(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0}),m=!g.found;if(m){if(d&&(d.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&s(l,"BAD_INDENT",Gi)),!g.anchor&&!g.tag&&!h){c=g.end,g.comment&&(a.comment?a.comment+=`
64
+ `+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||We(d))&&s(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(l,"BAD_INDENT",Gi);n.atKey=!0;let y=g.end,b=d?t(n,d,g,s):e(n,y,f,null,g,s);n.schema.compat&&qt(r.indent,d,s),n.atKey=!1,Kn(n,a.items,b)&&s(y,"DUPLICATE_KEY","Map keys must be unique");let w=_e(h??[],{indicator:"map-value-ind",next:p,offset:b.range[2],onError:s,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=w.end,w.found){m&&(p?.type==="block-map"&&!w.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<w.found.offset-1024&&s(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=p?t(n,p,w,s):e(n,l,h,null,w,s);n.schema.compat&&qt(r.indent,p,s),l=S.range[2];let C=new M(b,S);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{m&&s(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(b.comment?b.comment+=`
65
+ `+w.comment:b.comment=w.comment);let S=new M(b);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}function Ui({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??V,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=r.offset,c=null;for(let{start:u,value:f}of r.items){let d=_e(u,{indicator:"seq-item-ind",next:f,offset:l,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?s(d.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(n,f,d,s):e(n,d.end,u,null,d,s);n.schema.compat&&qt(r.indent,f,s),l=h.range[2],a.items.push(h)}return a.range=[r.offset,l,c??l],a}function ve(t,e,n,r){let s="";if(t){let i=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=l),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:s,offset:e}}var es="Block collections are not allowed within flow collections",ts=t=>t&&(t.type==="block-map"||t.type==="block-seq");function qi({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?D:V),c=new l(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let m=0;m<r.items.length;++m){let y=r.items[m],{start:b,key:w,sep:S,value:C}=y,E=_e(b,{flow:a,indicator:"explicit-key-ind",next:w??S?.[0],offset:f,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){m===0&&E.comma?s(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<r.items.length-1&&s(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(c.comment?c.comment+=`
66
+ `+E.comment:c.comment=E.comment),f=E.end;continue}!o&&n.options.strict&&We(w)&&s(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&s(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||s(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let _ of b)switch(_.type){case"comma":case"space":break;case"comment":x=_.source.substring(1);break e;default:break e}if(x){let _=c.items[c.items.length-1];L(_)&&(_=_.value??_.key),_.comment?_.comment+=`
67
+ `+x:_.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!o&&!S&&!E.found){let x=C?t(n,C,E,s):e(n,E.end,S,null,E,s);c.items.push(x),f=x.range[2],ts(C)&&s(x.range,"BLOCK_IN_FLOW",es)}else{n.atKey=!0;let x=E.end,_=w?t(n,w,E,s):e(n,x,b,null,E,s);ts(w)&&s(_.range,"BLOCK_IN_FLOW",es),n.atKey=!1;let $=_e(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:_.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!o&&!E.found&&n.options.strict){if(S)for(let O of S){if(O===$.found)break;if(O.type==="newline"){s(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<$.found.offset-1024&&s($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?s(C,"MISSING_CHAR",`Missing space after : in ${a}`):s($.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let re=C?t(n,C,$,s):$.found?e(n,$.end,S,null,$,s):null;re?ts(C)&&s(re.range,"BLOCK_IN_FLOW",es):$.comment&&(_.comment?_.comment+=`
68
+ `+$.comment:_.comment=$.comment);let ye=new M(_,re);if(n.options.keepSourceTokens&&(ye.srcToken=y),o){let O=c;Kn(n,O.items,_)&&s(x,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(ye)}else{let O=new D(n.schema);O.flow=!0,O.items.push(ye);let It=(re??_).range;O.range=[_.range[0],It[1],It[2]],c.items.push(O)}f=re?re.range[2]:$.end}}let d=o?"}":"]",[h,...p]=r.end,g=f;if(h?.source===d)g=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;s(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&p.unshift(h)}if(p.length>0){let m=ve(p,g,n.options.strict,s);m.comment&&(c.comment?c.comment+=`
69
+ `+m.comment:c.comment=m.comment),c.range=[r.offset,g,m.offset]}else c.range=[r.offset,g,g];return c}function ns(t,e,n,r,s,i){let o=n.type==="block-map"?ji(t,e,n,r,i):n.type==="block-seq"?Ui(t,e,n,r,i):qi(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Hi(t,e,n,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,d=>s(i,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=r,p=d&&i?d.offset>i.offset?d:i:d??i;p&&(!h||h.offset<p.offset)&&s(p,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===D.tagName&&a==="map"||o===V.tagName&&a==="seq")return ns(t,e,n,s,o);let l=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!l){let d=e.schema.knownTags[o];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?s(i,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ns(t,e,n,s,o)}let c=ns(t,e,n,s,o,l),u=l.resolve?.(c,d=>s(i,"TAG_RESOLVE_FAILED",d),e.options)??c,f=T(u)?u:new v(u);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}function rs(t,e,n){let r=e.offset,s=Wl(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?v.BLOCK_FOLDED:v.BLOCK_LITERAL,o=e.source?Kl(e.source):[],a=o.length;for(let g=o.length-1;g>=0;--g){let m=o[g][1];if(m===""||m==="\r")a=g;else break}if(a===0){let g=s.chomp==="+"&&o.length>0?`
70
+ `.repeat(Math.max(1,o.length-1)):"",m=r+s.length;return e.source&&(m+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,m,m]}}let l=e.indent+s.indent,c=e.offset+s.length,u=0;for(let g=0;g<a;++g){let[m,y]=o[g];if(y===""||y==="\r")s.indent===0&&m.length>l&&(l=m.length);else{m.length<l&&n(c+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=m.length),u=g,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=m.length+y.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>l&&(a=g+1);let f="",d="",h=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(l)+`
71
+ `;for(let g=u;g<a;++g){let[m,y]=o[g];c+=m.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&m.length<l){let S=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(b?2:1),"BAD_INDENT",S),m=""}i===v.BLOCK_LITERAL?(f+=d+m.slice(l)+y,d=`
72
+ `):m.length>l||y[0]===" "?(d===" "?d=`
73
+ `:!h&&d===`
74
+ `&&(d=`
75
+
76
+ `),f+=d+m.slice(l)+y,d=`
77
+ `,h=!0):y===""?d===`
78
+ `?f+=`
79
+ `:d=`
80
+ `:(f+=d+y,d=" ",h=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)f+=`
81
+ `+o[g][0].slice(l);f[f.length-1]!==`
82
+ `&&(f+=`
83
+ `);break;default:f+=`
84
+ `}let p=r+s.length+e.source.length;return{value:f,type:i,comment:s.comment,range:[r,p,p]}}function Wl({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",l=-1;for(let d=1;d<s.length;++d){let h=s[d];if(!a&&(h==="-"||h==="+"))a=h;else{let p=Number(h);!o&&p?o=p:l===-1&&(l=t+d)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,u="",f=s.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":n&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let p=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",p);let g=h.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:f}}function Kl(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}function ss(t,e,n){let{offset:r,type:s,source:i,end:o}=t,a,l,c=(d,h,p)=>n(r+d,h,p);switch(s){case"scalar":a=v.PLAIN,l=Vl(i,c);break;case"single-quoted-scalar":a=v.QUOTE_SINGLE,l=zl(i,c);break;case"double-quoted-scalar":a=v.QUOTE_DOUBLE,l=Jl(i,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,f=ve(o,u,e,n);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function Vl(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Wi(t)}function zl(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Wi(t.slice(1,-1)).replace(/''/g,"'")}function Wi(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let r,s;try{r=new RegExp("(?<![ ])[ ]+$"),s=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{r=/[ \t]+$/,s=/^[ \t]+|[ \t]+$/g}let i=n[1].replace(r,""),o=" ",a=e.lastIndex;for(;n=e.exec(t);){let c=n[1].replace(s,"");c===""?o===`
85
+ `?i+=o:o=`
86
+ `:(i+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+o+(n?.[1]??"")}function Jl(t,e){let n="";for(let r=1;r<t.length-1;++r){let s=t[r];if(!(s==="\r"&&t[r+1]===`
87
+ `))if(s===`
88
+ `){let{fold:i,offset:o}=Yl(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r],o=Ql[i];if(o)n+=o;else if(i===`
89
+ `)for(i=t[r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="\r"&&t[r+1]===`
90
+ `)for(i=t[++r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;n+=Xl(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){let i=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
91
+ `&&!(o==="\r"&&t[r+2]===`
92
+ `)&&(n+=r>i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Yl(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
93
+ `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
94
+ `);)r===`
95
+ `&&(n+=`
96
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Ql={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
97
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Xl(t,e,n,r){let s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function is(t,e,n,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?rs(t,e,r):ss(e,t.options.strict,r),l=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[ee]:l?c=Zl(t.schema,s,l,n,r):e.type==="scalar"?c=ec(t,s,e,r):c=t.schema[ee];let u;try{let f=c.resolve(s,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=I(f)?f:new v(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),u=new v(s)}return u.range=a,u.source=s,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function Zl(t,e,n,r,s){if(n==="!")return t[ee];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[ee])}function ec({atKey:t,directives:e,schema:n},r,s,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[ee];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(r))??n[ee];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}function Ki(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}var tc={composeNode:os,composeEmptyNode:Vn};function os(t,e,n,r){let s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n,c,u=!0;switch(e.type){case"alias":c=nc(t,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=is(t,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Hi(tc,t,e,n,r),a&&(c.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Vn(t,e.offset,void 0,null,n,r)),a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!I(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Vn(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:Ki(e,n,r),indent:-1,source:""},f=is(t,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function nc({options:t},{offset:e,source:n,end:r},s){let i=new xe(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=ve(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function Vi(t,e,{offset:n,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},t),l=new He(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=_e(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?os(c,s,u,o):Vn(c,u.end,r,null,u,o);let f=l.contents.range[2],d=ve(i,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}function Ht(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function zi(t){let e="",n=!1,r=!1;for(let s=0;s<t.length;++s){let i=t[s];switch(i[0]){case"#":e+=(e===""?"":r?`
98
+
99
+ `:`
100
+ `)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":t[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Wt=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{let o=Ht(n);i?this.warnings.push(new Ut(o,r,s)):this.errors.push(new Ce(o,r,s))},this.directives=new ke({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:s}=zi(this.prelude);if(r){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
101
+ ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(B(i)&&!i.flow&&i.items.length>0){let o=i.items[0];L(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
102
+ ${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
103
+ ${o}`:r}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(n,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,r,s)=>{let i=Ht(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Vi(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Ce(Ht(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Ce(Ht(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=ve(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
104
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ce(Ht(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new He(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}};var as=Symbol("break visit"),rc=Symbol("skip children"),Ji=Symbol("remove item");function et(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Yi(Object.freeze([]),t,e)}et.BREAK=as;et.SKIP=rc;et.REMOVE=Ji;et.itemAtPath=(t,e)=>{let n=t;for(let[r,s]of e){let i=n?.[r];if(i&&"items"in i)n=i.items[s];else return}return n};et.parentCollection=(t,e)=>{let n=et.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function Yi(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=Yi(Object.freeze(t.concat([[s,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===as)return as;a===Ji&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}var ls="\uFEFF",cs="",us="",zn="";function Qi(t){switch(t){case ls:return"byte-order-mark";case cs:return"doc-mode";case us:return"flow-error-end";case zn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
105
+ `:case`\r
106
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ge(t){switch(t){case void 0:case" ":case`
107
+ `:case"\r":case" ":return!0;default:return!1}}var Xi=new Set("0123456789ABCDEFabcdef"),ic=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jn=new Set(",[]{}"),oc=new Set(` ,[]{}
108
+ \r `),fs=t=>!t||oc.has(t),Kt=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
109
+ `?!0:n==="\r"?this.buffer[e+1]===`
110
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let s=this.buffer[r+e+1];if(s===`
111
+ `||!s&&!this.atEnd)return e+r+1}return n===`
112
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ge(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
113
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ls&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield cs,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ge(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ge(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ge(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(fs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&ge(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield us,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(fs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ge(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),s=r.indexOf(`
114
+ `,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
115
+ `,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ge(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
116
+ `:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
117
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
118
+ `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
119
+ `;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
120
+ `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield zn,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(ge(i)||e&&Jn.has(i))break;n=r}else if(ge(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
121
+ `?(r+=1,s=`
122
+ `,i=this.buffer[r+1]):n=r),i==="#"||e&&Jn.has(i))break;if(s===`
123
+ `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Jn.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield zn,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(fs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(ge(r)||n&&Jn.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ge(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(ic.has(n))n=this.buffer[++e];else if(n==="%"&&Xi.has(this.buffer[e+1])&&Xi.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
124
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
125
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var Vt=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let i=n+r>>1;this.lineStarts[i]<e?n=i+1:r=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let s=this.lineStarts[n-1];return{line:n,col:e-s+1}}}};function Ke(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Zi(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function to(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Yn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function St(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Qn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function eo(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Ke(e.start,"explicit-key-ind")&&!Ke(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,to(e.value)?e.value.end?Qn(e.value.end,e.sep):e.value.end=e.sep:Qn(e.start,e.sep),delete e.sep)}var zt=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Kt,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Qi(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&eo(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Zi(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Zi(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Yn(this.peek(2)),r=St(n),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
126
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
127
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Qn(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let l=n.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ke(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(to(n.key)&&!Ke(n.sep,"newline")){let o=St(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(Ke(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=St(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Ke(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ke(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Qn(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Ke(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=Yn(r),i=St(s);eo(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
128
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
129
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Yn(e),r=St(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Yn(e),r=St(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function ac(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Vt||null,prettyErrors:e}}function ds(t,e={}){let{lineCounter:n,prettyErrors:r}=ac(e),s=new zt(n?.addNewLine),i=new Wt(e),o=Array.from(i.compose(s.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Zr(t,n)),a.warnings.forEach(Zr(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}var cc=(t,e)=>{let n=new Map;if(t.length>1e5)return n;let r=t.split(`
130
+ `),s=(i,o)=>{for(;o>i&&!r[o]?.trim();)o--;o>i&&n.set(i,Math.max(o,n.get(i)??0))};if(e==="json"||e==="yaml"||e==="yml"){let i=[0];for(let l=0;l<t.length;l++)t[l]===`
131
+ `&&i.push(l+1);let o=l=>{let c=0,u=i.length;for(;c+1<u;){let f=c+u>>>1;(i[f]??0)<=l?c=f:u=f}return c},a=(l,c)=>{let u=o(c-1),f=r[u]?.slice(c-(i[u]??0))??"";s(o(l),/^[\s,}\]]*(?:#.*)?$/.test(f)?u:u-1)};for(let l of ds(t))l.errors.length||se(l,(c,u)=>{if(L(u)&&T(u.key)&&T(u.value)?u.key.range&&u.value.range&&a(u.key.range[0],u.value.range[1]):B(u)&&u.flow&&u.range&&a(u.range[0],u.range[1]),te(u)&&!u.flow)for(let f of u.items)T(f)&&f.range&&a(f.range[0],f.range[1])})}else if(e==="toml"){let i=[],o=[],a="",l=0;r.forEach((c,u)=>{let f=!!a,d="";for(let h=0;h<c.length;h++){let p=c[h]??"";if(a)a[0]==='"'&&p==="\\"?h++:c.slice(h,h+a.length)===a&&(a.length===3&&s(l,u),h+=a.length-1,a="");else{if(p==="#")break;p==='"'||p==="'"?(a=c.slice(h,h+3)===p.repeat(3)?p.repeat(3):p,l=u,h+=a.length-1,d+="x"):d+=p}}if(!f&&!o.length&&/^\s*\[\[?.+\]\]?\s*$/.test(d)){i.push(u);return}for(let h of d)if(h==="["||h==="{")o.push({char:h,line:u});else if(h==="]"||h==="}"){let p=o.pop();p&&(p.char==="["?h==="]":h==="}")&&s(p.line,u)}}),i.forEach((c,u)=>{s(c,(i[u+1]??r.length)-1)})}return n},no=new WeakMap,ro=(t,e,n,r)=>{let s=cc(e,n);if(!r.length&&!s.size)return;let i=no.get(t);(!i||i.source!==e||i.language!==n)&&(i={source:e,language:n,folded:new Set},no.set(t,i));let o=i.folded,a=e.split(`
132
+ `),l=[],c=[],u=()=>{let f=-1;c.forEach((d,h)=>{d.hidden=h<=f,d.classList.toggle("code-line-folded",o.has(h));let p=d.querySelector("button");if(p){let g=o.has(h)?"Expand section":"Collapse section",m=window.__docsTranslate;p.setAttribute("aria-expanded",String(!o.has(h))),p.setAttribute("aria-label",m?.(g)??g),p.title=p.getAttribute("aria-label")??g,p.dataset.i18nTitle=g,p.dataset.i18nAriaLabel=g}o.has(h)&&(f=Math.max(f,s.get(h)??h))})};a.forEach((f,d)=>{let h=document.createElement("span");h.className="code-line";let p=document.createElement("span");p.className="code-line-text";let g=r[d];for(let m of g?.map(y=>y.content).join("")===f?g:[{content:f}]){let y=document.createElement("span");m.color&&(y.style.color=m.color),y.textContent=m.content,p.append(y)}if(s.has(d)){let m=document.createElement("button");m.type="button",m.className="code-section-fold",m.innerHTML='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4 6 4 4 4-4"/></svg>',m.addEventListener("click",()=>{o.delete(d)||o.add(d),u()}),h.append(m)}h.append(p),d<a.length-1&&h.append(document.createTextNode(`
133
+ `)),c.push(h),l.push(h)}),t.classList.toggle("code-foldable",s.size>0),t.replaceChildren(...l),u()};var P=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function uc(t){return Cs(t)}function Cs(t){return Array.isArray(t)?fc(t):t instanceof RegExp?t:typeof t=="object"?dc(t):t}function fc(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Cs(t[n]);return e}function dc(t){let e={};for(let n in t)e[n]=Cs(t[n]);return e}function ho(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function po(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?po(t.substring(0,t.length-1)):t.substr(~e+1)}var hs=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Xn=class{static hasCaptures(t){return t===null?!1:(hs.lastIndex=0,hs.test(t))}static replaceCaptures(t,e,n){return t.replace(hs,(r,s,i,o)=>{let a=n[parseInt(s||i,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function go(t,e){return t<e?-1:t>e?1:0}function mo(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let i=go(t[s],e[s]);if(i!==0)return i}return 0}return n-r}function so(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function yo(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var bo=class{constructor(t){this.fn=t}fn;cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},Qt=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}_colorMap;_defaults;_root;static createFromRawTheme(t,e){return this.createFromParsedTheme(gc(t),e)}static createFromParsedTheme(t,e){return yc(t,e)}_cachedMatchRoot=new bo(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>hc(t.parent,s.parentScopes));return r?new wo(r.fontStyle,r.foreground,r.background):null}},ps=class Zn{constructor(e,n){this.parent=e,this.scopeName=n}parent;scopeName;static push(e,n){for(let r of n)e=new Zn(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Zn(n,e[r]);return n}push(e){return new Zn(this,e)}getSegments(){let e=this,n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function hc(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!pc(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function pc(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var wo=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function gc(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,i=e.length;s<i;s++){let o=e[s];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let f=o.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),a=f.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let f=o.settings.fontStyle.split(" ");for(let d=0,h=f.length;d<h;d++)switch(f[d]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof o.settings.foreground=="string"&&so(o.settings.foreground)&&(c=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&so(o.settings.background)&&(u=o.settings.background);for(let f=0,d=a.length;f<d;f++){let p=a[f].trim().split(" "),g=p[p.length-1],m=null;p.length>1&&(m=p.slice(0,p.length-1),m.reverse()),n[r++]=new mc(g,m,s,l,c,u)}}return n}var mc=class{constructor(t,e,n,r,s,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=i}scope;parentScopes;index;fontStyle;foreground;background},K=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(K||{});function yc(t,e){t.sort((l,c)=>{let u=go(l.scope,c.scope);return u!==0||(u=mo(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(s=l.background)}let i=new bc(e),o=new wo(n,i.getId(r),i.getId(s)),a=new kc(new ms(0,null,-1,0,0),[]);for(let l=0,c=t.length;l<c;l++){let u=t[l];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Qt(i,o,a)}var bc=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},wc=Object.freeze([]),ms=class ko{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,i){this.scopeDepth=e,this.parentScopes=n||wc,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new ko(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},kc=class ys{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){let i=n.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1?(s=e,i=""):(s=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(i)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ys._cmpBySpecificity),n}insert(e,n,r,s,i,o){if(n===""){this._doInsertHere(e,r,s,i,o);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new ys(this._mainRule.clone(),ms.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(e+1,c,r,s,i,o)}_doInsertHere(e,n,r,s,i){if(n===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let l=this._rulesWithParentScopes[o];if(mo(l.parentScopes,n)===0){l.acceptOverwrite(e,r,s,i);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ms(e,n,r,s,i))}},Ve=class oe{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let n=oe.getLanguageId(e),r=oe.getTokenType(e),s=oe.getFontStyle(e),i=oe.getForeground(e),o=oe.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,i,o,a){let l=oe.getLanguageId(e),c=oe.getTokenType(e),u=oe.containsBalancedBrackets(e)?1:0,f=oe.getFontStyle(e),d=oe.getForeground(e),h=oe.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(u=s?1:0),i!==-1&&(f=i),o!==0&&(d=o),a!==0&&(h=a),(l<<0|c<<8|u<<10|f<<11|d<<15|h<<24)>>>0}};function tr(t,e){let n=[],r=Sc(t),s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=o();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function i(){if(s==="-"){s=r.next();let l=i();return c=>!!l&&!l(c)}if(s==="("){s=r.next();let l=a();return s===")"&&(s=r.next()),l}if(io(s)){let l=[];do l.push(s),s=r.next();while(io(s));return c=>e(l,c)}return null}function o(){let l=[],c=i();for(;c;)l.push(c),c=i();return u=>l.every(f=>f(u))}function a(){let l=[],c=o();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=o()}return u=>l.some(f=>f(u))}}function io(t){return!!t&&!!t.match(/[\w\.:]+/)}function Sc(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function So(t){typeof t.dispose=="function"&&t.dispose()}var Xt=class{constructor(t){this.scopeName=t}scopeName;toKey(){return this.scopeName}},Cc=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},_c=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){let e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},vc=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Xt(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let t=this.Q;this.Q=[];let e=new _c;for(let n of t)Ec(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof Xt){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ec(t,e,n,r){let s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}let i=n.lookup(e);t instanceof Xt?er({baseGrammar:i,selfGrammar:s},r):bs(t.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);let o=n.injections(t.scopeName);if(o)for(let a of o)r.add(new Xt(a))}function bs(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];nr([r],e,n)}}function er(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&nr(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&nr(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function nr(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let s=r.repository?ho({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&nr(r.patterns,{...e,repository:s},n);let i=r.include;if(!i)continue;let o=Co(i);switch(o.kind){case 0:er({...e,selfGrammar:e.baseGrammar},n);break;case 1:er(e,n);break;case 2:bs(o.ruleName,{...e,repository:s},n);break;case 3:case 4:let a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){let l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:s};o.kind===4?bs(o.ruleName,l,n):er(l,n)}else o.kind===4?n.add(new Cc(o.scopeName,o.ruleName)):n.add(new Xt(o.scopeName));break}}}var Ac=class{kind=0},Nc=class{kind=1},xc=class{constructor(t){this.ruleName=t}ruleName;kind=2},Ic=class{constructor(t){this.scopeName=t}scopeName;kind=3},Tc=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;kind=4};function Co(t){if(t==="$base")return new Ac;if(t==="$self")return new Nc;let e=t.indexOf("#");if(e===-1)return new Ic(t);if(e===0)return new xc(t.substring(1));{let n=t.substring(0,e),r=t.substring(e+1);return new Tc(n,r)}}var Lc=/\\(\d+)/,oo=/\\(\d+)/g,Bc=-1,_o=-2;var tn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=Xn.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Xn.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${po(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Xn.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Xn.replaceCaptures(this._contentName,t,e)}},Oc=class extends tn{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Rc=class extends tn{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new Zt(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new en,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ao=class extends tn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(let n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new en,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ws=class extends tn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,i,o,a,l,c){super(t,e,n,r),this._begin=new Zt(s,this.id),this.beginCaptures=i,this._end=new Zt(o||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new en;for(let n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},rr=class extends tn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,i,o,a,l){super(t,e,n,r),this._begin=new Zt(s,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new Zt(o,_o),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new en;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new en,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"\uFFFF"),this._cachedCompiledWhilePatterns}},vo=class J{static createCaptureRule(e,n,r,s,i){return e.registerRule(o=>new Oc(n,o,r,s,i))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new Rc(e.$vscodeTextmateLocation,e.id,e.name,e.match,J._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=ho({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new ao(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,J._compilePatterns(i,n,r))}return e.while?new rr(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,J._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,J._compileCaptures(e.whileCaptures||e.captures,n,r),J._compilePatterns(e.patterns,n,r)):new ws(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,J._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,J._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,J._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let i=0;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)s[o]=null;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10),l=0;e[o].patterns&&(l=J.getCompiledRuleId(e[o],n,r)),s[a]=J.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let i=0,o=e.length;i<o;i++){let a=e[i],l=-1;if(a.include){let c=Co(a.include);switch(c.kind){case 0:case 1:l=J.getCompiledRuleId(r[a.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=J.getCompiledRuleId(u,n,r));break;case 3:case 4:let f=c.scopeName,d=c.kind===4?c.ruleName:null,h=n.getExternalGrammar(f,r);if(h)if(d){let p=h.repository[d];p&&(l=J.getCompiledRuleId(p,n,h.repository))}else l=J.getCompiledRuleId(h.repository.$self,n,h.repository);break}}else l=J.getCompiledRuleId(a,n,r);if(l!==-1){let c=n.getRule(l),u=!1;if((c instanceof ao||c instanceof ws||c instanceof rr)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},Zt=class Eo{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){let r=e.length,s=0,i=[],o=!1;for(let a=0;a<r;a++)if(e.charAt(a)==="\\"&&a+1<r){let c=e.charAt(a+1);c==="z"?(i.push(e.substring(s,a)),i.push("$(?!\\n)(?<!\\n)"),s=a+2):(c==="A"||c==="G")&&(o=!0),a++}this.hasAnchor=o,s===0?this.source=e:(i.push(e.substring(s,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Lc.test(this.source):this.hasBackReferences=!1}clone(){return new Eo(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return oo.lastIndex=0,this.source.replace(oo,(s,i)=>yo(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],i,o,a,l;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,r[i]=a,s[i]=a,a==="\\"&&i+1<o&&(l=this.source.charAt(i+1),l==="A"?(e[i+1]="\uFFFF",n[i+1]="\uFFFF",r[i+1]="A",s[i+1]="A"):l==="G"?(e[i+1]="\uFFFF",n[i+1]="G",r[i+1]="\uFFFF",s[i+1]="G"):(e[i+1]=l,n[i+1]=l,r[i+1]=l,s[i+1]=l),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},en=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new lo(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new lo(t,r,this._items.map(s=>s.ruleId))}},lo=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
134
+ `)}findNextMatchSync(t,e,n){let r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},gs=class{constructor(t,e){this.languageId=t,this.tokenType=e}languageId;tokenType},Pc=class ks{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new gs(e,8),this._embeddedLanguagesMatcher=new $c(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ks._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new gs(0,0);_getBasicScopeAttributes=new bo(e=>{let n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new gs(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let n=e.match(ks.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},$c=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([n,r])=>yo(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Vb={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},Ao=!1,co=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}stack;stoppedEarly};function No(t,e,n,r,s,i,o,a){let l=e.content.length,c=!1,u=-1;if(o){let h=Mc(t,e,n,r,s,i);s=h.stack,r=h.linePos,n=h.isFirstLine,u=h.anchorPosition}let f=Date.now();for(;!c;){if(a!==0&&Date.now()-f>a)return new co(s,!0);d()}return new co(s,!1);function d(){let h=Fc(t,e,n,r,s,u);if(!h){i.produce(s,l),c=!0;return}let p=h.captureIndices,g=h.matchedRuleId,m=p&&p.length>0?p[0].end>r:!1;if(g===Bc){let y=s.getRule(t);i.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),Jt(t,e,n,s,i,y.endCaptures,p),i.produce(s,p[0].end);let b=s;if(s=s.parent,u=b.getAnchorPos(),!m&&b.getEnterPos()===r){s=b,i.produce(s,l),c=!0;return}}else{let y=t.getRule(g);i.produce(s,p[0].start);let b=s,w=y.getName(e.content,p),S=s.contentNameScopesList.pushAttributed(w,t);if(s=s.push(g,r,u,p[0].end===l,null,S,S),y instanceof ws){let C=y;Jt(t,e,n,s,i,C.beginCaptures,p),i.produce(s,p[0].end),u=p[0].end;let E=C.getContentName(e.content,p),x=S.pushAttributed(E,t);if(s=s.withContentNameScopesList(x),C.endHasBackReferences&&(s=s.withEndRule(C.getEndWithResolvedBackReferences(e.content,p))),!m&&b.hasSameRuleAs(s)){s=s.pop(),i.produce(s,l),c=!0;return}}else if(y instanceof rr){let C=y;Jt(t,e,n,s,i,C.beginCaptures,p),i.produce(s,p[0].end),u=p[0].end;let E=C.getContentName(e.content,p),x=S.pushAttributed(E,t);if(s=s.withContentNameScopesList(x),C.whileHasBackReferences&&(s=s.withEndRule(C.getWhileWithResolvedBackReferences(e.content,p))),!m&&b.hasSameRuleAs(s)){s=s.pop(),i.produce(s,l),c=!0;return}}else if(Jt(t,e,n,s,i,y.captures,p),i.produce(s,p[0].end),s=s.pop(),!m){s=s.safePop(),i.produce(s,l),c=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function Mc(t,e,n,r,s,i){let o=s.beginRuleCapturedEOL?0:-1,a=[];for(let l=s;l;l=l.pop()){let c=l.getRule(t);c instanceof rr&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){let{ruleScanner:c,findOptions:u}=jc(l.rule,t,l.stack.endRule,n,r===o),f=c.findNextMatchSync(e,r,u);if(f){if(f.ruleId!==_o){s=l.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(i.produce(l.stack,f.captureIndices[0].start),Jt(t,e,n,l.stack,i,l.rule.whileCaptures,f.captureIndices),i.produce(l.stack,f.captureIndices[0].end),o=f.captureIndices[0].end,f.captureIndices[0].end>r&&(r=f.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function Fc(t,e,n,r,s,i){let o=Dc(t,e,n,r,s,i),a=t.getInjections();if(a.length===0)return o;let l=Gc(a,t,e,n,r,s,i);if(!l)return o;if(!o)return l;let c=o.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:o}function Dc(t,e,n,r,s,i){let o=s.getRule(t),{ruleScanner:a,findOptions:l}=xo(o,t,s.endRule,n,r===i),c=a.findNextMatchSync(e,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Gc(t,e,n,r,s,i,o){let a=Number.MAX_VALUE,l=null,c,u=0,f=i.contentNameScopesList.getScopeNames();for(let d=0,h=t.length;d<h;d++){let p=t[d];if(!p.matcher(f))continue;let g=e.getRule(p.ruleId),{ruleScanner:m,findOptions:y}=xo(g,e,null,r,s===o),b=m.findNextMatchSync(n,s,y);if(!b)continue;let w=b.captureIndices[0].start;if(!(w>=a)&&(a=w,l=b.captureIndices,c=b.ruleId,u=p.priority,a===s))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function xo(t,e,n,r,s){if(Ao){let o=t.compile(e,n),a=Io(r,s);return{ruleScanner:o,findOptions:a}}return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function jc(t,e,n,r,s){if(Ao){let o=t.compileWhile(e,n),a=Io(r,s);return{ruleScanner:o,findOptions:a}}return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function Io(t,e){let n=0;return t||(n|=1),e||(n|=4),n}function Jt(t,e,n,r,s,i,o){if(i.length===0)return;let a=e.content,l=Math.min(i.length,o.length),c=[],u=o[0].end;for(let f=0;f<l;f++){let d=i[f];if(d===null)continue;let h=o[f];if(h.length===0)continue;if(h.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,h.start):s.produce(r,h.start),d.retokenizeCapturedWithRuleId){let g=d.getName(a,o),m=r.contentNameScopesList.pushAttributed(g,t),y=d.getContentName(a,o),b=m.pushAttributed(y,t),w=r.push(d.retokenizeCapturedWithRuleId,h.start,-1,!1,null,m,b),S=t.createOnigString(a.substring(0,h.end));No(t,S,n&&h.start===0,h.start,w,s,!1,0),So(S);continue}let p=d.getName(a,o);if(p!==null){let m=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);c.push(new Uc(m,h.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Uc=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function qc(t,e,n,r,s,i,o,a){return new Wc(t,e,n,r,s,i,o,a)}function uo(t,e,n,r,s){let i=tr(e,sr),o=vo.getCompiledRuleId(n,r,s.repository);for(let a of i)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:s,priority:a.priority})}function sr(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(Hc(e[s],r))return n=s+1,!0;return!1})}function Hc(t,e){if(!t)return!1;if(t===e)return!0;let n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Wc=class{constructor(t,e,n,r,s,i,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new Pc(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=fo(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(let l of Object.keys(s)){let c=tr(l,sr);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[l]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){let s=r.injections;if(s)for(let o in s)uo(e,o,s[o],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(o=>{let a=this.getExternalGrammar(o);if(a){let l=a.injectionSelector;l&&uo(e,l,a,this,a)}})}return e.sort((s,i)=>s.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){let e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){let n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=fo(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){let r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){let r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=vo.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===Ss.NULL){s=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),f=Ve.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null),h;d?h=Yt.createRootAndLookUpScopeName(d,f,this):h=Yt.createRoot("unknown",f),e=new Ss(null,this._rootId,-1,-1,!1,null,h,h)}else s=!1,e.reset();t=t+`
135
+ `;let i=this.createOnigString(t),o=i.content.length,a=new Vc(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=No(this,i,s,0,e,a,!0,r);return So(i),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function fo(t,e){return t=uc(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Yt=class Ee{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}parent;scopePath;tokenAttributes;static fromExtension(e,n){let r=e,s=e?.scopePath??null;for(let i of n)s=ps.push(s,i.scopeNames),r=new Ee(r,s,i.encodedTokenAttributes);return r}static createRoot(e,n){return new Ee(null,new ps(null,e),n)}static createRootAndLookUpScopeName(e,n,r){let s=r.getMetadataForScope(e),i=new ps(null,e),o=r.themeProvider.themeMatch(i),a=Ee.mergeAttributes(n,s,o);return new Ee(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Ee.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,i=0,o=0;return r!==null&&(s=r.fontStyle,i=r.foregroundId,o=r.backgroundId),Ve.set(e,n.languageId,n.tokenType,null,s,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Ee._pushAttributed(this,e,n);let r=e.split(/ /g),s=this;for(let i of r)s=Ee._pushAttributed(s,i,n);return s}static _pushAttributed(e,n,r){let s=r.getMetadataForScope(n),i=e.scopePath.push(n),o=r.themeProvider.themeMatch(i),a=Ee.mergeAttributes(e.tokenAttributes,s,o);return new Ee(e,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let n=[],r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Ss=class tt{constructor(e,n,r,s,i,o,a,l){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new tt(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:tt._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Yt.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){tt._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,i,o,a){return new tt(this,e,n,r,s,i,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new tt(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){let r=Yt.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new tt(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Yt.fromExtension(r,n.contentNameScopesList))}},Kc=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):tr(n,sr).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>tr(n,sr).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Vc=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let i=t?.getScopeNames()??[];for(let o of this._tokenTypeOverrides)o.matcher(i)&&(r=Ve.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(i))}if(s&&(r=Ve.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}let n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},zc=class{constructor(t,e){this._onigLib=e,this._theme=t}_onigLib;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,qc(t,i,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},To=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new zc(Qt.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(Qt.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,n){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,e,n){return this._loadGrammar(t,e,n.embeddedLanguages,n.tokenTypes,new Kc(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,n,r,s){let i=new vc(this._syncRegistry,t);for(;i.Q.length>0;)i.Q.map(o=>this._loadSingleGrammar(o.scopeName)),i.processQueue();return this._grammarForScopeName(t,e,n,r,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,n)}}addGrammar(t,e=[],n=0,r=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,n,r)}_grammarForScopeName(t,e=0,n=null,r=null,s=null){return this._syncRegistry.grammarForScopeName(t,e,n,r,s)}},ir=Ss.NULL;function rn(t,e){let n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(let[s,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[s]=i:s===r&&Object.assign(n,i);return n}function Le(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Po(t){return Array.isArray(t)?t:[t]}async function _s(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function sn(t){return!t||["plaintext","txt","text","plain"].includes(t)}function $o(t){return t==="ansi"||sn(t)}function on(t){return t==="none"}function Mo(t){return on(t)}var Jc=/(\r?\n)/g;function Ct(t,e=!1){if(t.length===0)return[["",0]];let n=t.split(Jc),r=0,s=[];for(let i=0;i<n.length;i+=2){let o=e?n[i]+(n[i+1]||""):n[i];s.push([o,r]),r+=n[i].length,r+=n[i+1]?.length||0}return s}var Lo={light:"#333333",dark:"#bbbbbb"},Bo={light:"#fffffe",dark:"#1e1e1e"},Oo="__shiki_resolved";function or(t){if(t?.[Oo])return t;let e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){let a=e.settings?e.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Lo.light:Lo.dark),n||(n=e.type==="light"?Bo.light:Bo.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0,i=new Map;function o(a){if(i.has(a))return i.get(a);s+=1;let l=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?o(a):(i.set(a,l),l)}e.settings=e.settings.map(a=>{let l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;let u={...a,settings:{...a.settings}};if(l){let f=o(a.settings.foreground);e.colorReplacements[f]=a.settings.foreground,u.settings.foreground=f}if(c){let f=o(a.settings.background);e.colorReplacements[f]=a.settings.background,u.settings.background=f}return u});for(let a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){let l=o(e.colors[a]);e.colorReplacements[l]=e.colors[a],e.colors[a]=l}return Object.defineProperty(e,Oo,{enumerable:!1,writable:!1,value:!0}),e}async function Fo(t){return[...new Set((await Promise.all(t.filter(e=>!$o(e)).map(async e=>await _s(e).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Do(t){return(await Promise.all(t.map(async e=>Mo(e)?null:or(await _s(e))))).filter(e=>!!e)}function Go(t,e){if(!e)return t;if(e[t]){let n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new P(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var Yc=class extends To{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(t,e,n,r={}){super(t),this._resolver=t,this._themes=e,this._langs=n,this._alias=r,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){let e=or(t);return e.name&&(this._resolvedThemes.set(e.name,e),this._loadedThemesCache=null),e}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let e=this._textmateThemeCache.get(t);e||(e=Qt.createFromRawTheme(t),this._textmateThemeCache.set(t,e)),this._syncRegistry.setTheme(e)}getGrammar(t){return t=Go(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;let e=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);let n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);let r=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases&&t.aliases.forEach(s=>{this._alias[s]=t.name}),this._loadedLanguagesCache=null,e.size)for(let s of e)this._syncRegistry?._grammars?.get(s.scopeName)?.dispose(),this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(let r of t)this.resolveEmbeddedLanguages(r);let e=[...this._langGraph.entries()],n=e.filter(([r,s])=>!s);if(n.length){let r=e.filter(([s,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(o=>n.map(([a])=>a).includes(o)):!1).filter(s=>!n.includes(s));throw new P(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(let[r,s]of e)this._resolver.addLanguage(s);for(let[r,s]of e)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);let e=t.embeddedLanguages??t.embeddedLangs;if(e)for(let n of e)this._langGraph.set(n,this._langMap.get(n))}},Qc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,e){this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).includes(t.scopeName)||this._injections.get(e).push(t.scopeName)})}getInjections(t){let e=t.split("."),n=[];for(let r=1;r<=e.length;r++){let s=e.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}},nn=0;function vs(t){nn+=1,t.warnings!==!1&&nn>=10&&nn%10===0&&console.warn(`[Shiki] ${nn} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new P("`engine` option is required for synchronous mode");let n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(or),s=new Yc(new Qc(t.engine,n),r,n,t.langAlias),i;function o(b){return Go(b,t.langAlias)}function a(b){m();let w=s.getGrammar(typeof b=="string"?b:b.name);if(!w)throw new P(`Language \`${b}\` not found, you may need to load it first`);return w}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};m();let w=s.getTheme(b);if(!w)throw new P(`Theme \`${b}\` not found, you may need to load it first`);return w}function c(b){m();let w=l(b);return i!==b&&(s.setTheme(w),i=b),{theme:w,colorMap:s.getColorMap()}}function u(){return m(),s.getLoadedThemes()}function f(){return m(),s.getLoadedLanguages()}function d(...b){m(),s.loadLanguages(b.flat(1))}async function h(...b){return d(await Fo(b))}function p(...b){m();for(let w of b.flat(1))s.loadTheme(w)}async function g(...b){return m(),p(await Do(b))}function m(){if(e)throw new P("Shiki instance has been disposed")}function y(){e||(e=!0,s.dispose(),nn-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:h,loadLanguageSync:d,loadTheme:g,loadThemeSync:p,dispose:y,[Symbol.dispose]:y}}async function Es(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[e,n,r]=await Promise.all([Do(t.themes||[]),Fo(t.langs||[]),t.engine]);return vs({...t,themes:e,langs:n,engine:r})}var jo=new WeakMap;function an(t,e){jo.set(t,e)}function _t(t){return jo.get(t)}var ar=class Uo{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Uo(Object.fromEntries(Po(n).map(r=>[r,ir])),e)}constructor(...e){if(e.length===2){let[n,r]=e;this.lang=r,this._stacks=n}else{let[n,r,s]=e;this.lang=r,this._stacks={[s]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Xc(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Xc(t){let e=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);let i=s?.nameScopesList?.scopeName;i&&e.push(i),s.parent&&r(s.parent)}return r(t),e}function Zc(t,e){if(!(t instanceof ar))throw new P("Invalid grammar state");return t.getInternalStack(e)}var eu=/,/,tu=/ /;function As(t,e,n={}){let{theme:r=t.getLoadedThemes()[0]}=n;if(sn(t.resolveLangAlias(n.lang||"text"))||on(r))return Ct(e).map(a=>[{content:a[0],offset:a[1]}]);let{theme:s,colorMap:i}=t.setTheme(r),o=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new P(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new P(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Ho(e,o,s,i,n)}function qo(...t){if(t.length===2)return _t(t[1]);let[e,n,r={}]=t,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(sn(s)||on(i))throw new P("Plain language does not have grammar state");if(s==="ansi")throw new P("ANSI language does not have grammar state");let{theme:o,colorMap:a}=e.setTheme(i),l=e.getLanguage(s);return new ar(Ns(n,l,o,a,r).stateStack,l.name,o.name)}function Ho(t,e,n,r,s){let i=Ns(t,e,n,r,s),o=new ar(i.stateStack,e.name,n.name);return an(i.tokens,o),i.tokens}function Ns(t,e,n,r,s){let i=rn(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=s,c=Ct(t),u=s.grammarState?Zc(s.grammarState,n.name)??ir:s.grammarContextCode!=null?Ns(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:ir,f=[],d=[];for(let h=0,p=c.length;h<p;h++){let[g,m]=c[h];if(g===""){f=[],d.push([]);continue}if(o>0&&g.length>=o){f=[],d.push([{content:g,offset:m,color:"",fontStyle:0}]);continue}let y,b,w;l&&l!=="tokenType"&&(y=e.tokenizeLine(g,u,a),b=y.tokens,w=0);let S=e.tokenizeLine2(g,u,a),C=S.tokens.length/2;for(let E=0;E<C;E++){let x=S.tokens[2*E],_=E+1<C?S.tokens[2*E+2]:g.length;if(x===_)continue;let $=S.tokens[2*E+1],re=Le(r[Ve.getForeground($)],i),ye=Ve.getFontStyle($),O={content:g.substring(x,_),offset:m+x,color:re,fontStyle:ye};if(l==="tokenType")O.type=Ve.getTokenType($);else if(l){let It=[];if(l!=="scopeName")for(let Ae of n.settings){let ut;switch(typeof Ae.scope){case"string":ut=Ae.scope.split(eu).map(Rr=>Rr.trim());break;case"object":ut=Ae.scope;break;default:continue}It.push({settings:Ae,selectors:ut.map(Rr=>Rr.split(tu))})}O.explanation=[];let fi=0;for(;x+fi<_;){let Ae=b[w],ut=g.substring(Ae.startIndex,Ae.endIndex);fi+=ut.length,O.explanation.push({content:ut,scopes:l==="scopeName"?nu(Ae.scopes):ru(It,Ae.scopes)}),w+=1}}f.push(O)}d.push(f),f=[],u=S.ruleStack}return{tokens:d,stateStack:u}}function nu(t){return t.map(e=>({scopeName:e}))}function ru(t,e){let n=[];for(let r=0,s=e.length;r<s;r++){let i=e[r];n[r]={scopeName:i,themeMatches:iu(t,i,e.slice(0,r))}}return n}function Ro(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function su(t,e,n){if(!Ro(t.at(-1),e))return!1;let r=t.length-2,s=n.length-1;for(;r>=0&&s>=0;)Ro(t[r],n[s])&&(r-=1),s-=1;return r===-1}function iu(t,e,n){let r=[];for(let{selectors:s,settings:i}of t)for(let o of s)if(su(o,e,n)){r.push(i);break}return r}function lr(t,e,n,r=As){let s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),i=s.map(c=>{let u=r(t,e,{...n,theme:c.theme});return{tokens:u,state:_t(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),o=ou(...i.map(c=>c.tokens)),a=o[0].map((c,u)=>c.map((f,d)=>{let h={content:f.content,variants:{},offset:f.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=f.explanation),o.forEach((p,g)=>{let{content:m,explanation:y,offset:b,...w}=p[u][d];h.variants[s[g].color]=w}),h})),l=i[0].state?new ar(Object.fromEntries(i.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),i[0].state.lang):void 0;return l&&an(a,l),a}function ou(...t){let e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){let s=t.map(l=>l[r]),i=e.map(()=>[]);e.forEach((l,c)=>l.push(i[c]));let o=s.map(()=>0),a=s.map(l=>l[0]);for(;a.every(l=>l);){let l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){let u=a[c];u.content.length===l?(i[c].push(u),o[c]+=1,a[c]=s[c][o[c]]):(i[c].push({...u,content:u.content.slice(0,l)}),a[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return e}var Wo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Be=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};Be.prototype.normal={};Be.prototype.property={};Be.prototype.space=void 0;function xs(t,e){let n={},r={};for(let s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new Be(n,r,e)}function ln(t){return t.toLowerCase()}var W=class{constructor(e,n){this.attribute=n,this.property=e}};W.prototype.attribute="";W.prototype.booleanish=!1;W.prototype.boolean=!1;W.prototype.commaOrSpaceSeparated=!1;W.prototype.commaSeparated=!1;W.prototype.defined=!1;W.prototype.mustUseProperty=!1;W.prototype.number=!1;W.prototype.overloadedBoolean=!1;W.prototype.property="";W.prototype.spaceSeparated=!1;W.prototype.space=void 0;var cn={};Pr(cn,{boolean:()=>A,booleanish:()=>F,commaOrSpaceSeparated:()=>X,commaSeparated:()=>Oe,number:()=>k,overloadedBoolean:()=>cr,spaceSeparated:()=>R});var au=0,A=nt(),F=nt(),cr=nt(),k=nt(),R=nt(),Oe=nt(),X=nt();function nt(){return 2**++au}var Is=Object.keys(cn),rt=class extends W{constructor(e,n,r,s){let i=-1;if(super(e,n),Ko(this,"space",s),typeof r=="number")for(;++i<Is.length;){let o=Is[i];Ko(this,Is[i],(r&cn[o])===cn[o])}}};rt.prototype.defined=!0;function Ko(t,e,n){n&&(t[e]=n)}function ae(t){let e={},n={};for(let[r,s]of Object.entries(t.properties)){let i=new rt(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[ln(r)]=r,n[ln(i.attribute)]=r}return new Be(e,n,t.space)}var Ts=ae({properties:{ariaActiveDescendant:null,ariaAtomic:F,ariaAutoComplete:null,ariaBusy:F,ariaChecked:F,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:R,ariaCurrent:null,ariaDescribedBy:R,ariaDetails:null,ariaDisabled:F,ariaDropEffect:R,ariaErrorMessage:null,ariaExpanded:F,ariaFlowTo:R,ariaGrabbed:F,ariaHasPopup:null,ariaHidden:F,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:R,ariaLevel:k,ariaLive:null,ariaModal:F,ariaMultiLine:F,ariaMultiSelectable:F,ariaOrientation:null,ariaOwns:R,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:F,ariaReadOnly:F,ariaRelevant:null,ariaRequired:F,ariaRoleDescription:R,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:F,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function ur(t,e){return e in t?t[e]:e}function fr(t,e){return ur(t,e.toLowerCase())}var Vo=ae({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Oe,acceptCharset:R,accessKey:R,action:null,allow:null,allowFullScreen:A,allowPaymentRequest:A,allowUserMedia:A,alpha:A,alt:null,as:null,async:A,autoCapitalize:null,autoComplete:R,autoFocus:A,autoPlay:A,blocking:R,capture:null,charSet:null,checked:A,cite:null,className:R,closedBy:null,colorSpace:null,cols:k,colSpan:k,command:null,commandFor:null,content:null,contentEditable:F,controls:A,controlsList:R,coords:k|Oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:A,defer:A,dir:null,dirName:null,disabled:A,download:cr,draggable:F,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:A,formTarget:null,headers:R,height:k,hidden:cr,high:k,href:null,hrefLang:null,htmlFor:R,httpEquiv:R,id:null,imageSizes:null,imageSrcSet:null,inert:A,inputMode:null,integrity:null,is:null,isMap:A,itemId:null,itemProp:R,itemRef:R,itemScope:A,itemType:R,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:A,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:A,muted:A,name:null,nonce:null,noModule:A,noValidate:A,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:A,optimum:k,pattern:null,ping:R,placeholder:null,playsInline:A,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:A,referrerPolicy:null,rel:R,required:A,reversed:A,rows:k,rowSpan:k,sandbox:R,scope:null,scoped:A,seamless:A,selected:A,shadowRootClonable:A,shadowRootCustomElementRegistry:A,shadowRootDelegatesFocus:A,shadowRootMode:null,shadowRootSerializable:A,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:F,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:A,useMap:null,value:F,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:R,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:A,declare:A,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:A,noHref:A,noShade:A,noWrap:A,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:F,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:A,disablePictureInPicture:A,disableRemotePlayback:A,exportParts:Oe,part:R,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:fr});var zo=ae({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:X,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:R,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:A,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Oe,g2:Oe,glyphName:Oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:X,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:R,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:X,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:X,rev:X,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:X,requiredFeatures:X,requiredFonts:X,requiredFormats:X,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:X,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:X,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:X,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ur});var Ls=ae({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}});var Bs=ae({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fr});var Os=ae({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}});var lu=/[A-Z]/g,Jo=/-[a-z]/g,cu=/^data[-\w.:]+$/i;function Rs(t,e){let n=ln(e),r=e,s=W;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cu.test(e)){if(e.charAt(4)==="-"){let i=e.slice(5).replace(Jo,fu);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=e.slice(4);if(!Jo.test(i)){let o=i.replace(lu,uu);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=rt}return new s(r,e)}function uu(t){return"-"+t.toLowerCase()}function fu(t){return t.charAt(1).toUpperCase()}var dr=xs([Ts,Vo,Ls,Bs,Os],"html"),hr=xs([Ts,zo,Ls,Bs,Os],"svg");var Yo={}.hasOwnProperty;function Qo(t,e){let n=e||{};function r(s,...i){let o=r.invalid,a=r.handlers;if(s&&Yo.call(s,t)){let l=String(s[t]);o=Yo.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var du=/["&'<>`]/g,hu=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,pu=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,gu=/[|\\{}()[\]^$+*?.]/g,Xo=new WeakMap;function Zo(t,e){if(t=t.replace(e.subset?mu(e.subset):du,r),e.subset||e.escapeOnly)return t;return t.replace(hu,n).replace(pu,r);function n(s,i,o){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function r(s,i,o){return e.format(s.charCodeAt(0),o.charCodeAt(i+1),e)}}function mu(t){let e=Xo.get(t);return e||(e=yu(t),Xo.set(t,e)),e}function yu(t){let e=[],n=-1;for(;++n<t.length;)e.push(t[n].replace(gu,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}var bu=/[\dA-Fa-f]/;function ea(t,e,n){let r="&#x"+t.toString(16).toUpperCase();return n&&e&&!bu.test(String.fromCharCode(e))?r:r+";"}var wu=/\d/;function ta(t,e,n){let r="&#"+String(t);return n&&e&&!wu.test(String.fromCharCode(e))?r:r+";"}var na=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var pr={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var ra=["cent","copy","divide","gt","lt","not","para","times"];var sa={}.hasOwnProperty,Ps={},gr;for(gr in pr)sa.call(pr,gr)&&(Ps[pr[gr]]=gr);var ku=/[^\dA-Za-z]/;function ia(t,e,n,r){let s=String.fromCharCode(t);if(sa.call(Ps,s)){let i=Ps[s],o="&"+i;return n&&na.includes(i)&&!ra.includes(i)&&(!r||e&&e!==61&&ku.test(String.fromCharCode(e)))?o:o+";"}return""}function oa(t,e,n){let r=ea(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=ia(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){let i=ta(t,e,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function Re(t,e){return Zo(t,Object.assign({format:oa},e))}var Su=/^>|^->|<!--|-->|--!>|<!-$/g,Cu=[">"],_u=["<",">"];function aa(t,e,n,r){return r.settings.bogusComments?"<?"+Re(t.value,Object.assign({},r.settings.characterReferences,{subset:Cu}))+">":"<!--"+t.value.replace(Su,s)+"-->";function s(i){return Re(i,Object.assign({},r.settings.characterReferences,{subset:_u}))}}function la(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function $s(t,e){let n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function ca(t,e){let n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function ua(t){return t.join(" ").trim()}var vu=/[ \t\n\f\r]/g;function st(t){return typeof t=="object"?t.type==="text"?fa(t.value):!1:fa(t)}function fa(t){return t.replace(vu,"")===""}var G=da(1),Ms=da(-1),Eu=[];function da(t){return e;function e(n,r,s){let i=n?n.children:Eu,o=(r||0)+t,a=i[o];if(!s)for(;a&&st(a);)o+=t,a=i[o];return a}}var Au={}.hasOwnProperty;function mr(t){return e;function e(n,r,s){return Au.call(t,n.tagName)&&t[n.tagName](n,r,s)}}var un=mr({body:xu,caption:Fs,colgroup:Fs,dd:Bu,dt:Lu,head:Fs,html:Nu,li:Tu,optgroup:Ou,option:Ru,p:Iu,rp:ha,rt:ha,tbody:$u,td:pa,tfoot:Mu,th:pa,thead:Pu,tr:Fu});function Fs(t,e,n){let r=G(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&st(r.value.charAt(0)))}function Nu(t,e,n){let r=G(n,e);return!r||r.type!=="comment"}function xu(t,e,n){let r=G(n,e);return!r||r.type!=="comment"}function Iu(t,e,n){let r=G(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"||n.tagName.includes("-")))}function Tu(t,e,n){let r=G(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Lu(t,e,n){let r=G(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Bu(t,e,n){let r=G(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ha(t,e,n){let r=G(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ou(t,e,n){let r=G(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ru(t,e,n){let r=G(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Pu(t,e,n){let r=G(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function $u(t,e,n){let r=G(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Mu(t,e,n){return!G(n,e)}function Fu(t,e,n){let r=G(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function pa(t,e,n){let r=G(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var ga=mr({body:ju,colgroup:Uu,head:Gu,html:Du,tbody:qu});function Du(t){let e=G(t,-1);return!e||e.type!=="comment"}function Gu(t){let e=new Set;for(let r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}let n=t.children[0];return!n||n.type==="element"}function ju(t){let e=G(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&st(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Uu(t,e,n){let r=Ms(n,e);if(n&&r&&r.type==="element"&&r.tagName==="colgroup"&&un(r,n.children.indexOf(r),n))return!1;let s=G(t,-1,!0);return!!(s&&s.type==="element"&&s.tagName==="col")}function qu(t,e,n){let r=Ms(n,e);if(n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&un(r,n.children.indexOf(r),n))return!1;let s=G(t,-1);return!!(s&&s.type==="element"&&s.tagName==="tr")}var yr={name:[[`
136
+ \f\r &/=>`.split(""),`
137
+ \f\r "&'/=>\``.split("")],[`\0
138
+ \f\r "&'/<=>`.split(""),`\0
139
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
140
+ \f\r &>`.split(""),`\0
141
+ \f\r "&'<=>\``.split("")],[`\0
142
+ \f\r "&'<=>\``.split(""),`\0
143
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},Hu=new Set(["desc","foreignObject","title"]);function ma(t,e,n,r){let{schema:s}=r,i=s.space==="svg"?!1:r.settings.omitOptionalTags,o=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase()),a=[];s.space==="html"&&t.tagName==="svg"&&(r.schema=hr);let l=Wu(r,t.properties);r.schema.space==="svg"&&Hu.has(t.tagName)&&(r.schema=dr);let c=r.all(s.space==="html"&&t.tagName==="template"?t.content:t);if(r.schema=s,c&&(o=!1),l||!i||!ga(t,e,n)){if(a.push("<",t.tagName,l?" "+l:""),o&&(s.space==="svg"||r.settings.closeSelfClosing)){let u=l.charAt(l.length-1);(!r.settings.tightSelfClosing||u==="/"||u&&u!=='"'&&u!=="'")&&a.push(" "),a.push("/")}a.push(">")}return a.push(c),!o&&(!i||!un(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function Wu(t,e){let n=[],r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){let i=Ku(t,s,e[s]);i&&n.push(i)}}for(;++r<n.length;){let i=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function Ku(t,e,n){let r=Rs(t.schema,e),s=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";let o=Re(r.attribute,Object.assign({},t.settings.characterReferences,{subset:yr.name[s][i]}));if(n===!0||(n=Array.isArray(n)?(r.commaSeparated?ca:ua)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n))return o;let a;if(t.settings.preferUnquoted&&(a=Re(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:yr.unquoted[s][i]}))),a!==n){let{quote:l}=t;t.settings.quoteSmart&&$s(n,l)>$s(n,t.alternative)&&(l=t.alternative),a=l+Re(n,Object.assign({},t.settings.characterReferences,{subset:(l==="'"?yr.single:yr.double)[s][i],attribute:!0}))+l}return o+(a&&"="+a)}var Vu=["<","&"];function br(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Re(t.value,Object.assign({},r.settings.characterReferences,{subset:Vu}))}function ya(t,e,n,r){return r.settings.allowDangerousHtml?t.value:br(t,e,n,r)}function ba(t,e,n,r){return r.all(t)}var wa=Qo("type",{invalid:zu,unknown:Ju,handlers:{comment:aa,doctype:la,element:ma,raw:ya,root:ba,text:br}});function zu(t){throw new Error("Expected node, not `"+t+"`")}function Ju(t){let e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}var Yu={},Qu={},Xu=[];function Ds(t,e){let n=e||Yu,r=n.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");let s=r==='"'?"'":'"';return{one:Zu,all:ef,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Wo,characterReferences:n.characterReferences||Qu,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?hr:dr,quote:r,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Zu(t,e,n){return wa(t,e,n,this)}function ef(t){let e=[],n=t&&t.children||Xu,r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}var ka=/\s+/g;function _a(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(ka)),Array.isArray(t.properties.class)||(t.properties.class=[]);let n=Array.isArray(e)?e:e.split(ka);for(let r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function tf(t){let e=Ct(t,!0).map(([s])=>s);function n(s){if(s===t.length)return{line:e.length-1,character:e.at(-1).length};let i=s,o=0;for(let a of e){if(i<a.length)break;i-=a.length,o++}return{line:o,character:i}}function r(s,i){let o=0;for(let a=0;a<s;a++)o+=e[a].length;return o+=i,o}return{lines:e,indexToPos:n,posToIndex:r}}var nf=["color","background-color"];function rf(t,e){let n=0,r=[];for(let s of e)s>n&&r.push({...t,content:t.content.slice(n,s),offset:t.offset+n}),n=s;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function sf(t,e){let n=0,r=t.length;for(;n<r;){let s=n+(r-n>>1);t[s]<=e?n=s+1:r=s}return n}function of(t,e){let n=[...e instanceof Set?e:new Set(e)].sort((r,s)=>r-s);return n.length?t.map(r=>r.flatMap(s=>{let i=s.offset+s.content.length,o=sf(n,s.offset),a=o;for(;a<n.length&&n[a]<i;)a++;if(o===a)return s;let l=n.slice(o,a);for(let c=0;c<l.length;c++)l[c]-=s.offset;return rf(s,l)})):t}function af(t,e,n,r,s="css-vars"){let i={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>wr(t.variants[u])),a=new Set(o.flatMap(u=>Object.keys(u))),l={},c=(u,f)=>{let d=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+e[u]+(f==="color"?"":d)};return o.forEach((u,f)=>{for(let d of a){let h=u[d]||"inherit";if(f===0&&r&&nf.includes(d))if(r==="light-dark()"&&o.length>1){let p=e.findIndex(b=>b==="light"),g=e.findIndex(b=>b==="dark");if(p===-1||g===-1)throw new P('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let m=o[p][d]||"inherit",y=o[g][d]||"inherit";l[d]=`light-dark(${m}, ${y})`,s==="css-vars"&&(l[c(f,d)]=h)}else l[d]=h;else s==="css-vars"&&(l[c(f,d)]=h)}}),i.htmlStyle=l,i}function wr(t){let e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&K.Italic&&(e["font-style"]="italic"),t.fontStyle&K.Bold&&(e["font-weight"]="bold");let n=[];t.fontStyle&K.Underline&&n.push("underline"),t.fontStyle&K.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function js(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function lf(){let t=new WeakMap;function e(n){if(!t.has(n.meta)){let s=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new P(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...r.indexToPos(o),offset:o}}else{let a=r.lines[o.line];if(a===void 0)throw new P(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new P(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:r.posToIndex(o.line,l)}}},r=tf(n.source),i=(n.options.decorations||[]).map(o=>({...o,start:s(o.start),end:s(o.end)}));cf(i),t.set(n.meta,{decorations:i,converter:r,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return of(n,e(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;let r=e(this),s=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new P(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,f,d,h){let p=s[u],g="",m=-1,y=-1;if(f===0&&(m=0),d===0&&(y=0),d===Number.POSITIVE_INFINITY&&(y=p.children.length),m===-1||y===-1)for(let w=0;w<p.children.length;w++)g+=va(p.children[w]),m===-1&&g.length===f&&(m=w+1),y===-1&&g.length===d&&(y=w+1);if(m===-1)throw new P(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(y===-1)throw new P(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);let b=p.children.slice(m,y);if(!h.alwaysWrap&&b.length===p.children.length)a(p,h,"line");else if(!h.alwaysWrap&&b.length===1&&b[0].type==="element")a(b[0],h,"token");else{let w={type:"element",tagName:"span",properties:{},children:b};a(w,h,"wrapper"),p.children.splice(m,b.length,w)}}function o(u,f){s[u]=a(s[u],f,"line")}function a(u,f,d){let h=f.properties||{},p=f.transform||(g=>g);return u.tagName=f.tagName||"span",u.properties={...u.properties,...h,class:u.properties.class},f.properties?.class&&_a(u,f.properties.class),u=p(u,d)||u,u}let l=[],c=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(let u of c){let{start:f,end:d}=u;if(f.line===d.line)i(f.line,f.character,d.character,u);else if(f.line<d.line){i(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let h=f.line+1;h<d.line;h++)l.unshift(()=>o(h,u));i(d.line,0,d.character,u)}}l.forEach(u=>u())}}}function cf(t){for(let e=0;e<t.length;e++){let n=t[e];if(n.start.offset>n.end.offset)throw new P(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){let s=t[r],i=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,o=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,a=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(i||o||a||l){if(i&&o||a&&l||a&&n.start.offset===n.end.offset||o&&s.start.offset===s.end.offset)continue;throw new P(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function va(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(va).join(""):""}var uf=[lf()];function kr(t){let e=ff(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...uf]}function ff(t){let e=[],n=[],r=[];for(let s of t)switch(s.enforce){case"pre":e.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:e,post:n,normal:r}}var it=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Gs={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function df(t,e){let n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){let r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function Sa(t){let e=t.shift();if(e==="2"){let n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){let n=t.shift();if(n)return{type:"table",index:Number(n)}}}function hf(t){let e=[];for(;t.length>0;){let n=t.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Gs[r]&&e.push({type:"setDecoration",value:Gs[r]});else if(r<=29){let s=Gs[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:it[r-30]}});else if(r===38){let s=Sa(t);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:it[r-40]}});else if(r===48){let s=Sa(t);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:it[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:it[r-100+8]}})}return e}function pf(){let t=null,e=null,n=new Set;return{parse(r){let s=[],i=0;do{let o=df(r,i),a=o.sequence?r.substring(i,o.startPosition):r.substring(i);if(a.length>0&&s.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){let l=hf(o.sequence);for(let c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(let c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}i=o.position}while(i<r.length);return s}}}var gf={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function mf(t=gf){function e(a){return t[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let c=0;c<it.length;c++)r.push(e(it[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let f=0;f<6;f++)r.push(n([a[c],a[u],a[f]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function i(a){return s()[a]}function o(a){switch(a.type){case"named":return e(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:o}}var yf=/#([0-9a-f]{3,8})/i,bf=/var\((--[\w-]+-ansi-[\w-]+)\)/,wf={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function kf(t,e,n){let r=rn(t,n),s=Ct(e),i=mf(Object.fromEntries(it.map(a=>{let l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,t.colors?.[l]||wf[a]]}))),o=pf();return s.map(a=>o.parse(a[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?i.value(l.background):t.bg,u=l.foreground?i.value(l.foreground):t.fg):(c=l.foreground?i.value(l.foreground):t.fg,u=l.background?i.value(l.background):void 0),c=Le(c,r),u=Le(u,r),l.decorations.has("dim")&&(c=Sf(c));let f=K.None;return l.decorations.has("bold")&&(f|=K.Bold),l.decorations.has("italic")&&(f|=K.Italic),l.decorations.has("underline")&&(f|=K.Underline),l.decorations.has("strikethrough")&&(f|=K.Strikethrough),{content:l.value,offset:a[1],color:c,bgColor:u,fontStyle:f}}))}function Sf(t){let e=t.match(yf);if(e){let r=e[1];if(r.length===8){let s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){let s=r[0],i=r[1],o=r[2],a=r[3];return`#${s}${s}${i}${i}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){let s=r[0],i=r[1],o=r[2];return`#${s}${s}${i}${i}${o}${o}80`}}}let n=t.match(bf);return n?`var(${n[1]}-dim)`:t}function Us(t,e,n={}){let r=t.resolveLangAlias(n.lang||"text"),{theme:s=t.getLoadedThemes()[0]}=n;if(!sn(r)&&!on(s)&&r==="ansi"){let{theme:i}=t.setTheme(s);return kf(i,e,n)}return As(t,e,n)}function Sr(t,e,n){let r,s,i,o,a,l;if("themes"in n){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:f="css-vars"}=n,d=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,b)=>y.color===c?-1:b.color===c?1:0);if(d.length===0)throw new P("`themes` option must not be empty");let h=lr(t,e,n,Us);if(l=_t(h),c&&c!=="light-dark()"&&!d.some(y=>y.color===c))throw new P(`\`themes\` option must contain the defaultColor key \`${c}\``);let p=d.map(y=>t.getTheme(y.theme)),g=d.map(y=>y.color);i=h.map(y=>y.map(b=>af(b,g,u,c,f))),l&&an(i,l);let m=d.map(y=>rn(y.theme,n));s=Ca(d,p,m,u,c,"fg",f),r=Ca(d,p,m,u,c,"bg",f),o=`shiki-themes ${p.map(y=>y.name).join(" ")}`,a=c?void 0:[s,r].join(";")}else if("theme"in n){let c=rn(n.theme,n);i=Us(t,e,n);let u=t.getTheme(n.theme);r=Le(u.bg,c),s=Le(u.fg,c),o=u.name,l=_t(i)}else throw new P("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:s,bg:r,themeName:o,rootStyle:a,grammarState:l}}function Ca(t,e,n,r,s,i,o){return t.map((a,l)=>{let c=Le(e[l][i],n[l])||"inherit",u=`${r+a.color}${i==="bg"?"-bg":""}:${c}`;if(l===0&&s){if(s==="light-dark()"&&t.length>1){let f=t.findIndex(h=>h.color==="light"),d=t.findIndex(h=>h.color==="dark");if(f===-1||d===-1)throw new P('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Le(e[f][i],n[f])||"inherit"}, ${Le(e[d][i],n[d])||"inherit"});${u}`}return c}return o==="css-vars"?u:null}).filter(a=>!!a).join(";")}var Ea=/^\s+$/,Cf=/^(\s*)(.*?)(\s*)$/;function Cr(t,e,n,r={meta:{},options:n,codeToHast:(s,i)=>Cr(t,s,i),codeToTokens:(s,i)=>Sr(t,s,i)}){let s=e;for(let p of kr(n))s=p.preprocess?.call(r,s,n)||s;let{tokens:i,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:u}=Sr(t,s,n),{mergeWhitespaces:f=!0,mergeSameStyleTokens:d=!1}=n;f===!0?i=vf(i):f==="never"&&(i=Ef(i)),d&&(i=Af(i));let h={...r,get source(){return s}};for(let p of kr(n))i=p.tokens?.call(h,i)||i;return _f(i,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},h,u)}function _f(t,e,n,r=_t(t)){let s=kr(e),i=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(let[g,m]of Object.entries(e.meta||{}))g.startsWith("_")||(c[g]=m);let u={type:"element",tagName:"pre",properties:c,children:[],data:e.data},f={type:"element",tagName:"code",properties:{},children:i},d=[],h={...n,structure:a,addClassToHast:_a,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return f},get lines(){return d}};if(t.forEach((g,m)=>{m&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
144
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(let w of g){let S={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]},C=js(w.htmlStyle||wr(w));C&&(S.properties.style=C);for(let E of s)S=E?.span?.call(h,S,m+1,b,y,w)||S;a==="inline"?o.children.push(S):a==="classic"&&y.children.push(S),b+=w.content.length}if(a==="classic"){for(let w of s)y=w?.line?.call(h,y,m+1)||y;d.push(y),i.push(y)}else a==="inline"&&d.push(y)}),a==="classic"){for(let g of s)f=g?.code?.call(h,f)||f;u.children.push(f);for(let g of s)u=g?.pre?.call(h,u)||u;o.children.push(u)}else if(a==="inline"){let g=[],m={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let b of o.children)b.type==="element"&&b.tagName==="br"?(g.push(m),m={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&m.children.push(b);g.push(m);let y={type:"element",tagName:"code",properties:{},children:g};for(let b of s)y=b?.code?.call(h,y)||y;o.children=[];for(let b=0;b<y.children.length;b++){b>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});let w=y.children[b];w.type==="element"&&o.children.push(...w.children)}}let p=o;for(let g of s)p=g?.root?.call(h,p)||p;return r&&an(p,r),p}function vf(t){return t.map(e=>{let n=[],r="",s;return e.forEach((i,o)=>{let a=!(i.fontStyle&&(i.fontStyle&K.Underline||i.fontStyle&K.Strikethrough));a&&Ea.test(i.content)&&e[o+1]?(s===void 0&&(s=i.offset),r+=i.content):r?(a?n.push({...i,offset:s,content:r+i.content}):n.push({content:r,offset:s},i),s=void 0,r=""):n.push(i)}),n})}function Ef(t){return t.map(e=>e.flatMap(n=>{if(Ea.test(n.content))return n;let r=n.content.match(Cf);if(!r)return n;let[,s,i,o]=r;if(!s&&!o)return n;let a=[{...n,offset:n.offset+s.length,content:i}];return s&&a.unshift({content:s,offset:n.offset}),o&&a.push({content:o,offset:n.offset+s.length+i.length}),a}))}function Af(t){return t.map(e=>{let n=[];for(let r of e){if(n.length===0){n.push({...r});continue}let s=n.at(-1),i=js(s.htmlStyle||wr(s)),o=js(r.htmlStyle||wr(r)),a=s.fontStyle&&(s.fontStyle&K.Underline||s.fontStyle&K.Strikethrough),l=r.fontStyle&&(r.fontStyle&K.Underline||r.fontStyle&K.Strikethrough);!a&&!l&&i===o?s.content+=r.content:n.push({...r})}return n})}var Nf=Ds;function xf(t,e,n){let r={meta:{},options:n,codeToHast:(i,o)=>Cr(t,i,o),codeToTokens:(i,o)=>Sr(t,i,o)},s=Nf(Cr(t,e,n,r));for(let i of kr(n))s=i.postprocess?.call(r,s,n)||s;return s}async function Aa(t){let e=await Es(t);return{getLastGrammarState:(...n)=>qo(e,...n),codeToTokensBase:(n,r)=>Us(e,n,r),codeToTokensWithThemes:(n,r)=>lr(e,n,r),codeToTokens:(n,r)=>Sr(e,n,r),codeToHast:(n,r)=>Cr(e,n,r),codeToHtml:(n,r)=>xf(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function If(t){return!t.sticky&&!t.rawOptions?.strategy}function Na(t,e){return{index:t,captureIndices:e.map(n=>n==null?{start:4294967295,end:4294967295,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var xa=class{patterns;options;regexps;lastSearches;constructor(t,e={}){this.patterns=t,this.options=e;let{forgiving:n=!1,cache:r,regexConstructor:s}=e;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(i=>{if(typeof i!="string")return i;let o=r?.get(i);if(o){if(o instanceof RegExp)return o;if(n)return null;throw o}try{let a=s(i);return r?.set(i,a),a}catch(a){if(r?.set(i,a),n)return null;throw a}}),this.lastSearches=this.regexps.map(i=>i&&If(i)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(t,e,n){let r=typeof t=="string"?t:t.content,s=typeof t=="string"?0:t.id||0,i=-1,o=0,a=null;for(let l=0;l<this.regexps.length;l++){let c=this.regexps[l];if(c)try{let u=s?this.lastSearches[l]:null,f,d;if(u&&u.strId===s&&u.searchedFrom<=e&&(u.matchIndex===-1||u.matchIndex>=e))f=u.matchIndex,d=u.indices;else{c.lastIndex=e;let h=c.exec(r);f=h?h.index:-1,d=h?h.indices:null,u&&(u.strId=s,u.searchedFrom=e,u.matchIndex=f,u.indices=d)}if(f===-1)continue;if(f===e)return Na(l,d);(i===-1||f<o)&&(i=l,o=f,a=d)}catch(u){if(this.options.forgiving)continue;throw u}}return i===-1?null:Na(i,a)}},Tf=0;function Ia(t){return{content:t,id:++Tf}}function ze(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function Ta(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}var fn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),U=String.raw;function Pe(t,e){if(t==null)throw new Error(e??"Value expected");return t}var $a=U`\[\^?`,Ma=`c.? | C(?:-.?)?|${U`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${U`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${U`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${U`o\{[^\}]*\}?`}|${U`\d{1,3}`}`,Hs=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,_r=new RegExp(U`
145
+ \\ (?:
146
+ ${Ma}
147
+ | [gk]<[^>]*>?
148
+ | [gk]'[^']*'?
149
+ | .
150
+ )
151
+ | \( (?:
152
+ \? (?:
153
+ [:=!>({]
154
+ | <[=!]
155
+ | <[^>]*>
156
+ | '[^']*'
157
+ | ~\|?
158
+ | #(?:[^)\\]|\\.?)*
159
+ | [^:)]*[:)]
160
+ )?
161
+ | \*[^\)]*\)?
162
+ )?
163
+ | (?:${Hs.source})+
164
+ | ${$a}
165
+ | .
166
+ `.replace(/\s+/g,""),"gsu"),qs=new RegExp(U`
167
+ \\ (?:
168
+ ${Ma}
169
+ | .
170
+ )
171
+ | \[:(?:\^?\p{Alpha}+|\^):\]
172
+ | ${$a}
173
+ | &&
174
+ | .
175
+ `.replace(/\s+/g,""),"gsu");function Fa(t,e={}){let n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");let r=Jf(n.flags),s=[r.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(f){s.push(f)},replaceCurrentModX(f){s[s.length-1]=f},singleline:n.rules.singleline},o=[],a;for(_r.lastIndex=0;a=_r.exec(t);){let f=Lf(i,t,a[0],_r.lastIndex);f.tokens?o.push(...f.tokens):f.token&&o.push(f.token),f.lastIndex!==void 0&&(_r.lastIndex=f.lastIndex)}let l=[],c=0;o.filter(f=>f.type==="GroupOpen").forEach(f=>{f.kind==="capturing"?f.number=++c:f.raw==="("&&l.push(f)}),c||l.forEach((f,d)=>{f.kind="capturing",f.number=d+1});let u=c||l.length;return{tokens:o.map(f=>f.type==="EscapedNumber"?Qf(f,u):f).flat(),flags:r}}function Lf(t,e,n,r){let[s,i]=n;if(n==="["||n==="[^"){let o=Bf(e,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(i))return{token:La(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Uf(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ga(n)}}if(i==="K")return{token:ja("keep",n)};if(i==="N"||i==="R")return{token:ot("newline",n,{negate:i==="N"})};if(i==="O")return{token:ot("any",n)};if(i==="X")return{token:ot("text_segment",n)};let o=Da(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(s==="("){if(i==="*")return{token:Kf(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Wf(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:vt("group",n)};if(n==="(?>")return{token:vt("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:vt(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:vt("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:vt("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Df(n)}}if(t.getCurrentModX()){if(n==="#"){let o=e.indexOf(`
176
+ `,r);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(n)){let o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(e)?o.lastIndex:r}}}if(n===".")return{token:ot("dot",n)};if(n==="^"||n==="$"){let o=t.singleline?{"^":U`\A`,$:U`\Z`}[n]:n;return{token:La(o,n)}}return n==="|"?{token:Rf(n)}:Hs.test(n)?{tokens:Xf(n)}:{token:$e(ze(n),n)}}function Bf(t,e,n){let r=[Ba(e[1]==="^",e)],s=1,i;for(qs.lastIndex=n;i=qs.exec(t);){let o=i[0];if(o[0]==="["&&o[1]!==":")s++,r.push(Ba(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push($e(93,o));else if(s--,r.push(Pf(o)),!s)break}else{let a=Of(o);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:qs.lastIndex||t.length}}function Of(t){if(t[0]==="\\")return Da(t,{inCharClass:!0});if(t[0]==="["){let e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!fn.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return ot("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?$f(t):t==="&&"?Mf(t):$e(ze(t),t)}function Da(t,{inCharClass:e}){let n=t[1];if(n==="c"||n==="C")return Hf(t);if("dDhHsSwW".includes(n))return Vf(t);if(t.startsWith(U`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return zf(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{let r=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),i=new TextEncoder;return[...s].map(o=>{let a=[...i.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return $e(ze(o),a)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return $e(Yf(t),t);if(Oa.has(n))return $e(Oa.get(n),t);if(/\d/.test(n))return Ff(e,t);if(t==="\\")throw new Error(U`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return $e(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function Rf(t){return{type:"Alternator",raw:t}}function La(t,e){return{type:"Assertion",kind:t,raw:e}}function Ga(t){return{type:"Backreference",raw:t}}function $e(t,e){return{type:"Character",value:t,raw:e}}function Pf(t){return{type:"CharacterClassClose",raw:t}}function $f(t){return{type:"CharacterClassHyphen",raw:t}}function Mf(t){return{type:"CharacterClassIntersector",raw:t}}function Ba(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function ot(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function ja(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:Pe(n.flags),raw:e}}function Ff(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function Df(t){return{type:"GroupClose",raw:t}}function vt(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function Gf(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function jf(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function Uf(t){return{type:"Subroutine",raw:t}}var qf=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Oa=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Hf(t){let e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return $e(ze(e.toUpperCase())-64,t)}function Wf(t,e){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;r??="";let s=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),i=Pa(n),o=Pa(r),a={};if(i&&(a.enable=i),o&&(a.disable=o),t.endsWith(")"))return e.replaceCurrentModX(s),ja("flags",t,{flags:a});if(t.endsWith(":"))return e.pushModX(s),e.numOpenGroups++,vt("group",t,{...(i||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${t}"`)}function Kf(t){let e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);let{name:n,tag:r,args:s}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);let i=s?s.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[o,a,l]=i,c=qf.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(i.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Gf(c,r??null,s?.split(",")??null,t)}function Ra(t){let e=null,n,r;if(t[0]==="{"){let{minStr:s,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,o=1e5;if(+s>o||i&&+i>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=i===void 0?+s:i===""?1/0:+i,n>r&&(e="possessive",[n,r]=[r,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return jf(e,n,r,t)}function Vf(t){let e=t[1].toLowerCase();return ot({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function zf(t){let{p:e,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return ot("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function Pa(t){let e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function Jf(t){let e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){let r=t[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return e}function Yf(t){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(t))throw new Error(`Incomplete or invalid escape "${t}"`);let e=t[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function Qf(t,e){let{raw:n,inCharClass:r}=t,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=e))return[Ga(n)];let i=[],o=s.match(/^[0-7]+|\d/g);for(let a=0;a<o.length;a++){let l=o[a],c;if(a===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(U`Octal encoded byte above 177 unsupported "${n}"`)}else c=ze(l);i.push($e(c,(a===0?"\\":"")+l))}return i}function Xf(t){let e=[],n=new RegExp(Hs,"gy"),r;for(;r=n.exec(t);){let s=r[0];if(s[0]==="{"){let i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(i){let{min:o,max:a}=i.groups;if(+o>+a&&s.endsWith("?")){n.lastIndex--,e.push(Ra(s.slice(0,-1)));continue}}}e.push(Ra(s))}return e}function vr(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;let n=t.body[0];return!e||Object.keys(e).every(r=>e[r]===n[r])}function Ua(t){return Zf.has(t.type)}var Zf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ar(t,e={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=Fa(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(d,h)=>{let p=r.tokens[i.nextIndex];switch(i.parent=d,i.nextIndex++,p.type){case"Alternator":return Me();case"Assertion":return ed(p);case"Backreference":return td(p,i);case"Character":return Et(p.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return nd(p,i,h);case"CharacterClassOpen":return rd(p,i,h);case"CharacterSet":return sd(p,i);case"Directive":return ud(p.kind,{flags:p.flags});case"GroupOpen":return id(p,i,h);case"NamedCallout":return dd(p.kind,p.tag,p.arguments);case"Quantifier":return od(p,i);case"Subroutine":return ad(p,i);default:throw new Error(`Unexpected token type "${p.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:s},o=pd(fd(r.flags)),a=o.body[0];for(;i.nextIndex<r.tokens.length;){let d=s(a,{});d.type==="Alternative"?(o.body.push(d),a=d):a.body.push(d)}let{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:u,subroutines:f}=i;if(c&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:d}of f)if(typeof d=="number"){if(d>l.length)throw new Error("Subroutine uses a group number that's not defined");d&&(l[d-1].isSubroutined=!0)}else if(u.has(d)){if(u.get(d).length>1)throw new Error(U`Subroutine uses a duplicate group name "\g<${d}>"`);u.get(d)[0].isSubroutined=!0}else throw new Error(U`Subroutine uses a group name that's not defined "\g<${d}>"`);return o}function ed({kind:t}){return Nr(Pe({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===U`\B`||t===U`\Y`})}function td({raw:t},e){let n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),s=(i,o=!1)=>{let a=e.capturingGroups.length,l=!1;if(i>a)if(e.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,Er(o?a+1-i:i,{orphan:l})};if(n){let i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(i)return s(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return Er(r)}return s(+r)}function nd(t,e,n){let{tokens:r,walk:s}=e,i=e.parent,o=i.body.at(-1),a=r[e.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){let l=s(i,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return i.body.pop(),cd(o,l);throw new Error("Invalid character class range")}return Et(ze("-"))}function rd({negate:t},e,n){let{tokens:r,walk:s}=e,i=[dn()],o=r[e.nextIndex],a=Wa(o);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")i.push(dn()),e.nextIndex++;else{let c=i.at(-1);c.body.push(s(c,n))}a=Wa(r[e.nextIndex],o)}let l=dn({negate:t});return i.length===1?l.body=i[0].body:(l.kind="intersection",l.body=i.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,l}function sd({kind:t,negate:e,value:n},r){let{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:i,unicodePropertyMap:o}=r;if(t==="property"){let a=At(n);if(fn.has(a)&&!o?.has(a))t="posix",n=a;else return at(n,{negate:e,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:i,unicodePropertyMap:o})}return t==="posix"?hd(n,{negate:e}):xr(t,{negate:e})}function id(t,e,n){let{tokens:r,capturingGroups:s,namedGroupsByName:i,skipLookbehindValidation:o,walk:a}=e,l=gd(t),c=l.type==="AbsenceFunction",u=Ha(l),f=u&&l.negate;if(l.type==="CapturingGroup"&&(s.push(l),l.name&&Ta(i,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Ka(r[e.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")l.body.push(Me()),e.nextIndex++;else{let h=l.body.at(-1),p=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||f});if(h.body.push(p),(u||n.isInLookbehind)&&!o){let g="Lookbehind includes a pattern not allowed by Oniguruma";if(f||n.isInNegLookbehind){if(qa(p)||p.type==="CapturingGroup")throw new Error(g)}else if(qa(p)||Ha(p)&&p.negate)throw new Error(g)}}d=Ka(r[e.nextIndex])}return e.nextIndex++,l}function od({kind:t,min:e,max:n},r){let s=r.parent,i=s.body.at(-1);if(!i||!Ua(i))throw new Error("Quantifier requires a repeatable token");let o=Ks(t,e,n,i);return s.body.pop(),o}function ad({raw:t},e){let{capturingGroups:n,subroutines:r}=e,s=t.slice(3,-1),i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(i){let a=+i.groups.num,l=n.length;if(e.hasNumberedRef=!0,s={"":a,"+":l+a,"-":l+1-a}[i.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);let o=Vs(s);return r.push(o),o}function ld(t,e){if(t!=="repeater")throw new Error(`Unexpected absence function kind "${t}"`);return{type:"AbsenceFunction",kind:t,body:hn(e?.body)}}function Me(t){return{type:"Alternative",body:Va(t?.body)}}function Nr(t,e){let n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!e?.negate),n}function Er(t,e){let n=!!e?.orphan;return{type:"Backreference",ref:t,...n&&{orphan:n}}}function Ws(t,e){let n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!md(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:hn(e?.body)}}function Et(t,e){let n={useLastValid:!1,...e};if(t>1114111){let r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:t}}function dn(t){let e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Va(t?.body)}}function cd(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function xr(t,e){let n=!!e?.negate,r={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(r.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(r.variableLength=!0),r}function ud(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:Pe(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function fd(t){return{type:"Flags",...t}}function ne(t){let e=t?.atomic,n=t?.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:hn(t?.body)}}function Je(t){let e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:hn(t?.body)}}function dd(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function hd(t,e){let n=!!e?.negate;if(!fn.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function Ks(t,e,n,r){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function pd(t,e){return{type:"Regex",body:hn(e?.body),flags:t}}function Vs(t){return{type:"Subroutine",ref:t}}function at(t,e){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e},r=n.unicodePropertyMap?.get(At(t));if(!r){if(n.normalizeUnknownPropertyNames)r=yd(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(U`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function gd({flags:t,kind:e,name:n,negate:r,number:s}){switch(e){case"absence_repeater":return ld("repeater");case"atomic":return ne({atomic:!0});case"capturing":return Ws(s,{name:n});case"group":return ne({flags:t});case"lookahead":case"lookbehind":return Je({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function hn(t){if(t===void 0)t=[Me()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Va(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function qa(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Ha(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function md(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function yd(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function At(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Wa(t,e){let n=e;return Pe(t,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Ka(t){return Pe(t,"Unclosed group")}function lt(t,e,n=null){function r(i,o){for(let a=0;a<i.length;a++){let l=s(i[a],o,a,i);a=Math.max(-1,a+l)}}function s(i,o=null,a=null,l=null){let c=0,u=!1,f={node:i,parent:o,key:a,container:l,root:t,remove(){Ir(l).splice(Math.max(0,Nt(a)+c),1),c--,u=!0},removeAllNextSiblings(){return Ir(l).splice(Nt(a)+1)},removeAllPrevSiblings(){let y=Nt(a)+c;return c-=y,Ir(l).splice(0,Math.max(0,y))},replaceWith(y,b={}){let w=!!b.traverse;l?l[Math.max(0,Nt(a)+c)]=y:Pe(o,"Can't replace root node")[a]=y,w&&s(y,o,a,l),u=!0},replaceWithMultiple(y,b={}){let w=!!b.traverse;if(Ir(l).splice(Math.max(0,Nt(a)+c),1,...y),c+=y.length-1,w){let S=0;for(let C=0;C<y.length;C++)S+=s(y[C],o,Nt(a)+C+S,l)}u=!0},skip(){u=!0}},{type:d}=i,h=e["*"],p=e[d],g=typeof h=="function"?h:h?.enter,m=typeof p=="function"?p:p?.enter;if(g?.(f,n),m?.(f,n),!u)switch(d){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(i.min,i,"min"),s(i.max,i,"max");break;case"Quantifier":s(i.body,i,"body");break;case"Regex":r(i.body,i),s(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return p?.exit?.(f,n),h?.exit?.(f,n),c}return s(t),t}function Ir(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function Nt(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}var za=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Ja(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function Ya(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}var Z=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function pn(t,e,n,r){let s=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1],o=0,a="";for(let l of t.matchAll(s)){let{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===Z.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?Z.CHAR_CLASS:Z.DEFAULT,negated:i[i.length-1]}):a+=n;continue}c[0]==="["?(o++,i.push(c[1]==="^")):c==="]"&&o&&(o--,i.pop()),a+=c}return a}function zs(t,e,n,r){pn(t,e,n,r)}function bd(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;let s=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let i=0,o;for(;o=s.exec(t);){let{0:a,groups:{$skip:l}}=o;if(!l&&(!r||r===Z.DEFAULT==!i))return o;a==="["?i++:a==="]"&&i&&i--,s.lastIndex==o.index&&s.lastIndex++}return null}function gn(t,e,n){return!!bd(t,e,0,n)}function Qa(t,e){let n=/\\?./gsu;n.lastIndex=e;let r=t.length,s=0,i=1,o;for(;o=n.exec(t);){let[a]=o;if(a==="[")s++;else if(s)a==="]"&&s--;else if(a==="(")i++;else if(a===")"&&(i--,!i)){r=o.index;break}}return t.slice(e,r)}var Xa=new RegExp(String.raw`(?<noncapturingStart>${za})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Ys(t,e){let n=e?.hiddenCaptures??[],r=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};let s="(?>",i="(?:(?=(",o=[0],a=[],l=0,c=0,u=NaN,f;do{f=!1;let d=0,h=0,p=!1,g;for(Xa.lastIndex=Number.isNaN(u)?0:u+i.length;g=Xa.exec(t);){let{0:m,index:y,groups:{capturingStart:b,noncapturingStart:w}}=g;if(m==="[")d++;else if(d)m==="]"&&d--;else if(m===s&&!p)u=y,p=!0;else if(p&&w)h++;else if(b)p?h++:(l++,o.push(l+c));else if(m===")"&&p){if(!h){c++;let S=l+c;if(t=`${t.slice(0,u)}${i}${t.slice(u+s.length,y)}))<$$${S}>)${t.slice(y+1)}`,f=!0,a.push(S),Ja(n,S),r.size){let C=new Map;r.forEach((E,x)=>{C.set(x>=S?x+1:x,E.map(_=>_>=S?_+1:_))}),r=C}break}h--}}}while(f);return n.push(...a),t=pn(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:h,wrappedBackrefNum:p}})=>{if(h){let g=+h;if(g>o.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${o[g]}`}return`\\${p}`},Z.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}var Za=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Js=new RegExp(String.raw`
177
+ \\(?: \d+
178
+ | c[A-Za-z]
179
+ | [gk]<[^>]+>
180
+ | [pPu]\{[^\}]+\}
181
+ | u[A-Fa-f\d]{4}
182
+ | x[A-Fa-f\d]{2}
183
+ )
184
+ | \((?: \? (?: [:=!>]
185
+ | <(?:[=!]|[^>]+>)
186
+ | [A-Za-z\-]+:
187
+ | \(DEFINE\)
188
+ ))?
189
+ | (?<qBase>${Za})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
190
+ | \\?.
191
+ `.replace(/\s+/g,""),"gsu");function Qs(t){if(!new RegExp(`${Za}\\+`).test(t))return{pattern:t};let e=[],n=null,r=null,s="",i=0,o;for(Js.lastIndex=0;o=Js.exec(t);){let{0:a,index:l,groups:{qBase:c,qMod:u,invalidQ:f}}=o;if(a==="[")i||(r=l),i++;else if(a==="]")i?i--:r=null;else if(!i)if(u==="+"&&s&&!s.startsWith("(")){if(f)throw new Error(`Invalid quantifier "${a}"`);let d=-1;if(/^\{\d+\}$/.test(c))t=Ya(t,l+c.length,u,"");else{if(s===")"||s==="]"){let h=s===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${s}"`);t=`${t.slice(0,h)}(?>${t.slice(h,l)}${c})${t.slice(l+a.length)}`}else t=`${t.slice(0,l-s.length)}(?>${s}${c})${t.slice(l+a.length)}`;d+=4}Js.lastIndex+=d}else a[0]==="("?e.push(l):a===")"&&(n=e.length?e.pop():null);s=a}return{pattern:t}}var le=String.raw,wd=le`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Zs=le`\(\?R=(?<rDepth>[^\)]+)\)|${wd}`,Tr=le`\(\?<(?![=!])(?<captureName>[^>]+)>`,sl=le`${Tr}|(?<unnamed>\()(?!\?)`,ct=new RegExp(le`${Tr}|${Zs}|\(\?|\\?.`,"gsu"),Xs="Cannot use multiple overlapping recursions";function il(t,e){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e},s=e?.captureTransfers??new Map;if(!new RegExp(Zs,"su").test(t))return{pattern:t,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&gn(t,le`\(\?\(DEFINE\)`,Z.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let i=[],o=gn(t,le`\\[1-9]`,Z.DEFAULT),a=new Map,l=[],c=!1,u=0,f=0,d;for(ct.lastIndex=0;d=ct.exec(t);){let{0:h,groups:{captureName:p,rDepth:g,gRNameOrNum:m,gRDepth:y}}=d;if(h==="[")u++;else if(u)h==="]"&&u--;else if(g){if(el(g),c)throw new Error(Xs);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let b=t.slice(0,d.index),w=t.slice(ct.lastIndex);if(gn(w,Zs,Z.DEFAULT))throw new Error(Xs);let S=+g-1;t=tl(b,w,S,!1,n,i,f),s=rl(s,b,S,i.length,0,f);break}else if(m){el(y);let b=!1;for(let O of l)if(O.name===m||O.num===+m){if(b=!0,O.hasRecursedWithin)throw new Error(Xs);break}if(!b)throw new Error(le`Recursive \g cannot be used outside the referenced group "${r==="external"?m:le`\g<${m}&R=${y}>`}"`);let w=a.get(m),S=Qa(t,w);if(o&&gn(S,le`${Tr}|\((?!\?)`,Z.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let C=t.slice(w,d.index),E=S.slice(C.length+h.length),x=i.length,_=+y-1,$=tl(C,E,_,!0,n,i,f);s=rl(s,C,_,i.length-x,x,f);let re=t.slice(0,w),ye=t.slice(w+S.length);t=`${re}${$}${ye}`,ct.lastIndex+=$.length-h.length-C.length-E.length,l.forEach(O=>O.hasRecursedWithin=!0),c=!0}else if(p)f++,a.set(String(f),ct.lastIndex),a.set(p,ct.lastIndex),l.push({num:f,name:p});else if(h[0]==="("){let b=h==="(";b&&(f++,a.set(String(f),ct.lastIndex)),l.push(b?{num:f}:{})}else h===")"&&l.pop()}return n.push(...i),{pattern:t,captureTransfers:s,hiddenCaptures:n}}function el(t){let e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function tl(t,e,n,r,s,i,o){let a=new Set;r&&zs(t+e,Tr,({groups:{captureName:c}})=>{a.add(c)},Z.DEFAULT);let l=[n,r?a:null,s,i,o];return`${t}${nl(`(?:${t}`,"forward",...l)}(?:)${nl(`${e})`,"backward",...l)}${e}`}function nl(t,e,n,r,s,i,o){let l=u=>e==="forward"?u+2:n-u+2-1,c="";for(let u=0;u<n;u++){let f=l(u);c+=pn(t,le`${sl}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:h,unnamed:p,backref:g}})=>{if(g&&r&&!r.has(g))return d;let m=`_$${f}`;if(p||h){let y=o+i.length+1;return i.push(y),kd(s,y),p?d:`(?<${h}${m}>`}return le`\k<${g}${m}>`},Z.DEFAULT)}return c}function kd(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function rl(t,e,n,r,s,i){if(t.size&&r){let o=0;zs(e,sl,()=>o++,Z.DEFAULT);let a=i-o+s,l=new Map;return t.forEach((c,u)=>{let f=(r-o*n)/n,d=o*n,h=u>a+o?u+r:u,p=[];for(let g of c)if(g<=a)p.push(g);else if(g>a+o+f)p.push(g+r);else if(g<=a+o)for(let m=0;m<=n;m++)p.push(g+o*m);else for(let m=0;m<=n;m++)p.push(g+d+f*m);l.set(h,p)}),l}return t}var H=String.fromCodePoint,N=String.raw,me={},Br=globalThis.RegExp;me.flagGroups=(()=>{try{new Br("(?i:)")}catch{return!1}return!0})();me.unicodeSets=(()=>{try{new Br("[[]]","v")}catch{return!1}return!0})();me.bugFlagVLiteralHyphenIsRange=me.unicodeSets?(()=>{try{new Br(N`[\d\-a]`,"v")}catch{return!0}return!1})():!1;me.bugNestedClassIgnoresNegation=me.unicodeSets&&new Br("[[^a]]","v").test("a");function Lr(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function mn(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function si(t,e){return ol[t]>=ol[e]}function Sd(t,e){if(t==null)throw new Error(e??"Value expected");return t}var ol={ES2025:2025,ES2024:2024,ES2018:2018},Cd={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function fl(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!Cd[t.target])throw new Error(`Unexpected target "${t.target}"`);let e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=me.flagGroups?"ES2025":me.unicodeSets?"ES2024":"ES2018"),e}var _d="[ -\r ]",vd=new Set([H(304),H(305)]),Fe=N`[\p{L}\p{M}\p{N}\p{Pc}]`;function dl(t){if(vd.has(t))return[t];let e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),s=Nd.get(n),i=Ed.get(n),o=Ad.get(n);return[...r].length===1&&e.add(r),o&&e.add(o),s&&e.add(s),e.add(n),i&&e.add(i),[...e]}var oi=new Map(`C Other
192
+ Cc Control cntrl
193
+ Cf Format
194
+ Cn Unassigned
195
+ Co Private_Use
196
+ Cs Surrogate
197
+ L Letter
198
+ LC Cased_Letter
199
+ Ll Lowercase_Letter
200
+ Lm Modifier_Letter
201
+ Lo Other_Letter
202
+ Lt Titlecase_Letter
203
+ Lu Uppercase_Letter
204
+ M Mark Combining_Mark
205
+ Mc Spacing_Mark
206
+ Me Enclosing_Mark
207
+ Mn Nonspacing_Mark
208
+ N Number
209
+ Nd Decimal_Number digit
210
+ Nl Letter_Number
211
+ No Other_Number
212
+ P Punctuation punct
213
+ Pc Connector_Punctuation
214
+ Pd Dash_Punctuation
215
+ Pe Close_Punctuation
216
+ Pf Final_Punctuation
217
+ Pi Initial_Punctuation
218
+ Po Other_Punctuation
219
+ Ps Open_Punctuation
220
+ S Symbol
221
+ Sc Currency_Symbol
222
+ Sk Modifier_Symbol
223
+ Sm Math_Symbol
224
+ So Other_Symbol
225
+ Z Separator
226
+ Zl Line_Separator
227
+ Zp Paragraph_Separator
228
+ Zs Space_Separator
229
+ ASCII
230
+ ASCII_Hex_Digit AHex
231
+ Alphabetic Alpha
232
+ Any
233
+ Assigned
234
+ Bidi_Control Bidi_C
235
+ Bidi_Mirrored Bidi_M
236
+ Case_Ignorable CI
237
+ Cased
238
+ Changes_When_Casefolded CWCF
239
+ Changes_When_Casemapped CWCM
240
+ Changes_When_Lowercased CWL
241
+ Changes_When_NFKC_Casefolded CWKCF
242
+ Changes_When_Titlecased CWT
243
+ Changes_When_Uppercased CWU
244
+ Dash
245
+ Default_Ignorable_Code_Point DI
246
+ Deprecated Dep
247
+ Diacritic Dia
248
+ Emoji
249
+ Emoji_Component EComp
250
+ Emoji_Modifier EMod
251
+ Emoji_Modifier_Base EBase
252
+ Emoji_Presentation EPres
253
+ Extended_Pictographic ExtPict
254
+ Extender Ext
255
+ Grapheme_Base Gr_Base
256
+ Grapheme_Extend Gr_Ext
257
+ Hex_Digit Hex
258
+ IDS_Binary_Operator IDSB
259
+ IDS_Trinary_Operator IDST
260
+ ID_Continue IDC
261
+ ID_Start IDS
262
+ Ideographic Ideo
263
+ Join_Control Join_C
264
+ Logical_Order_Exception LOE
265
+ Lowercase Lower
266
+ Math
267
+ Noncharacter_Code_Point NChar
268
+ Pattern_Syntax Pat_Syn
269
+ Pattern_White_Space Pat_WS
270
+ Quotation_Mark QMark
271
+ Radical
272
+ Regional_Indicator RI
273
+ Sentence_Terminal STerm
274
+ Soft_Dotted SD
275
+ Terminal_Punctuation Term
276
+ Unified_Ideograph UIdeo
277
+ Uppercase Upper
278
+ Variation_Selector VS
279
+ White_Space space
280
+ XID_Continue XIDC
281
+ XID_Start XIDS`.split(/\s/).map(t=>[At(t),t])),Ed=new Map([["s",H(383)],[H(383),"s"]]),Ad=new Map([[H(223),H(7838)],[H(107),H(8490)],[H(229),H(8491)],[H(969),H(8486)]]),Nd=new Map([Ye(453),Ye(456),Ye(459),Ye(498),...ei(8072,8079),...ei(8088,8095),...ei(8104,8111),Ye(8124),Ye(8140),Ye(8188)]),xd=new Map([["alnum",N`[\p{Alpha}\p{Nd}]`],["alpha",N`\p{Alpha}`],["ascii",N`\p{ASCII}`],["blank",N`[\p{Zs}\t]`],["cntrl",N`\p{Cc}`],["digit",N`\p{Nd}`],["graph",N`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",N`\p{Lower}`],["print",N`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",N`[\p{P}\p{S}]`],["space",N`\p{space}`],["upper",N`\p{Upper}`],["word",N`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",N`\p{AHex}`]]);function Id(t,e){let n=[];for(let r=t;r<=e;r++)n.push(r);return n}function Ye(t){let e=H(t);return[e.toLowerCase(),e]}function ei(t,e){return Id(t,e).map(n=>Ye(n))}var hl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Td(t,e){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};pl(t);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:si(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};lt(t,Ld,r);let s={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},i={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};lt(t,Bd,i);let o={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return lt(t,Od,o),t._originMap=i.groupOriginByCopy,t._strategy=r.strategy,t}var Ld={AbsenceFunction({node:t,parent:e,replaceWith:n}){let{body:r,kind:s}=t;if(s==="repeater"){let i=ne();i.body[0].body.push(Je({negate:!0,body:r}),at("Any"));let o=ne();o.body[0].body.push(Ks("greedy",0,1/0,i)),n(j(o,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){let s=t.body.filter(i=>i.kind==="flags");for(let i=n+1;i<e.body.length;i++){let o=e.body[i];mn(r,o,[]).push(...s)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){let n=ml(e.get(t));if(n){let r=ne({flags:n});r.body[0].body=t.body,t.body=[j(r,t)]}}}},Assertion({node:t,parent:e,key:n,container:r,root:s,remove:i,replaceWith:o},a){let{kind:l,negate:c}=t,{asciiWordBoundaries:u,avoidSubclass:f,supportedGNodes:d,wordIsAscii:h}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")o(j(Je({body:[Me({body:[Nr("string_end")]}),Me({body:[Et(10)]})]}),e));else if(l==="line_start")o(j(De(N`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(l==="search_start")if(d.has(t))s.flags.sticky=!0,i();else{let p=r[n-1];if(p&&Dd(p))o(j(Je({negate:!0}),e));else{if(f)throw new Error(N`Uses "\G" in a way that requires a subclass`);o(Qe(Nr("string_start"),e)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")o(j(De(N`(?=\n?\z)`),e));else if(l==="word_boundary"){if(!h&&!u){let p=`(?:(?<=${Fe})(?!${Fe})|(?<!${Fe})(?=${Fe}))`,g=`(?:(?<=${Fe})(?=${Fe})|(?<!${Fe})(?!${Fe}))`;o(j(De(c?g:p),e))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ni(n)&&(n=ti(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:r}=t;r&&!ni(r)&&(r=ti(r,e),t.name=r),n.set(t.number,t),r&&n.set(r,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){let r=dn({body:[t]});n(j(r,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:i,spaceIsAscii:o,wordIsAscii:a}){let{kind:l,negate:c,value:u}=t;if(i&&(l==="digit"||u==="digit")){n(Qe(xr("digit",{negate:c}),e));return}if(o&&(l==="space"||u==="space")){n(j(ri(De(_d),c),e));return}if(a&&(l==="word"||u==="word")){n(Qe(xr("word",{negate:c}),e));return}if(l==="any")n(Qe(at("Any"),e));else if(l==="digit")n(Qe(at("Nd",{negate:c}),e));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(N`Use of "\X" requires non-strict accuracy`);let f="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=N`\p{RI}{2}|${f}(?:\u200D${f})*`;n(j(De(N`(?>\r\n|${s?N`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(l==="hex")n(Qe(at("AHex",{negate:c}),e));else if(l==="newline")n(j(De(c?`[^
282
+ ]`:`(?>\r
283
+ ?|[
284
+ \v\f\x85\u2028\u2029])`),e));else if(l==="posix")if(!s&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let f={graph:"!-~",print:" -~"}[u];c&&(f=`\0-${H(f.codePointAt(0)-1)}${H(f.codePointAt(2)+1)}-\u{10FFFF}`),n(j(De(`[${f}]`),e))}else n(j(ri(De(xd.get(u)),c),e));else if(l==="property")oi.has(At(u))||(t.key="sc");else if(l==="space")n(Qe(at("space",{negate:c}),e));else if(l==="word")n(j(ri(De(Fe),c),e));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:i,removeAllNextSiblings:o}){let{kind:a,flags:l}=t;if(a==="flags")if(!l.enable&&!l.disable)r();else{let c=ne({flags:l});c.body[0].body=o(),s(j(c,e),{traverse:!0})}else if(a==="keep"){let c=n.body[0],f=n.body.length===1&&vr(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(e.parent!==f||f.body.length>1)throw new Error(N`Uses "\K" in a way that's unsupported`);let d=Je({behind:!0});d.body[0].body=i(),s(j(d,e))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;let{enable:e,disable:n}=t.flags;e?.extended&&delete e.extended,n?.extended&&delete n.extended,e?.dotAll&&n?.dotAll&&delete e.dotAll,e?.ignoreCase&&n?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){let{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){let{kind:r}=t;if(r==="fail")n(j(Je({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){let e=ne();e.body[0].body.push(t.body),t.body=j(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){let n=[],r=!1,s=!1;for(let i of t.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{let o=bl(i.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):s=!0}r&&!s&&n.forEach(i=>e.add(i))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(N`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!ni(n)&&(n=ti(n,e),t.ref=n)}},Bd={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){let{orphan:r,ref:s}=t;r||n.set(t,[...e.get(s).map(({node:i})=>i)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:i,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){let c=s.get(t);if(c&&a.has(t.number)){let f=Qe(al(t.number),e);l.set(f,a.get(t.number)),n(f);return}a.set(t.number,t),o.set(t.number,[]),t.name&&mn(o,t.name,[]);let u=o.get(t.name??t.number);for(let f=0;f<u.length;f++){let d=u[f];if(c===d.node||c&&c===d.origin||t===d.origin){u.splice(f,1);break}}if(o.get(t.number).push({node:t,origin:c}),t.name&&o.get(t.name).push({node:t,origin:c}),t.name){let f=mn(i,t.name,new Map),d=!1;if(c)d=!0;else for(let h of f.values())if(!h.hasDuplicateNameToRemove){d=!0;break}i.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:d})}},exit({node:t},{openRefs:e}){e.get(t.number)===t&&e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Lr(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},r){let{isRecursive:s,ref:i}=t;if(s){let u=e;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===i||u.number===i)););r.reffedNodesByReferencer.set(t,u);return}let o=r.subroutineRefMap.get(i),a=i===0,l=a?al(0):gl(o,r.groupOriginByCopy,null),c=l;if(!a){let u=ml($d(o,d=>d.type==="Group"&&!!d.flags)),f=u?Lr(r.globalFlags,u):r.globalFlags;Rd(f,r.currentFlags)||(c=ne({flags:Md(f)}),c.body[0].body.push(l))}n(j(c,e),{traverse:!a})}},Od={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}let i=r.reffedNodesByReferencer.get(t).filter(o=>Pd(o,t));if(!i.length)n(j(Je({negate:!0}),e));else if(i.length>1){let o=ne({atomic:!0,body:i.reverse().map(a=>Me({body:[Er(a.number)]}))});n(j(o,e))}else t.ref=i[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){let n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r<n;r++){let s=Ws();t.body.at(-1).body.push(s)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function pl(t){lt(t,{"*"({node:e,parent:n}){e.parent=n}})}function Rd(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function Pd(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;let r=yl(n.parent);for(let s of r){if(s===n)break;if(s===t||wl(s,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function gl(t,e,n,r){let s=Array.isArray(t)?[]:{};for(let[i,o]of Object.entries(t))i==="parent"?s.parent=Array.isArray(n)?r:n:o&&typeof o=="object"?s[i]=gl(o,e,s,n):(i==="type"&&o==="CapturingGroup"&&e.set(s,e.get(t)??t),s[i]=o);return s}function al(t){let e=Vs(t);return e.isRecursive=!0,e}function $d(t,e){let n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function ti(t,e){if(e.has(t))return e.get(t);let n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function ml(t){let e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:r})=>{e.forEach(s=>{r.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),r.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Md({dotAll:t,ignoreCase:e}){let n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function yl(t){if(!t)throw new Error("Node expected");let{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function bl(t){let e=t.find(n=>n.kind==="search_start"||Gd(n,{negate:!1})||!Fd(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){let n=[];for(let r of e.body){let s=bl(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function wl(t,e){let n=yl(t)??[];for(let r of n)if(r===e||wl(r,e))return!0;return!1}function Fd({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function Dd(t){let e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function Gd(t,e){let n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&vr(t.body[0],{type:"Assertion",kind:"search_start"})}function ni(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function De(t,e){let r=Ar(t,{...e,unicodePropertyMap:oi}).body;return r.length>1||r[0].body.length>1?ne({body:r}):r[0].body[0]}function ri(t,e){return t.negate=e,t}function Qe(t,e){return t.parent=e,t}function j(t,e){return pl(t),t.parent=e,t}function jd(t,e){let n=fl(e),r=si(n.target,"ES2024"),s=si(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!s){let h=[t.flags.ignoreCase];lt(t,Ud,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(p){h.push(p)},setHasCasedChar(){h.at(-1)?o=!0:a=!0}})}let l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!a)},c=t,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!s&&o&&a),useFlagMods:s,useFlagV:r,verbose:n.verbose};function f(h){return u.lastNode=c,c=h,Sd(qd[h.type],`Unexpected node type "${h.type}"`)(h,u,f)}let d={pattern:t.body.map(f).join("|"),flags:f(t.flags),options:{...t.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],u.captureMap.forEach((h,p)=>{h.hidden&&d._hiddenCaptures.push(p),h.transferTo&&mn(d._captureTransfers,h.transferTo,[]).push(p)}),d}var Ud={"*":{enter({node:t},e){if(cl(t)){let n=e.getCurrentModI();e.pushModI(t.flags?Lr({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){cl(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){ai(H(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),kl(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&hl.has(t.value)&&e.setHasCasedChar()}},qd={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?N`\B`:N`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){let{body:r,name:s,number:i}=t,o={ignoreCase:e.currentFlags.ignoreCase},a=e.originMap.get(t);return a&&(o.hidden=!0,i>a.number&&(o.transferTo=a.number)),e.captureMap.set(i,o),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:t},e){let n=H(t),r=xt(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&ai(n)){let s=dl(n);return e.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(t,e,n){let{kind:r,negate:s,parent:i}=t,{body:o}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");me.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some(ul)&&(o=[Et(45),...o.filter(c=>!ul(c))]);let a=()=>`[${s?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||me.bugNestedClassIgnoresNegation)&&!s){let u=o.filter(f=>f.type==="CharacterClass"&&f.kind==="union"&&f.negate);if(u.length){let f=ne(),d=f.body[0];return f.parent=i,d.parent=f,o=o.filter(h=>!u.includes(h)),t.body=o,o.length?(t.parent=d,d.body.push(t)):f.body.pop(),u.forEach(h=>{let p=Me({body:[h]});h.parent=p,p.parent=f,f.body.push(p)}),n(f)}}e.inCharClass=!0;let c=a();return e.inCharClass=!1,c}let l=o[0];if(r==="union"&&!s&&l&&((!e.useFlagV||!e.verbose)&&i.kind==="union"&&!(me.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&i.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(n).join("");if(!e.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(t,e){let n=t.min.value,r=t.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},i=xt(n,s),o=xt(r,s),a=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){let l=kl(t);zd(l).forEach(u=>{a.add(Array.isArray(u)?`${xt(u[0],s)}-${xt(u[1],s)}`:xt(u,s))})}return`${i}-${o}${[...a].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},s){if(t==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":N`[^\n]`;if(t==="digit")return e?N`\D`:N`\d`;if(t==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&hl.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?N`\P`:N`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?N`\W`:N`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:r},s,i){let o=s.currentFlags;n&&(s.currentFlags=Lr(o,n));let a=e.map(i).join("|"),l=!s.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!s.useFlagMods||!n)?a:`(?${Jd(t,n,s.useFlagMods)}${a})`;return s.currentFlags=o,l},LookaroundAssertion({body:t,kind:e,negate:n},r,s){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(s).join("|")})`},Quantifier(t,e,n){return n(t.body)+Yd(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return e===0?`(?R=${r})`:N`\g<${e}&R=${r}>`}},Hd=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Wd=new Set(["-","\\","]","^","["]),Kd=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ll=new Map([[9,N`\t`],[10,N`\n`],[11,N`\v`],[12,N`\f`],[13,N`\r`],[8232,N`\u2028`],[8233,N`\u2029`],[65279,N`\uFEFF`]]),Vd=/^\p{Cased}$/u;function ai(t){return Vd.test(t)}function kl(t,e){let n=!!e?.firstOnly,r=t.min.value,s=t.max.value,i=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return i;for(let o=r;o<=s;o++){let a=H(o);if(!ai(a))continue;let l=dl(a).filter(c=>{let u=c.codePointAt(0);return u<r||u>s});if(l.length&&(i.push(...l),n))break}return i}function xt(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(ll.has(t))return ll.get(t);if(t<32||t>126&&t<160||t>262143||e&&Qd(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;let s=n?r?Kd:Wd:Hd,i=H(t);return(s.has(i)?"\\":"")+i}function zd(t){let e=t.map(s=>s.codePointAt(0)).sort((s,i)=>s-i),n=[],r=null;for(let s=0;s<e.length;s++)e[s+1]===e[s]+1?r??=e[s]:r===null?n.push(e[s]):(n.push([r,e[s]]),r=null);return n}function Jd(t,e,n){if(t)return">";let r="";if(e&&n){let{enable:s,disable:i}=e;r=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(i?"-":"")+(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")}return`${r}:`}function Yd({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function cl({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Qd(t){return t>47&&t<58}function ul({type:t,value:e}){return t==="Character"&&e===45}var Xd=class ii extends RegExp{#t=new Map;#e=null;#r;#n=null;#s=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(e,n,r){let s=!!r?.lazyCompile;if(e instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let i=e;super(i,n),this.#r=i.source,i instanceof ii&&(this.#t=i.#t,this.#n=i.#n,this.#s=i.#s,this.rawOptions=i.rawOptions)}else{let i={hiddenCaptures:[],strategy:null,transfers:[],...r};super(s?"":e,n),this.#r=e,this.#t=eh(i.hiddenCaptures,i.transfers),this.#s=i.strategy,this.rawOptions=r??{}}s||(this.#e=this)}exec(e){if(!this.#e){let{lazyCompile:s,...i}=this.rawOptions;this.#e=new ii(this.#r,this.flags,i)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#s==="clip_search"&&n&&r){this.lastIndex=0;let s=this.#i(e.slice(r));return s&&(Zd(s,r,e,this.hasIndices),this.lastIndex+=r),s}return this.#i(e)}#i(e){this.#e.lastIndex=this.lastIndex;let n=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;let r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);let i=[0];for(let o=1;o<r.length;o++){let{hidden:a,transferTo:l}=this.#t.get(o)??{};if(a?i.push(null):(i.push(n.length),n.push(r[o]),this.hasIndices&&n.indices.push(s[o])),l&&r[o]!==void 0){let c=i[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[o],this.hasIndices&&(n.indices[c]=s[o]),n.groups){this.#n||(this.#n=th(this.source));let u=this.#n.get(l);u&&(n.groups[u]=r[o],this.hasIndices&&(n.indices.groups[u]=s[o]))}}}return n}};function Zd(t,e,n,r){if(t.index+=e,t.input=n,r){let s=t.indices;for(let o=0;o<s.length;o++){let a=s[o];a&&(s[o]=[a[0]+e,a[1]+e])}let i=s.groups;i&&Object.keys(i).forEach(o=>{let a=i[o];a&&(i[o]=[a[0]+e,a[1]+e])})}}function eh(t,e){let n=new Map;for(let r of t)n.set(r,{hidden:!0});for(let[r,s]of e)for(let i of s)mn(n,i,{}).transferTo=r;return n}function th(t){let e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,s=0,i;for(;i=e.exec(t);){let{0:o,groups:{capture:a,name:l}}=i;o==="["?r++:r?o==="]"&&r--:a&&(s++,l&&n.set(s,l))}return n}function Sl(t,e){let n=nh(t,e);return n.options?new Xd(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function nh(t,e){let n=fl(e),r=Ar(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:oi}),s=Td(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=jd(s,n),o=il(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),a=Qs(o.pattern),l=Ys(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let u=l.hiddenCaptures.sort((p,g)=>p-g),f=Array.from(l.captureTransfers),d=s._strategy,h=c.pattern.length>=n.lazyCompileLength;(u.length||f.length||d||h)&&(c.options={...u.length&&{hiddenCaptures:u},...f.length&&{transfers:f},...d&&{strategy:d},...h&&{lazyCompile:h}})}return c}function Cl(t,e){return Sl(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function li(t={}){let e={target:"auto",cache:new Map,...t};return e.regexConstructor||=n=>Cl(n,{target:e.target}),{createScanner(n){return new xa(n,e)},createString:Ia}}var ih,Nl,xl=()=>ih??=JSON.parse(document.getElementById("code-grammars")?.textContent??"[]"),ci=t=>{let e=t?.closest("#panel")?document.documentElement.dataset.editorTheme:t?.closest("[data-theme]")?.dataset.theme??document.documentElement.dataset.theme;return e==="dark"||(!e||e==="auto")&&matchMedia("(prefers-color-scheme: dark)").matches?"github-dark":"github-light"},Il=async(t,e,n)=>{if(t.length>1e5||t.split(`
285
+ `).some(s=>s.length>1e4))return[];let r=xl().find(s=>s.name===e||s.aliases?.includes(e));return r?(Nl??=Aa({langs:xl(),themes:[Promise.resolve().then(()=>(vl(),_l)),Promise.resolve().then(()=>(Al(),El))],engine:li()}),(await Nl).codeToTokens(t,{lang:r.name,theme:n??ci()}).tokens):[]};var ui=new WeakMap,Or=()=>{for(let t of document.querySelectorAll(".codeblk")){let e=ci(t),n=t.querySelector("pre code"),r=t.getAttribute("data-lang")??t.querySelector(".codeblk-lang")?.textContent??"";if(!n)continue;let s=n.textContent??"",i=`${e}\0${r}\0${s}`;ui.get(n)!==i&&(ui.set(n,i),Il(s,r,e).then(o=>{!n.isConnected||ui.get(n)!==i||ro(n,s,r,o)}).catch(()=>{}))}};new MutationObserver(Or).observe(document.body,{childList:!0,subtree:!0});new MutationObserver(Or).observe(document.documentElement,{attributeFilter:["data-theme"],subtree:!0});matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Or);Or();})();