zudoku 0.64.1 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.d.ts +91 -1
- package/dist/app/main.js +5 -1
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +15 -46
- package/dist/config/validators/InputNavigationSchema.d.ts +61 -61
- package/dist/config/validators/NavigationSchema.js +2 -4
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +158 -2
- package/dist/config/validators/validate.js +37 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +43 -0
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +22 -0
- package/dist/lib/auth/issuer.js +3 -0
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -1
- package/dist/lib/authentication/providers/auth0.js +6 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.d.ts +4 -0
- package/dist/lib/authentication/providers/firebase.js +215 -0
- package/dist/lib/authentication/providers/firebase.js.map +1 -0
- package/dist/lib/authentication/providers/supabase.js +1 -6
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +24 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +124 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Apple.js +4 -0
- package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
- package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Github.js +4 -0
- package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Google.js +4 -0
- package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
- package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/X.js +4 -0
- package/dist/lib/authentication/ui/icons/X.js.map +1 -0
- package/dist/lib/components/Autocomplete.d.ts +3 -1
- package/dist/lib/components/Autocomplete.js +6 -2
- package/dist/lib/components/Autocomplete.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +6 -6
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/RouterError.d.ts +3 -1
- package/dist/lib/errors/RouterError.js +3 -2
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/parser/index.js +7 -3
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
- package/dist/lib/plugins/openapi/OperationList.js +5 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +3 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +7 -4
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +3 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +25 -4
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js +53 -26
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
- package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
- package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +13 -0
- package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
- package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +56 -28
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +20 -13
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
- package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +5 -14
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +3 -3
- package/dist/lib/ui/Badge.js +9 -7
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Button.js +1 -0
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -2
- package/dist/lib/ui/Checkbox.js +4 -4
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Collapsible.d.ts +4 -4
- package/dist/lib/ui/Collapsible.js +11 -4
- package/dist/lib/ui/Collapsible.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/EmbeddedCodeBlock.d.ts +0 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/lib/ui/Frame.d.ts +8 -0
- package/dist/lib/ui/Frame.js +22 -0
- package/dist/lib/ui/Frame.js.map +1 -0
- package/dist/lib/ui/Item.d.ts +23 -0
- package/dist/lib/ui/Item.js +67 -0
- package/dist/lib/ui/Item.js.map +1 -0
- package/dist/lib/ui/NativeSelect.d.ts +5 -0
- package/dist/lib/ui/NativeSelect.js +14 -0
- package/dist/lib/ui/NativeSelect.js.map +1 -0
- package/dist/lib/ui/Select.d.ts +13 -11
- package/dist/lib/ui/Select.js +34 -23
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Separator.d.ts +4 -0
- package/dist/lib/ui/Separator.js +8 -0
- package/dist/lib/ui/Separator.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -7
- package/dist/lib/ui/Tooltip.js +16 -10
- package/dist/lib/ui/Tooltip.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +5 -2
- package/dist/lib/util/createVariantComponent.js +5 -2
- package/dist/lib/util/createVariantComponent.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +4 -0
- package/dist/lib/util/flattenAllOf.js +65 -0
- package/dist/lib/util/flattenAllOf.js.map +1 -0
- package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
- package/dist/lib/util/flattenAllOf.test.js +532 -0
- package/dist/lib/util/flattenAllOf.test.js.map +1 -0
- package/dist/lib/util/readFrontmatter.d.ts +6 -0
- package/dist/lib/util/readFrontmatter.js +12 -0
- package/dist/lib/util/readFrontmatter.js.map +1 -0
- package/dist/vite/api/SchemaManager.js +6 -18
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/mdx/remark-last-modified.js +57 -3
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-frontmatter.js +3 -5
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +3 -4
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +10 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/lib/{Button-DmS4u8Lj.js → Button-B3ucvvQw.js} +7 -6
- package/lib/Button-B3ucvvQw.js.map +1 -0
- package/lib/{ErrorAlert-DE3Sf66a.js → ErrorAlert-BOVgwTRP.js} +2832 -2857
- package/lib/ErrorAlert-BOVgwTRP.js.map +1 -0
- package/lib/{MdxPage-DZfeC0QY.js → MdxPage-CBYFyqUs.js} +6 -6
- package/lib/{MdxPage-DZfeC0QY.js.map → MdxPage-CBYFyqUs.js.map} +1 -1
- package/lib/{OAuthErrorPage-BycMozgn.js → OAuthErrorPage-DlTYnbLO.js} +4 -4
- package/lib/{OAuthErrorPage-BycMozgn.js.map → OAuthErrorPage-DlTYnbLO.js.map} +1 -1
- package/lib/{OasProvider-1XEOsIiW.js → OasProvider-DIPAQ79S.js} +2 -2
- package/lib/{OasProvider-1XEOsIiW.js.map → OasProvider-DIPAQ79S.js.map} +1 -1
- package/lib/OperationList-BOTFIfda.js +5688 -0
- package/lib/OperationList-BOTFIfda.js.map +1 -0
- package/lib/{Pagination-CJszmeSA.js → Pagination-BOZ9Pxcw.js} +2 -2
- package/lib/{Pagination-CJszmeSA.js.map → Pagination-BOZ9Pxcw.js.map} +1 -1
- package/lib/RouteGuard-Brz95MSt.js +77 -0
- package/lib/RouteGuard-Brz95MSt.js.map +1 -0
- package/lib/RouterError-DQS_bMwf.js +42 -0
- package/lib/RouterError-DQS_bMwf.js.map +1 -0
- package/lib/{SchemaList-qOHkDzSz.js → SchemaList-Bu95q_q2.js} +7 -7
- package/lib/{SchemaList-qOHkDzSz.js.map → SchemaList-Bu95q_q2.js.map} +1 -1
- package/lib/SchemaView-CaxK_HV4.js +586 -0
- package/lib/SchemaView-CaxK_HV4.js.map +1 -0
- package/lib/Select-DFRCS31-.js +399 -0
- package/lib/Select-DFRCS31-.js.map +1 -0
- package/lib/{SignUp-6SGx9Yyq.js → SignUp-CfB278ao.js} +2 -2
- package/lib/{SignUp-6SGx9Yyq.js.map → SignUp-CfB278ao.js.map} +1 -1
- package/lib/{SyntaxHighlight-zvlnSnHB.js → SyntaxHighlight-C19vH0V_.js} +525 -509
- package/lib/SyntaxHighlight-C19vH0V_.js.map +1 -0
- package/lib/{Toc-Da9yp7lo.js → Toc-DQIqdghO.js} +2 -2
- package/lib/{Toc-Da9yp7lo.js.map → Toc-DQIqdghO.js.map} +1 -1
- package/lib/{circular-CSSuz-LS.js → circular-B-_VyILZ.js} +6360 -5953
- package/lib/circular-B-_VyILZ.js.map +1 -0
- package/lib/{createServer-CLbcVLbK.js → createServer-C5lXk4ba.js} +4732 -4273
- package/lib/createServer-C5lXk4ba.js.map +1 -0
- package/lib/{errors-CuGgh3hf.js → errors-DqoyOKev.js} +2 -2
- package/lib/{errors-CuGgh3hf.js.map → errors-DqoyOKev.js.map} +1 -1
- package/lib/index-B7yD7ZUk.js +3680 -0
- package/lib/index-B7yD7ZUk.js.map +1 -0
- package/lib/{index-rYHsvtTo.js → index-BG79m3lF.js} +2 -2
- package/lib/{index-rYHsvtTo.js.map → index-BG79m3lF.js.map} +1 -1
- package/lib/{index-B1rmok4X.js → index-DHDtI9H5.js} +3 -3
- package/lib/{index-B1rmok4X.js.map → index-DHDtI9H5.js.map} +1 -1
- package/lib/ui/ActionButton.js +1 -1
- package/lib/ui/Badge.js +27 -13
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Button.js +6 -5
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Checkbox.js +29 -26
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +7 -7
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/Collapsible.js +32 -5
- package/lib/ui/Collapsible.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +26 -25
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Frame.js +81 -0
- package/lib/ui/Frame.js.map +1 -0
- package/lib/ui/Item.js +188 -0
- package/lib/ui/Item.js.map +1 -0
- package/lib/ui/NativeSelect.js +57 -0
- package/lib/ui/NativeSelect.js.map +1 -0
- package/lib/ui/Select.js +166 -116
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Separator.js +27 -0
- package/lib/ui/Separator.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +1 -1
- package/lib/ui/Tabs.js +10 -10
- package/lib/ui/Tooltip.js +55 -28
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/zudoku.__internal.js +345 -345
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +7 -7
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +3 -3
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.auth-supabase.js +30 -33
- package/lib/zudoku.auth-supabase.js.map +1 -1
- package/lib/zudoku.components.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +2 -2
- package/package.json +18 -13
- package/src/app/main.css +1 -1
- package/src/app/main.tsx +5 -1
- package/src/lib/auth/issuer.ts +3 -0
- package/src/lib/authentication/authentication.ts +1 -1
- package/src/lib/authentication/providers/auth0.tsx +6 -1
- package/src/lib/authentication/providers/firebase.tsx +284 -0
- package/src/lib/authentication/providers/supabase.tsx +2 -7
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +335 -0
- package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
- package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
- package/src/lib/authentication/ui/icons/Github.tsx +16 -0
- package/src/lib/authentication/ui/icons/Google.tsx +16 -0
- package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
- package/src/lib/authentication/ui/icons/X.tsx +10 -0
- package/src/lib/components/Autocomplete.tsx +11 -2
- package/src/lib/components/Layout.tsx +3 -2
- package/src/lib/components/navigation/NavigationItem.tsx +7 -20
- package/src/lib/core/RouteGuard.tsx +8 -8
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/errors/RouterError.tsx +7 -2
- package/src/lib/oas/parser/index.ts +8 -3
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
- package/src/lib/plugins/openapi/OperationList.tsx +7 -0
- package/src/lib/plugins/openapi/OperationListItem.tsx +10 -7
- package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
- package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +81 -33
- package/src/lib/plugins/openapi/Sidecar.tsx +129 -65
- package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
- package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
- package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
- package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
- package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
- package/src/lib/plugins/openapi/interfaces.ts +12 -0
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
- package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
- package/src/lib/plugins/openapi/playground/Playground.tsx +73 -35
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
- package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
- package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +82 -53
- package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
- package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +5 -15
- package/src/lib/ui/Badge.tsx +21 -12
- package/src/lib/ui/Button.tsx +1 -0
- package/src/lib/ui/Checkbox.tsx +23 -24
- package/src/lib/ui/CodeBlock.tsx +3 -4
- package/src/lib/ui/Collapsible.tsx +26 -4
- package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -19
- package/src/lib/ui/Frame.tsx +81 -0
- package/src/lib/ui/Item.tsx +192 -0
- package/src/lib/ui/NativeSelect.tsx +47 -0
- package/src/lib/ui/Select.tsx +153 -126
- package/src/lib/ui/Separator.tsx +25 -0
- package/src/lib/ui/Tooltip.tsx +54 -32
- package/src/lib/util/createVariantComponent.tsx +31 -5
- package/src/lib/util/flattenAllOf.test.ts +637 -0
- package/src/lib/util/flattenAllOf.ts +101 -0
- package/src/lib/util/readFrontmatter.ts +13 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
- package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
- package/lib/Button-DmS4u8Lj.js.map +0 -1
- package/lib/ErrorAlert-DE3Sf66a.js.map +0 -1
- package/lib/OperationList-DCJw6wXL.js +0 -5450
- package/lib/OperationList-DCJw6wXL.js.map +0 -1
- package/lib/RouteGuard-DhU3LRr1.js +0 -81
- package/lib/RouteGuard-DhU3LRr1.js.map +0 -1
- package/lib/RouterError-VDLnrFqF.js +0 -41
- package/lib/RouterError-VDLnrFqF.js.map +0 -1
- package/lib/SchemaView-D3hm65cc.js +0 -458
- package/lib/SchemaView-D3hm65cc.js.map +0 -1
- package/lib/Select-C1DeCqKv.js +0 -372
- package/lib/Select-C1DeCqKv.js.map +0 -1
- package/lib/SyntaxHighlight-zvlnSnHB.js.map +0 -1
- package/lib/circular-CSSuz-LS.js.map +0 -1
- package/lib/createServer-CLbcVLbK.js.map +0 -1
- package/lib/index-RNAxx6IF.js +0 -3364
- package/lib/index-RNAxx6IF.js.map +0 -1
- package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
|
@@ -5,11 +5,11 @@ import { c as Ir } from "./cn-dYga0KKN.js";
|
|
|
5
5
|
import { g as ls, i as us } from "./invariant-Bm-FVUQE.js";
|
|
6
6
|
import { CodeBlock as cs } from "./ui/CodeBlock.js";
|
|
7
7
|
import { EmbeddedCodeBlock as hs } from "./ui/EmbeddedCodeBlock.js";
|
|
8
|
-
function rh() {
|
|
9
|
-
}
|
|
10
8
|
function oh() {
|
|
11
9
|
}
|
|
12
|
-
function sh(
|
|
10
|
+
function sh() {
|
|
11
|
+
}
|
|
12
|
+
function ah(t) {
|
|
13
13
|
const e = [], n = String(t || "");
|
|
14
14
|
let r = n.indexOf(","), o = 0, s = !1;
|
|
15
15
|
for (; !s; ) {
|
|
@@ -1199,7 +1199,7 @@ function vs(t) {
|
|
|
1199
1199
|
return t.charAt(1).toUpperCase();
|
|
1200
1200
|
}
|
|
1201
1201
|
const xs = Lr([$r, ys, Or, Dr, Gr], "html"), fn = Lr([$r, bs, Or, Dr, Gr], "svg");
|
|
1202
|
-
function
|
|
1202
|
+
function ch(t) {
|
|
1203
1203
|
const e = String(t || "").trim();
|
|
1204
1204
|
return e ? e.split(/[ \t\n\r\f]+/g) : [];
|
|
1205
1205
|
}
|
|
@@ -1211,7 +1211,7 @@ function Es() {
|
|
|
1211
1211
|
if ($n) return Rt;
|
|
1212
1212
|
$n = 1;
|
|
1213
1213
|
var t = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, e = /\n/g, n = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, o = /^:\s*/, s = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, a = /^[;\s]*/, i = /^\s+|\s+$/g, l = `
|
|
1214
|
-
`, u = "/", c = "*", h = "",
|
|
1214
|
+
`, u = "/", c = "*", h = "", f = "comment", d = "declaration";
|
|
1215
1215
|
Rt = function(g, C) {
|
|
1216
1216
|
if (typeof g != "string")
|
|
1217
1217
|
throw new TypeError("First argument must be a string");
|
|
@@ -1265,7 +1265,7 @@ function Es() {
|
|
|
1265
1265
|
return D("End of comment missing");
|
|
1266
1266
|
var G = g.slice(2, k - 2);
|
|
1267
1267
|
return m += 2, _(G), g = g.slice(k), m += 2, R({
|
|
1268
|
-
type:
|
|
1268
|
+
type: f,
|
|
1269
1269
|
comment: G
|
|
1270
1270
|
});
|
|
1271
1271
|
}
|
|
@@ -1276,8 +1276,8 @@ function Es() {
|
|
|
1276
1276
|
if (ee(), !L(o)) return D("property missing ':'");
|
|
1277
1277
|
var G = L(s), Te = R({
|
|
1278
1278
|
type: d,
|
|
1279
|
-
property:
|
|
1280
|
-
value: G ?
|
|
1279
|
+
property: p(k[0].replace(t, h)),
|
|
1280
|
+
value: G ? p(G[0].replace(t, h)) : h
|
|
1281
1281
|
});
|
|
1282
1282
|
return L(a), Te;
|
|
1283
1283
|
}
|
|
@@ -1291,7 +1291,7 @@ function Es() {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return j(), te();
|
|
1293
1293
|
};
|
|
1294
|
-
function
|
|
1294
|
+
function p(g) {
|
|
1295
1295
|
return g ? g.replace(i, h) : h;
|
|
1296
1296
|
}
|
|
1297
1297
|
return Rt;
|
|
@@ -1363,7 +1363,7 @@ function jr(t) {
|
|
|
1363
1363
|
};
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function hh(t) {
|
|
1367
1367
|
const e = Br(t), n = Ps(t);
|
|
1368
1368
|
if (e && n)
|
|
1369
1369
|
return { start: e, end: n };
|
|
@@ -1855,13 +1855,13 @@ function ia(t, e, n, r) {
|
|
|
1855
1855
|
typeof h.name == "string" ? h.name : void 0
|
|
1856
1856
|
)
|
|
1857
1857
|
);
|
|
1858
|
-
Object.defineProperty(
|
|
1858
|
+
Object.defineProperty(f, "name", {
|
|
1859
1859
|
value: "node (" + (l.type + (d ? "<" + d + ">" : "")) + ")"
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
|
-
return
|
|
1863
|
-
function
|
|
1864
|
-
let d = qr,
|
|
1862
|
+
return f;
|
|
1863
|
+
function f() {
|
|
1864
|
+
let d = qr, p, g, C;
|
|
1865
1865
|
if ((!e || s(l, u, c[c.length - 1] || void 0)) && (d = la(n(l, c)), d[0] === Fn))
|
|
1866
1866
|
return d;
|
|
1867
1867
|
if ("children" in l && l.children) {
|
|
@@ -1872,9 +1872,9 @@ function ia(t, e, n, r) {
|
|
|
1872
1872
|
if (y.children && d[0] !== aa)
|
|
1873
1873
|
for (g = (r ? y.children.length : -1) + a, C = c.concat(y); g > -1 && g < y.children.length; ) {
|
|
1874
1874
|
const m = y.children[g];
|
|
1875
|
-
if (
|
|
1876
|
-
return
|
|
1877
|
-
g = typeof
|
|
1875
|
+
if (p = i(m, g, C)(), p[0] === Fn)
|
|
1876
|
+
return p;
|
|
1877
|
+
g = typeof p[1] == "number" ? p[1] : g + a;
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
1880
|
return d;
|
|
@@ -2151,8 +2151,8 @@ function ma(t) {
|
|
|
2151
2151
|
if (typeof a.settings.fontStyle == "string") {
|
|
2152
2152
|
l = 0;
|
|
2153
2153
|
let h = a.settings.fontStyle.split(" ");
|
|
2154
|
-
for (let
|
|
2155
|
-
switch (h[
|
|
2154
|
+
for (let f = 0, d = h.length; f < d; f++)
|
|
2155
|
+
switch (h[f]) {
|
|
2156
2156
|
case "italic":
|
|
2157
2157
|
l = l | 1;
|
|
2158
2158
|
break;
|
|
@@ -2171,9 +2171,9 @@ function ma(t) {
|
|
|
2171
2171
|
typeof a.settings.foreground == "string" && Un(a.settings.foreground) && (u = a.settings.foreground);
|
|
2172
2172
|
let c = null;
|
|
2173
2173
|
typeof a.settings.background == "string" && Un(a.settings.background) && (c = a.settings.background);
|
|
2174
|
-
for (let h = 0,
|
|
2175
|
-
let
|
|
2176
|
-
|
|
2174
|
+
for (let h = 0, f = i.length; h < f; h++) {
|
|
2175
|
+
let p = i[h].trim().split(" "), g = p[p.length - 1], C = null;
|
|
2176
|
+
p.length > 1 && (C = p.slice(0, p.length - 1), C.reverse()), n[r++] = new ya(
|
|
2177
2177
|
g,
|
|
2178
2178
|
C,
|
|
2179
2179
|
o,
|
|
@@ -2342,8 +2342,8 @@ var wa = class {
|
|
|
2342
2342
|
* A value of `0`, `NotSet` or `null` indicates that the corresponding field should be left as is.
|
|
2343
2343
|
*/
|
|
2344
2344
|
static set(e, n, r, o, s, a, i) {
|
|
2345
|
-
let l = K.getLanguageId(e), u = K.getTokenType(e), c = K.containsBalancedBrackets(e) ? 1 : 0, h = K.getFontStyle(e),
|
|
2346
|
-
return n !== 0 && (l = n), r !== 8 && (u = r), o !== null && (c = o ? 1 : 0), s !== -1 && (h = s), a !== 0 && (
|
|
2345
|
+
let l = K.getLanguageId(e), u = K.getTokenType(e), c = K.containsBalancedBrackets(e) ? 1 : 0, h = K.getFontStyle(e), f = K.getForeground(e), d = K.getBackground(e);
|
|
2346
|
+
return n !== 0 && (l = n), r !== 8 && (u = r), o !== null && (c = o ? 1 : 0), s !== -1 && (h = s), a !== 0 && (f = a), i !== 0 && (d = i), (l << 0 | u << 8 | c << 10 | h << 11 | f << 15 | d << 24) >>> 0;
|
|
2347
2347
|
}
|
|
2348
2348
|
};
|
|
2349
2349
|
function lt(t, e) {
|
|
@@ -2848,11 +2848,11 @@ var Xe = class {
|
|
|
2848
2848
|
break;
|
|
2849
2849
|
case 3:
|
|
2850
2850
|
case 4:
|
|
2851
|
-
const h = u.scopeName,
|
|
2851
|
+
const h = u.scopeName, f = u.kind === 4 ? u.ruleName : null, d = n.getExternalGrammar(h, r);
|
|
2852
2852
|
if (d)
|
|
2853
|
-
if (
|
|
2854
|
-
let
|
|
2855
|
-
|
|
2853
|
+
if (f) {
|
|
2854
|
+
let p = d.repository[f];
|
|
2855
|
+
p && (l = U.getCompiledRuleId(p, n, d.repository));
|
|
2856
2856
|
} else
|
|
2857
2857
|
l = U.getCompiledRuleId(d.repository.$self, n, d.repository);
|
|
2858
2858
|
break;
|
|
@@ -3085,10 +3085,10 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3085
3085
|
for (; !u; ) {
|
|
3086
3086
|
if (i !== 0 && Date.now() - h > i)
|
|
3087
3087
|
return new qn(o, !0);
|
|
3088
|
-
|
|
3088
|
+
f();
|
|
3089
3089
|
}
|
|
3090
3090
|
return new qn(o, !1);
|
|
3091
|
-
function
|
|
3091
|
+
function f() {
|
|
3092
3092
|
const d = Fa(
|
|
3093
3093
|
t,
|
|
3094
3094
|
e,
|
|
@@ -3101,18 +3101,18 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3101
3101
|
s.produce(o, l), u = !0;
|
|
3102
3102
|
return;
|
|
3103
3103
|
}
|
|
3104
|
-
const
|
|
3104
|
+
const p = d.captureIndices, g = d.matchedRuleId, C = p && p.length > 0 ? p[0].end > r : !1;
|
|
3105
3105
|
if (g === $a) {
|
|
3106
3106
|
const y = o.getRule(t);
|
|
3107
|
-
s.produce(o,
|
|
3107
|
+
s.produce(o, p[0].start), o = o.withContentNameScopesList(o.nameScopesList), Ge(
|
|
3108
3108
|
t,
|
|
3109
3109
|
e,
|
|
3110
3110
|
n,
|
|
3111
3111
|
o,
|
|
3112
3112
|
s,
|
|
3113
3113
|
y.endCaptures,
|
|
3114
|
-
|
|
3115
|
-
), s.produce(o,
|
|
3114
|
+
p
|
|
3115
|
+
), s.produce(o, p[0].end);
|
|
3116
3116
|
const m = o;
|
|
3117
3117
|
if (o = o.parent, c = m.getAnchorPos(), !C && m.getEnterPos() === r) {
|
|
3118
3118
|
o = m, s.produce(o, l), u = !0;
|
|
@@ -3120,8 +3120,8 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
} else {
|
|
3122
3122
|
const y = t.getRule(g);
|
|
3123
|
-
s.produce(o,
|
|
3124
|
-
const m = o, _ = y.getName(e.content,
|
|
3123
|
+
s.produce(o, p[0].start);
|
|
3124
|
+
const m = o, _ = y.getName(e.content, p), S = o.contentNameScopesList.pushAttributed(
|
|
3125
3125
|
_,
|
|
3126
3126
|
t
|
|
3127
3127
|
);
|
|
@@ -3129,7 +3129,7 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3129
3129
|
g,
|
|
3130
3130
|
r,
|
|
3131
3131
|
c,
|
|
3132
|
-
|
|
3132
|
+
p[0].end === l,
|
|
3133
3133
|
null,
|
|
3134
3134
|
S,
|
|
3135
3135
|
S
|
|
@@ -3142,11 +3142,11 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3142
3142
|
o,
|
|
3143
3143
|
s,
|
|
3144
3144
|
A.beginCaptures,
|
|
3145
|
-
|
|
3146
|
-
), s.produce(o,
|
|
3145
|
+
p
|
|
3146
|
+
), s.produce(o, p[0].end), c = p[0].end;
|
|
3147
3147
|
const D = A.getContentName(
|
|
3148
3148
|
e.content,
|
|
3149
|
-
|
|
3149
|
+
p
|
|
3150
3150
|
), L = S.pushAttributed(
|
|
3151
3151
|
D,
|
|
3152
3152
|
t
|
|
@@ -3154,7 +3154,7 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3154
3154
|
if (o = o.withContentNameScopesList(L), A.endHasBackReferences && (o = o.withEndRule(
|
|
3155
3155
|
A.getEndWithResolvedBackReferences(
|
|
3156
3156
|
e.content,
|
|
3157
|
-
|
|
3157
|
+
p
|
|
3158
3158
|
)
|
|
3159
3159
|
)), !C && m.hasSameRuleAs(o)) {
|
|
3160
3160
|
o = o.pop(), s.produce(o, l), u = !0;
|
|
@@ -3169,11 +3169,11 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3169
3169
|
o,
|
|
3170
3170
|
s,
|
|
3171
3171
|
A.beginCaptures,
|
|
3172
|
-
|
|
3173
|
-
), s.produce(o,
|
|
3172
|
+
p
|
|
3173
|
+
), s.produce(o, p[0].end), c = p[0].end;
|
|
3174
3174
|
const D = A.getContentName(
|
|
3175
3175
|
e.content,
|
|
3176
|
-
|
|
3176
|
+
p
|
|
3177
3177
|
), L = S.pushAttributed(
|
|
3178
3178
|
D,
|
|
3179
3179
|
t
|
|
@@ -3181,7 +3181,7 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3181
3181
|
if (o = o.withContentNameScopesList(L), A.whileHasBackReferences && (o = o.withEndRule(
|
|
3182
3182
|
A.getWhileWithResolvedBackReferences(
|
|
3183
3183
|
e.content,
|
|
3184
|
-
|
|
3184
|
+
p
|
|
3185
3185
|
)
|
|
3186
3186
|
)), !C && m.hasSameRuleAs(o)) {
|
|
3187
3187
|
o = o.pop(), s.produce(o, l), u = !0;
|
|
@@ -3194,13 +3194,13 @@ function lo(t, e, n, r, o, s, a, i) {
|
|
|
3194
3194
|
o,
|
|
3195
3195
|
s,
|
|
3196
3196
|
y.captures,
|
|
3197
|
-
|
|
3198
|
-
), s.produce(o,
|
|
3197
|
+
p
|
|
3198
|
+
), s.produce(o, p[0].end), o = o.pop(), !C) {
|
|
3199
3199
|
o = o.safePop(), s.produce(o, l), u = !0;
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
3202
3202
|
}
|
|
3203
|
-
|
|
3203
|
+
p[0].end > r && (r = p[0].end, n = !1);
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
3206
|
function Ga(t, e, n, r, o, s) {
|
|
@@ -3250,15 +3250,15 @@ function Ba(t, e, n, r, o, s) {
|
|
|
3250
3250
|
function ja(t, e, n, r, o, s, a) {
|
|
3251
3251
|
let i = Number.MAX_VALUE, l = null, u, c = 0;
|
|
3252
3252
|
const h = s.contentNameScopesList.getScopeNames();
|
|
3253
|
-
for (let
|
|
3254
|
-
const
|
|
3255
|
-
if (!
|
|
3253
|
+
for (let f = 0, d = t.length; f < d; f++) {
|
|
3254
|
+
const p = t[f];
|
|
3255
|
+
if (!p.matcher(h))
|
|
3256
3256
|
continue;
|
|
3257
|
-
const g = e.getRule(
|
|
3257
|
+
const g = e.getRule(p.ruleId), { ruleScanner: C, findOptions: y } = uo(g, e, null, r, o === a), m = C.findNextMatchSync(n, o, y);
|
|
3258
3258
|
if (!m)
|
|
3259
3259
|
continue;
|
|
3260
3260
|
const _ = m.captureIndices[0].start;
|
|
3261
|
-
if (!(_ >= i) && (i = _, l = m.captureIndices, u = m.ruleId, c =
|
|
3261
|
+
if (!(_ >= i) && (i = _, l = m.captureIndices, u = m.ruleId, c = p.priority, i === o))
|
|
3262
3262
|
break;
|
|
3263
3263
|
}
|
|
3264
3264
|
return l ? {
|
|
@@ -3286,8 +3286,8 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3286
3286
|
return;
|
|
3287
3287
|
const i = e.content, l = Math.min(s.length, a.length), u = [], c = a[0].end;
|
|
3288
3288
|
for (let h = 0; h < l; h++) {
|
|
3289
|
-
const
|
|
3290
|
-
if (
|
|
3289
|
+
const f = s[h];
|
|
3290
|
+
if (f === null)
|
|
3291
3291
|
continue;
|
|
3292
3292
|
const d = a[h];
|
|
3293
3293
|
if (d.length === 0)
|
|
@@ -3296,8 +3296,8 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3296
3296
|
break;
|
|
3297
3297
|
for (; u.length > 0 && u[u.length - 1].endPos <= d.start; )
|
|
3298
3298
|
o.produceFromScopes(u[u.length - 1].scopes, u[u.length - 1].endPos), u.pop();
|
|
3299
|
-
if (u.length > 0 ? o.produceFromScopes(u[u.length - 1].scopes, d.start) : o.produce(r, d.start),
|
|
3300
|
-
const g =
|
|
3299
|
+
if (u.length > 0 ? o.produceFromScopes(u[u.length - 1].scopes, d.start) : o.produce(r, d.start), f.retokenizeCapturedWithRuleId) {
|
|
3300
|
+
const g = f.getName(i, a), C = r.contentNameScopesList.pushAttributed(g, t), y = f.getContentName(i, a), m = C.pushAttributed(y, t), _ = r.push(f.retokenizeCapturedWithRuleId, d.start, -1, !1, null, C, m), S = t.createOnigString(i.substring(0, d.end));
|
|
3301
3301
|
lo(
|
|
3302
3302
|
t,
|
|
3303
3303
|
S,
|
|
@@ -3311,9 +3311,9 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3311
3311
|
), ro(S);
|
|
3312
3312
|
continue;
|
|
3313
3313
|
}
|
|
3314
|
-
const
|
|
3315
|
-
if (
|
|
3316
|
-
const C = (u.length > 0 ? u[u.length - 1].scopes : r.contentNameScopesList).pushAttributed(
|
|
3314
|
+
const p = f.getName(i, a);
|
|
3315
|
+
if (p !== null) {
|
|
3316
|
+
const C = (u.length > 0 ? u[u.length - 1].scopes : r.contentNameScopesList).pushAttributed(p, t);
|
|
3317
3317
|
u.push(new za(C, d.end));
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
@@ -3497,13 +3497,13 @@ var Va = class {
|
|
|
3497
3497
|
c.fontStyle,
|
|
3498
3498
|
c.foregroundId,
|
|
3499
3499
|
c.backgroundId
|
|
3500
|
-
),
|
|
3500
|
+
), f = this.getRule(this._rootId).getName(
|
|
3501
3501
|
null,
|
|
3502
3502
|
null
|
|
3503
3503
|
);
|
|
3504
3504
|
let d;
|
|
3505
|
-
|
|
3506
|
-
|
|
3505
|
+
f ? d = Fe.createRootAndLookUpScopeName(
|
|
3506
|
+
f,
|
|
3507
3507
|
h,
|
|
3508
3508
|
this
|
|
3509
3509
|
) : d = Fe.createRoot(
|
|
@@ -6075,23 +6075,23 @@ function dl(t, e, n, r, o = "css-vars") {
|
|
|
6075
6075
|
explanation: t.explanation,
|
|
6076
6076
|
offset: t.offset
|
|
6077
6077
|
}, a = e.map((c) => pt(t.variants[c])), i = new Set(a.flatMap((c) => Object.keys(c))), l = {}, u = (c, h) => {
|
|
6078
|
-
const
|
|
6079
|
-
return n + e[c] + (h === "color" ? "" :
|
|
6078
|
+
const f = h === "color" ? "" : h === "background-color" ? "-bg" : `-${h}`;
|
|
6079
|
+
return n + e[c] + (h === "color" ? "" : f);
|
|
6080
6080
|
};
|
|
6081
6081
|
return a.forEach((c, h) => {
|
|
6082
|
-
for (const
|
|
6083
|
-
const d = c[
|
|
6084
|
-
if (h === 0 && r && hl.includes(
|
|
6082
|
+
for (const f of i) {
|
|
6083
|
+
const d = c[f] || "inherit";
|
|
6084
|
+
if (h === 0 && r && hl.includes(f))
|
|
6085
6085
|
if (r === _n && a.length > 1) {
|
|
6086
|
-
const
|
|
6087
|
-
if (
|
|
6086
|
+
const p = e.findIndex((m) => m === "light"), g = e.findIndex((m) => m === "dark");
|
|
6087
|
+
if (p === -1 || g === -1)
|
|
6088
6088
|
throw new F('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
6089
|
-
const C = a[
|
|
6090
|
-
l[
|
|
6089
|
+
const C = a[p][f] || "inherit", y = a[g][f] || "inherit";
|
|
6090
|
+
l[f] = `light-dark(${C}, ${y})`, o === "css-vars" && (l[u(h, f)] = d);
|
|
6091
6091
|
} else
|
|
6092
|
-
l[
|
|
6092
|
+
l[f] = d;
|
|
6093
6093
|
else
|
|
6094
|
-
o === "css-vars" && (l[u(h,
|
|
6094
|
+
o === "css-vars" && (l[u(h, f)] = d);
|
|
6095
6095
|
}
|
|
6096
6096
|
}), s.htmlStyle = l, s;
|
|
6097
6097
|
}
|
|
@@ -6235,19 +6235,19 @@ function yl() {
|
|
|
6235
6235
|
const r = e(this), o = Array.from(n.children).filter((c) => c.type === "element" && c.tagName === "span");
|
|
6236
6236
|
if (o.length !== r.converter.lines.length)
|
|
6237
6237
|
throw new F(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);
|
|
6238
|
-
function s(c, h,
|
|
6239
|
-
const
|
|
6238
|
+
function s(c, h, f, d) {
|
|
6239
|
+
const p = o[c];
|
|
6240
6240
|
let g = "", C = -1, y = -1;
|
|
6241
|
-
if (h === 0 && (C = 0),
|
|
6242
|
-
for (let _ = 0; _ <
|
|
6243
|
-
g += Ro(
|
|
6241
|
+
if (h === 0 && (C = 0), f === 0 && (y = 0), f === Number.POSITIVE_INFINITY && (y = p.children.length), C === -1 || y === -1)
|
|
6242
|
+
for (let _ = 0; _ < p.children.length; _++)
|
|
6243
|
+
g += Ro(p.children[_]), C === -1 && g.length === h && (C = _ + 1), y === -1 && g.length === f && (y = _ + 1);
|
|
6244
6244
|
if (C === -1)
|
|
6245
6245
|
throw new F(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);
|
|
6246
6246
|
if (y === -1)
|
|
6247
6247
|
throw new F(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);
|
|
6248
|
-
const m =
|
|
6249
|
-
if (!d.alwaysWrap && m.length ===
|
|
6250
|
-
i(
|
|
6248
|
+
const m = p.children.slice(C, y);
|
|
6249
|
+
if (!d.alwaysWrap && m.length === p.children.length)
|
|
6250
|
+
i(p, d, "line");
|
|
6251
6251
|
else if (!d.alwaysWrap && m.length === 1 && m[0].type === "element")
|
|
6252
6252
|
i(m[0], d, "token");
|
|
6253
6253
|
else {
|
|
@@ -6257,30 +6257,30 @@ function yl() {
|
|
|
6257
6257
|
properties: {},
|
|
6258
6258
|
children: m
|
|
6259
6259
|
};
|
|
6260
|
-
i(_, d, "wrapper"),
|
|
6260
|
+
i(_, d, "wrapper"), p.children.splice(C, m.length, _);
|
|
6261
6261
|
}
|
|
6262
6262
|
}
|
|
6263
6263
|
function a(c, h) {
|
|
6264
6264
|
o[c] = i(o[c], h, "line");
|
|
6265
6265
|
}
|
|
6266
|
-
function i(c, h,
|
|
6267
|
-
const d = h.properties || {},
|
|
6266
|
+
function i(c, h, f) {
|
|
6267
|
+
const d = h.properties || {}, p = h.transform || ((g) => g);
|
|
6268
6268
|
return c.tagName = h.tagName || "span", c.properties = {
|
|
6269
6269
|
...c.properties,
|
|
6270
6270
|
...d,
|
|
6271
6271
|
class: c.properties.class
|
|
6272
|
-
}, h.properties?.class && Eo(c, h.properties.class), c =
|
|
6272
|
+
}, h.properties?.class && Eo(c, h.properties.class), c = p(c, f) || c, c;
|
|
6273
6273
|
}
|
|
6274
6274
|
const l = [], u = r.decorations.sort((c, h) => h.start.offset - c.start.offset || c.end.offset - h.end.offset);
|
|
6275
6275
|
for (const c of u) {
|
|
6276
|
-
const { start: h, end:
|
|
6277
|
-
if (h.line ===
|
|
6278
|
-
s(h.line, h.character,
|
|
6279
|
-
else if (h.line <
|
|
6276
|
+
const { start: h, end: f } = c;
|
|
6277
|
+
if (h.line === f.line)
|
|
6278
|
+
s(h.line, h.character, f.character, c);
|
|
6279
|
+
else if (h.line < f.line) {
|
|
6280
6280
|
s(h.line, h.character, Number.POSITIVE_INFINITY, c);
|
|
6281
|
-
for (let d = h.line + 1; d <
|
|
6281
|
+
for (let d = h.line + 1; d < f.line; d++)
|
|
6282
6282
|
l.unshift(() => a(d, c));
|
|
6283
|
-
s(
|
|
6283
|
+
s(f.line, 0, f.character, c);
|
|
6284
6284
|
}
|
|
6285
6285
|
}
|
|
6286
6286
|
l.forEach((c) => c());
|
|
@@ -6540,33 +6540,49 @@ function xl(t = vl) {
|
|
|
6540
6540
|
value: a
|
|
6541
6541
|
};
|
|
6542
6542
|
}
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6543
|
+
const El = {
|
|
6544
|
+
black: "#000000",
|
|
6545
|
+
red: "#cd3131",
|
|
6546
|
+
green: "#0DBC79",
|
|
6547
|
+
yellow: "#E5E510",
|
|
6548
|
+
blue: "#2472C8",
|
|
6549
|
+
magenta: "#BC3FBC",
|
|
6550
|
+
cyan: "#11A8CD",
|
|
6551
|
+
white: "#E5E5E5",
|
|
6552
|
+
brightBlack: "#666666",
|
|
6553
|
+
brightRed: "#F14C4C",
|
|
6554
|
+
brightGreen: "#23D18B",
|
|
6555
|
+
brightYellow: "#F5F543",
|
|
6556
|
+
brightBlue: "#3B8EEA",
|
|
6557
|
+
brightMagenta: "#D670D6",
|
|
6558
|
+
brightCyan: "#29B8DB",
|
|
6559
|
+
brightWhite: "#FFFFFF"
|
|
6560
|
+
};
|
|
6561
|
+
function Al(t, e, n) {
|
|
6562
|
+
const r = ft(t, n), o = St(e), s = Object.fromEntries(
|
|
6563
|
+
de.map((l) => {
|
|
6564
|
+
const u = `terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`, c = t.colors?.[u];
|
|
6565
|
+
return [l, c || El[l]];
|
|
6566
|
+
})
|
|
6567
|
+
), a = xl(s), i = kl();
|
|
6552
6568
|
return o.map(
|
|
6553
|
-
(
|
|
6554
|
-
let
|
|
6555
|
-
|
|
6556
|
-
let
|
|
6557
|
-
return
|
|
6558
|
-
content:
|
|
6559
|
-
offset:
|
|
6569
|
+
(l) => i.parse(l[0]).map((u) => {
|
|
6570
|
+
let c, h;
|
|
6571
|
+
u.decorations.has("reverse") ? (c = u.background ? a.value(u.background) : t.bg, h = u.foreground ? a.value(u.foreground) : t.fg) : (c = u.foreground ? a.value(u.foreground) : t.fg, h = u.background ? a.value(u.background) : void 0), c = ue(c, r), h = ue(h, r), u.decorations.has("dim") && (c = Rl(c));
|
|
6572
|
+
let f = z.None;
|
|
6573
|
+
return u.decorations.has("bold") && (f |= z.Bold), u.decorations.has("italic") && (f |= z.Italic), u.decorations.has("underline") && (f |= z.Underline), u.decorations.has("strikethrough") && (f |= z.Strikethrough), {
|
|
6574
|
+
content: u.value,
|
|
6575
|
+
offset: l[1],
|
|
6560
6576
|
// TODO: more accurate offset? might need to fork ansi-sequence-parser
|
|
6561
|
-
color:
|
|
6562
|
-
bgColor:
|
|
6563
|
-
fontStyle:
|
|
6577
|
+
color: c,
|
|
6578
|
+
bgColor: h,
|
|
6579
|
+
fontStyle: f
|
|
6564
6580
|
};
|
|
6565
6581
|
})
|
|
6566
6582
|
);
|
|
6567
6583
|
}
|
|
6568
|
-
function
|
|
6569
|
-
const e = t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);
|
|
6584
|
+
function Rl(t) {
|
|
6585
|
+
const e = t.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/i);
|
|
6570
6586
|
if (e)
|
|
6571
6587
|
if (e[3]) {
|
|
6572
6588
|
const r = Math.round(Number.parseInt(e[3], 16) / 2).toString(16).padStart(2, "0");
|
|
@@ -6584,7 +6600,7 @@ function Sn(t, e, n = {}) {
|
|
|
6584
6600
|
return St(e).map((l) => [{ content: l[0], offset: l[1] }]);
|
|
6585
6601
|
const { theme: s, colorMap: a } = t.setTheme(o);
|
|
6586
6602
|
if (r === "ansi")
|
|
6587
|
-
return
|
|
6603
|
+
return Al(s, e, n);
|
|
6588
6604
|
const i = t.getLanguage(r);
|
|
6589
6605
|
if (n.grammarState) {
|
|
6590
6606
|
if (n.grammarState.lang !== i.name)
|
|
@@ -6592,9 +6608,9 @@ function Sn(t, e, n = {}) {
|
|
|
6592
6608
|
if (!n.grammarState.themes.includes(s.name))
|
|
6593
6609
|
throw new F(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`);
|
|
6594
6610
|
}
|
|
6595
|
-
return
|
|
6611
|
+
return Nl(e, i, s, a, n);
|
|
6596
6612
|
}
|
|
6597
|
-
function
|
|
6613
|
+
function Il(...t) {
|
|
6598
6614
|
if (t.length === 2)
|
|
6599
6615
|
return We(t[1]);
|
|
6600
6616
|
const [e, n, r = {}] = t, {
|
|
@@ -6612,7 +6628,7 @@ function Rl(...t) {
|
|
|
6612
6628
|
a.name
|
|
6613
6629
|
);
|
|
6614
6630
|
}
|
|
6615
|
-
function
|
|
6631
|
+
function Nl(t, e, n, r, o) {
|
|
6616
6632
|
const s = gt(t, e, n, r, o), a = new Le(
|
|
6617
6633
|
gt(t, e, n, r, o).stateStack,
|
|
6618
6634
|
e.name,
|
|
@@ -6637,15 +6653,15 @@ function gt(t, e, n, r, o) {
|
|
|
6637
6653
|
}
|
|
6638
6654
|
).stateStack : Zt, c = [];
|
|
6639
6655
|
const h = [];
|
|
6640
|
-
for (let
|
|
6641
|
-
const [
|
|
6642
|
-
if (
|
|
6656
|
+
for (let f = 0, d = l.length; f < d; f++) {
|
|
6657
|
+
const [p, g] = l[f];
|
|
6658
|
+
if (p === "") {
|
|
6643
6659
|
c = [], h.push([]);
|
|
6644
6660
|
continue;
|
|
6645
6661
|
}
|
|
6646
|
-
if (a > 0 &&
|
|
6662
|
+
if (a > 0 && p.length >= a) {
|
|
6647
6663
|
c = [], h.push([{
|
|
6648
|
-
content:
|
|
6664
|
+
content: p,
|
|
6649
6665
|
offset: g,
|
|
6650
6666
|
color: "",
|
|
6651
6667
|
fontStyle: 0
|
|
@@ -6653,17 +6669,17 @@ function gt(t, e, n, r, o) {
|
|
|
6653
6669
|
continue;
|
|
6654
6670
|
}
|
|
6655
6671
|
let C, y, m;
|
|
6656
|
-
o.includeExplanation && (C = e.tokenizeLine(
|
|
6657
|
-
const _ = e.tokenizeLine2(
|
|
6672
|
+
o.includeExplanation && (C = e.tokenizeLine(p, u, i), y = C.tokens, m = 0);
|
|
6673
|
+
const _ = e.tokenizeLine2(p, u, i), S = _.tokens.length / 2;
|
|
6658
6674
|
for (let A = 0; A < S; A++) {
|
|
6659
|
-
const D = _.tokens[2 * A], L = A + 1 < S ? _.tokens[2 * A + 2] :
|
|
6675
|
+
const D = _.tokens[2 * A], L = A + 1 < S ? _.tokens[2 * A + 2] : p.length;
|
|
6660
6676
|
if (D === L)
|
|
6661
6677
|
continue;
|
|
6662
6678
|
const j = _.tokens[2 * A + 1], Z = ue(
|
|
6663
6679
|
r[Re.getForeground(j)],
|
|
6664
6680
|
s
|
|
6665
6681
|
), ee = Re.getFontStyle(j), ce = {
|
|
6666
|
-
content:
|
|
6682
|
+
content: p.substring(D, L),
|
|
6667
6683
|
offset: g + D,
|
|
6668
6684
|
color: Z,
|
|
6669
6685
|
fontStyle: ee
|
|
@@ -6691,15 +6707,15 @@ function gt(t, e, n, r, o) {
|
|
|
6691
6707
|
ce.explanation = [];
|
|
6692
6708
|
let R = 0;
|
|
6693
6709
|
for (; D + R < L; ) {
|
|
6694
|
-
const k = y[m], G =
|
|
6710
|
+
const k = y[m], G = p.substring(
|
|
6695
6711
|
k.startIndex,
|
|
6696
6712
|
k.endIndex
|
|
6697
6713
|
);
|
|
6698
6714
|
R += G.length, ce.explanation.push({
|
|
6699
6715
|
content: G,
|
|
6700
|
-
scopes: o.includeExplanation === "scopeName" ?
|
|
6716
|
+
scopes: o.includeExplanation === "scopeName" ? Ll(
|
|
6701
6717
|
k.scopes
|
|
6702
|
-
) :
|
|
6718
|
+
) : Pl(
|
|
6703
6719
|
te,
|
|
6704
6720
|
k.scopes
|
|
6705
6721
|
)
|
|
@@ -6715,16 +6731,16 @@ function gt(t, e, n, r, o) {
|
|
|
6715
6731
|
stateStack: u
|
|
6716
6732
|
};
|
|
6717
6733
|
}
|
|
6718
|
-
function
|
|
6734
|
+
function Ll(t) {
|
|
6719
6735
|
return t.map((e) => ({ scopeName: e }));
|
|
6720
6736
|
}
|
|
6721
|
-
function
|
|
6737
|
+
function Pl(t, e) {
|
|
6722
6738
|
const n = [];
|
|
6723
6739
|
for (let r = 0, o = e.length; r < o; r++) {
|
|
6724
6740
|
const s = e[r];
|
|
6725
6741
|
n[r] = {
|
|
6726
6742
|
scopeName: s,
|
|
6727
|
-
themeMatches:
|
|
6743
|
+
themeMatches: Tl(t, s, e.slice(0, r))
|
|
6728
6744
|
};
|
|
6729
6745
|
}
|
|
6730
6746
|
return n;
|
|
@@ -6732,7 +6748,7 @@ function Ll(t, e) {
|
|
|
6732
6748
|
function nr(t, e) {
|
|
6733
6749
|
return t === e || e.substring(0, t.length) === t && e[t.length] === ".";
|
|
6734
6750
|
}
|
|
6735
|
-
function
|
|
6751
|
+
function $l(t, e, n) {
|
|
6736
6752
|
if (!nr(t[t.length - 1], e))
|
|
6737
6753
|
return !1;
|
|
6738
6754
|
let r = t.length - 2, o = n.length - 1;
|
|
@@ -6740,11 +6756,11 @@ function Pl(t, e, n) {
|
|
|
6740
6756
|
nr(t[r], n[o]) && (r -= 1), o -= 1;
|
|
6741
6757
|
return r === -1;
|
|
6742
6758
|
}
|
|
6743
|
-
function
|
|
6759
|
+
function Tl(t, e, n) {
|
|
6744
6760
|
const r = [];
|
|
6745
6761
|
for (const { selectors: o, settings: s } of t)
|
|
6746
6762
|
for (const a of o)
|
|
6747
|
-
if (
|
|
6763
|
+
if ($l(a, e, n)) {
|
|
6748
6764
|
r.push(s);
|
|
6749
6765
|
break;
|
|
6750
6766
|
}
|
|
@@ -6761,24 +6777,24 @@ function Io(t, e, n) {
|
|
|
6761
6777
|
state: c,
|
|
6762
6778
|
theme: h
|
|
6763
6779
|
};
|
|
6764
|
-
}), s =
|
|
6780
|
+
}), s = Ml(
|
|
6765
6781
|
...o.map((l) => l.tokens)
|
|
6766
6782
|
), a = s[0].map(
|
|
6767
6783
|
(l, u) => l.map((c, h) => {
|
|
6768
|
-
const
|
|
6784
|
+
const f = {
|
|
6769
6785
|
content: c.content,
|
|
6770
6786
|
variants: {},
|
|
6771
6787
|
offset: c.offset
|
|
6772
6788
|
};
|
|
6773
|
-
return "includeExplanation" in n && n.includeExplanation && (
|
|
6789
|
+
return "includeExplanation" in n && n.includeExplanation && (f.explanation = c.explanation), s.forEach((d, p) => {
|
|
6774
6790
|
const {
|
|
6775
6791
|
content: g,
|
|
6776
6792
|
explanation: C,
|
|
6777
6793
|
offset: y,
|
|
6778
6794
|
...m
|
|
6779
6795
|
} = d[u][h];
|
|
6780
|
-
|
|
6781
|
-
}),
|
|
6796
|
+
f.variants[r[p].color] = m;
|
|
6797
|
+
}), f;
|
|
6782
6798
|
})
|
|
6783
6799
|
), i = o[0].state ? new Le(
|
|
6784
6800
|
Object.fromEntries(o.map((l) => [l.theme, l.state?.getInternalStack(l.theme)])),
|
|
@@ -6786,7 +6802,7 @@ function Io(t, e, n) {
|
|
|
6786
6802
|
) : void 0;
|
|
6787
6803
|
return i && kt(a, i), a;
|
|
6788
6804
|
}
|
|
6789
|
-
function
|
|
6805
|
+
function Ml(...t) {
|
|
6790
6806
|
const e = t.map(() => []), n = t.length;
|
|
6791
6807
|
for (let r = 0; r < t[0].length; r++) {
|
|
6792
6808
|
const o = t.map((l) => l[r]), s = e.map(() => []);
|
|
@@ -6816,20 +6832,20 @@ function mt(t, e, n) {
|
|
|
6816
6832
|
defaultColor: u = "light",
|
|
6817
6833
|
cssVariablePrefix: c = "--shiki-",
|
|
6818
6834
|
colorsRendering: h = "css-vars"
|
|
6819
|
-
} = n,
|
|
6820
|
-
if (
|
|
6835
|
+
} = n, f = Object.entries(n.themes).filter((y) => y[1]).map((y) => ({ color: y[0], theme: y[1] })).sort((y, m) => y.color === u ? -1 : m.color === u ? 1 : 0);
|
|
6836
|
+
if (f.length === 0)
|
|
6821
6837
|
throw new F("`themes` option must not be empty");
|
|
6822
6838
|
const d = Io(
|
|
6823
6839
|
t,
|
|
6824
6840
|
e,
|
|
6825
6841
|
n
|
|
6826
6842
|
);
|
|
6827
|
-
if (l = We(d), u && _n !== u && !
|
|
6843
|
+
if (l = We(d), u && _n !== u && !f.find((y) => y.color === u))
|
|
6828
6844
|
throw new F(`\`themes\` option must contain the defaultColor key \`${u}\``);
|
|
6829
|
-
const
|
|
6845
|
+
const p = f.map((y) => t.getTheme(y.theme)), g = f.map((y) => y.color);
|
|
6830
6846
|
s = d.map((y) => y.map((m) => dl(m, g, c, u, h))), l && kt(s, l);
|
|
6831
|
-
const C =
|
|
6832
|
-
o = rr(
|
|
6847
|
+
const C = f.map((y) => ft(y.theme, n));
|
|
6848
|
+
o = rr(f, p, C, c, u, "fg", h), r = rr(f, p, C, c, u, "bg", h), a = `shiki-themes ${p.map((y) => y.name).join(" ")}`, i = u ? void 0 : [o, r].join(";");
|
|
6833
6849
|
} else if ("theme" in n) {
|
|
6834
6850
|
const u = ft(n.theme, n);
|
|
6835
6851
|
s = Sn(
|
|
@@ -6855,11 +6871,11 @@ function rr(t, e, n, r, o, s, a) {
|
|
|
6855
6871
|
const u = ue(e[l][s], n[l]) || "inherit", c = `${r + i.color}${s === "bg" ? "-bg" : ""}:${u}`;
|
|
6856
6872
|
if (l === 0 && o) {
|
|
6857
6873
|
if (o === _n && t.length > 1) {
|
|
6858
|
-
const h = t.findIndex((g) => g.color === "light"),
|
|
6859
|
-
if (h === -1 ||
|
|
6874
|
+
const h = t.findIndex((g) => g.color === "light"), f = t.findIndex((g) => g.color === "dark");
|
|
6875
|
+
if (h === -1 || f === -1)
|
|
6860
6876
|
throw new F('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
6861
|
-
const d = ue(e[h][s], n[h]) || "inherit",
|
|
6862
|
-
return `light-dark(${d}, ${
|
|
6877
|
+
const d = ue(e[h][s], n[h]) || "inherit", p = ue(e[f][s], n[f]) || "inherit";
|
|
6878
|
+
return `light-dark(${d}, ${p});${c}`;
|
|
6863
6879
|
}
|
|
6864
6880
|
return u;
|
|
6865
6881
|
}
|
|
@@ -6873,8 +6889,8 @@ function yt(t, e, n, r = {
|
|
|
6873
6889
|
codeToTokens: (o, s) => mt(t, o, s)
|
|
6874
6890
|
}) {
|
|
6875
6891
|
let o = e;
|
|
6876
|
-
for (const
|
|
6877
|
-
o =
|
|
6892
|
+
for (const p of dt(n))
|
|
6893
|
+
o = p.preprocess?.call(r, o, n) || o;
|
|
6878
6894
|
let {
|
|
6879
6895
|
tokens: s,
|
|
6880
6896
|
fg: a,
|
|
@@ -6885,18 +6901,18 @@ function yt(t, e, n, r = {
|
|
|
6885
6901
|
} = mt(t, o, n);
|
|
6886
6902
|
const {
|
|
6887
6903
|
mergeWhitespaces: h = !0,
|
|
6888
|
-
mergeSameStyleTokens:
|
|
6904
|
+
mergeSameStyleTokens: f = !1
|
|
6889
6905
|
} = n;
|
|
6890
|
-
h === !0 ? s =
|
|
6906
|
+
h === !0 ? s = Dl(s) : h === "never" && (s = Gl(s)), f && (s = Fl(s));
|
|
6891
6907
|
const d = {
|
|
6892
6908
|
...r,
|
|
6893
6909
|
get source() {
|
|
6894
6910
|
return o;
|
|
6895
6911
|
}
|
|
6896
6912
|
};
|
|
6897
|
-
for (const
|
|
6898
|
-
s =
|
|
6899
|
-
return
|
|
6913
|
+
for (const p of dt(n))
|
|
6914
|
+
s = p.tokens?.call(d, s) || s;
|
|
6915
|
+
return Ol(
|
|
6900
6916
|
s,
|
|
6901
6917
|
{
|
|
6902
6918
|
...n,
|
|
@@ -6909,7 +6925,7 @@ function yt(t, e, n, r = {
|
|
|
6909
6925
|
c
|
|
6910
6926
|
);
|
|
6911
6927
|
}
|
|
6912
|
-
function
|
|
6928
|
+
function Ol(t, e, n, r = We(t)) {
|
|
6913
6929
|
const o = dt(e), s = [], a = {
|
|
6914
6930
|
type: "root",
|
|
6915
6931
|
children: []
|
|
@@ -6929,7 +6945,7 @@ function Ml(t, e, n, r = We(t)) {
|
|
|
6929
6945
|
...Object.fromEntries(
|
|
6930
6946
|
Array.from(
|
|
6931
6947
|
Object.entries(e.meta || {})
|
|
6932
|
-
).filter(([
|
|
6948
|
+
).filter(([p]) => !p.startsWith("_"))
|
|
6933
6949
|
)
|
|
6934
6950
|
},
|
|
6935
6951
|
children: []
|
|
@@ -6939,7 +6955,7 @@ function Ml(t, e, n, r = We(t)) {
|
|
|
6939
6955
|
properties: {},
|
|
6940
6956
|
children: s
|
|
6941
6957
|
};
|
|
6942
|
-
const h = [],
|
|
6958
|
+
const h = [], f = {
|
|
6943
6959
|
...n,
|
|
6944
6960
|
structure: i,
|
|
6945
6961
|
addClassToHast: Eo,
|
|
@@ -6965,7 +6981,7 @@ function Ml(t, e, n, r = We(t)) {
|
|
|
6965
6981
|
return h;
|
|
6966
6982
|
}
|
|
6967
6983
|
};
|
|
6968
|
-
if (t.forEach((
|
|
6984
|
+
if (t.forEach((p, g) => {
|
|
6969
6985
|
g && (i === "inline" ? a.children.push({ type: "element", tagName: "br", properties: {}, children: [] }) : i === "classic" && s.push({ type: "text", value: `
|
|
6970
6986
|
` }));
|
|
6971
6987
|
let C = {
|
|
@@ -6974,7 +6990,7 @@ function Ml(t, e, n, r = We(t)) {
|
|
|
6974
6990
|
properties: { class: "line" },
|
|
6975
6991
|
children: []
|
|
6976
6992
|
}, y = 0;
|
|
6977
|
-
for (const m of
|
|
6993
|
+
for (const m of p) {
|
|
6978
6994
|
let _ = {
|
|
6979
6995
|
type: "element",
|
|
6980
6996
|
tagName: "span",
|
|
@@ -6986,28 +7002,28 @@ function Ml(t, e, n, r = We(t)) {
|
|
|
6986
7002
|
const S = rn(m.htmlStyle || pt(m));
|
|
6987
7003
|
S && (_.properties.style = S);
|
|
6988
7004
|
for (const A of o)
|
|
6989
|
-
_ = A?.span?.call(
|
|
7005
|
+
_ = A?.span?.call(f, _, g + 1, y, C, m) || _;
|
|
6990
7006
|
i === "inline" ? a.children.push(_) : i === "classic" && C.children.push(_), y += m.content.length;
|
|
6991
7007
|
}
|
|
6992
7008
|
if (i === "classic") {
|
|
6993
7009
|
for (const m of o)
|
|
6994
|
-
C = m?.line?.call(
|
|
7010
|
+
C = m?.line?.call(f, C, g + 1) || C;
|
|
6995
7011
|
h.push(C), s.push(C);
|
|
6996
7012
|
}
|
|
6997
7013
|
}), i === "classic") {
|
|
6998
|
-
for (const
|
|
6999
|
-
c =
|
|
7014
|
+
for (const p of o)
|
|
7015
|
+
c = p?.code?.call(f, c) || c;
|
|
7000
7016
|
u.children.push(c);
|
|
7001
|
-
for (const
|
|
7002
|
-
u =
|
|
7017
|
+
for (const p of o)
|
|
7018
|
+
u = p?.pre?.call(f, u) || u;
|
|
7003
7019
|
a.children.push(u);
|
|
7004
7020
|
}
|
|
7005
7021
|
let d = a;
|
|
7006
|
-
for (const
|
|
7007
|
-
d =
|
|
7022
|
+
for (const p of o)
|
|
7023
|
+
d = p?.root?.call(f, d) || d;
|
|
7008
7024
|
return r && kt(d, r), d;
|
|
7009
7025
|
}
|
|
7010
|
-
function
|
|
7026
|
+
function Dl(t) {
|
|
7011
7027
|
return t.map((e) => {
|
|
7012
7028
|
const n = [];
|
|
7013
7029
|
let r = "", o = 0;
|
|
@@ -7027,7 +7043,7 @@ function Ol(t) {
|
|
|
7027
7043
|
}), n;
|
|
7028
7044
|
});
|
|
7029
7045
|
}
|
|
7030
|
-
function
|
|
7046
|
+
function Gl(t) {
|
|
7031
7047
|
return t.map((e) => e.flatMap((n) => {
|
|
7032
7048
|
if (n.content.match(/^\s+$/))
|
|
7033
7049
|
return n;
|
|
@@ -7051,7 +7067,7 @@ function Dl(t) {
|
|
|
7051
7067
|
}), i;
|
|
7052
7068
|
}));
|
|
7053
7069
|
}
|
|
7054
|
-
function
|
|
7070
|
+
function Fl(t) {
|
|
7055
7071
|
return t.map((e) => {
|
|
7056
7072
|
const n = [];
|
|
7057
7073
|
for (const r of e) {
|
|
@@ -7065,15 +7081,15 @@ function Gl(t) {
|
|
|
7065
7081
|
return n;
|
|
7066
7082
|
});
|
|
7067
7083
|
}
|
|
7068
|
-
const
|
|
7069
|
-
function
|
|
7084
|
+
const Bl = sl;
|
|
7085
|
+
function jl(t, e, n) {
|
|
7070
7086
|
const r = {
|
|
7071
7087
|
meta: {},
|
|
7072
7088
|
options: n,
|
|
7073
7089
|
codeToHast: (s, a) => yt(t, s, a),
|
|
7074
7090
|
codeToTokens: (s, a) => mt(t, s, a)
|
|
7075
7091
|
};
|
|
7076
|
-
let o =
|
|
7092
|
+
let o = Bl(yt(t, e, n, r));
|
|
7077
7093
|
for (const s of dt(n))
|
|
7078
7094
|
o = s.postprocess?.call(r, o, n) || o;
|
|
7079
7095
|
return o;
|
|
@@ -7149,16 +7165,16 @@ async function Lo(t) {
|
|
|
7149
7165
|
)
|
|
7150
7166
|
)).filter((n) => !!n);
|
|
7151
7167
|
}
|
|
7152
|
-
let
|
|
7153
|
-
function
|
|
7154
|
-
e >
|
|
7168
|
+
let Ul = 3;
|
|
7169
|
+
function zl(t, e = 3) {
|
|
7170
|
+
e > Ul || console.trace(`[SHIKI DEPRECATE]: ${t}`);
|
|
7155
7171
|
}
|
|
7156
7172
|
class ve extends Error {
|
|
7157
7173
|
constructor(e) {
|
|
7158
7174
|
super(e), this.name = "ShikiError";
|
|
7159
7175
|
}
|
|
7160
7176
|
}
|
|
7161
|
-
class
|
|
7177
|
+
class Hl extends Ya {
|
|
7162
7178
|
constructor(e, n, r, o = {}) {
|
|
7163
7179
|
super(e), this._resolver = e, this._themes = n, this._langs = r, this._alias = o, this._themes.map((s) => this.loadTheme(s)), this.loadLanguages(this._langs);
|
|
7164
7180
|
}
|
|
@@ -7245,7 +7261,7 @@ class zl extends Ya {
|
|
|
7245
7261
|
this._langGraph.set(n, this._langMap.get(n));
|
|
7246
7262
|
}
|
|
7247
7263
|
}
|
|
7248
|
-
class
|
|
7264
|
+
class Wl {
|
|
7249
7265
|
_langs = /* @__PURE__ */ new Map();
|
|
7250
7266
|
_scopeToLang = /* @__PURE__ */ new Map();
|
|
7251
7267
|
_injections = /* @__PURE__ */ new Map();
|
|
@@ -7283,12 +7299,12 @@ class Hl {
|
|
|
7283
7299
|
}
|
|
7284
7300
|
}
|
|
7285
7301
|
let De = 0;
|
|
7286
|
-
function
|
|
7302
|
+
function Vl(t) {
|
|
7287
7303
|
De += 1, t.warnings !== !1 && De >= 10 && De % 10 === 0 && console.warn(`[Shiki] ${De} 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.`);
|
|
7288
7304
|
let e = !1;
|
|
7289
7305
|
if (!t.engine)
|
|
7290
7306
|
throw new ve("`engine` option is required for synchronous mode");
|
|
7291
|
-
const n = (t.langs || []).flat(1), r = (t.themes || []).flat(1).map(kn), o = new
|
|
7307
|
+
const n = (t.langs || []).flat(1), r = (t.themes || []).flat(1).map(kn), o = new Wl(t.engine, n), s = new Hl(o, r, n, t.langAlias);
|
|
7292
7308
|
let a;
|
|
7293
7309
|
function i(m) {
|
|
7294
7310
|
C();
|
|
@@ -7322,19 +7338,19 @@ function Wl(t) {
|
|
|
7322
7338
|
function h() {
|
|
7323
7339
|
return C(), s.getLoadedLanguages();
|
|
7324
7340
|
}
|
|
7325
|
-
function
|
|
7341
|
+
function f(...m) {
|
|
7326
7342
|
C(), s.loadLanguages(m.flat(1));
|
|
7327
7343
|
}
|
|
7328
7344
|
async function d(...m) {
|
|
7329
|
-
return
|
|
7345
|
+
return f(await No(m));
|
|
7330
7346
|
}
|
|
7331
|
-
function
|
|
7347
|
+
function p(...m) {
|
|
7332
7348
|
C();
|
|
7333
7349
|
for (const _ of m.flat(1))
|
|
7334
7350
|
s.loadTheme(_);
|
|
7335
7351
|
}
|
|
7336
7352
|
async function g(...m) {
|
|
7337
|
-
return C(),
|
|
7353
|
+
return C(), p(await Lo(m));
|
|
7338
7354
|
}
|
|
7339
7355
|
function C() {
|
|
7340
7356
|
if (e)
|
|
@@ -7350,15 +7366,15 @@ function Wl(t) {
|
|
|
7350
7366
|
getLoadedThemes: c,
|
|
7351
7367
|
getLoadedLanguages: h,
|
|
7352
7368
|
loadLanguage: d,
|
|
7353
|
-
loadLanguageSync:
|
|
7369
|
+
loadLanguageSync: f,
|
|
7354
7370
|
loadTheme: g,
|
|
7355
|
-
loadThemeSync:
|
|
7371
|
+
loadThemeSync: p,
|
|
7356
7372
|
dispose: y,
|
|
7357
7373
|
[Symbol.dispose]: y
|
|
7358
7374
|
};
|
|
7359
7375
|
}
|
|
7360
|
-
async function
|
|
7361
|
-
t.engine ||
|
|
7376
|
+
async function ql(t) {
|
|
7377
|
+
t.engine || zl("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");
|
|
7362
7378
|
const [
|
|
7363
7379
|
e,
|
|
7364
7380
|
n,
|
|
@@ -7368,22 +7384,22 @@ async function Vl(t) {
|
|
|
7368
7384
|
No(t.langs || []),
|
|
7369
7385
|
t.engine
|
|
7370
7386
|
]);
|
|
7371
|
-
return
|
|
7387
|
+
return Vl({
|
|
7372
7388
|
...t,
|
|
7373
7389
|
themes: e,
|
|
7374
7390
|
langs: n,
|
|
7375
7391
|
engine: r
|
|
7376
7392
|
});
|
|
7377
7393
|
}
|
|
7378
|
-
async function
|
|
7379
|
-
const e = await
|
|
7394
|
+
async function Xl(t) {
|
|
7395
|
+
const e = await ql(t);
|
|
7380
7396
|
return {
|
|
7381
|
-
getLastGrammarState: (...n) =>
|
|
7397
|
+
getLastGrammarState: (...n) => Il(e, ...n),
|
|
7382
7398
|
codeToTokensBase: (n, r) => Sn(e, n, r),
|
|
7383
7399
|
codeToTokensWithThemes: (n, r) => Io(e, n, r),
|
|
7384
7400
|
codeToTokens: (n, r) => mt(e, n, r),
|
|
7385
7401
|
codeToHast: (n, r) => yt(e, n, r),
|
|
7386
|
-
codeToHtml: (n, r) =>
|
|
7402
|
+
codeToHtml: (n, r) => jl(e, n, r),
|
|
7387
7403
|
getBundledLanguages: () => ({}),
|
|
7388
7404
|
getBundledThemes: () => ({}),
|
|
7389
7405
|
...e,
|
|
@@ -7393,17 +7409,17 @@ async function ql(t) {
|
|
|
7393
7409
|
function Po(t) {
|
|
7394
7410
|
return "children" in t ? $o(t) : "value" in t ? t.value : "";
|
|
7395
7411
|
}
|
|
7396
|
-
function
|
|
7412
|
+
function Kl(t) {
|
|
7397
7413
|
return t.type === "text" ? t.value : "children" in t ? $o(t) : "";
|
|
7398
7414
|
}
|
|
7399
7415
|
function $o(t) {
|
|
7400
7416
|
let e = -1;
|
|
7401
7417
|
const n = [];
|
|
7402
7418
|
for (; ++e < t.children.length; )
|
|
7403
|
-
n[e] =
|
|
7419
|
+
n[e] = Kl(t.children[e]);
|
|
7404
7420
|
return n.join("");
|
|
7405
7421
|
}
|
|
7406
|
-
const
|
|
7422
|
+
const Yl = {
|
|
7407
7423
|
"tailing-curly-colon": (t, e) => {
|
|
7408
7424
|
const n = Po(e), r = n.match(/(.+)\{:([\w-]+)\}$/);
|
|
7409
7425
|
if (r)
|
|
@@ -7413,7 +7429,7 @@ const Kl = {
|
|
|
7413
7429
|
lang: r.at(2)
|
|
7414
7430
|
};
|
|
7415
7431
|
}
|
|
7416
|
-
}, ir = "language-",
|
|
7432
|
+
}, ir = "language-", Jl = (t, e) => {
|
|
7417
7433
|
const n = e.children[0];
|
|
7418
7434
|
if (!n || n.type !== "element" || n.tagName !== "code" || !n.properties)
|
|
7419
7435
|
return;
|
|
@@ -7426,8 +7442,8 @@ const Kl = {
|
|
|
7426
7442
|
code: Po(n),
|
|
7427
7443
|
meta: n.data?.meta ?? n.properties.metastring?.toString() ?? ""
|
|
7428
7444
|
};
|
|
7429
|
-
},
|
|
7430
|
-
function
|
|
7445
|
+
}, Zl = "language-";
|
|
7446
|
+
function Ql(t, e) {
|
|
7431
7447
|
const {
|
|
7432
7448
|
addLanguageClass: n = !1,
|
|
7433
7449
|
parseMetaString: r,
|
|
@@ -7440,8 +7456,8 @@ function Zl(t, e) {
|
|
|
7440
7456
|
lazy: c = !1,
|
|
7441
7457
|
...h
|
|
7442
7458
|
} = e;
|
|
7443
|
-
function
|
|
7444
|
-
const y = `${d}:${g}:${
|
|
7459
|
+
function f(d, p, g = "", C = {}) {
|
|
7460
|
+
const y = `${d}:${g}:${p}`, m = o?.get(y);
|
|
7445
7461
|
if (m)
|
|
7446
7462
|
return m;
|
|
7447
7463
|
const _ = {
|
|
@@ -7458,13 +7474,13 @@ function Zl(t, e) {
|
|
|
7458
7474
|
{
|
|
7459
7475
|
name: "rehype-shiki:code-language-class",
|
|
7460
7476
|
code(S) {
|
|
7461
|
-
return this.addClassToHast(S, `${
|
|
7477
|
+
return this.addClassToHast(S, `${Zl}${d}`), S;
|
|
7462
7478
|
}
|
|
7463
7479
|
}
|
|
7464
|
-
]), l &&
|
|
7465
|
-
`) && (
|
|
7480
|
+
]), l && p.endsWith(`
|
|
7481
|
+
`) && (p = p.slice(0, -1));
|
|
7466
7482
|
try {
|
|
7467
|
-
const S = t.codeToHast(
|
|
7483
|
+
const S = t.codeToHast(p, _);
|
|
7468
7484
|
return o?.set(y, S), S;
|
|
7469
7485
|
} catch (S) {
|
|
7470
7486
|
if (i)
|
|
@@ -7474,15 +7490,15 @@ function Zl(t, e) {
|
|
|
7474
7490
|
}
|
|
7475
7491
|
}
|
|
7476
7492
|
return (d) => {
|
|
7477
|
-
const
|
|
7493
|
+
const p = [];
|
|
7478
7494
|
if (Xr(d, "element", (g, C, y) => {
|
|
7479
7495
|
let m;
|
|
7480
7496
|
if (!y || C == null)
|
|
7481
7497
|
return;
|
|
7482
7498
|
if (g.tagName === "pre")
|
|
7483
|
-
m =
|
|
7499
|
+
m = Jl;
|
|
7484
7500
|
else if (g.tagName === "code" && u)
|
|
7485
|
-
m =
|
|
7501
|
+
m = Yl[u];
|
|
7486
7502
|
else
|
|
7487
7503
|
return;
|
|
7488
7504
|
const _ = m(d, g);
|
|
@@ -7492,7 +7508,7 @@ function Zl(t, e) {
|
|
|
7492
7508
|
if (_.lang ? t.getLoadedLanguages().includes(_.lang) || xo(_.lang) ? S = _.lang : c ? (A = !0, S = _.lang) : a && (S = a) : S = s, !S)
|
|
7493
7509
|
return;
|
|
7494
7510
|
const D = _.meta ? r?.(_.meta, g, d) : void 0, L = (j) => {
|
|
7495
|
-
const Z =
|
|
7511
|
+
const Z = f(j, _.code, _.meta, D ?? {});
|
|
7496
7512
|
if (Z) {
|
|
7497
7513
|
if (_.type === "inline") {
|
|
7498
7514
|
const ee = Z.children[0];
|
|
@@ -7503,7 +7519,7 @@ function Zl(t, e) {
|
|
|
7503
7519
|
};
|
|
7504
7520
|
if (A)
|
|
7505
7521
|
try {
|
|
7506
|
-
|
|
7522
|
+
p.push(t.loadLanguage(S).then(() => L(S)));
|
|
7507
7523
|
} catch (j) {
|
|
7508
7524
|
if (a)
|
|
7509
7525
|
return L(a);
|
|
@@ -7514,15 +7530,15 @@ function Zl(t, e) {
|
|
|
7514
7530
|
else
|
|
7515
7531
|
L(S);
|
|
7516
7532
|
return "skip";
|
|
7517
|
-
}),
|
|
7533
|
+
}), p.length > 0) {
|
|
7518
7534
|
async function g() {
|
|
7519
|
-
await Promise.all(
|
|
7535
|
+
await Promise.all(p);
|
|
7520
7536
|
}
|
|
7521
7537
|
return g();
|
|
7522
7538
|
}
|
|
7523
7539
|
};
|
|
7524
7540
|
}
|
|
7525
|
-
function
|
|
7541
|
+
function eu(t) {
|
|
7526
7542
|
if (!t)
|
|
7527
7543
|
return null;
|
|
7528
7544
|
const e = t.match(/\{([\d,-]+)\}/);
|
|
@@ -7532,7 +7548,7 @@ function Ql(t) {
|
|
|
7532
7548
|
}) : null;
|
|
7533
7549
|
}
|
|
7534
7550
|
const lr = Symbol("highlighted-lines");
|
|
7535
|
-
function
|
|
7551
|
+
function tu(t = {}) {
|
|
7536
7552
|
const {
|
|
7537
7553
|
className: e = "highlighted"
|
|
7538
7554
|
} = t;
|
|
@@ -7542,14 +7558,14 @@ function eu(t = {}) {
|
|
|
7542
7558
|
if (!this.options.meta?.__raw)
|
|
7543
7559
|
return;
|
|
7544
7560
|
const o = this.meta;
|
|
7545
|
-
return o[lr] ??=
|
|
7561
|
+
return o[lr] ??= eu(this.options.meta.__raw), (o[lr] ?? []).includes(r) && this.addClassToHast(n, e), n;
|
|
7546
7562
|
}
|
|
7547
7563
|
};
|
|
7548
7564
|
}
|
|
7549
|
-
function
|
|
7565
|
+
function nu(t) {
|
|
7550
7566
|
return t ? Array.from(t.matchAll(/\/((?:\\.|[^/])+)\//g)).map((n) => n[1].replace(/\\(.)/g, "$1")) : [];
|
|
7551
7567
|
}
|
|
7552
|
-
function
|
|
7568
|
+
function ru(t = {}) {
|
|
7553
7569
|
const {
|
|
7554
7570
|
className: e = "highlighted-word"
|
|
7555
7571
|
} = t;
|
|
@@ -7558,10 +7574,10 @@ function nu(t = {}) {
|
|
|
7558
7574
|
preprocess(n, r) {
|
|
7559
7575
|
if (!this.options.meta?.__raw)
|
|
7560
7576
|
return;
|
|
7561
|
-
const o =
|
|
7577
|
+
const o = nu(this.options.meta.__raw);
|
|
7562
7578
|
r.decorations ||= [];
|
|
7563
7579
|
for (const s of o) {
|
|
7564
|
-
const a =
|
|
7580
|
+
const a = ou(n, s);
|
|
7565
7581
|
for (const i of a)
|
|
7566
7582
|
r.decorations.push({
|
|
7567
7583
|
start: i,
|
|
@@ -7574,7 +7590,7 @@ function nu(t = {}) {
|
|
|
7574
7590
|
}
|
|
7575
7591
|
};
|
|
7576
7592
|
}
|
|
7577
|
-
function
|
|
7593
|
+
function ou(t, e) {
|
|
7578
7594
|
const n = [];
|
|
7579
7595
|
let r = 0;
|
|
7580
7596
|
for (; ; ) {
|
|
@@ -7589,7 +7605,7 @@ function Pe(t) {
|
|
|
7589
7605
|
if ([...t].length !== 1) throw new Error(`Expected "${t}" to be a single code point`);
|
|
7590
7606
|
return t.codePointAt(0);
|
|
7591
7607
|
}
|
|
7592
|
-
function
|
|
7608
|
+
function su(t, e, n) {
|
|
7593
7609
|
return t.has(e) || t.set(e, n), t.get(e);
|
|
7594
7610
|
}
|
|
7595
7611
|
const vn = /* @__PURE__ */ new Set(["alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit"]), B = String.raw;
|
|
@@ -7629,10 +7645,10 @@ const To = B`\[\^?`, Mo = `c.? | C(?:-.?)?|${B`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x
|
|
|
7629
7645
|
| &&
|
|
7630
7646
|
| .
|
|
7631
7647
|
`.replace(/\s+/g, ""), "gsu");
|
|
7632
|
-
function
|
|
7648
|
+
function au(t, e = {}) {
|
|
7633
7649
|
const n = { flags: "", ...e, rules: { captureGroup: !1, singleline: !1, ...e.rules } };
|
|
7634
7650
|
if (typeof t != "string") throw new Error("String expected as pattern");
|
|
7635
|
-
const r =
|
|
7651
|
+
const r = xu(n.flags), o = [r.extended], s = { captureGroup: n.rules.captureGroup, getCurrentModX() {
|
|
7636
7652
|
return o.at(-1);
|
|
7637
7653
|
}, numOpenGroups: 0, popModX() {
|
|
7638
7654
|
o.pop();
|
|
@@ -7643,30 +7659,30 @@ function su(t, e = {}) {
|
|
|
7643
7659
|
}, singleline: n.rules.singleline };
|
|
7644
7660
|
let a = [], i;
|
|
7645
7661
|
for (et.lastIndex = 0; i = et.exec(t); ) {
|
|
7646
|
-
const h =
|
|
7662
|
+
const h = iu(s, t, i[0], et.lastIndex);
|
|
7647
7663
|
h.tokens ? a.push(...h.tokens) : h.token && a.push(h.token), h.lastIndex !== void 0 && (et.lastIndex = h.lastIndex);
|
|
7648
7664
|
}
|
|
7649
7665
|
const l = [];
|
|
7650
7666
|
let u = 0;
|
|
7651
7667
|
a.filter((h) => h.type === "GroupOpen").forEach((h) => {
|
|
7652
7668
|
h.kind === "capturing" ? h.number = ++u : h.raw === "(" && l.push(h);
|
|
7653
|
-
}), u || l.forEach((h,
|
|
7654
|
-
h.kind = "capturing", h.number =
|
|
7669
|
+
}), u || l.forEach((h, f) => {
|
|
7670
|
+
h.kind = "capturing", h.number = f + 1;
|
|
7655
7671
|
});
|
|
7656
7672
|
const c = u || l.length;
|
|
7657
|
-
return { tokens: a.map((h) => h.type === "EscapedNumber" ?
|
|
7673
|
+
return { tokens: a.map((h) => h.type === "EscapedNumber" ? Au(h, c) : h).flat(), flags: r };
|
|
7658
7674
|
}
|
|
7659
|
-
function
|
|
7675
|
+
function iu(t, e, n, r) {
|
|
7660
7676
|
const [o, s] = n;
|
|
7661
7677
|
if (n === "[" || n === "[^") {
|
|
7662
|
-
const a =
|
|
7678
|
+
const a = lu(e, n, r);
|
|
7663
7679
|
return { tokens: a.tokens, lastIndex: a.lastIndex };
|
|
7664
7680
|
}
|
|
7665
7681
|
if (o === "\\") {
|
|
7666
7682
|
if ("AbBGyYzZ".includes(s)) return { token: ur(n, n) };
|
|
7667
7683
|
if (/^\\g[<']/.test(n)) {
|
|
7668
7684
|
if (!/^\\g(?:<[^>]+>|'[^']+')$/.test(n)) throw new Error(`Invalid group name "${n}"`);
|
|
7669
|
-
return { token:
|
|
7685
|
+
return { token: bu(n) };
|
|
7670
7686
|
}
|
|
7671
7687
|
if (/^\\k[<']/.test(n)) {
|
|
7672
7688
|
if (!/^\\k(?:<[^>]+>|'[^']+')$/.test(n)) throw new Error(`Invalid group name "${n}"`);
|
|
@@ -7680,13 +7696,13 @@ function au(t, e, n, r) {
|
|
|
7680
7696
|
return Array.isArray(a) ? { tokens: a } : { token: a };
|
|
7681
7697
|
}
|
|
7682
7698
|
if (o === "(") {
|
|
7683
|
-
if (s === "*") return { token:
|
|
7699
|
+
if (s === "*") return { token: Su(n) };
|
|
7684
7700
|
if (n === "(?{") throw new Error(`Unsupported callout "${n}"`);
|
|
7685
7701
|
if (n.startsWith("(?#")) {
|
|
7686
7702
|
if (e[r] !== ")") throw new Error('Unclosed comment group "(?#"');
|
|
7687
7703
|
return { lastIndex: r + 1 };
|
|
7688
7704
|
}
|
|
7689
|
-
if (/^\(\?[-imx]+[:)]$/.test(n)) return { token:
|
|
7705
|
+
if (/^\(\?[-imx]+[:)]$/.test(n)) return { token: _u(n, t) };
|
|
7690
7706
|
if (t.pushModX(t.getCurrentModX()), t.numOpenGroups++, n === "(" && !t.captureGroup || n === "(?:") return { token: Se("group", n) };
|
|
7691
7707
|
if (n === "(?>") return { token: Se("atomic", n) };
|
|
7692
7708
|
if (n === "(?=" || n === "(?!" || n === "(?<=" || n === "(?<!") return { token: Se(n[2] === "<" ? "lookbehind" : "lookahead", n, { negate: n.endsWith("!") }) };
|
|
@@ -7699,7 +7715,7 @@ function au(t, e, n, r) {
|
|
|
7699
7715
|
}
|
|
7700
7716
|
if (n === ")") {
|
|
7701
7717
|
if (t.popModX(), t.numOpenGroups--, t.numOpenGroups < 0) throw new Error('Unmatched ")"');
|
|
7702
|
-
return { token:
|
|
7718
|
+
return { token: gu(n) };
|
|
7703
7719
|
}
|
|
7704
7720
|
if (t.getCurrentModX()) {
|
|
7705
7721
|
if (n === "#") {
|
|
@@ -7717,9 +7733,9 @@ function au(t, e, n, r) {
|
|
|
7717
7733
|
const a = t.singleline ? { "^": B`\A`, $: B`\Z` }[n] : n;
|
|
7718
7734
|
return { token: ur(a, n) };
|
|
7719
7735
|
}
|
|
7720
|
-
return n === "|" ? { token:
|
|
7736
|
+
return n === "|" ? { token: cu(n) } : xn.test(n) ? { tokens: Ru(n) } : { token: se(Pe(n), n) };
|
|
7721
7737
|
}
|
|
7722
|
-
function
|
|
7738
|
+
function lu(t, e, n) {
|
|
7723
7739
|
const r = [cr(e[1] === "^", e)];
|
|
7724
7740
|
let o = 1, s;
|
|
7725
7741
|
for (Ot.lastIndex = n; s = Ot.exec(t); ) {
|
|
@@ -7727,31 +7743,31 @@ function iu(t, e, n) {
|
|
|
7727
7743
|
if (a[0] === "[" && a[1] !== ":") o++, r.push(cr(a[1] === "^", a));
|
|
7728
7744
|
else if (a === "]") {
|
|
7729
7745
|
if (r.at(-1).type === "CharacterClassOpen") r.push(se(93, a));
|
|
7730
|
-
else if (o--, r.push(
|
|
7746
|
+
else if (o--, r.push(hu(a)), !o) break;
|
|
7731
7747
|
} else {
|
|
7732
|
-
const i =
|
|
7748
|
+
const i = uu(a);
|
|
7733
7749
|
Array.isArray(i) ? r.push(...i) : r.push(i);
|
|
7734
7750
|
}
|
|
7735
7751
|
}
|
|
7736
7752
|
return { tokens: r, lastIndex: Ot.lastIndex || t.length };
|
|
7737
7753
|
}
|
|
7738
|
-
function
|
|
7754
|
+
function uu(t) {
|
|
7739
7755
|
if (t[0] === "\\") return Oo(t, { inCharClass: !0 });
|
|
7740
7756
|
if (t[0] === "[") {
|
|
7741
7757
|
const e = /\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);
|
|
7742
7758
|
if (!e || !vn.has(e.groups.name)) throw new Error(`Invalid POSIX class "${t}"`);
|
|
7743
7759
|
return ge("posix", t, { value: e.groups.name, negate: !!e.groups.negate });
|
|
7744
7760
|
}
|
|
7745
|
-
return t === "-" ?
|
|
7761
|
+
return t === "-" ? fu(t) : t === "&&" ? pu(t) : se(Pe(t), t);
|
|
7746
7762
|
}
|
|
7747
7763
|
function Oo(t, { inCharClass: e }) {
|
|
7748
7764
|
const n = t[1];
|
|
7749
|
-
if (n === "c" || n === "C") return
|
|
7750
|
-
if ("dDhHsSwW".includes(n)) return
|
|
7765
|
+
if (n === "c" || n === "C") return Cu(t);
|
|
7766
|
+
if ("dDhHsSwW".includes(n)) return ku(t);
|
|
7751
7767
|
if (t.startsWith(B`\o{`)) throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);
|
|
7752
7768
|
if (/^\\[pP]\{/.test(t)) {
|
|
7753
7769
|
if (t.length === 3) throw new Error(`Incomplete or invalid Unicode property "${t}"`);
|
|
7754
|
-
return
|
|
7770
|
+
return vu(t);
|
|
7755
7771
|
}
|
|
7756
7772
|
if (/^\\x[89A-Fa-f]\p{AHex}/u.test(t)) try {
|
|
7757
7773
|
const r = t.split(/\\x/).slice(1).map((a) => parseInt(a, 16)), o = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }).decode(new Uint8Array(r)), s = new TextEncoder();
|
|
@@ -7762,15 +7778,15 @@ function Oo(t, { inCharClass: e }) {
|
|
|
7762
7778
|
} catch {
|
|
7763
7779
|
throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`);
|
|
7764
7780
|
}
|
|
7765
|
-
if (n === "u" || n === "x") return se(
|
|
7781
|
+
if (n === "u" || n === "x") return se(Eu(t), t);
|
|
7766
7782
|
if (hr.has(n)) return se(hr.get(n), t);
|
|
7767
|
-
if (/\d/.test(n)) return
|
|
7783
|
+
if (/\d/.test(n)) return du(e, t);
|
|
7768
7784
|
if (t === "\\") throw new Error(B`Incomplete escape "\"`);
|
|
7769
7785
|
if (n === "M") throw new Error(`Unsupported meta "${t}"`);
|
|
7770
7786
|
if ([...t].length === 2) return se(t.codePointAt(1), t);
|
|
7771
7787
|
throw new Error(`Unexpected escape "${t}"`);
|
|
7772
7788
|
}
|
|
7773
|
-
function
|
|
7789
|
+
function cu(t) {
|
|
7774
7790
|
return { type: "Alternator", raw: t };
|
|
7775
7791
|
}
|
|
7776
7792
|
function ur(t, e) {
|
|
@@ -7782,13 +7798,13 @@ function Do(t) {
|
|
|
7782
7798
|
function se(t, e) {
|
|
7783
7799
|
return { type: "Character", value: t, raw: e };
|
|
7784
7800
|
}
|
|
7785
|
-
function
|
|
7801
|
+
function hu(t) {
|
|
7786
7802
|
return { type: "CharacterClassClose", raw: t };
|
|
7787
7803
|
}
|
|
7788
|
-
function
|
|
7804
|
+
function fu(t) {
|
|
7789
7805
|
return { type: "CharacterClassHyphen", raw: t };
|
|
7790
7806
|
}
|
|
7791
|
-
function
|
|
7807
|
+
function pu(t) {
|
|
7792
7808
|
return { type: "CharacterClassIntersector", raw: t };
|
|
7793
7809
|
}
|
|
7794
7810
|
function cr(t, e) {
|
|
@@ -7800,31 +7816,31 @@ function ge(t, e, n = {}) {
|
|
|
7800
7816
|
function Go(t, e, n = {}) {
|
|
7801
7817
|
return t === "keep" ? { type: "Directive", kind: t, raw: e } : { type: "Directive", kind: t, flags: $e(n.flags), raw: e };
|
|
7802
7818
|
}
|
|
7803
|
-
function
|
|
7819
|
+
function du(t, e) {
|
|
7804
7820
|
return { type: "EscapedNumber", inCharClass: t, raw: e };
|
|
7805
7821
|
}
|
|
7806
|
-
function
|
|
7822
|
+
function gu(t) {
|
|
7807
7823
|
return { type: "GroupClose", raw: t };
|
|
7808
7824
|
}
|
|
7809
7825
|
function Se(t, e, n = {}) {
|
|
7810
7826
|
return { type: "GroupOpen", kind: t, ...n, raw: e };
|
|
7811
7827
|
}
|
|
7812
|
-
function
|
|
7828
|
+
function mu(t, e, n, r) {
|
|
7813
7829
|
return { type: "NamedCallout", kind: t, tag: e, arguments: n, raw: r };
|
|
7814
7830
|
}
|
|
7815
|
-
function
|
|
7831
|
+
function yu(t, e, n, r) {
|
|
7816
7832
|
return { type: "Quantifier", kind: t, min: e, max: n, raw: r };
|
|
7817
7833
|
}
|
|
7818
|
-
function
|
|
7834
|
+
function bu(t) {
|
|
7819
7835
|
return { type: "Subroutine", raw: t };
|
|
7820
7836
|
}
|
|
7821
|
-
const
|
|
7822
|
-
function
|
|
7837
|
+
const wu = /* @__PURE__ */ new Set(["COUNT", "CMP", "ERROR", "FAIL", "MAX", "MISMATCH", "SKIP", "TOTAL_COUNT"]), hr = /* @__PURE__ */ new Map([["a", 7], ["b", 8], ["e", 27], ["f", 12], ["n", 10], ["r", 13], ["t", 9], ["v", 11]]);
|
|
7838
|
+
function Cu(t) {
|
|
7823
7839
|
const e = t[1] === "c" ? t[2] : t[3];
|
|
7824
7840
|
if (!e || !/[A-Za-z]/.test(e)) throw new Error(`Unsupported control character "${t}"`);
|
|
7825
7841
|
return se(Pe(e.toUpperCase()) - 64, t);
|
|
7826
7842
|
}
|
|
7827
|
-
function
|
|
7843
|
+
function _u(t, e) {
|
|
7828
7844
|
let { on: n, off: r } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;
|
|
7829
7845
|
r ??= "";
|
|
7830
7846
|
const o = (e.getCurrentModX() || n.includes("x")) && !r.includes("x"), s = pr(n), a = pr(r), i = {};
|
|
@@ -7832,13 +7848,13 @@ function Cu(t, e) {
|
|
|
7832
7848
|
if (t.endsWith(":")) return e.pushModX(o), e.numOpenGroups++, Se("group", t, { ...(s || a) && { flags: i } });
|
|
7833
7849
|
throw new Error(`Unexpected flag modifier "${t}"`);
|
|
7834
7850
|
}
|
|
7835
|
-
function
|
|
7851
|
+
function Su(t) {
|
|
7836
7852
|
const e = /\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);
|
|
7837
7853
|
if (!e) throw new Error(`Incomplete or invalid named callout "${t}"`);
|
|
7838
7854
|
const { name: n, tag: r, args: o } = e.groups;
|
|
7839
7855
|
if (!n) throw new Error(`Invalid named callout "${t}"`);
|
|
7840
7856
|
if (r === "") throw new Error(`Named callout tag with empty value not allowed "${t}"`);
|
|
7841
|
-
const s = o ? o.split(",").filter((c) => c !== "").map((c) => /^[+-]?\d+$/.test(c) ? +c : c) : [], [a, i, l] = s, u =
|
|
7857
|
+
const s = o ? o.split(",").filter((c) => c !== "").map((c) => /^[+-]?\d+$/.test(c) ? +c : c) : [], [a, i, l] = s, u = wu.has(n) ? n.toLowerCase() : "custom";
|
|
7842
7858
|
switch (u) {
|
|
7843
7859
|
case "fail":
|
|
7844
7860
|
case "mismatch":
|
|
@@ -7870,7 +7886,7 @@ function _u(t) {
|
|
|
7870
7886
|
default:
|
|
7871
7887
|
throw new Error(`Unexpected named callout kind "${u}"`);
|
|
7872
7888
|
}
|
|
7873
|
-
return
|
|
7889
|
+
return mu(u, r ?? null, o?.split(",") ?? null, t);
|
|
7874
7890
|
}
|
|
7875
7891
|
function fr(t) {
|
|
7876
7892
|
let e = null, n, r;
|
|
@@ -7882,13 +7898,13 @@ function fr(t) {
|
|
|
7882
7898
|
e = "lazy";
|
|
7883
7899
|
} else e || (e = "greedy");
|
|
7884
7900
|
} else n = t[0] === "+" ? 1 : 0, r = t[0] === "?" ? 1 : 1 / 0, e = t[1] === "+" ? "possessive" : t[1] === "?" ? "lazy" : "greedy";
|
|
7885
|
-
return
|
|
7901
|
+
return yu(e, n, r, t);
|
|
7886
7902
|
}
|
|
7887
|
-
function
|
|
7903
|
+
function ku(t) {
|
|
7888
7904
|
const e = t[1].toLowerCase();
|
|
7889
7905
|
return ge({ d: "digit", h: "hex", s: "space", w: "word" }[e], t, { negate: t[1] !== e });
|
|
7890
7906
|
}
|
|
7891
|
-
function
|
|
7907
|
+
function vu(t) {
|
|
7892
7908
|
const { p: e, neg: n, value: r } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;
|
|
7893
7909
|
return ge("property", t, { value: r, negate: e === "P" && !n || e === "p" && !!n });
|
|
7894
7910
|
}
|
|
@@ -7896,7 +7912,7 @@ function pr(t) {
|
|
|
7896
7912
|
const e = {};
|
|
7897
7913
|
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;
|
|
7898
7914
|
}
|
|
7899
|
-
function
|
|
7915
|
+
function xu(t) {
|
|
7900
7916
|
const e = { ignoreCase: !1, dotAll: !1, extended: !1, digitIsAscii: !1, posixIsAscii: !1, spaceIsAscii: !1, wordIsAscii: !1, textSegmentMode: null };
|
|
7901
7917
|
for (let n = 0; n < t.length; n++) {
|
|
7902
7918
|
const r = t[n];
|
|
@@ -7910,12 +7926,12 @@ function vu(t) {
|
|
|
7910
7926
|
}
|
|
7911
7927
|
return e;
|
|
7912
7928
|
}
|
|
7913
|
-
function
|
|
7929
|
+
function Eu(t) {
|
|
7914
7930
|
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}"`);
|
|
7915
7931
|
const e = t[2] === "{" ? /^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex : t.slice(2);
|
|
7916
7932
|
return parseInt(e, 16);
|
|
7917
7933
|
}
|
|
7918
|
-
function
|
|
7934
|
+
function Au(t, e) {
|
|
7919
7935
|
const { raw: n, inCharClass: r } = t, o = n.slice(1);
|
|
7920
7936
|
if (!r && (o !== "0" && o.length === 1 || o[0] !== "0" && +o <= e)) return [Do(n)];
|
|
7921
7937
|
const s = [], a = o.match(/^[0-7]+|\d/g);
|
|
@@ -7929,7 +7945,7 @@ function Eu(t, e) {
|
|
|
7929
7945
|
}
|
|
7930
7946
|
return s;
|
|
7931
7947
|
}
|
|
7932
|
-
function
|
|
7948
|
+
function Ru(t) {
|
|
7933
7949
|
const e = [], n = new RegExp(xn, "gy");
|
|
7934
7950
|
let r;
|
|
7935
7951
|
for (; r = n.exec(t); ) {
|
|
@@ -7954,62 +7970,62 @@ function Fo(t, e) {
|
|
|
7954
7970
|
const n = t.body[0];
|
|
7955
7971
|
return !e || Object.keys(e).every((r) => e[r] === n[r]);
|
|
7956
7972
|
}
|
|
7957
|
-
function
|
|
7958
|
-
return
|
|
7973
|
+
function Iu(t) {
|
|
7974
|
+
return Nu.has(t.type);
|
|
7959
7975
|
}
|
|
7960
|
-
const
|
|
7976
|
+
const Nu = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
|
|
7961
7977
|
function Bo(t, e = {}) {
|
|
7962
|
-
const n = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...e, rules: { captureGroup: !1, singleline: !1, ...e.rules } }, r =
|
|
7963
|
-
const
|
|
7964
|
-
switch (s.parent =
|
|
7978
|
+
const n = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...e, rules: { captureGroup: !1, singleline: !1, ...e.rules } }, r = au(t, { flags: n.flags, rules: { captureGroup: n.rules.captureGroup, singleline: n.rules.singleline } }), o = (f, d) => {
|
|
7979
|
+
const p = r.tokens[s.nextIndex];
|
|
7980
|
+
switch (s.parent = f, s.nextIndex++, p.type) {
|
|
7965
7981
|
case "Alternator":
|
|
7966
7982
|
return me();
|
|
7967
7983
|
case "Assertion":
|
|
7968
|
-
return
|
|
7984
|
+
return Lu(p);
|
|
7969
7985
|
case "Backreference":
|
|
7970
|
-
return
|
|
7986
|
+
return Pu(p, s);
|
|
7971
7987
|
case "Character":
|
|
7972
|
-
return vt(
|
|
7988
|
+
return vt(p.value, { useLastValid: !!d.isCheckingRangeEnd });
|
|
7973
7989
|
case "CharacterClassHyphen":
|
|
7974
|
-
return
|
|
7990
|
+
return $u(p, s, d);
|
|
7975
7991
|
case "CharacterClassOpen":
|
|
7976
|
-
return
|
|
7992
|
+
return Tu(p, s, d);
|
|
7977
7993
|
case "CharacterSet":
|
|
7978
|
-
return
|
|
7994
|
+
return Mu(p, s);
|
|
7979
7995
|
case "Directive":
|
|
7980
|
-
return
|
|
7996
|
+
return ju(p.kind, { flags: p.flags });
|
|
7981
7997
|
case "GroupOpen":
|
|
7982
|
-
return
|
|
7998
|
+
return Ou(p, s, d);
|
|
7983
7999
|
case "NamedCallout":
|
|
7984
|
-
return
|
|
8000
|
+
return zu(p.kind, p.tag, p.arguments);
|
|
7985
8001
|
case "Quantifier":
|
|
7986
|
-
return
|
|
8002
|
+
return Du(p, s);
|
|
7987
8003
|
case "Subroutine":
|
|
7988
|
-
return
|
|
8004
|
+
return Gu(p, s);
|
|
7989
8005
|
default:
|
|
7990
|
-
throw new Error(`Unexpected token type "${
|
|
8006
|
+
throw new Error(`Unexpected token type "${p.type}"`);
|
|
7991
8007
|
}
|
|
7992
|
-
}, s = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ 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: o }, a =
|
|
8008
|
+
}, s = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ 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: o }, a = Wu(Uu(r.flags));
|
|
7993
8009
|
let i = a.body[0];
|
|
7994
8010
|
for (; s.nextIndex < r.tokens.length; ) {
|
|
7995
|
-
const
|
|
7996
|
-
|
|
8011
|
+
const f = o(i, {});
|
|
8012
|
+
f.type === "Alternative" ? (a.body.push(f), i = f) : i.body.push(f);
|
|
7997
8013
|
}
|
|
7998
8014
|
const { capturingGroups: l, hasNumberedRef: u, namedGroupsByName: c, subroutines: h } = s;
|
|
7999
8015
|
if (u && c.size && !n.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
8000
|
-
for (const { ref:
|
|
8001
|
-
if (
|
|
8002
|
-
|
|
8003
|
-
} else if (c.has(
|
|
8004
|
-
if (c.get(
|
|
8005
|
-
c.get(
|
|
8006
|
-
} else throw new Error(B`Subroutine uses a group name that's not defined "\g<${
|
|
8016
|
+
for (const { ref: f } of h) if (typeof f == "number") {
|
|
8017
|
+
if (f > l.length) throw new Error("Subroutine uses a group number that's not defined");
|
|
8018
|
+
f && (l[f - 1].isSubroutined = !0);
|
|
8019
|
+
} else if (c.has(f)) {
|
|
8020
|
+
if (c.get(f).length > 1) throw new Error(B`Subroutine uses a duplicate group name "\g<${f}>"`);
|
|
8021
|
+
c.get(f)[0].isSubroutined = !0;
|
|
8022
|
+
} else throw new Error(B`Subroutine uses a group name that's not defined "\g<${f}>"`);
|
|
8007
8023
|
return a;
|
|
8008
8024
|
}
|
|
8009
|
-
function
|
|
8025
|
+
function Lu({ kind: t }) {
|
|
8010
8026
|
return on($e({ "^": "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 === B`\B` || t === B`\Y` });
|
|
8011
8027
|
}
|
|
8012
|
-
function
|
|
8028
|
+
function Pu({ raw: t }, e) {
|
|
8013
8029
|
const n = /^\\k[<']/.test(t), r = n ? t.slice(3, -1) : t.slice(1), o = (s, a = !1) => {
|
|
8014
8030
|
const i = e.capturingGroups.length;
|
|
8015
8031
|
let l = !1;
|
|
@@ -8026,16 +8042,16 @@ function Lu({ raw: t }, e) {
|
|
|
8026
8042
|
}
|
|
8027
8043
|
return o(+r);
|
|
8028
8044
|
}
|
|
8029
|
-
function
|
|
8045
|
+
function $u(t, e, n) {
|
|
8030
8046
|
const { tokens: r, walk: o } = e, s = e.parent, a = s.body.at(-1), i = r[e.nextIndex];
|
|
8031
8047
|
if (!n.isCheckingRangeEnd && a && a.type !== "CharacterClass" && a.type !== "CharacterClassRange" && i && i.type !== "CharacterClassOpen" && i.type !== "CharacterClassClose" && i.type !== "CharacterClassIntersector") {
|
|
8032
8048
|
const l = o(s, { ...n, isCheckingRangeEnd: !0 });
|
|
8033
|
-
if (a.type === "Character" && l.type === "Character") return s.body.pop(),
|
|
8049
|
+
if (a.type === "Character" && l.type === "Character") return s.body.pop(), Bu(a, l);
|
|
8034
8050
|
throw new Error("Invalid character class range");
|
|
8035
8051
|
}
|
|
8036
8052
|
return vt(Pe("-"));
|
|
8037
8053
|
}
|
|
8038
|
-
function
|
|
8054
|
+
function Tu({ negate: t }, e, n) {
|
|
8039
8055
|
const { tokens: r, walk: o } = e, s = r[e.nextIndex], a = [st()];
|
|
8040
8056
|
let i = mr(s);
|
|
8041
8057
|
for (; i.type !== "CharacterClassClose"; ) {
|
|
@@ -8049,41 +8065,41 @@ function $u({ negate: t }, e, n) {
|
|
|
8049
8065
|
const l = st({ negate: t });
|
|
8050
8066
|
return a.length === 1 ? l.body = a[0].body : (l.kind = "intersection", l.body = a.map((u) => u.body.length === 1 ? u.body[0] : u)), e.nextIndex++, l;
|
|
8051
8067
|
}
|
|
8052
|
-
function
|
|
8068
|
+
function Mu({ kind: t, negate: e, value: n }, r) {
|
|
8053
8069
|
const { normalizeUnknownPropertyNames: o, skipPropertyNameValidation: s, unicodePropertyMap: a } = r;
|
|
8054
8070
|
if (t === "property") {
|
|
8055
8071
|
const i = xt(n);
|
|
8056
8072
|
if (vn.has(i) && !a?.has(i)) t = "posix", n = i;
|
|
8057
8073
|
else return ke(n, { negate: e, normalizeUnknownPropertyNames: o, skipPropertyNameValidation: s, unicodePropertyMap: a });
|
|
8058
8074
|
}
|
|
8059
|
-
return t === "posix" ?
|
|
8075
|
+
return t === "posix" ? Hu(n, { negate: e }) : an(t, { negate: e });
|
|
8060
8076
|
}
|
|
8061
|
-
function
|
|
8062
|
-
const { tokens: r, capturingGroups: o, namedGroupsByName: s, skipLookbehindValidation: a, walk: i } = e, l =
|
|
8063
|
-
if (l.type === "CapturingGroup" && (o.push(l), l.name &&
|
|
8064
|
-
let
|
|
8065
|
-
for (;
|
|
8066
|
-
if (
|
|
8077
|
+
function Ou(t, e, n) {
|
|
8078
|
+
const { tokens: r, capturingGroups: o, namedGroupsByName: s, skipLookbehindValidation: a, walk: i } = e, l = Vu(t), u = l.type === "AbsenceFunction", c = gr(l), h = c && l.negate;
|
|
8079
|
+
if (l.type === "CapturingGroup" && (o.push(l), l.name && su(s, l.name, []).push(l)), u && n.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
|
|
8080
|
+
let f = yr(r[e.nextIndex]);
|
|
8081
|
+
for (; f.type !== "GroupClose"; ) {
|
|
8082
|
+
if (f.type === "Alternator") l.body.push(me()), e.nextIndex++;
|
|
8067
8083
|
else {
|
|
8068
|
-
const d = l.body.at(-1),
|
|
8069
|
-
if (d.body.push(
|
|
8084
|
+
const d = l.body.at(-1), p = i(d, { ...n, isInAbsenceFunction: n.isInAbsenceFunction || u, isInLookbehind: n.isInLookbehind || c, isInNegLookbehind: n.isInNegLookbehind || h });
|
|
8085
|
+
if (d.body.push(p), (c || n.isInLookbehind) && !a) {
|
|
8070
8086
|
const g = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
8071
8087
|
if (h || n.isInNegLookbehind) {
|
|
8072
|
-
if (dr(
|
|
8073
|
-
} else if (dr(
|
|
8088
|
+
if (dr(p) || p.type === "CapturingGroup") throw new Error(g);
|
|
8089
|
+
} else if (dr(p) || gr(p) && p.negate) throw new Error(g);
|
|
8074
8090
|
}
|
|
8075
8091
|
}
|
|
8076
|
-
|
|
8092
|
+
f = yr(r[e.nextIndex]);
|
|
8077
8093
|
}
|
|
8078
8094
|
return e.nextIndex++, l;
|
|
8079
8095
|
}
|
|
8080
|
-
function
|
|
8096
|
+
function Du({ kind: t, min: e, max: n }, r) {
|
|
8081
8097
|
const o = r.parent, s = o.body.at(-1);
|
|
8082
|
-
if (!s || !
|
|
8098
|
+
if (!s || !Iu(s)) throw new Error("Quantifier requires a repeatable token");
|
|
8083
8099
|
const a = Uo(t, e, n, s);
|
|
8084
8100
|
return o.body.pop(), a;
|
|
8085
8101
|
}
|
|
8086
|
-
function
|
|
8102
|
+
function Gu({ raw: t }, e) {
|
|
8087
8103
|
const { capturingGroups: n, subroutines: r } = e;
|
|
8088
8104
|
let o = t.slice(3, -1);
|
|
8089
8105
|
const s = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);
|
|
@@ -8094,7 +8110,7 @@ function Du({ raw: t }, e) {
|
|
|
8094
8110
|
const a = zo(o);
|
|
8095
8111
|
return r.push(a), a;
|
|
8096
8112
|
}
|
|
8097
|
-
function
|
|
8113
|
+
function Fu(t, e) {
|
|
8098
8114
|
return { type: "AbsenceFunction", kind: t, body: Ye(e?.body) };
|
|
8099
8115
|
}
|
|
8100
8116
|
function me(t) {
|
|
@@ -8110,7 +8126,7 @@ function sn(t, e) {
|
|
|
8110
8126
|
}
|
|
8111
8127
|
function jo(t, e) {
|
|
8112
8128
|
const n = { name: void 0, isSubroutined: !1, ...e };
|
|
8113
|
-
if (n.name !== void 0 && !
|
|
8129
|
+
if (n.name !== void 0 && !qu(n.name)) throw new Error(`Group name "${n.name}" invalid in Oniguruma`);
|
|
8114
8130
|
return { type: "CapturingGroup", number: t, ...n.name && { name: n.name }, ...n.isSubroutined && { isSubroutined: n.isSubroutined }, body: Ye(e?.body) };
|
|
8115
8131
|
}
|
|
8116
8132
|
function vt(t, e) {
|
|
@@ -8126,7 +8142,7 @@ function st(t) {
|
|
|
8126
8142
|
const e = { kind: "union", negate: !1, ...t };
|
|
8127
8143
|
return { type: "CharacterClass", kind: e.kind, negate: e.negate, body: Ho(t?.body) };
|
|
8128
8144
|
}
|
|
8129
|
-
function
|
|
8145
|
+
function Bu(t, e) {
|
|
8130
8146
|
if (e.value < t.value) throw new Error("Character class range out of order");
|
|
8131
8147
|
return { type: "CharacterClassRange", min: t, max: e };
|
|
8132
8148
|
}
|
|
@@ -8134,12 +8150,12 @@ function an(t, e) {
|
|
|
8134
8150
|
const n = !!e?.negate, r = { type: "CharacterSet", kind: t };
|
|
8135
8151
|
return (t === "digit" || t === "hex" || t === "newline" || t === "space" || t === "word") && (r.negate = n), (t === "text_segment" || t === "newline" && !n) && (r.variableLength = !0), r;
|
|
8136
8152
|
}
|
|
8137
|
-
function
|
|
8153
|
+
function ju(t, e = {}) {
|
|
8138
8154
|
if (t === "keep") return { type: "Directive", kind: t };
|
|
8139
8155
|
if (t === "flags") return { type: "Directive", kind: t, flags: $e(e.flags) };
|
|
8140
8156
|
throw new Error(`Unexpected directive kind "${t}"`);
|
|
8141
8157
|
}
|
|
8142
|
-
function
|
|
8158
|
+
function Uu(t) {
|
|
8143
8159
|
return { type: "Flags", ...t };
|
|
8144
8160
|
}
|
|
8145
8161
|
function Q(t) {
|
|
@@ -8151,10 +8167,10 @@ function pe(t) {
|
|
|
8151
8167
|
const e = { behind: !1, negate: !1, ...t };
|
|
8152
8168
|
return { type: "LookaroundAssertion", kind: e.behind ? "lookbehind" : "lookahead", negate: e.negate, body: Ye(t?.body) };
|
|
8153
8169
|
}
|
|
8154
|
-
function
|
|
8170
|
+
function zu(t, e, n) {
|
|
8155
8171
|
return { type: "NamedCallout", kind: t, tag: e, arguments: n };
|
|
8156
8172
|
}
|
|
8157
|
-
function
|
|
8173
|
+
function Hu(t, e) {
|
|
8158
8174
|
const n = !!e?.negate;
|
|
8159
8175
|
if (!vn.has(t)) throw new Error(`Invalid POSIX class "${t}"`);
|
|
8160
8176
|
return { type: "CharacterSet", kind: "posix", value: t, negate: n };
|
|
@@ -8163,7 +8179,7 @@ function Uo(t, e, n, r) {
|
|
|
8163
8179
|
if (e > n) throw new Error("Invalid reversed quantifier range");
|
|
8164
8180
|
return { type: "Quantifier", kind: t, min: e, max: n, body: r };
|
|
8165
8181
|
}
|
|
8166
|
-
function
|
|
8182
|
+
function Wu(t, e) {
|
|
8167
8183
|
return { type: "Regex", body: Ye(e?.body), flags: t };
|
|
8168
8184
|
}
|
|
8169
8185
|
function zo(t) {
|
|
@@ -8173,15 +8189,15 @@ function ke(t, e) {
|
|
|
8173
8189
|
const n = { negate: !1, normalizeUnknownPropertyNames: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...e };
|
|
8174
8190
|
let r = n.unicodePropertyMap?.get(xt(t));
|
|
8175
8191
|
if (!r) {
|
|
8176
|
-
if (n.normalizeUnknownPropertyNames) r =
|
|
8192
|
+
if (n.normalizeUnknownPropertyNames) r = Xu(t);
|
|
8177
8193
|
else if (n.unicodePropertyMap && !n.skipPropertyNameValidation) throw new Error(B`Invalid Unicode property "\p{${t}}"`);
|
|
8178
8194
|
}
|
|
8179
8195
|
return { type: "CharacterSet", kind: "property", value: r ?? t, negate: n.negate };
|
|
8180
8196
|
}
|
|
8181
|
-
function
|
|
8197
|
+
function Vu({ flags: t, kind: e, name: n, negate: r, number: o }) {
|
|
8182
8198
|
switch (e) {
|
|
8183
8199
|
case "absence_repeater":
|
|
8184
|
-
return
|
|
8200
|
+
return Fu("repeater");
|
|
8185
8201
|
case "atomic":
|
|
8186
8202
|
return Q({ atomic: !0 });
|
|
8187
8203
|
case "capturing":
|
|
@@ -8211,10 +8227,10 @@ function dr(t) {
|
|
|
8211
8227
|
function gr(t) {
|
|
8212
8228
|
return t.type === "LookaroundAssertion" && t.kind === "lookbehind";
|
|
8213
8229
|
}
|
|
8214
|
-
function
|
|
8230
|
+
function qu(t) {
|
|
8215
8231
|
return /^[\p{Alpha}\p{Pc}][^)]*$/u.test(t);
|
|
8216
8232
|
}
|
|
8217
|
-
function
|
|
8233
|
+
function Xu(t) {
|
|
8218
8234
|
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());
|
|
8219
8235
|
}
|
|
8220
8236
|
function xt(t) {
|
|
@@ -8254,8 +8270,8 @@ function Be(t, e, n = null) {
|
|
|
8254
8270
|
c = !0;
|
|
8255
8271
|
}, skip() {
|
|
8256
8272
|
c = !0;
|
|
8257
|
-
} }, { type:
|
|
8258
|
-
if (g?.(h, n), C?.(h, n), !c) switch (
|
|
8273
|
+
} }, { type: f } = s, d = e["*"], p = e[f], g = typeof d == "function" ? d : d?.enter, C = typeof p == "function" ? p : p?.enter;
|
|
8274
|
+
if (g?.(h, n), C?.(h, n), !c) switch (f) {
|
|
8259
8275
|
case "AbsenceFunction":
|
|
8260
8276
|
case "CapturingGroup":
|
|
8261
8277
|
case "Group":
|
|
@@ -8287,9 +8303,9 @@ function Be(t, e, n = null) {
|
|
|
8287
8303
|
r(s.body, s), o(s.flags, s, "flags");
|
|
8288
8304
|
break;
|
|
8289
8305
|
default:
|
|
8290
|
-
throw new Error(`Unexpected node type "${
|
|
8306
|
+
throw new Error(`Unexpected node type "${f}"`);
|
|
8291
8307
|
}
|
|
8292
|
-
return
|
|
8308
|
+
return p?.exit?.(h, n), d?.exit?.(h, n), u;
|
|
8293
8309
|
}
|
|
8294
8310
|
return o(t), t;
|
|
8295
8311
|
}
|
|
@@ -8301,12 +8317,12 @@ function Ce(t) {
|
|
|
8301
8317
|
if (typeof t != "number") throw new Error("Numeric key expected");
|
|
8302
8318
|
return t;
|
|
8303
8319
|
}
|
|
8304
|
-
const
|
|
8305
|
-
function
|
|
8320
|
+
const Ku = String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;
|
|
8321
|
+
function Yu(t, e) {
|
|
8306
8322
|
for (let n = 0; n < t.length; n++)
|
|
8307
8323
|
t[n] >= e && t[n]++;
|
|
8308
8324
|
}
|
|
8309
|
-
function
|
|
8325
|
+
function Ju(t, e, n, r) {
|
|
8310
8326
|
return t.slice(0, e) + r + t.slice(e + n.length);
|
|
8311
8327
|
}
|
|
8312
8328
|
const J = Object.freeze({
|
|
@@ -8332,7 +8348,7 @@ function En(t, e, n, r) {
|
|
|
8332
8348
|
function Wo(t, e, n, r) {
|
|
8333
8349
|
En(t, e, n, r);
|
|
8334
8350
|
}
|
|
8335
|
-
function
|
|
8351
|
+
function Zu(t, e, n = 0, r) {
|
|
8336
8352
|
if (!new RegExp(e, "su").test(t))
|
|
8337
8353
|
return null;
|
|
8338
8354
|
const o = new RegExp(`${e}|(?<$skip>\\\\?.)`, "gsu");
|
|
@@ -8347,9 +8363,9 @@ function Ju(t, e, n = 0, r) {
|
|
|
8347
8363
|
return null;
|
|
8348
8364
|
}
|
|
8349
8365
|
function nt(t, e, n) {
|
|
8350
|
-
return !!
|
|
8366
|
+
return !!Zu(t, e, 0, n);
|
|
8351
8367
|
}
|
|
8352
|
-
function
|
|
8368
|
+
function Qu(t, e) {
|
|
8353
8369
|
const n = /\\?./gsu;
|
|
8354
8370
|
n.lastIndex = e;
|
|
8355
8371
|
let r = t.length, o = 0, s = 1, a;
|
|
@@ -8368,8 +8384,8 @@ function Zu(t, e) {
|
|
|
8368
8384
|
}
|
|
8369
8385
|
return t.slice(e, r);
|
|
8370
8386
|
}
|
|
8371
|
-
const br = new RegExp(String.raw`(?<noncapturingStart>${
|
|
8372
|
-
function
|
|
8387
|
+
const br = new RegExp(String.raw`(?<noncapturingStart>${Ku})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`, "gsu");
|
|
8388
|
+
function ec(t, e) {
|
|
8373
8389
|
const n = e?.hiddenCaptures ?? [];
|
|
8374
8390
|
let r = e?.captureTransfers ?? /* @__PURE__ */ new Map();
|
|
8375
8391
|
if (!/\(\?>/.test(t))
|
|
@@ -8382,24 +8398,24 @@ function Qu(t, e) {
|
|
|
8382
8398
|
let l = 0, u = 0, c = NaN, h;
|
|
8383
8399
|
do {
|
|
8384
8400
|
h = !1;
|
|
8385
|
-
let
|
|
8401
|
+
let f = 0, d = 0, p = !1, g;
|
|
8386
8402
|
for (br.lastIndex = Number.isNaN(c) ? 0 : c + s.length; g = br.exec(t); ) {
|
|
8387
8403
|
const { 0: C, index: y, groups: { capturingStart: m, noncapturingStart: _ } } = g;
|
|
8388
8404
|
if (C === "[")
|
|
8389
|
-
|
|
8390
|
-
else if (
|
|
8391
|
-
C === "]" &&
|
|
8392
|
-
else if (C === o && !
|
|
8393
|
-
c = y,
|
|
8394
|
-
else if (
|
|
8405
|
+
f++;
|
|
8406
|
+
else if (f)
|
|
8407
|
+
C === "]" && f--;
|
|
8408
|
+
else if (C === o && !p)
|
|
8409
|
+
c = y, p = !0;
|
|
8410
|
+
else if (p && _)
|
|
8395
8411
|
d++;
|
|
8396
8412
|
else if (m)
|
|
8397
|
-
|
|
8398
|
-
else if (C === ")" &&
|
|
8413
|
+
p ? d++ : (l++, a.push(l + u));
|
|
8414
|
+
else if (C === ")" && p) {
|
|
8399
8415
|
if (!d) {
|
|
8400
8416
|
u++;
|
|
8401
8417
|
const S = l + u;
|
|
8402
|
-
if (t = `${t.slice(0, c)}${s}${t.slice(c + o.length, y)}))<$$${S}>)${t.slice(y + 1)}`, h = !0, i.push(S),
|
|
8418
|
+
if (t = `${t.slice(0, c)}${s}${t.slice(c + o.length, y)}))<$$${S}>)${t.slice(y + 1)}`, h = !0, i.push(S), Yu(n, S), r.size) {
|
|
8403
8419
|
const A = /* @__PURE__ */ new Map();
|
|
8404
8420
|
r.forEach((D, L) => {
|
|
8405
8421
|
A.set(
|
|
@@ -8417,14 +8433,14 @@ function Qu(t, e) {
|
|
|
8417
8433
|
return n.push(...i), t = En(
|
|
8418
8434
|
t,
|
|
8419
8435
|
String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
|
|
8420
|
-
({ 0:
|
|
8436
|
+
({ 0: f, groups: { backrefNum: d, wrappedBackrefNum: p } }) => {
|
|
8421
8437
|
if (d) {
|
|
8422
8438
|
const g = +d;
|
|
8423
8439
|
if (g > a.length - 1)
|
|
8424
|
-
throw new Error(`Backref "${
|
|
8440
|
+
throw new Error(`Backref "${f}" greater than number of captures`);
|
|
8425
8441
|
return `\\${a[g]}`;
|
|
8426
8442
|
}
|
|
8427
|
-
return `\\${
|
|
8443
|
+
return `\\${p}`;
|
|
8428
8444
|
},
|
|
8429
8445
|
J.DEFAULT
|
|
8430
8446
|
), {
|
|
@@ -8449,7 +8465,7 @@ const Vo = String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`, Dt = new RegExp(String.raw`
|
|
|
8449
8465
|
| (?<qBase>${Vo})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
8450
8466
|
| \\?.
|
|
8451
8467
|
`.replace(/\s+/g, ""), "gsu");
|
|
8452
|
-
function
|
|
8468
|
+
function tc(t) {
|
|
8453
8469
|
if (!new RegExp(`${Vo}\\+`).test(t))
|
|
8454
8470
|
return {
|
|
8455
8471
|
pattern: t
|
|
@@ -8466,9 +8482,9 @@ function ec(t) {
|
|
|
8466
8482
|
if (c === "+" && o && !o.startsWith("(")) {
|
|
8467
8483
|
if (h)
|
|
8468
8484
|
throw new Error(`Invalid quantifier "${i}"`);
|
|
8469
|
-
let
|
|
8485
|
+
let f = -1;
|
|
8470
8486
|
if (/^\{\d+\}$/.test(u))
|
|
8471
|
-
t =
|
|
8487
|
+
t = Ju(t, l + u.length, c, "");
|
|
8472
8488
|
else {
|
|
8473
8489
|
if (o === ")" || o === "]") {
|
|
8474
8490
|
const d = o === ")" ? n : r;
|
|
@@ -8477,9 +8493,9 @@ function ec(t) {
|
|
|
8477
8493
|
t = `${t.slice(0, d)}(?>${t.slice(d, l)}${u})${t.slice(l + i.length)}`;
|
|
8478
8494
|
} else
|
|
8479
8495
|
t = `${t.slice(0, l - o.length)}(?>${o}${u})${t.slice(l + i.length)}`;
|
|
8480
|
-
|
|
8496
|
+
f += 4;
|
|
8481
8497
|
}
|
|
8482
|
-
Dt.lastIndex +=
|
|
8498
|
+
Dt.lastIndex += f;
|
|
8483
8499
|
} else i[0] === "(" ? e.push(l) : i === ")" && (n = e.length ? e.pop() : null);
|
|
8484
8500
|
o = i;
|
|
8485
8501
|
}
|
|
@@ -8487,8 +8503,8 @@ function ec(t) {
|
|
|
8487
8503
|
pattern: t
|
|
8488
8504
|
};
|
|
8489
8505
|
}
|
|
8490
|
-
const Y = String.raw,
|
|
8491
|
-
function
|
|
8506
|
+
const Y = String.raw, nc = Y`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`, ln = Y`\(\?R=(?<rDepth>[^\)]+)\)|${nc}`, Et = Y`\(\?<(?![=!])(?<captureName>[^>]+)>`, qo = Y`${Et}|(?<unnamed>\()(?!\?)`, he = new RegExp(Y`${Et}|${ln}|\(\?|\\?.`, "gsu"), Gt = "Cannot use multiple overlapping recursions";
|
|
8507
|
+
function rc(t, e) {
|
|
8492
8508
|
const { hiddenCaptures: n, mode: r } = {
|
|
8493
8509
|
hiddenCaptures: [],
|
|
8494
8510
|
mode: "plugin",
|
|
@@ -8504,9 +8520,9 @@ function nc(t, e) {
|
|
|
8504
8520
|
if (r === "plugin" && nt(t, Y`\(\?\(DEFINE\)`, J.DEFAULT))
|
|
8505
8521
|
throw new Error("DEFINE groups cannot be used with recursion");
|
|
8506
8522
|
const s = [], a = nt(t, Y`\\[1-9]`, J.DEFAULT), i = /* @__PURE__ */ new Map(), l = [];
|
|
8507
|
-
let u = !1, c = 0, h = 0,
|
|
8508
|
-
for (he.lastIndex = 0;
|
|
8509
|
-
const { 0: d, groups: { captureName:
|
|
8523
|
+
let u = !1, c = 0, h = 0, f;
|
|
8524
|
+
for (he.lastIndex = 0; f = he.exec(t); ) {
|
|
8525
|
+
const { 0: d, groups: { captureName: p, rDepth: g, gRNameOrNum: C, gRDepth: y } } = f;
|
|
8510
8526
|
if (d === "[")
|
|
8511
8527
|
c++;
|
|
8512
8528
|
else if (c)
|
|
@@ -8520,7 +8536,7 @@ function nc(t, e) {
|
|
|
8520
8536
|
// gone through conversion from named to numbered, so avoid a misleading error
|
|
8521
8537
|
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
|
|
8522
8538
|
);
|
|
8523
|
-
const m = t.slice(0,
|
|
8539
|
+
const m = t.slice(0, f.index), _ = t.slice(he.lastIndex);
|
|
8524
8540
|
if (nt(_, ln, J.DEFAULT))
|
|
8525
8541
|
throw new Error(Gt);
|
|
8526
8542
|
const S = +g - 1;
|
|
@@ -8552,14 +8568,14 @@ function nc(t, e) {
|
|
|
8552
8568
|
}
|
|
8553
8569
|
if (!m)
|
|
8554
8570
|
throw new Error(Y`Recursive \g cannot be used outside the referenced group "${r === "external" ? C : Y`\g<${C}&R=${y}>`}"`);
|
|
8555
|
-
const _ = i.get(C), S =
|
|
8571
|
+
const _ = i.get(C), S = Qu(t, _);
|
|
8556
8572
|
if (a && nt(S, Y`${Et}|\((?!\?)`, J.DEFAULT))
|
|
8557
8573
|
throw new Error(
|
|
8558
8574
|
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
8559
8575
|
// gone through conversion from named to numbered, so avoid a misleading error
|
|
8560
8576
|
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
|
|
8561
8577
|
);
|
|
8562
|
-
const A = t.slice(_,
|
|
8578
|
+
const A = t.slice(_, f.index), D = S.slice(A.length + d.length), L = s.length, j = +y - 1, Z = Cr(
|
|
8563
8579
|
A,
|
|
8564
8580
|
D,
|
|
8565
8581
|
j,
|
|
@@ -8578,10 +8594,10 @@ function nc(t, e) {
|
|
|
8578
8594
|
);
|
|
8579
8595
|
const ee = t.slice(0, _), ce = t.slice(_ + S.length);
|
|
8580
8596
|
t = `${ee}${Z}${ce}`, he.lastIndex += Z.length - d.length - A.length - D.length, l.forEach((te) => te.hasRecursedWithin = !0), u = !0;
|
|
8581
|
-
} else if (
|
|
8582
|
-
h++, i.set(String(h), he.lastIndex), i.set(
|
|
8597
|
+
} else if (p)
|
|
8598
|
+
h++, i.set(String(h), he.lastIndex), i.set(p, he.lastIndex), l.push({
|
|
8583
8599
|
num: h,
|
|
8584
|
-
name:
|
|
8600
|
+
name: p
|
|
8585
8601
|
});
|
|
8586
8602
|
else if (d[0] === "(") {
|
|
8587
8603
|
const m = d === "(";
|
|
@@ -8623,13 +8639,13 @@ function _r(t, e, n, r, o, s, a) {
|
|
|
8623
8639
|
u += En(
|
|
8624
8640
|
t,
|
|
8625
8641
|
Y`${qo}|\\k<(?<backref>[^>]+)>`,
|
|
8626
|
-
({ 0:
|
|
8642
|
+
({ 0: f, groups: { captureName: d, unnamed: p, backref: g } }) => {
|
|
8627
8643
|
if (g && r && !r.has(g))
|
|
8628
|
-
return
|
|
8644
|
+
return f;
|
|
8629
8645
|
const C = `_$${h}`;
|
|
8630
|
-
if (
|
|
8646
|
+
if (p || d) {
|
|
8631
8647
|
const y = a + s.length + 1;
|
|
8632
|
-
return s.push(y),
|
|
8648
|
+
return s.push(y), oc(o, y), p ? f : `(?<${d}${C}>`;
|
|
8633
8649
|
}
|
|
8634
8650
|
return Y`\k<${g}${C}>`;
|
|
8635
8651
|
},
|
|
@@ -8638,7 +8654,7 @@ function _r(t, e, n, r, o, s, a) {
|
|
|
8638
8654
|
}
|
|
8639
8655
|
return u;
|
|
8640
8656
|
}
|
|
8641
|
-
function
|
|
8657
|
+
function oc(t, e) {
|
|
8642
8658
|
for (let n = 0; n < t.length; n++)
|
|
8643
8659
|
t[n] >= e && t[n]++;
|
|
8644
8660
|
}
|
|
@@ -8648,19 +8664,19 @@ function Sr(t, e, n, r, o, s) {
|
|
|
8648
8664
|
Wo(e, qo, () => a++, J.DEFAULT);
|
|
8649
8665
|
const i = s - a + o, l = /* @__PURE__ */ new Map();
|
|
8650
8666
|
return t.forEach((u, c) => {
|
|
8651
|
-
const h = (r - a * n) / n,
|
|
8667
|
+
const h = (r - a * n) / n, f = a * n, d = c > i + a ? c + r : c, p = [];
|
|
8652
8668
|
for (const g of u)
|
|
8653
8669
|
if (g <= i)
|
|
8654
|
-
|
|
8670
|
+
p.push(g);
|
|
8655
8671
|
else if (g > i + a + h)
|
|
8656
|
-
|
|
8672
|
+
p.push(g + r);
|
|
8657
8673
|
else if (g <= i + a)
|
|
8658
8674
|
for (let C = 0; C <= n; C++)
|
|
8659
|
-
|
|
8675
|
+
p.push(g + a * C);
|
|
8660
8676
|
else
|
|
8661
8677
|
for (let C = 0; C <= n; C++)
|
|
8662
|
-
|
|
8663
|
-
l.set(d,
|
|
8678
|
+
p.push(g + f + h * C);
|
|
8679
|
+
l.set(d, p);
|
|
8664
8680
|
}), l;
|
|
8665
8681
|
}
|
|
8666
8682
|
return t;
|
|
@@ -8704,7 +8720,7 @@ function Ve(t, e, n) {
|
|
|
8704
8720
|
function un(t, e) {
|
|
8705
8721
|
return kr[t] >= kr[e];
|
|
8706
8722
|
}
|
|
8707
|
-
function
|
|
8723
|
+
function sc(t, e) {
|
|
8708
8724
|
if (t == null)
|
|
8709
8725
|
throw new Error(e ?? "Value expected");
|
|
8710
8726
|
return t;
|
|
@@ -8713,7 +8729,7 @@ var kr = {
|
|
|
8713
8729
|
ES2025: 2025,
|
|
8714
8730
|
ES2024: 2024,
|
|
8715
8731
|
ES2018: 2018
|
|
8716
|
-
},
|
|
8732
|
+
}, ac = (
|
|
8717
8733
|
/** @type {const} */
|
|
8718
8734
|
{
|
|
8719
8735
|
auto: "auto",
|
|
@@ -8725,7 +8741,7 @@ var kr = {
|
|
|
8725
8741
|
function Xo(t = {}) {
|
|
8726
8742
|
if ({}.toString.call(t) !== "[object Object]")
|
|
8727
8743
|
throw new Error("Unexpected options");
|
|
8728
|
-
if (t.target !== void 0 && !
|
|
8744
|
+
if (t.target !== void 0 && !ac[t.target])
|
|
8729
8745
|
throw new Error(`Unexpected target "${t.target}"`);
|
|
8730
8746
|
const e = {
|
|
8731
8747
|
// Sets the level of emulation rigor/strictness.
|
|
@@ -8769,16 +8785,16 @@ function Xo(t = {}) {
|
|
|
8769
8785
|
};
|
|
8770
8786
|
return e.target === "auto" && (e.target = ae.flagGroups ? "ES2025" : ae.unicodeSets ? "ES2024" : "ES2018"), e;
|
|
8771
8787
|
}
|
|
8772
|
-
var
|
|
8788
|
+
var ic = "[ -\r ]", lc = /* @__PURE__ */ new Set([
|
|
8773
8789
|
M(304),
|
|
8774
8790
|
// İ
|
|
8775
8791
|
M(305)
|
|
8776
8792
|
// ı
|
|
8777
8793
|
]), re = v`[\p{L}\p{M}\p{N}\p{Pc}]`;
|
|
8778
8794
|
function Ko(t) {
|
|
8779
|
-
if (
|
|
8795
|
+
if (lc.has(t))
|
|
8780
8796
|
return [t];
|
|
8781
|
-
const e = /* @__PURE__ */ new Set(), n = t.toLowerCase(), r = n.toUpperCase(), o =
|
|
8797
|
+
const e = /* @__PURE__ */ new Set(), n = t.toLowerCase(), r = n.toUpperCase(), o = hc.get(n), s = uc.get(n), a = cc.get(n);
|
|
8782
8798
|
return [...r].length === 1 && e.add(r), a && e.add(a), o && e.add(o), e.add(n), s && e.add(s), [...e];
|
|
8783
8799
|
}
|
|
8784
8800
|
var An = /* @__PURE__ */ new Map(
|
|
@@ -8873,12 +8889,12 @@ Variation_Selector VS
|
|
|
8873
8889
|
White_Space space
|
|
8874
8890
|
XID_Continue XIDC
|
|
8875
8891
|
XID_Start XIDS`.split(/\s/).map((t) => [xt(t), t])
|
|
8876
|
-
),
|
|
8892
|
+
), uc = /* @__PURE__ */ new Map([
|
|
8877
8893
|
["s", M(383)],
|
|
8878
8894
|
// s, ſ
|
|
8879
8895
|
[M(383), "s"]
|
|
8880
8896
|
// ſ, s
|
|
8881
|
-
]),
|
|
8897
|
+
]), cc = /* @__PURE__ */ new Map([
|
|
8882
8898
|
[M(223), M(7838)],
|
|
8883
8899
|
// ß, ẞ
|
|
8884
8900
|
[M(107), M(8490)],
|
|
@@ -8887,7 +8903,7 @@ XID_Start XIDS`.split(/\s/).map((t) => [xt(t), t])
|
|
|
8887
8903
|
// å, Å (Angstrom)
|
|
8888
8904
|
[M(969), M(8486)]
|
|
8889
8905
|
// ω, Ω (Ohm)
|
|
8890
|
-
]),
|
|
8906
|
+
]), hc = new Map([
|
|
8891
8907
|
ie(453),
|
|
8892
8908
|
ie(456),
|
|
8893
8909
|
ie(459),
|
|
@@ -8898,7 +8914,7 @@ XID_Start XIDS`.split(/\s/).map((t) => [xt(t), t])
|
|
|
8898
8914
|
ie(8124),
|
|
8899
8915
|
ie(8140),
|
|
8900
8916
|
ie(8188)
|
|
8901
|
-
]),
|
|
8917
|
+
]), fc = /* @__PURE__ */ new Map([
|
|
8902
8918
|
["alnum", v`[\p{Alpha}\p{Nd}]`],
|
|
8903
8919
|
["alpha", v`\p{Alpha}`],
|
|
8904
8920
|
["ascii", v`\p{ASCII}`],
|
|
@@ -8915,7 +8931,7 @@ XID_Start XIDS`.split(/\s/).map((t) => [xt(t), t])
|
|
|
8915
8931
|
["word", v`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],
|
|
8916
8932
|
["xdigit", v`\p{AHex}`]
|
|
8917
8933
|
]);
|
|
8918
|
-
function
|
|
8934
|
+
function pc(t, e) {
|
|
8919
8935
|
const n = [];
|
|
8920
8936
|
for (let r = t; r <= e; r++)
|
|
8921
8937
|
n.push(r);
|
|
@@ -8926,7 +8942,7 @@ function ie(t) {
|
|
|
8926
8942
|
return [e.toLowerCase(), e];
|
|
8927
8943
|
}
|
|
8928
8944
|
function Ft(t, e) {
|
|
8929
|
-
return
|
|
8945
|
+
return pc(t, e).map((n) => ie(n));
|
|
8930
8946
|
}
|
|
8931
8947
|
var Yo = /* @__PURE__ */ new Set([
|
|
8932
8948
|
"Lower",
|
|
@@ -8944,7 +8960,7 @@ var Yo = /* @__PURE__ */ new Set([
|
|
|
8944
8960
|
// generally extreme edge cases and using such properties case insensitively generally produces
|
|
8945
8961
|
// undesired behavior anyway
|
|
8946
8962
|
]);
|
|
8947
|
-
function
|
|
8963
|
+
function dc(t, e) {
|
|
8948
8964
|
const n = {
|
|
8949
8965
|
// A couple edge cases exist where options `accuracy` and `bestEffortTarget` are used:
|
|
8950
8966
|
// - `CharacterSet` kind `text_segment` (`\X`): An exact representation would require heavy
|
|
@@ -8975,7 +8991,7 @@ function pc(t, e) {
|
|
|
8975
8991
|
spaceIsAscii: t.flags.spaceIsAscii,
|
|
8976
8992
|
wordIsAscii: t.flags.wordIsAscii
|
|
8977
8993
|
};
|
|
8978
|
-
Be(t,
|
|
8994
|
+
Be(t, gc, r);
|
|
8979
8995
|
const o = {
|
|
8980
8996
|
dotAll: t.flags.dotAll,
|
|
8981
8997
|
ignoreCase: t.flags.ignoreCase
|
|
@@ -8990,16 +9006,16 @@ function pc(t, e) {
|
|
|
8990
9006
|
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
8991
9007
|
subroutineRefMap: r.subroutineRefMap
|
|
8992
9008
|
};
|
|
8993
|
-
Be(t,
|
|
9009
|
+
Be(t, mc, s);
|
|
8994
9010
|
const a = {
|
|
8995
9011
|
groupsByName: s.groupsByName,
|
|
8996
9012
|
highestOrphanBackref: 0,
|
|
8997
9013
|
numCapturesToLeft: 0,
|
|
8998
9014
|
reffedNodesByReferencer: s.reffedNodesByReferencer
|
|
8999
9015
|
};
|
|
9000
|
-
return Be(t,
|
|
9016
|
+
return Be(t, yc, a), t._originMap = s.groupOriginByCopy, t._strategy = r.strategy, t;
|
|
9001
9017
|
}
|
|
9002
|
-
var
|
|
9018
|
+
var gc = {
|
|
9003
9019
|
AbsenceFunction({ node: t, parent: e, replaceWith: n }) {
|
|
9004
9020
|
const { body: r, kind: o } = t;
|
|
9005
9021
|
if (o === "repeater") {
|
|
@@ -9035,7 +9051,7 @@ var dc = {
|
|
|
9035
9051
|
}
|
|
9036
9052
|
},
|
|
9037
9053
|
Assertion({ node: t, parent: e, key: n, container: r, root: o, remove: s, replaceWith: a }, i) {
|
|
9038
|
-
const { kind: l, negate: u } = t, { asciiWordBoundaries: c, avoidSubclass: h, supportedGNodes:
|
|
9054
|
+
const { kind: l, negate: u } = t, { asciiWordBoundaries: c, avoidSubclass: h, supportedGNodes: f, wordIsAscii: d } = i;
|
|
9039
9055
|
if (l === "text_segment_boundary")
|
|
9040
9056
|
throw new Error(`Unsupported text segment boundary "\\${u ? "Y" : "y"}"`);
|
|
9041
9057
|
if (l === "line_end")
|
|
@@ -9047,11 +9063,11 @@ var dc = {
|
|
|
9047
9063
|
else if (l === "line_start")
|
|
9048
9064
|
a(P(oe(v`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), e));
|
|
9049
9065
|
else if (l === "search_start")
|
|
9050
|
-
if (
|
|
9066
|
+
if (f.has(t))
|
|
9051
9067
|
o.flags.sticky = !0, s();
|
|
9052
9068
|
else {
|
|
9053
|
-
const
|
|
9054
|
-
if (
|
|
9069
|
+
const p = r[n - 1];
|
|
9070
|
+
if (p && kc(p))
|
|
9055
9071
|
a(P(pe({ negate: !0 }), e));
|
|
9056
9072
|
else {
|
|
9057
9073
|
if (h)
|
|
@@ -9063,8 +9079,8 @@ var dc = {
|
|
|
9063
9079
|
a(P(oe(v`(?=\n?\z)`), e));
|
|
9064
9080
|
else if (l === "word_boundary") {
|
|
9065
9081
|
if (!d && !c) {
|
|
9066
|
-
const
|
|
9067
|
-
a(P(oe(u ? g :
|
|
9082
|
+
const p = `(?:(?<=${re})(?!${re})|(?<!${re})(?=${re}))`, g = `(?:(?<=${re})(?=${re})|(?<!${re})(?!${re}))`;
|
|
9083
|
+
a(P(oe(u ? g : p), e));
|
|
9068
9084
|
}
|
|
9069
9085
|
} else
|
|
9070
9086
|
throw new Error(`Unexpected assertion kind "${l}"`);
|
|
@@ -9090,7 +9106,7 @@ var dc = {
|
|
|
9090
9106
|
return;
|
|
9091
9107
|
}
|
|
9092
9108
|
if (a && (l === "space" || c === "space")) {
|
|
9093
|
-
n(P(Ut(oe(
|
|
9109
|
+
n(P(Ut(oe(ic), u), e));
|
|
9094
9110
|
return;
|
|
9095
9111
|
}
|
|
9096
9112
|
if (i && (l === "word" || c === "word")) {
|
|
@@ -9104,10 +9120,10 @@ var dc = {
|
|
|
9104
9120
|
else if (l !== "dot") if (l === "text_segment") {
|
|
9105
9121
|
if (r === "strict")
|
|
9106
9122
|
throw new Error(v`Use of "\X" requires non-strict accuracy`);
|
|
9107
|
-
const h = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",
|
|
9123
|
+
const h = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", f = v`\p{RI}{2}|${h}(?:\u200D${h})*`;
|
|
9108
9124
|
n(P(oe(
|
|
9109
9125
|
// Close approximation of an extended grapheme cluster; see: <unicode.org/reports/tr29/>
|
|
9110
|
-
v`(?>\r\n|${o ? v`\p{RGI_Emoji}` :
|
|
9126
|
+
v`(?>\r\n|${o ? v`\p{RGI_Emoji}` : f}|\P{M}\p{M}*)`,
|
|
9111
9127
|
// Allow JS property `RGI_Emoji` through
|
|
9112
9128
|
{ skipPropertyNameValidation: !0 }
|
|
9113
9129
|
), e));
|
|
@@ -9128,7 +9144,7 @@ var dc = {
|
|
|
9128
9144
|
}[c];
|
|
9129
9145
|
u && (h = `\0-${M(h.codePointAt(0) - 1)}${M(h.codePointAt(2) + 1)}-`), n(P(oe(`[${h}]`), e));
|
|
9130
9146
|
} else
|
|
9131
|
-
n(P(Ut(oe(
|
|
9147
|
+
n(P(Ut(oe(fc.get(c)), u), e));
|
|
9132
9148
|
else if (l === "property")
|
|
9133
9149
|
An.has(xt(c)) || (t.key = "sc");
|
|
9134
9150
|
else if (l === "space")
|
|
@@ -9152,8 +9168,8 @@ var dc = {
|
|
|
9152
9168
|
Fo(u, { type: "Group" }) && u.body[0].body.length === 1 ? u.body[0] : n;
|
|
9153
9169
|
if (e.parent !== h || h.body.length > 1)
|
|
9154
9170
|
throw new Error(v`Uses "\K" in a way that's unsupported`);
|
|
9155
|
-
const
|
|
9156
|
-
|
|
9171
|
+
const f = pe({ behind: !0 });
|
|
9172
|
+
f.body[0].body = s(), o(P(f, e));
|
|
9157
9173
|
} else
|
|
9158
9174
|
throw new Error(`Unexpected directive kind "${i}"`);
|
|
9159
9175
|
},
|
|
@@ -9250,7 +9266,7 @@ var dc = {
|
|
|
9250
9266
|
let { ref: n } = t;
|
|
9251
9267
|
typeof n == "string" && !jt(n) && (n = Bt(n, e), t.ref = n);
|
|
9252
9268
|
}
|
|
9253
|
-
},
|
|
9269
|
+
}, mc = {
|
|
9254
9270
|
Backreference({ node: t }, { multiplexCapturesToLeftByRef: e, reffedNodesByReferencer: n }) {
|
|
9255
9271
|
const { orphan: r, ref: o } = t;
|
|
9256
9272
|
r || n.set(t, [...e.get(o).map(({ node: s }) => s)]);
|
|
@@ -9277,13 +9293,13 @@ var dc = {
|
|
|
9277
9293
|
i.set(t.number, t), a.set(t.number, []), t.name && Ve(a, t.name, []);
|
|
9278
9294
|
const c = a.get(t.name ?? t.number);
|
|
9279
9295
|
for (let h = 0; h < c.length; h++) {
|
|
9280
|
-
const
|
|
9296
|
+
const f = c[h];
|
|
9281
9297
|
if (
|
|
9282
9298
|
// This group is from subroutine expansion, and there's a multiplex value from either the
|
|
9283
9299
|
// origin node or a prior subroutine expansion group with the same origin
|
|
9284
|
-
u ===
|
|
9300
|
+
u === f.node || u && u === f.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
|
|
9285
9301
|
// group that refers to this group
|
|
9286
|
-
t ===
|
|
9302
|
+
t === f.origin
|
|
9287
9303
|
) {
|
|
9288
9304
|
c.splice(h, 1);
|
|
9289
9305
|
break;
|
|
@@ -9291,16 +9307,16 @@ var dc = {
|
|
|
9291
9307
|
}
|
|
9292
9308
|
if (a.get(t.number).push({ node: t, origin: u }), t.name && a.get(t.name).push({ node: t, origin: u }), t.name) {
|
|
9293
9309
|
const h = Ve(s, t.name, /* @__PURE__ */ new Map());
|
|
9294
|
-
let
|
|
9310
|
+
let f = !1;
|
|
9295
9311
|
if (u)
|
|
9296
|
-
|
|
9312
|
+
f = !0;
|
|
9297
9313
|
else
|
|
9298
9314
|
for (const d of h.values())
|
|
9299
9315
|
if (!d.hasDuplicateNameToRemove) {
|
|
9300
|
-
|
|
9316
|
+
f = !0;
|
|
9301
9317
|
break;
|
|
9302
9318
|
}
|
|
9303
|
-
s.get(t.name).set(t, { node: t, hasDuplicateNameToRemove:
|
|
9319
|
+
s.get(t.name).set(t, { node: t, hasDuplicateNameToRemove: f });
|
|
9304
9320
|
}
|
|
9305
9321
|
},
|
|
9306
9322
|
exit({ node: t }, { openRefs: e }) {
|
|
@@ -9330,23 +9346,23 @@ var dc = {
|
|
|
9330
9346
|
);
|
|
9331
9347
|
let u = l;
|
|
9332
9348
|
if (!i) {
|
|
9333
|
-
const c = Qo(
|
|
9349
|
+
const c = Qo(Cc(
|
|
9334
9350
|
a,
|
|
9335
|
-
(
|
|
9351
|
+
(f) => f.type === "Group" && !!f.flags
|
|
9336
9352
|
)), h = c ? bt(r.globalFlags, c) : r.globalFlags;
|
|
9337
|
-
|
|
9338
|
-
flags:
|
|
9353
|
+
bc(h, r.currentFlags) || (u = Q({
|
|
9354
|
+
flags: _c(h)
|
|
9339
9355
|
}), u.body[0].body.push(l));
|
|
9340
9356
|
}
|
|
9341
9357
|
n(P(u, e), { traverse: !i });
|
|
9342
9358
|
}
|
|
9343
|
-
},
|
|
9359
|
+
}, yc = {
|
|
9344
9360
|
Backreference({ node: t, parent: e, replaceWith: n }, r) {
|
|
9345
9361
|
if (t.orphan) {
|
|
9346
9362
|
r.highestOrphanBackref = Math.max(r.highestOrphanBackref, t.ref);
|
|
9347
9363
|
return;
|
|
9348
9364
|
}
|
|
9349
|
-
const s = r.reffedNodesByReferencer.get(t).filter((a) =>
|
|
9365
|
+
const s = r.reffedNodesByReferencer.get(t).filter((a) => wc(a, t));
|
|
9350
9366
|
if (!s.length)
|
|
9351
9367
|
n(P(pe({ negate: !0 }), e));
|
|
9352
9368
|
else if (s.length > 1) {
|
|
@@ -9383,10 +9399,10 @@ function Jo(t) {
|
|
|
9383
9399
|
}
|
|
9384
9400
|
});
|
|
9385
9401
|
}
|
|
9386
|
-
function
|
|
9402
|
+
function bc(t, e) {
|
|
9387
9403
|
return t.dotAll === e.dotAll && t.ignoreCase === e.ignoreCase;
|
|
9388
9404
|
}
|
|
9389
|
-
function
|
|
9405
|
+
function wc(t, e) {
|
|
9390
9406
|
let n = e;
|
|
9391
9407
|
do {
|
|
9392
9408
|
if (n.type === "Regex")
|
|
@@ -9415,7 +9431,7 @@ function vr(t) {
|
|
|
9415
9431
|
const e = zo(t);
|
|
9416
9432
|
return e.isRecursive = !0, e;
|
|
9417
9433
|
}
|
|
9418
|
-
function
|
|
9434
|
+
function Cc(t, e) {
|
|
9419
9435
|
const n = [];
|
|
9420
9436
|
for (; t = t.parent; )
|
|
9421
9437
|
(!e || e(t)) && n.push(t);
|
|
@@ -9435,7 +9451,7 @@ function Qo(t) {
|
|
|
9435
9451
|
});
|
|
9436
9452
|
}), Object.keys(n.enable).length || delete n.enable, Object.keys(n.disable).length || delete n.disable, n.enable || n.disable ? n : null;
|
|
9437
9453
|
}
|
|
9438
|
-
function
|
|
9454
|
+
function _c({ dotAll: t, ignoreCase: e }) {
|
|
9439
9455
|
const n = {};
|
|
9440
9456
|
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;
|
|
9441
9457
|
}
|
|
@@ -9446,7 +9462,7 @@ function es(t) {
|
|
|
9446
9462
|
return Array.isArray(e) ? e : e ? [e] : null;
|
|
9447
9463
|
}
|
|
9448
9464
|
function ts(t) {
|
|
9449
|
-
const e = t.find((n) => n.kind === "search_start" ||
|
|
9465
|
+
const e = t.find((n) => n.kind === "search_start" || vc(n, { negate: !1 }) || !Sc(n));
|
|
9450
9466
|
if (!e)
|
|
9451
9467
|
return null;
|
|
9452
9468
|
if (e.kind === "search_start")
|
|
@@ -9472,10 +9488,10 @@ function ns(t, e) {
|
|
|
9472
9488
|
return !0;
|
|
9473
9489
|
return !1;
|
|
9474
9490
|
}
|
|
9475
|
-
function
|
|
9491
|
+
function Sc({ type: t }) {
|
|
9476
9492
|
return t === "Assertion" || t === "Directive" || t === "LookaroundAssertion";
|
|
9477
9493
|
}
|
|
9478
|
-
function
|
|
9494
|
+
function kc(t) {
|
|
9479
9495
|
const e = [
|
|
9480
9496
|
"Character",
|
|
9481
9497
|
"CharacterClass",
|
|
@@ -9483,7 +9499,7 @@ function Sc(t) {
|
|
|
9483
9499
|
];
|
|
9484
9500
|
return e.includes(t.type) || t.type === "Quantifier" && t.min && e.includes(t.body.type);
|
|
9485
9501
|
}
|
|
9486
|
-
function
|
|
9502
|
+
function vc(t, e) {
|
|
9487
9503
|
const n = {
|
|
9488
9504
|
negate: null,
|
|
9489
9505
|
...e
|
|
@@ -9514,20 +9530,20 @@ function le(t, e) {
|
|
|
9514
9530
|
function P(t, e) {
|
|
9515
9531
|
return Jo(t), t.parent = e, t;
|
|
9516
9532
|
}
|
|
9517
|
-
function
|
|
9533
|
+
function xc(t, e) {
|
|
9518
9534
|
const n = Xo(e), r = un(n.target, "ES2024"), o = un(n.target, "ES2025"), s = n.rules.recursionLimit;
|
|
9519
9535
|
if (!Number.isInteger(s) || s < 2 || s > 20)
|
|
9520
9536
|
throw new Error("Invalid recursionLimit; use 2-20");
|
|
9521
9537
|
let a = null, i = null;
|
|
9522
9538
|
if (!o) {
|
|
9523
9539
|
const d = [t.flags.ignoreCase];
|
|
9524
|
-
Be(t,
|
|
9540
|
+
Be(t, Ec, {
|
|
9525
9541
|
getCurrentModI: () => d.at(-1),
|
|
9526
9542
|
popModI() {
|
|
9527
9543
|
d.pop();
|
|
9528
9544
|
},
|
|
9529
|
-
pushModI(
|
|
9530
|
-
d.push(
|
|
9545
|
+
pushModI(p) {
|
|
9546
|
+
d.push(p);
|
|
9531
9547
|
},
|
|
9532
9548
|
setHasCasedChar() {
|
|
9533
9549
|
d.at(-1) ? a = !0 : i = !0;
|
|
@@ -9561,19 +9577,19 @@ function vc(t, e) {
|
|
|
9561
9577
|
verbose: n.verbose
|
|
9562
9578
|
};
|
|
9563
9579
|
function h(d) {
|
|
9564
|
-
return c.lastNode = u, u = d,
|
|
9580
|
+
return c.lastNode = u, u = d, sc(Ac[d.type], `Unexpected node type "${d.type}"`)(d, c, h);
|
|
9565
9581
|
}
|
|
9566
|
-
const
|
|
9582
|
+
const f = {
|
|
9567
9583
|
pattern: t.body.map(h).join("|"),
|
|
9568
9584
|
// Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
|
|
9569
9585
|
flags: h(t.flags),
|
|
9570
9586
|
options: { ...t.options }
|
|
9571
9587
|
};
|
|
9572
|
-
return r || (delete
|
|
9573
|
-
d.hidden &&
|
|
9574
|
-
}),
|
|
9588
|
+
return r || (delete f.options.force.v, f.options.disable.v = !0, f.options.unicodeSetsPlugin = null), f._captureTransfers = /* @__PURE__ */ new Map(), f._hiddenCaptures = [], c.captureMap.forEach((d, p) => {
|
|
9589
|
+
d.hidden && f._hiddenCaptures.push(p), d.transferTo && Ve(f._captureTransfers, d.transferTo, []).push(p);
|
|
9590
|
+
}), f;
|
|
9575
9591
|
}
|
|
9576
|
-
var
|
|
9592
|
+
var Ec = {
|
|
9577
9593
|
"*": {
|
|
9578
9594
|
enter({ node: t }, e) {
|
|
9579
9595
|
if (Er(t)) {
|
|
@@ -9599,7 +9615,7 @@ var xc = {
|
|
|
9599
9615
|
CharacterSet({ node: t }, e) {
|
|
9600
9616
|
t.kind === "property" && Yo.has(t.value) && e.setHasCasedChar();
|
|
9601
9617
|
}
|
|
9602
|
-
},
|
|
9618
|
+
}, Ac = {
|
|
9603
9619
|
/**
|
|
9604
9620
|
@param {AlternativeNode} node
|
|
9605
9621
|
*/
|
|
@@ -9671,10 +9687,10 @@ var xc = {
|
|
|
9671
9687
|
(h) => h.type === "CharacterClass" && h.kind === "union" && h.negate
|
|
9672
9688
|
);
|
|
9673
9689
|
if (c.length) {
|
|
9674
|
-
const h = Q(),
|
|
9675
|
-
return h.parent = s,
|
|
9676
|
-
const
|
|
9677
|
-
d.parent =
|
|
9690
|
+
const h = Q(), f = h.body[0];
|
|
9691
|
+
return h.parent = s, f.parent = h, a = a.filter((d) => !c.includes(d)), t.body = a, a.length ? (t.parent = f, f.body.push(t)) : h.body.pop(), c.forEach((d) => {
|
|
9692
|
+
const p = me({ body: [d] });
|
|
9693
|
+
d.parent = p, p.parent = h, h.body.push(p);
|
|
9678
9694
|
}), n(h);
|
|
9679
9695
|
}
|
|
9680
9696
|
}
|
|
@@ -9705,7 +9721,7 @@ var xc = {
|
|
|
9705
9721
|
}, s = _e(n, o), a = _e(r, o), i = /* @__PURE__ */ new Set();
|
|
9706
9722
|
if (e.useAppliedIgnoreCase && e.currentFlags.ignoreCase) {
|
|
9707
9723
|
const l = rs(t);
|
|
9708
|
-
|
|
9724
|
+
Pc(l).forEach((c) => {
|
|
9709
9725
|
i.add(
|
|
9710
9726
|
Array.isArray(c) ? `${_e(c[0], o)}-${_e(c[1], o)}` : _e(c, o)
|
|
9711
9727
|
);
|
|
@@ -9753,7 +9769,7 @@ var xc = {
|
|
|
9753
9769
|
const a = o.currentFlags;
|
|
9754
9770
|
n && (o.currentFlags = bt(a, n));
|
|
9755
9771
|
const i = e.map(s).join("|"), l = !o.verbose && e.length === 1 && // Single alt
|
|
9756
|
-
r.type !== "Quantifier" && !t && (!o.useFlagMods || !n) ? i : `(?${
|
|
9772
|
+
r.type !== "Quantifier" && !t && (!o.useFlagMods || !n) ? i : `(?${$c(t, n, o.useFlagMods)}${i})`;
|
|
9757
9773
|
return o.currentFlags = a, l;
|
|
9758
9774
|
},
|
|
9759
9775
|
/**
|
|
@@ -9766,7 +9782,7 @@ var xc = {
|
|
|
9766
9782
|
@param {QuantifierNode} node
|
|
9767
9783
|
*/
|
|
9768
9784
|
Quantifier(t, e, n) {
|
|
9769
|
-
return n(t.body) +
|
|
9785
|
+
return n(t.body) + Tc(t);
|
|
9770
9786
|
},
|
|
9771
9787
|
/**
|
|
9772
9788
|
@param {SubroutineNode & {isRecursive: true}} node
|
|
@@ -9777,7 +9793,7 @@ var xc = {
|
|
|
9777
9793
|
const r = n.recursionLimit;
|
|
9778
9794
|
return e === 0 ? `(?R=${r})` : v`\g<${e}&R=${r}>`;
|
|
9779
9795
|
}
|
|
9780
|
-
},
|
|
9796
|
+
}, Rc = /* @__PURE__ */ new Set([
|
|
9781
9797
|
"$",
|
|
9782
9798
|
"(",
|
|
9783
9799
|
")",
|
|
@@ -9792,7 +9808,7 @@ var xc = {
|
|
|
9792
9808
|
"{",
|
|
9793
9809
|
"|",
|
|
9794
9810
|
"}"
|
|
9795
|
-
]),
|
|
9811
|
+
]), Ic = /* @__PURE__ */ new Set([
|
|
9796
9812
|
"-",
|
|
9797
9813
|
"\\",
|
|
9798
9814
|
"]",
|
|
@@ -9800,7 +9816,7 @@ var xc = {
|
|
|
9800
9816
|
// Literal `[` doesn't require escaping with flag u, but this can help work around regex source
|
|
9801
9817
|
// linters and regex syntax processors that expect unescaped `[` to create a nested class
|
|
9802
9818
|
"["
|
|
9803
|
-
]),
|
|
9819
|
+
]), Nc = /* @__PURE__ */ new Set([
|
|
9804
9820
|
"(",
|
|
9805
9821
|
")",
|
|
9806
9822
|
"-",
|
|
@@ -9848,9 +9864,9 @@ var xc = {
|
|
|
9848
9864
|
// paragraph separator
|
|
9849
9865
|
[65279, v`\uFEFF`]
|
|
9850
9866
|
// ZWNBSP/BOM
|
|
9851
|
-
]),
|
|
9867
|
+
]), Lc = /^\p{Cased}$/u;
|
|
9852
9868
|
function Rn(t) {
|
|
9853
|
-
return
|
|
9869
|
+
return Lc.test(t);
|
|
9854
9870
|
}
|
|
9855
9871
|
function rs(t, e) {
|
|
9856
9872
|
const n = !!e?.firstOnly, r = t.min.value, o = t.max.value, s = [];
|
|
@@ -9876,20 +9892,20 @@ function _e(t, { escDigit: e, inCharClass: n, useFlagV: r }) {
|
|
|
9876
9892
|
// Control chars, etc.; condition modeled on the Chrome developer console's display for strings
|
|
9877
9893
|
t < 32 || t > 126 && t < 160 || // Unicode planes 4-16; unassigned, special purpose, and private use area
|
|
9878
9894
|
t > 262143 || // Avoid corrupting a preceding backref by immediately following it with a literal digit
|
|
9879
|
-
e &&
|
|
9895
|
+
e && Mc(t)
|
|
9880
9896
|
)
|
|
9881
9897
|
return t > 255 ? `\\u{${t.toString(16).toUpperCase()}}` : `\\x${t.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
9882
|
-
const o = n ? r ?
|
|
9898
|
+
const o = n ? r ? Nc : Ic : Rc, s = M(t);
|
|
9883
9899
|
return (o.has(s) ? "\\" : "") + s;
|
|
9884
9900
|
}
|
|
9885
|
-
function
|
|
9901
|
+
function Pc(t) {
|
|
9886
9902
|
const e = t.map((o) => o.codePointAt(0)).sort((o, s) => o - s), n = [];
|
|
9887
9903
|
let r = null;
|
|
9888
9904
|
for (let o = 0; o < e.length; o++)
|
|
9889
9905
|
e[o + 1] === e[o] + 1 ? r ??= e[o] : r === null ? n.push(e[o]) : (n.push([r, e[o]]), r = null);
|
|
9890
9906
|
return n;
|
|
9891
9907
|
}
|
|
9892
|
-
function
|
|
9908
|
+
function $c(t, e, n) {
|
|
9893
9909
|
if (t)
|
|
9894
9910
|
return ">";
|
|
9895
9911
|
let r = "";
|
|
@@ -9899,7 +9915,7 @@ function Pc(t, e, n) {
|
|
|
9899
9915
|
}
|
|
9900
9916
|
return `${r}:`;
|
|
9901
9917
|
}
|
|
9902
|
-
function
|
|
9918
|
+
function Tc({ kind: t, max: e, min: n }) {
|
|
9903
9919
|
let r;
|
|
9904
9920
|
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 + {
|
|
9905
9921
|
greedy: "",
|
|
@@ -9910,13 +9926,13 @@ function $c({ kind: t, max: e, min: n }) {
|
|
|
9910
9926
|
function Er({ type: t }) {
|
|
9911
9927
|
return t === "CapturingGroup" || t === "Group" || t === "LookaroundAssertion";
|
|
9912
9928
|
}
|
|
9913
|
-
function
|
|
9929
|
+
function Mc(t) {
|
|
9914
9930
|
return t > 47 && t < 58;
|
|
9915
9931
|
}
|
|
9916
9932
|
function Ar({ type: t, value: e }) {
|
|
9917
9933
|
return t === "Character" && e === 45;
|
|
9918
9934
|
}
|
|
9919
|
-
var
|
|
9935
|
+
var Oc = class cn extends RegExp {
|
|
9920
9936
|
/**
|
|
9921
9937
|
@type {Map<number, {
|
|
9922
9938
|
hidden?: true;
|
|
@@ -9974,7 +9990,7 @@ var Mc = class cn extends RegExp {
|
|
|
9974
9990
|
transfers: [],
|
|
9975
9991
|
...r
|
|
9976
9992
|
};
|
|
9977
|
-
super(o ? "" : e, n), this.#r = e, this.#t =
|
|
9993
|
+
super(o ? "" : e, n), this.#r = e, this.#t = Gc(s.hiddenCaptures, s.transfers), this.#o = s.strategy, this.rawOptions = r ?? {};
|
|
9978
9994
|
}
|
|
9979
9995
|
o || (this.#e = this);
|
|
9980
9996
|
}
|
|
@@ -9993,7 +10009,7 @@ var Mc = class cn extends RegExp {
|
|
|
9993
10009
|
if (this.#o === "clip_search" && n && r) {
|
|
9994
10010
|
this.lastIndex = 0;
|
|
9995
10011
|
const o = this.#s(e.slice(r));
|
|
9996
|
-
return o && (
|
|
10012
|
+
return o && (Dc(o, r, e, this.hasIndices), this.lastIndex += r), o;
|
|
9997
10013
|
}
|
|
9998
10014
|
return this.#s(e);
|
|
9999
10015
|
}
|
|
@@ -10019,7 +10035,7 @@ var Mc = class cn extends RegExp {
|
|
|
10019
10035
|
if (!u)
|
|
10020
10036
|
throw new Error(`Invalid capture transfer to "${u}"`);
|
|
10021
10037
|
if (n[u] = r[a], this.hasIndices && (n.indices[u] = o[a]), n.groups) {
|
|
10022
|
-
this.#n || (this.#n =
|
|
10038
|
+
this.#n || (this.#n = Fc(this.source));
|
|
10023
10039
|
const c = this.#n.get(l);
|
|
10024
10040
|
c && (n.groups[c] = r[a], this.hasIndices && (n.indices.groups[c] = o[a]));
|
|
10025
10041
|
}
|
|
@@ -10028,7 +10044,7 @@ var Mc = class cn extends RegExp {
|
|
|
10028
10044
|
return n;
|
|
10029
10045
|
}
|
|
10030
10046
|
};
|
|
10031
|
-
function
|
|
10047
|
+
function Dc(t, e, n, r) {
|
|
10032
10048
|
if (t.index += e, t.input = n, r) {
|
|
10033
10049
|
const o = t.indices;
|
|
10034
10050
|
for (let a = 0; a < o.length; a++) {
|
|
@@ -10042,7 +10058,7 @@ function Oc(t, e, n, r) {
|
|
|
10042
10058
|
});
|
|
10043
10059
|
}
|
|
10044
10060
|
}
|
|
10045
|
-
function
|
|
10061
|
+
function Gc(t, e) {
|
|
10046
10062
|
const n = /* @__PURE__ */ new Map();
|
|
10047
10063
|
for (const r of t)
|
|
10048
10064
|
n.set(r, {
|
|
@@ -10053,7 +10069,7 @@ function Dc(t, e) {
|
|
|
10053
10069
|
Ve(n, s, {}).transferTo = r;
|
|
10054
10070
|
return n;
|
|
10055
10071
|
}
|
|
10056
|
-
function
|
|
10072
|
+
function Fc(t) {
|
|
10057
10073
|
const e = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, n = /* @__PURE__ */ new Map();
|
|
10058
10074
|
let r = 0, o = 0, s;
|
|
10059
10075
|
for (; s = e.exec(t); ) {
|
|
@@ -10062,11 +10078,11 @@ function Gc(t) {
|
|
|
10062
10078
|
}
|
|
10063
10079
|
return n;
|
|
10064
10080
|
}
|
|
10065
|
-
function Fc(t, e) {
|
|
10066
|
-
const n = Bc(t, e);
|
|
10067
|
-
return n.options ? new Mc(n.pattern, n.flags, n.options) : new RegExp(n.pattern, n.flags);
|
|
10068
|
-
}
|
|
10069
10081
|
function Bc(t, e) {
|
|
10082
|
+
const n = jc(t, e);
|
|
10083
|
+
return n.options ? new Oc(n.pattern, n.flags, n.options) : new RegExp(n.pattern, n.flags);
|
|
10084
|
+
}
|
|
10085
|
+
function jc(t, e) {
|
|
10070
10086
|
const n = Xo(e), r = Bo(t, {
|
|
10071
10087
|
flags: n.flags,
|
|
10072
10088
|
normalizeUnknownPropertyNames: !0,
|
|
@@ -10076,16 +10092,16 @@ function Bc(t, e) {
|
|
|
10076
10092
|
},
|
|
10077
10093
|
skipBackrefValidation: n.rules.allowOrphanBackrefs,
|
|
10078
10094
|
unicodePropertyMap: An
|
|
10079
|
-
}), o =
|
|
10095
|
+
}), o = dc(r, {
|
|
10080
10096
|
accuracy: n.accuracy,
|
|
10081
10097
|
asciiWordBoundaries: n.rules.asciiWordBoundaries,
|
|
10082
10098
|
avoidSubclass: n.avoidSubclass,
|
|
10083
10099
|
bestEffortTarget: n.target
|
|
10084
|
-
}), s =
|
|
10100
|
+
}), s = xc(o, n), a = rc(s.pattern, {
|
|
10085
10101
|
captureTransfers: s._captureTransfers,
|
|
10086
10102
|
hiddenCaptures: s._hiddenCaptures,
|
|
10087
10103
|
mode: "external"
|
|
10088
|
-
}), i =
|
|
10104
|
+
}), i = tc(a.pattern), l = ec(i.pattern, {
|
|
10089
10105
|
captureTransfers: a.captureTransfers,
|
|
10090
10106
|
hiddenCaptures: a.hiddenCaptures
|
|
10091
10107
|
}), u = {
|
|
@@ -10096,18 +10112,18 @@ function Bc(t, e) {
|
|
|
10096
10112
|
if (n.lazyCompileLength !== 1 / 0)
|
|
10097
10113
|
throw new Error("Lazy compilation requires subclass");
|
|
10098
10114
|
} else {
|
|
10099
|
-
const c = l.hiddenCaptures.sort((
|
|
10100
|
-
(c.length || h.length ||
|
|
10115
|
+
const c = l.hiddenCaptures.sort((p, g) => p - g), h = Array.from(l.captureTransfers), f = o._strategy, d = u.pattern.length >= n.lazyCompileLength;
|
|
10116
|
+
(c.length || h.length || f || d) && (u.options = {
|
|
10101
10117
|
...c.length && { hiddenCaptures: c },
|
|
10102
10118
|
...h.length && { transfers: h },
|
|
10103
|
-
...
|
|
10119
|
+
...f && { strategy: f },
|
|
10104
10120
|
...d && { lazyCompile: d }
|
|
10105
10121
|
});
|
|
10106
10122
|
}
|
|
10107
10123
|
return u;
|
|
10108
10124
|
}
|
|
10109
10125
|
const Rr = 4294967295;
|
|
10110
|
-
class
|
|
10126
|
+
class Uc {
|
|
10111
10127
|
constructor(e, n = {}) {
|
|
10112
10128
|
this.patterns = e, this.options = n;
|
|
10113
10129
|
const {
|
|
@@ -10181,8 +10197,8 @@ class jc {
|
|
|
10181
10197
|
return null;
|
|
10182
10198
|
}
|
|
10183
10199
|
}
|
|
10184
|
-
function
|
|
10185
|
-
return
|
|
10200
|
+
function zc(t, e) {
|
|
10201
|
+
return Bc(
|
|
10186
10202
|
t,
|
|
10187
10203
|
{
|
|
10188
10204
|
global: !0,
|
|
@@ -10208,7 +10224,7 @@ function Uc(t, e) {
|
|
|
10208
10224
|
}
|
|
10209
10225
|
);
|
|
10210
10226
|
}
|
|
10211
|
-
function
|
|
10227
|
+
function Hc(t = {}) {
|
|
10212
10228
|
const e = Object.assign(
|
|
10213
10229
|
{
|
|
10214
10230
|
target: "auto",
|
|
@@ -10216,9 +10232,9 @@ function zc(t = {}) {
|
|
|
10216
10232
|
},
|
|
10217
10233
|
t
|
|
10218
10234
|
);
|
|
10219
|
-
return e.regexConstructor ||= (n) =>
|
|
10235
|
+
return e.regexConstructor ||= (n) => zc(n, { target: e.target }), {
|
|
10220
10236
|
createScanner(n) {
|
|
10221
|
-
return new
|
|
10237
|
+
return new Uc(n, e);
|
|
10222
10238
|
},
|
|
10223
10239
|
createString(n) {
|
|
10224
10240
|
return {
|
|
@@ -10227,8 +10243,8 @@ function zc(t = {}) {
|
|
|
10227
10243
|
}
|
|
10228
10244
|
};
|
|
10229
10245
|
}
|
|
10230
|
-
const
|
|
10231
|
-
engine:
|
|
10246
|
+
const Wc = "overflow-x-auto scrollbar not-inline", Vc = Hc({ forgiving: !0 }), qc = await Xl({
|
|
10247
|
+
engine: Vc,
|
|
10232
10248
|
langAlias: {
|
|
10233
10249
|
markup: "html",
|
|
10234
10250
|
svg: "xml",
|
|
@@ -10248,7 +10264,7 @@ const Hc = "overflow-x-auto scrollbar not-inline", Wc = zc({ forgiving: !0 }), V
|
|
|
10248
10264
|
fallbackLanguage: "text",
|
|
10249
10265
|
inline: "tailing-curly-colon",
|
|
10250
10266
|
addLanguageClass: !0,
|
|
10251
|
-
transformers: [
|
|
10267
|
+
transformers: [tu(), ru()],
|
|
10252
10268
|
parseMetaString: (t) => {
|
|
10253
10269
|
const e = t.matchAll(
|
|
10254
10270
|
/([a-z0-9]+)(?:=(["'])(.*?)\2|=(.*?)(?:\s|$)|(?:\s|$))/gi
|
|
@@ -10260,7 +10276,7 @@ const Hc = "overflow-x-auto scrollbar not-inline", Wc = zc({ forgiving: !0 }), V
|
|
|
10260
10276
|
})
|
|
10261
10277
|
);
|
|
10262
10278
|
}
|
|
10263
|
-
},
|
|
10279
|
+
}, Xc = () => (t) => {
|
|
10264
10280
|
Xr(t, "element", (e, n, r) => {
|
|
10265
10281
|
if (e.tagName !== "code") return;
|
|
10266
10282
|
const o = r?.type === "element" && r.tagName === "pre";
|
|
@@ -10270,14 +10286,14 @@ const Hc = "overflow-x-auto scrollbar not-inline", Wc = zc({ forgiving: !0 }), V
|
|
|
10270
10286
|
class: Ir(e.properties.class, r.properties.class)
|
|
10271
10287
|
}, r.properties = {});
|
|
10272
10288
|
});
|
|
10273
|
-
},
|
|
10289
|
+
}, dh = (t = wt.themes, e = qc) => [
|
|
10274
10290
|
[
|
|
10275
|
-
|
|
10291
|
+
Ql,
|
|
10276
10292
|
e,
|
|
10277
10293
|
{ ...wt, themes: t }
|
|
10278
10294
|
],
|
|
10279
|
-
|
|
10280
|
-
],
|
|
10295
|
+
Xc
|
|
10296
|
+
], Kc = (t, e, n = "text", r = wt.themes) => {
|
|
10281
10297
|
const o = t.codeToHast(e, {
|
|
10282
10298
|
lang: n,
|
|
10283
10299
|
...wt,
|
|
@@ -10290,15 +10306,15 @@ const Hc = "overflow-x-auto scrollbar not-inline", Wc = zc({ forgiving: !0 }), V
|
|
|
10290
10306
|
components: {
|
|
10291
10307
|
code: (s) => os("code", {
|
|
10292
10308
|
...s,
|
|
10293
|
-
className: Ir(s.className,
|
|
10309
|
+
className: Ir(s.className, Wc)
|
|
10294
10310
|
})
|
|
10295
10311
|
}
|
|
10296
10312
|
});
|
|
10297
|
-
},
|
|
10313
|
+
}, Yc = as(
|
|
10298
10314
|
({ code: t, children: e, embedded: n, ...r }) => {
|
|
10299
10315
|
const { syntaxHighlighting: o } = is().options;
|
|
10300
10316
|
us(o?.highlighter, "Highlighter not found");
|
|
10301
|
-
const s =
|
|
10317
|
+
const s = Kc(
|
|
10302
10318
|
o.highlighter,
|
|
10303
10319
|
t ?? e,
|
|
10304
10320
|
r.language,
|
|
@@ -10307,30 +10323,30 @@ const Hc = "overflow-x-auto scrollbar not-inline", Wc = zc({ forgiving: !0 }), V
|
|
|
10307
10323
|
return n ? /* @__PURE__ */ at.jsx(hs, { ...r, children: s }) : /* @__PURE__ */ at.jsx(cs, { ...r, children: s });
|
|
10308
10324
|
}
|
|
10309
10325
|
);
|
|
10310
|
-
|
|
10326
|
+
Yc.displayName = "SyntaxHighlight";
|
|
10311
10327
|
export {
|
|
10312
10328
|
Fn as E,
|
|
10313
|
-
|
|
10314
|
-
|
|
10329
|
+
Wc as H,
|
|
10330
|
+
Yc as S,
|
|
10315
10331
|
H as V,
|
|
10316
10332
|
Ps as a,
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10333
|
+
hh as b,
|
|
10334
|
+
ch as c,
|
|
10335
|
+
ah as d,
|
|
10320
10336
|
Nr as e,
|
|
10321
10337
|
Fr as f,
|
|
10322
10338
|
Vr as g,
|
|
10323
10339
|
ca as h,
|
|
10324
10340
|
ia as i,
|
|
10325
10341
|
jn as j,
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10342
|
+
dh as k,
|
|
10343
|
+
Kc as l,
|
|
10344
|
+
oh as o,
|
|
10329
10345
|
Br as p,
|
|
10330
10346
|
$s as s,
|
|
10331
10347
|
Gs as t,
|
|
10332
|
-
|
|
10348
|
+
sh as u,
|
|
10333
10349
|
Xr as v,
|
|
10334
10350
|
ua as z
|
|
10335
10351
|
};
|
|
10336
|
-
//# sourceMappingURL=SyntaxHighlight-
|
|
10352
|
+
//# sourceMappingURL=SyntaxHighlight-C19vH0V_.js.map
|