@loopstack/loopstack-studio 0.21.0 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/LoadingCentered.js +2 -2
- package/dist/components/ai-elements/code-block.js +96 -0
- package/dist/components/ai-elements/message.js +87 -0
- package/dist/components/ai-elements/prompt-input.js +321 -0
- package/dist/components/ai-elements/reasoning.js +124 -0
- package/dist/components/ai-elements/shimmer.js +37 -0
- package/dist/components/ai-elements/sources.js +65 -0
- package/dist/components/ai-elements/tool.js +158 -0
- package/dist/components/content/ErrorAlert.js +17 -0
- package/dist/components/data-table/DataTable.js +99 -96
- package/dist/components/dynamic-form/CodeContent.js +2 -2
- package/dist/components/dynamic-form/FormElement.js +3 -3
- package/dist/components/dynamic-form/FormElementHeader.js +2 -2
- package/dist/components/dynamic-form/ObjectController.js +2 -2
- package/dist/components/layout/MainLayout.js +0 -1
- package/dist/components/lists/ListView.js +62 -59
- package/dist/components/loopstack-elements/link.js +115 -0
- package/dist/components/ui/button-group.js +13 -0
- package/dist/components/ui/command.js +7 -0
- package/dist/components/ui/context-menu.js +63 -0
- package/dist/components/ui/hover-card.js +6 -0
- package/dist/components/ui/input-group.js +85 -0
- package/dist/components/ui/select.js +2 -2
- package/dist/components/ui/table.js +2 -2
- package/dist/components/ui/tabs.js +54 -0
- package/dist/components/ui-widgets/UiActions.js +24 -0
- package/dist/components/ui-widgets/UiWidget.js +43 -0
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +43 -0
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +23 -0
- package/dist/components/ui-widgets/widgets/SubmitButton.js +23 -0
- package/dist/events/sse-client-events.js +7 -0
- package/dist/features/code-explorer/CodeExplorer.js +69 -0
- package/dist/features/code-explorer/components/CodeExplorerTree.js +43 -0
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +237 -0
- package/dist/features/code-explorer/components/FileTabsBar.js +191 -0
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +165 -0
- package/dist/features/code-explorer/utils/fileIcons.js +42 -0
- package/dist/features/dashboard/Dashboard.js +125 -0
- package/dist/features/dashboard/RunItem.js +76 -0
- package/dist/features/dashboard/RunList.js +32 -0
- package/dist/features/debug/components/ConfigFlowViewer.js +79 -0
- package/dist/features/debug/components/PipelineDebugHeader.js +48 -0
- package/dist/features/debug/components/PipelineDebugLegend.js +68 -0
- package/dist/features/debug/components/PipelineFlowViewer.js +109 -0
- package/dist/features/debug/components/pipeline-flow/StateNode.js +111 -0
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +41 -0
- package/dist/features/debug/components/pipeline-flow/WorkflowTransitionEdge.js +97 -0
- package/dist/features/debug/lib/edge-paths.js +47 -0
- package/dist/features/debug/lib/flow-utils.js +247 -0
- package/dist/features/health/LocalHealthCheck.js +80 -67
- package/dist/features/oauth/OAuthCallbackPage.js +2 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +223 -0
- package/dist/features/oauth/index.js +3 -0
- package/dist/features/oauth/useOAuthPopup.js +83 -0
- package/dist/features/workbench/NavigationItems.js +52 -0
- package/dist/features/workbench/Workbench.js +101 -0
- package/dist/features/workbench/WorkbenchNavigation.js +38 -0
- package/dist/features/workbench/WorkflowItem.js +67 -0
- package/dist/features/workbench/WorkflowList.js +110 -0
- package/dist/features/workbench/components/DocumentItem.js +27 -0
- package/dist/features/workbench/components/DocumentList.js +40 -0
- package/dist/features/workbench/components/DocumentMetadataPills.js +63 -0
- package/dist/features/workbench/components/DocumentRenderer.js +54 -0
- package/dist/features/workbench/components/NavigationItem.js +68 -0
- package/dist/features/workbench/components/PipelineHistoryList.js +56 -0
- package/dist/features/workbench/components/WorkbenchSettingsModal.js +89 -0
- package/dist/features/workbench/components/WorkbenchSidebar.js +109 -0
- package/dist/features/workbench/components/WorkflowForms.js +22 -0
- package/dist/features/workbench/components/WorkflowHistoryItem.js +144 -0
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +85 -0
- package/dist/features/workbench/components/document-details/DocumentDetails.js +425 -0
- package/dist/features/workbench/components/document-details/PromptDetails.js +146 -0
- package/dist/features/workbench/components/document-renderer/AiMessage.js +56 -0
- package/dist/features/workbench/components/document-renderer/AiMessageContent.js +174 -0
- package/dist/features/workbench/components/document-renderer/DocumentDebugRenderer.js +30 -0
- package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +79 -0
- package/dist/features/workbench/components/document-renderer/DocumentMessageRenderer.js +10 -0
- package/dist/features/workbench/components/document-renderer/ErrorMessageRenderer.js +13 -0
- package/dist/features/workbench/components/document-renderer/LinkMessageRenderer.js +17 -0
- package/dist/features/workbench/components/document-renderer/MarkdownMessageRenderer.js +10 -0
- package/dist/features/workbench/components/document-renderer/PlainMessageRenderer.js +9 -0
- package/dist/features/workbench/hooks/useAutoScrollBottom.js +29 -0
- package/dist/features/workbench/hooks/useIntersectionObserver.js +44 -0
- package/dist/features/workbench/hooks/useScrollToListItem.js +23 -0
- package/dist/features/workbench/providers/ScrollProvider.js +22 -0
- package/dist/features/workbench/providers/WorkbenchContextProvider.js +3 -0
- package/dist/features/workspaces/Workspaces.js +166 -99
- package/dist/features/workspaces/components/CreateWorkspace.js +101 -78
- package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useAuth.js +25 -4
- package/dist/hooks/useDashboard.js +23 -0
- package/dist/hooks/useDocuments.js +45 -0
- package/dist/hooks/useFiles.js +63 -0
- package/dist/hooks/useNamespaceTree.js +27 -0
- package/dist/hooks/useNamespaces.js +34 -0
- package/dist/hooks/usePipelines.js +83 -6
- package/dist/hooks/useWorkflows.js +122 -0
- package/dist/hooks/useWorkspaces.js +49 -29
- package/dist/index.d.ts +88 -10
- package/dist/index.js +11 -1
- package/dist/lib/requireParam.js +6 -0
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@ai-sdk/provider/dist/index.js +65 -0
- package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +1008 -0
- package/dist/node_modules/@dagrejs/dagre/dist/dagre.esm.js +1968 -0
- package/dist/node_modules/@shikijs/core/dist/index.js +1420 -0
- package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +236 -0
- package/dist/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/abap.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/actionscript-3.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ada.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-expression.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-html.js +14 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-inline-style.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-inline-template.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-let-declaration.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-template-blocks.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-template.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/angular-ts.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/apache.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/apex.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/apl.js +14 -0
- package/dist/node_modules/@shikijs/langs/dist/applescript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ara.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/asciidoc.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/asm.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/astro.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/awk.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ballerina.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/bat.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/beancount.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/berry.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/bibtex.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/bicep.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/bird2.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/blade.js +18 -0
- package/dist/node_modules/@shikijs/langs/dist/bsl.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/c.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/c3.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cadence.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cairo.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/clarity.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/clojure.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cmake.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cobol.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/codeowners.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/codeql.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/coffee.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/common-lisp.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/coq.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cpp-macro.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/cpp.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/crystal.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/csharp.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/css.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/csv.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cue.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/cypher.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/d.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/dart.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/dax.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/desktop.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/diff.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/docker.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/dotenv.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/dream-maker.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/edge.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/elixir.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/elm.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/erb.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/erlang.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/es-tag-css.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/es-tag-glsl.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/es-tag-html.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/es-tag-xml.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/fennel.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/fish.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/fluent.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/fortran-fixed-form.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/fortran-free-form.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/fsharp.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/gdresource.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/gdscript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/gdshader.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/genie.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/gherkin.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/git-commit.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/git-rebase.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/gleam.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/glimmer-js.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/glimmer-ts.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/glsl.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/gn.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/gnuplot.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/go.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/graphql.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/groovy.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/hack.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/haml.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/handlebars.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/haskell.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/haxe.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/hcl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/hjson.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/hlsl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/html-derivative.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/html.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/http.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/hurl.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/hxml.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/hy.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/imba.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ini.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/java.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/javascript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jinja-html.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/jinja.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/jison.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/json.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/json5.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jsonc.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jsonl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jsonnet.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jssm.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/jsx.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/julia.js +14 -0
- package/dist/node_modules/@shikijs/langs/dist/just.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/kdl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/kotlin.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/kusto.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/latex.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/lean.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/less.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/liquid.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/llvm.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/log.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/logo.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/lua.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/luau.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/make.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/markdown-nix.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/markdown-vue.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/markdown.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/marko.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/matlab.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/mdc.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/mdx.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/mermaid.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/mipsasm.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/mojo.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/moonbit.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/move.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/narrat.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/nextflow.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/nginx.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/nim.js +18 -0
- package/dist/node_modules/@shikijs/langs/dist/nix.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/nushell.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/objective-c.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/objective-cpp.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ocaml.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/odin.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/openscad.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/pascal.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/perl.js +14 -0
- package/dist/node_modules/@shikijs/langs/dist/php.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/pkl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/plsql.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/po.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/polar.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/postcss.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/powerquery.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/powershell.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/prisma.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/prolog.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/proto.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/pug.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/puppet.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/purescript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/python.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/qml.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/qmldir.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/qss.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/r.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/racket.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/raku.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/razor.js +8 -0
- package/dist/node_modules/@shikijs/langs/dist/reg.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/regexp.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/rel.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/riscv.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ron.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/rosmsg.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/rst.js +20 -0
- package/dist/node_modules/@shikijs/langs/dist/ruby.js +28 -0
- package/dist/node_modules/@shikijs/langs/dist/rust.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/sas.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/sass.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/scala.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/scheme.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/scss.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/sdbl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/shaderlab.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/shellscript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/shellsession.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/smalltalk.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/solidity.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/soy.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/sparql.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/splunk.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/sql.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ssh-config.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/stata.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/stylus.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/surrealql.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/svelte.js +12 -0
- package/dist/node_modules/@shikijs/langs/dist/swift.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/system-verilog.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/systemd.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/talonscript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/tasl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/tcl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/templ.js +10 -0
- package/dist/node_modules/@shikijs/langs/dist/terraform.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/tex.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/toml.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/ts-tags.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/tsv.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/tsx.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/turtle.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/twig.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/typescript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/typespec.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/typst.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/v.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vala.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vb.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/verilog.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vhdl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/viml.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vue-directives.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vue-html.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/vue-interpolations.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/vue-vine.js +16 -0
- package/dist/node_modules/@shikijs/langs/dist/vue.js +24 -0
- package/dist/node_modules/@shikijs/langs/dist/vyper.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wasm.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wenyan.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wgsl.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wikitext.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wit.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/wolfram.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/xml.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/xsl.js +3 -0
- package/dist/node_modules/@shikijs/langs/dist/yaml.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/zenscript.js +2 -0
- package/dist/node_modules/@shikijs/langs/dist/zig.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/andromeeda.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/aurora-x.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/ayu-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/ayu-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/ayu-mirage.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-frappe.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-latte.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-macchiato.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-mocha.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/dark-plus.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/dracula-soft.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/dracula.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/everforest-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/everforest-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-dark-default.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-dark-dimmed.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-dark-high-contrast.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-light-default.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-light-high-contrast.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/github-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-hard.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-medium.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-soft.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/horizon.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/houston.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/kanagawa-dragon.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/kanagawa-lotus.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/kanagawa-wave.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/laserwave.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/light-plus.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/material-theme-darker.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/material-theme-lighter.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/material-theme-ocean.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/material-theme-palenight.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/material-theme.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/min-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/min-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/monokai.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/night-owl-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/night-owl.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/nord.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/one-dark-pro.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/one-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/plastic.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/poimandres.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/red.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/rose-pine-dawn.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/rose-pine-moon.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/rose-pine.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/slack-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/slack-ochin.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/snazzy-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/solarized-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/solarized-light.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/synthwave-84.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/tokyo-night.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/vesper.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/vitesse-black.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/vitesse-dark.js +2 -0
- package/dist/node_modules/@shikijs/themes/dist/vitesse-light.js +2 -0
- package/dist/node_modules/@shikijs/types/dist/index.js +6 -0
- package/dist/node_modules/@shikijs/vscode-textmate/dist/index.js +1580 -0
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +51 -0
- package/dist/node_modules/@ungap/structured-clone/esm/index.js +4 -0
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +91 -0
- package/dist/node_modules/@ungap/structured-clone/esm/types.js +2 -0
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +3280 -0
- package/dist/node_modules/@xyflow/system/dist/esm/index.js +1839 -0
- package/dist/node_modules/ai/dist/index.js +1083 -0
- package/dist/node_modules/bail/index.js +4 -0
- package/dist/node_modules/character-entities-html4/index.js +255 -0
- package/dist/node_modules/character-entities-legacy/index.js +2 -0
- package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +6 -1
- package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +4 -10
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +56 -65
- package/dist/node_modules/classcat/index.js +8 -0
- package/dist/node_modules/comma-separated-tokens/index.js +5 -1
- package/dist/node_modules/d3/src/index.js +5 -0
- package/dist/node_modules/d3-drag/src/constant.js +2 -0
- package/dist/node_modules/d3-drag/src/drag.js +112 -0
- package/dist/node_modules/d3-drag/src/event.js +60 -0
- package/dist/node_modules/d3-drag/src/nodrag.js +13 -0
- package/dist/node_modules/d3-drag/src/noevent.js +11 -0
- package/dist/node_modules/d3-interpolate/src/zoom.js +39 -0
- package/dist/node_modules/d3-selection/src/pointer.js +16 -0
- package/dist/node_modules/d3-selection/src/sourceEvent.js +6 -0
- package/dist/node_modules/d3-zoom/src/constant.js +2 -0
- package/dist/node_modules/d3-zoom/src/event.js +26 -0
- package/dist/node_modules/d3-zoom/src/index.js +1 -1
- package/dist/node_modules/d3-zoom/src/noevent.js +7 -0
- package/dist/node_modules/d3-zoom/src/zoom.js +214 -1
- package/dist/node_modules/decode-named-character-reference/index.dom.js +8 -0
- package/dist/node_modules/entities/dist/esm/decode-codepoint.js +35 -0
- package/dist/node_modules/entities/dist/esm/decode.js +129 -0
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +2 -0
- package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +5 -0
- package/dist/node_modules/extend/index.js +37 -0
- package/dist/node_modules/hast-util-from-parse5/lib/index.js +121 -0
- package/dist/node_modules/hast-util-raw/lib/index.js +204 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.js +34 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.js +5 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.js +150 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.js +267 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.js +9 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.js +65 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/index.js +8 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.js +69 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.js +1936 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.js +239 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.js +22 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +1451 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.js +75 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.js +155 -0
- package/dist/node_modules/hast-util-sanitize/lib/index.js +159 -0
- package/dist/node_modules/hast-util-sanitize/lib/schema.js +73 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/comment.js +9 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/doctype.js +4 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/element.js +47 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/index.js +27 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/raw.js +5 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/root.js +4 -0
- package/dist/node_modules/hast-util-to-html/lib/handle/text.js +6 -0
- package/dist/node_modules/hast-util-to-html/lib/index.js +46 -0
- package/dist/node_modules/hast-util-to-html/lib/omission/closing.js +84 -0
- package/dist/node_modules/hast-util-to-html/lib/omission/omission.js +8 -0
- package/dist/node_modules/hast-util-to-html/lib/omission/opening.js +37 -0
- package/dist/node_modules/hast-util-to-html/lib/omission/util/siblings.js +12 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +251 -0
- package/dist/node_modules/hast-util-to-parse5/lib/index.js +113 -0
- package/dist/node_modules/hast-util-whitespace/lib/index.js +8 -0
- package/dist/node_modules/html-url-attributes/lib/index.js +34 -0
- package/dist/node_modules/html-void-elements/index.js +23 -0
- package/dist/node_modules/inline-style-parser/cjs/index.js +88 -0
- package/dist/node_modules/lodash/_Symbol.js +7 -0
- package/dist/node_modules/lodash/_baseGetTag.js +13 -0
- package/dist/node_modules/lodash/_baseTrim.js +11 -0
- package/dist/node_modules/lodash/_freeGlobal.js +6 -0
- package/dist/node_modules/lodash/_getRawTag.js +17 -0
- package/dist/node_modules/lodash/_objectToString.js +10 -0
- package/dist/node_modules/lodash/_root.js +8 -0
- package/dist/node_modules/lodash/_trimmedEndIndex.js +11 -0
- package/dist/node_modules/lodash/debounce.js +53 -0
- package/dist/node_modules/lodash/isObject.js +10 -0
- package/dist/node_modules/lodash/isObjectLike.js +9 -0
- package/dist/node_modules/lodash/isSymbol.js +12 -0
- package/dist/node_modules/lodash/now.js +10 -0
- package/dist/node_modules/lodash/toNumber.js +22 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.js +555 -0
- package/dist/node_modules/mdast-util-to-hast/lib/footer.js +101 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +20 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +28 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +19 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +54 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +16 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +57 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +18 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +22 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +33 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +9 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/index.js +17 -0
- package/dist/node_modules/mdast-util-to-hast/lib/revert.js +18 -0
- package/dist/node_modules/mdast-util-to-hast/lib/state.js +106 -0
- package/dist/node_modules/micromark/lib/constructs.js +79 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.js +175 -0
- package/dist/node_modules/micromark/lib/initialize/content.js +32 -0
- package/dist/node_modules/micromark/lib/initialize/document.js +101 -0
- package/dist/node_modules/micromark/lib/initialize/flow.js +23 -0
- package/dist/node_modules/micromark/lib/initialize/text.js +84 -0
- package/dist/node_modules/micromark/lib/parse.js +27 -0
- package/dist/node_modules/micromark/lib/postprocess.js +6 -0
- package/dist/node_modules/micromark/lib/preprocess.js +30 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.js +112 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +41 -0
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +36 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +15 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +27 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +88 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +42 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +41 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.js +46 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.js +59 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +15 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +65 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +140 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +98 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +157 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +21 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +12 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.js +77 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +57 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +23 -0
- package/dist/node_modules/micromark-factory-destination/index.js +24 -0
- package/dist/node_modules/micromark-factory-label/index.js +18 -0
- package/dist/node_modules/micromark-factory-title/index.js +22 -0
- package/dist/node_modules/micromark-factory-whitespace/index.js +10 -0
- package/dist/node_modules/micromark-util-character/index.js +6 -5
- package/dist/node_modules/micromark-util-chunked/index.js +4 -1
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +5 -0
- package/dist/node_modules/micromark-util-decode-string/index.js +15 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.js +7 -0
- package/dist/node_modules/micromark-util-sanitize-uri/index.js +16 -0
- package/dist/node_modules/micromark-util-subtokenize/index.js +33 -0
- package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +55 -0
- package/dist/node_modules/motion/dist/es/react.js +3 -0
- package/dist/node_modules/nanoid/index.browser.js +7 -0
- package/dist/node_modules/nanoid/url-alphabet/index.js +2 -0
- package/dist/node_modules/property-information/index.js +1 -0
- package/dist/node_modules/property-information/lib/hast-to-react.js +20 -0
- package/dist/node_modules/rehype-harden/dist/index.js +168 -0
- package/dist/node_modules/rehype-raw/lib/index.js +10 -0
- package/dist/node_modules/rehype-sanitize/lib/index.js +7 -0
- package/dist/node_modules/remark-parse/lib/index.js +14 -0
- package/dist/node_modules/remark-rehype/lib/index.js +16 -0
- package/dist/node_modules/remend/dist/index.js +459 -0
- package/dist/node_modules/shiki/dist/bundle-full.js +11 -0
- package/dist/node_modules/shiki/dist/langs.js +1278 -0
- package/dist/node_modules/shiki/dist/themes.js +393 -0
- package/dist/node_modules/shiki/dist/wasm.js +2 -0
- package/dist/node_modules/space-separated-tokens/index.js +4 -1
- package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +2189 -0
- package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +33 -0
- package/dist/node_modules/streamdown/dist/index.js +2 -0
- package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +3 -0
- package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +1421 -0
- package/dist/node_modules/stringify-entities/lib/constant/dangerous.js +11 -0
- package/dist/node_modules/stringify-entities/lib/core.js +21 -0
- package/dist/node_modules/stringify-entities/lib/index.js +6 -0
- package/dist/node_modules/stringify-entities/lib/util/format-smart.js +12 -0
- package/dist/node_modules/stringify-entities/lib/util/to-decimal.js +6 -0
- package/dist/node_modules/stringify-entities/lib/util/to-hexadecimal.js +6 -0
- package/dist/node_modules/stringify-entities/lib/util/to-named.js +15 -0
- package/dist/node_modules/style-to-js/cjs/index.js +17 -0
- package/dist/node_modules/style-to-js/cjs/utilities.js +16 -0
- package/dist/node_modules/style-to-object/cjs/index.js +21 -0
- package/dist/node_modules/trim-lines/index.js +19 -0
- package/dist/node_modules/trough/lib/index.js +48 -0
- package/dist/node_modules/unified/lib/callable-instance.js +7 -0
- package/dist/node_modules/unified/lib/index.js +160 -0
- package/dist/node_modules/unified/node_modules/is-plain-obj/index.js +6 -0
- package/dist/node_modules/unist-util-position/lib/index.js +20 -0
- package/dist/node_modules/unist-util-stringify-position/lib/index.js +13 -0
- package/dist/node_modules/vfile/lib/index.js +87 -0
- package/dist/node_modules/vfile/lib/minpath.browser.js +97 -0
- package/dist/node_modules/vfile/lib/minproc.browser.js +5 -0
- package/dist/node_modules/vfile/lib/minurl.browser.js +29 -0
- package/dist/node_modules/vfile/lib/minurl.shared.js +4 -0
- package/dist/node_modules/vfile-location/lib/index.js +41 -0
- package/dist/node_modules/vfile-message/lib/index.js +22 -0
- package/dist/node_modules/zod/v3/ZodError.js +79 -0
- package/dist/node_modules/zod/v3/errors.js +6 -0
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +5 -0
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +90 -0
- package/dist/node_modules/zod/v3/helpers/util.js +72 -0
- package/dist/node_modules/zod/v3/locales/en.js +58 -0
- package/dist/node_modules/zod/v3/types.js +2425 -0
- package/dist/node_modules/zod/v4/classic/errors.js +21 -0
- package/dist/node_modules/zod/v4/classic/iso.js +29 -0
- package/dist/node_modules/zod/v4/classic/parse.js +4 -0
- package/dist/node_modules/zod/v4/classic/schemas.js +392 -0
- package/dist/node_modules/zod/v4/core/api.js +532 -0
- package/dist/node_modules/zod/v4/core/checks.js +283 -0
- package/dist/node_modules/zod/v4/core/core.js +44 -0
- package/dist/node_modules/zod/v4/core/doc.js +21 -0
- package/dist/node_modules/zod/v4/core/errors.js +40 -0
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +305 -0
- package/dist/node_modules/zod/v4/core/parse.js +66 -0
- package/dist/node_modules/zod/v4/core/regexes.js +28 -0
- package/dist/node_modules/zod/v4/core/registries.js +38 -0
- package/dist/node_modules/zod/v4/core/schemas.js +863 -0
- package/dist/node_modules/zod/v4/core/to-json-schema.js +220 -0
- package/dist/node_modules/zod/v4/core/util.js +267 -0
- package/dist/node_modules/zod/v4/core/versions.js +6 -0
- package/dist/node_modules/zwitch/index.js +14 -0
- package/dist/pages/DashboardPage.js +58 -0
- package/dist/pages/DebugWorkflowDetailsPage.js +121 -0
- package/dist/pages/DebugWorkflowsPage.js +130 -0
- package/dist/pages/EmbedWorkbenchPage.js +73 -0
- package/dist/pages/PipelineDebugPage.js +114 -0
- package/dist/pages/WorkbenchPage.js +67 -0
- package/dist/pages/WorkspacePage.js +1 -1
- package/dist/providers/ComponentOverridesProvider.js +12 -0
- package/dist/providers/InvalidationEventsProvider.js +43 -0
- package/dist/providers/SseProvider.js +44 -0
- package/dist/routing/LocalRouter.js +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,1421 @@
|
|
|
1
|
+
function M() {
|
|
2
|
+
return {
|
|
3
|
+
async: !1,
|
|
4
|
+
breaks: !1,
|
|
5
|
+
extensions: null,
|
|
6
|
+
gfm: !0,
|
|
7
|
+
hooks: null,
|
|
8
|
+
pedantic: !1,
|
|
9
|
+
renderer: null,
|
|
10
|
+
silent: !1,
|
|
11
|
+
tokenizer: null,
|
|
12
|
+
walkTokens: null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
var T = M();
|
|
16
|
+
function H(e) {
|
|
17
|
+
T = e;
|
|
18
|
+
}
|
|
19
|
+
var _ = { exec: () => null };
|
|
20
|
+
function k(e, c = "") {
|
|
21
|
+
let l = typeof e == "string" ? e : e.source, u = {
|
|
22
|
+
replace: (e, c) => {
|
|
23
|
+
let d = typeof c == "string" ? c : c.source;
|
|
24
|
+
return d = d.replace(m.caret, "$1"), l = l.replace(e, d), u;
|
|
25
|
+
},
|
|
26
|
+
getRegex: () => new RegExp(l, c)
|
|
27
|
+
};
|
|
28
|
+
return u;
|
|
29
|
+
}
|
|
30
|
+
var Re = (() => {
|
|
31
|
+
try {
|
|
32
|
+
return !0;
|
|
33
|
+
} catch {
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
})(), m = {
|
|
37
|
+
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
38
|
+
outputLinkReplace: /\\([\[\]])/g,
|
|
39
|
+
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
40
|
+
beginningSpace: /^\s+/,
|
|
41
|
+
endingHash: /#$/,
|
|
42
|
+
startingSpaceChar: /^ /,
|
|
43
|
+
endingSpaceChar: / $/,
|
|
44
|
+
nonSpaceChar: /[^ ]/,
|
|
45
|
+
newLineCharGlobal: /\n/g,
|
|
46
|
+
tabCharGlobal: /\t/g,
|
|
47
|
+
multipleSpaceGlobal: /\s+/g,
|
|
48
|
+
blankLine: /^[ \t]*$/,
|
|
49
|
+
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
|
|
50
|
+
blockquoteStart: /^ {0,3}>/,
|
|
51
|
+
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
52
|
+
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
53
|
+
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
54
|
+
listIsTask: /^\[[ xX]\] +\S/,
|
|
55
|
+
listReplaceTask: /^\[[ xX]\] +/,
|
|
56
|
+
listTaskCheckbox: /\[[ xX]\]/,
|
|
57
|
+
anyLine: /\n.*\n/,
|
|
58
|
+
hrefBrackets: /^<(.*)>$/,
|
|
59
|
+
tableDelimiter: /[:|]/,
|
|
60
|
+
tableAlignChars: /^\||\| *$/g,
|
|
61
|
+
tableRowBlankLine: /\n[ \t]*$/,
|
|
62
|
+
tableAlignRight: /^ *-+: *$/,
|
|
63
|
+
tableAlignCenter: /^ *:-+: *$/,
|
|
64
|
+
tableAlignLeft: /^ *:-+ *$/,
|
|
65
|
+
startATag: /^<a /i,
|
|
66
|
+
endATag: /^<\/a>/i,
|
|
67
|
+
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
|
|
68
|
+
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
|
|
69
|
+
startAngleBracket: /^</,
|
|
70
|
+
endAngleBracket: />$/,
|
|
71
|
+
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
|
|
72
|
+
unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
|
|
73
|
+
escapeTest: /[&<>"']/,
|
|
74
|
+
escapeReplace: /[&<>"']/g,
|
|
75
|
+
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
|
|
76
|
+
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
|
|
77
|
+
unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,
|
|
78
|
+
caret: /(^|[^\[])\^/g,
|
|
79
|
+
percentDecode: /%25/g,
|
|
80
|
+
findPipe: /\|/g,
|
|
81
|
+
splitPipe: / \|/,
|
|
82
|
+
slashPipe: /\\\|/g,
|
|
83
|
+
carriageReturn: /\r\n|\r/g,
|
|
84
|
+
spaceLine: /^ +$/gm,
|
|
85
|
+
notSpaceStart: /^\S*/,
|
|
86
|
+
endingNewline: /\n$/,
|
|
87
|
+
listItemRegex: (e) => /* @__PURE__ */ RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
88
|
+
nextBulletRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
89
|
+
hrRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
90
|
+
fencesBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`),
|
|
91
|
+
headingBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}#`),
|
|
92
|
+
htmlBeginRegex: (e) => RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i"),
|
|
93
|
+
blockquoteBeginRegex: (e) => /* @__PURE__ */ RegExp(`^ {0,${Math.min(3, e - 1)}}>`)
|
|
94
|
+
}, Te = /^(?:[ \t]*(?:\n|$))+/, Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = / {0,3}(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Pe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Le = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), U = {
|
|
95
|
+
blockquote: k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(),
|
|
96
|
+
code: Oe,
|
|
97
|
+
def: $e,
|
|
98
|
+
fences: we,
|
|
99
|
+
heading: ye,
|
|
100
|
+
hr: I,
|
|
101
|
+
html: Le,
|
|
102
|
+
lheading: se,
|
|
103
|
+
list: _e,
|
|
104
|
+
newline: Te,
|
|
105
|
+
paragraph: ie,
|
|
106
|
+
table: _,
|
|
107
|
+
text: Se
|
|
108
|
+
}, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), ze = {
|
|
109
|
+
...U,
|
|
110
|
+
lheading: Pe,
|
|
111
|
+
table: te,
|
|
112
|
+
paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex()
|
|
113
|
+
}, Ce = {
|
|
114
|
+
...U,
|
|
115
|
+
html: k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
116
|
+
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
117
|
+
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
118
|
+
fences: _,
|
|
119
|
+
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
120
|
+
paragraph: k(Q).replace("hr", I).replace("heading", " *#{1,6} *[^\n]").replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
121
|
+
}, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ee = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, v = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Be = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, De = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ue = /(?![*_])[\p{P}\p{S}]/u, ve = /(?![*_])[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|[*_])/u, He = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Re ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = k(pe, "u").replace(/punct/g, v).getRegex(), Ne = k(pe, "u").replace(/punct/g, le).getRegex(), ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Qe = k(ce, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Fe = k(ce, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, De).replace(/punct/g, le).getRegex(), je = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Ue = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ue).getRegex(), We = k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, ve).replace(/punct/g, ue).getRegex(), Xe = k(/\\(punct)/, "gu").replace(/punct/g, v).getRegex(), Je = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ve = k(j).replace("(?:-->|$)", "-->").getRegex(), Ye = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ve).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, et = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), he = k(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", F).getRegex(), ke = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), tt = k("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = {
|
|
122
|
+
_backpedal: _,
|
|
123
|
+
anyPunctuation: Xe,
|
|
124
|
+
autolink: Je,
|
|
125
|
+
blockSkip: He,
|
|
126
|
+
br: oe,
|
|
127
|
+
code: Ie,
|
|
128
|
+
del: _,
|
|
129
|
+
delLDelim: _,
|
|
130
|
+
delRDelim: _,
|
|
131
|
+
emStrongLDelim: Ze,
|
|
132
|
+
emStrongRDelimAst: Qe,
|
|
133
|
+
emStrongRDelimUnd: je,
|
|
134
|
+
escape: Ae,
|
|
135
|
+
link: et,
|
|
136
|
+
nolink: ke,
|
|
137
|
+
punctuation: Be,
|
|
138
|
+
reflink: he,
|
|
139
|
+
reflinkSearch: tt,
|
|
140
|
+
tag: Ye,
|
|
141
|
+
text: Ee,
|
|
142
|
+
url: _
|
|
143
|
+
}, nt = {
|
|
144
|
+
...W,
|
|
145
|
+
link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
|
|
146
|
+
reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
|
|
147
|
+
}, Z = {
|
|
148
|
+
...W,
|
|
149
|
+
emStrongRDelimAst: Fe,
|
|
150
|
+
emStrongLDelim: Ne,
|
|
151
|
+
delLDelim: Ue,
|
|
152
|
+
delRDelim: We,
|
|
153
|
+
url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
154
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
155
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
156
|
+
text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex()
|
|
157
|
+
}, rt = {
|
|
158
|
+
...Z,
|
|
159
|
+
br: k(oe).replace("{2,}", "*").getRegex(),
|
|
160
|
+
text: k(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
161
|
+
}, E = {
|
|
162
|
+
normal: U,
|
|
163
|
+
gfm: ze,
|
|
164
|
+
pedantic: Ce
|
|
165
|
+
}, z = {
|
|
166
|
+
normal: W,
|
|
167
|
+
gfm: Z,
|
|
168
|
+
breaks: rt,
|
|
169
|
+
pedantic: nt
|
|
170
|
+
}, st = {
|
|
171
|
+
"&": "&",
|
|
172
|
+
"<": "<",
|
|
173
|
+
">": ">",
|
|
174
|
+
"\"": """,
|
|
175
|
+
"'": "'"
|
|
176
|
+
}, de = (e) => st[e];
|
|
177
|
+
function O(e, c) {
|
|
178
|
+
if (c) {
|
|
179
|
+
if (m.escapeTest.test(e)) return e.replace(m.escapeReplace, de);
|
|
180
|
+
} else if (m.escapeTestNoEncode.test(e)) return e.replace(m.escapeReplaceNoEncode, de);
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
function X(e) {
|
|
184
|
+
try {
|
|
185
|
+
e = encodeURI(e).replace(m.percentDecode, "%");
|
|
186
|
+
} catch {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
return e;
|
|
190
|
+
}
|
|
191
|
+
function J(e, c) {
|
|
192
|
+
let l = e.replace(m.findPipe, (e, c, l) => {
|
|
193
|
+
let u = !1, d = c;
|
|
194
|
+
for (; --d >= 0 && l[d] === "\\";) u = !u;
|
|
195
|
+
return u ? "|" : " |";
|
|
196
|
+
}).split(m.splitPipe), u = 0;
|
|
197
|
+
if (l[0].trim() || l.shift(), l.length > 0 && !l.at(-1)?.trim() && l.pop(), c) if (l.length > c) l.splice(c);
|
|
198
|
+
else for (; l.length < c;) l.push("");
|
|
199
|
+
for (; u < l.length; u++) l[u] = l[u].trim().replace(m.slashPipe, "|");
|
|
200
|
+
return l;
|
|
201
|
+
}
|
|
202
|
+
function C(e, c, l) {
|
|
203
|
+
let u = e.length;
|
|
204
|
+
if (u === 0) return "";
|
|
205
|
+
let d = 0;
|
|
206
|
+
for (; d < u;) {
|
|
207
|
+
let f = e.charAt(u - d - 1);
|
|
208
|
+
if (f === c && !l) d++;
|
|
209
|
+
else if (f !== c && l) d++;
|
|
210
|
+
else break;
|
|
211
|
+
}
|
|
212
|
+
return e.slice(0, u - d);
|
|
213
|
+
}
|
|
214
|
+
function ge(e, c) {
|
|
215
|
+
if (e.indexOf(c[1]) === -1) return -1;
|
|
216
|
+
let l = 0;
|
|
217
|
+
for (let u = 0; u < e.length; u++) if (e[u] === "\\") u++;
|
|
218
|
+
else if (e[u] === c[0]) l++;
|
|
219
|
+
else if (e[u] === c[1] && (l--, l < 0)) return u;
|
|
220
|
+
return l > 0 ? -2 : -1;
|
|
221
|
+
}
|
|
222
|
+
function fe(e, c = 0) {
|
|
223
|
+
let l = c, u = "";
|
|
224
|
+
for (let c of e) if (c === " ") {
|
|
225
|
+
let e = 4 - l % 4;
|
|
226
|
+
u += " ".repeat(e), l += e;
|
|
227
|
+
} else u += c, l++;
|
|
228
|
+
return u;
|
|
229
|
+
}
|
|
230
|
+
function me(e, c, l, u, d) {
|
|
231
|
+
let f = c.href, p = c.title || null, h = e[1].replace(d.other.outputLinkReplace, "$1");
|
|
232
|
+
u.state.inLink = !0;
|
|
233
|
+
let S = {
|
|
234
|
+
type: e[0].charAt(0) === "!" ? "image" : "link",
|
|
235
|
+
raw: l,
|
|
236
|
+
href: f,
|
|
237
|
+
title: p,
|
|
238
|
+
text: h,
|
|
239
|
+
tokens: u.inlineTokens(h)
|
|
240
|
+
};
|
|
241
|
+
return u.state.inLink = !1, S;
|
|
242
|
+
}
|
|
243
|
+
function it(e, c, l) {
|
|
244
|
+
let u = e.match(l.other.indentCodeCompensation);
|
|
245
|
+
if (u === null) return c;
|
|
246
|
+
let d = u[1];
|
|
247
|
+
return c.split("\n").map((e) => {
|
|
248
|
+
let c = e.match(l.other.beginningSpace);
|
|
249
|
+
if (c === null) return e;
|
|
250
|
+
let [u] = c;
|
|
251
|
+
return u.length >= d.length ? e.slice(d.length) : e;
|
|
252
|
+
}).join("\n");
|
|
253
|
+
}
|
|
254
|
+
var w = class {
|
|
255
|
+
options;
|
|
256
|
+
rules;
|
|
257
|
+
lexer;
|
|
258
|
+
constructor(e) {
|
|
259
|
+
this.options = e || T;
|
|
260
|
+
}
|
|
261
|
+
space(e) {
|
|
262
|
+
let c = this.rules.block.newline.exec(e);
|
|
263
|
+
if (c && c[0].length > 0) return {
|
|
264
|
+
type: "space",
|
|
265
|
+
raw: c[0]
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
code(e) {
|
|
269
|
+
let c = this.rules.block.code.exec(e);
|
|
270
|
+
if (c) {
|
|
271
|
+
let e = c[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
272
|
+
return {
|
|
273
|
+
type: "code",
|
|
274
|
+
raw: c[0],
|
|
275
|
+
codeBlockStyle: "indented",
|
|
276
|
+
text: this.options.pedantic ? e : C(e, "\n")
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
fences(e) {
|
|
281
|
+
let c = this.rules.block.fences.exec(e);
|
|
282
|
+
if (c) {
|
|
283
|
+
let e = c[0], l = it(e, c[3] || "", this.rules);
|
|
284
|
+
return {
|
|
285
|
+
type: "code",
|
|
286
|
+
raw: e,
|
|
287
|
+
lang: c[2] ? c[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : c[2],
|
|
288
|
+
text: l
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
heading(e) {
|
|
293
|
+
let c = this.rules.block.heading.exec(e);
|
|
294
|
+
if (c) {
|
|
295
|
+
let e = c[2].trim();
|
|
296
|
+
if (this.rules.other.endingHash.test(e)) {
|
|
297
|
+
let c = C(e, "#");
|
|
298
|
+
(this.options.pedantic || !c || this.rules.other.endingSpaceChar.test(c)) && (e = c.trim());
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
type: "heading",
|
|
302
|
+
raw: c[0],
|
|
303
|
+
depth: c[1].length,
|
|
304
|
+
text: e,
|
|
305
|
+
tokens: this.lexer.inline(e)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
hr(e) {
|
|
310
|
+
let c = this.rules.block.hr.exec(e);
|
|
311
|
+
if (c) return {
|
|
312
|
+
type: "hr",
|
|
313
|
+
raw: C(c[0], "\n")
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
blockquote(e) {
|
|
317
|
+
let c = this.rules.block.blockquote.exec(e);
|
|
318
|
+
if (c) {
|
|
319
|
+
let e = C(c[0], "\n").split("\n"), l = "", u = "", d = [];
|
|
320
|
+
for (; e.length > 0;) {
|
|
321
|
+
let c = !1, f = [], p;
|
|
322
|
+
for (p = 0; p < e.length; p++) if (this.rules.other.blockquoteStart.test(e[p])) f.push(e[p]), c = !0;
|
|
323
|
+
else if (!c) f.push(e[p]);
|
|
324
|
+
else break;
|
|
325
|
+
e = e.slice(p);
|
|
326
|
+
let h = f.join("\n"), S = h.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
327
|
+
l = l ? `${l}
|
|
328
|
+
${h}` : h, u = u ? `${u}
|
|
329
|
+
${S}` : S;
|
|
330
|
+
let A = this.lexer.state.top;
|
|
331
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(S, d, !0), this.lexer.state.top = A, e.length === 0) break;
|
|
332
|
+
let R = d.at(-1);
|
|
333
|
+
if (R?.type === "code") break;
|
|
334
|
+
if (R?.type === "blockquote") {
|
|
335
|
+
let c = R, f = c.raw + "\n" + e.join("\n"), p = this.blockquote(f);
|
|
336
|
+
d[d.length - 1] = p, l = l.substring(0, l.length - c.raw.length) + p.raw, u = u.substring(0, u.length - c.text.length) + p.text;
|
|
337
|
+
break;
|
|
338
|
+
} else if (R?.type === "list") {
|
|
339
|
+
let c = R, f = c.raw + "\n" + e.join("\n"), p = this.list(f);
|
|
340
|
+
d[d.length - 1] = p, l = l.substring(0, l.length - R.raw.length) + p.raw, u = u.substring(0, u.length - c.raw.length) + p.raw, e = f.substring(d.at(-1).raw.length).split("\n");
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
type: "blockquote",
|
|
346
|
+
raw: l,
|
|
347
|
+
tokens: d,
|
|
348
|
+
text: u
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
list(e) {
|
|
353
|
+
let c = this.rules.block.list.exec(e);
|
|
354
|
+
if (c) {
|
|
355
|
+
let l = c[1].trim(), u = l.length > 1, d = {
|
|
356
|
+
type: "list",
|
|
357
|
+
raw: "",
|
|
358
|
+
ordered: u,
|
|
359
|
+
start: u ? +l.slice(0, -1) : "",
|
|
360
|
+
loose: !1,
|
|
361
|
+
items: []
|
|
362
|
+
};
|
|
363
|
+
l = u ? `\\d{1,9}\\${l.slice(-1)}` : `\\${l}`, this.options.pedantic && (l = u ? l : "[*+-]");
|
|
364
|
+
let f = this.rules.other.listItemRegex(l), p = !1;
|
|
365
|
+
for (; e;) {
|
|
366
|
+
let l = !1, u = "", h = "";
|
|
367
|
+
if (!(c = f.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
368
|
+
u = c[0], e = e.substring(u.length);
|
|
369
|
+
let S = fe(c[2].split("\n", 1)[0], c[1].length), A = e.split("\n", 1)[0], R = !S.trim(), B = 0;
|
|
370
|
+
if (this.options.pedantic ? (B = 2, h = S.trimStart()) : R ? B = c[1].length + 1 : (B = S.search(this.rules.other.nonSpaceChar), B = B > 4 ? 1 : B, h = S.slice(B), B += c[1].length), R && this.rules.other.blankLine.test(A) && (u += A + "\n", e = e.substring(A.length + 1), l = !0), !l) {
|
|
371
|
+
let c = this.rules.other.nextBulletRegex(B), l = this.rules.other.hrRegex(B), d = this.rules.other.fencesBeginRegex(B), f = this.rules.other.headingBeginRegex(B), p = this.rules.other.htmlBeginRegex(B), V = this.rules.other.blockquoteBeginRegex(B);
|
|
372
|
+
for (; e;) {
|
|
373
|
+
let G = e.split("\n", 1)[0], Y;
|
|
374
|
+
if (A = G, this.options.pedantic ? (A = A.replace(this.rules.other.listReplaceNesting, " "), Y = A) : Y = A.replace(this.rules.other.tabCharGlobal, " "), d.test(A) || f.test(A) || p.test(A) || V.test(A) || c.test(A) || l.test(A)) break;
|
|
375
|
+
if (Y.search(this.rules.other.nonSpaceChar) >= B || !A.trim()) h += "\n" + Y.slice(B);
|
|
376
|
+
else {
|
|
377
|
+
if (R || S.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || d.test(S) || f.test(S) || l.test(S)) break;
|
|
378
|
+
h += "\n" + A;
|
|
379
|
+
}
|
|
380
|
+
R = !A.trim(), u += G + "\n", e = e.substring(G.length + 1), S = Y.slice(B);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
d.loose || (p ? d.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (p = !0)), d.items.push({
|
|
384
|
+
type: "list_item",
|
|
385
|
+
raw: u,
|
|
386
|
+
task: !!this.options.gfm && this.rules.other.listIsTask.test(h),
|
|
387
|
+
loose: !1,
|
|
388
|
+
text: h,
|
|
389
|
+
tokens: []
|
|
390
|
+
}), d.raw += u;
|
|
391
|
+
}
|
|
392
|
+
let h = d.items.at(-1);
|
|
393
|
+
if (h) h.raw = h.raw.trimEnd(), h.text = h.text.trimEnd();
|
|
394
|
+
else return;
|
|
395
|
+
d.raw = d.raw.trimEnd();
|
|
396
|
+
for (let e of d.items) {
|
|
397
|
+
if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), e.task) {
|
|
398
|
+
if (e.text = e.text.replace(this.rules.other.listReplaceTask, ""), e.tokens[0]?.type === "text" || e.tokens[0]?.type === "paragraph") {
|
|
399
|
+
e.tokens[0].raw = e.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), e.tokens[0].text = e.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
400
|
+
for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
|
|
401
|
+
this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
let c = this.rules.other.listTaskCheckbox.exec(e.raw);
|
|
406
|
+
if (c) {
|
|
407
|
+
let l = {
|
|
408
|
+
type: "checkbox",
|
|
409
|
+
raw: c[0] + " ",
|
|
410
|
+
checked: c[0] !== "[ ]"
|
|
411
|
+
};
|
|
412
|
+
e.checked = l.checked, d.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = l.raw + e.tokens[0].raw, e.tokens[0].text = l.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(l)) : e.tokens.unshift({
|
|
413
|
+
type: "paragraph",
|
|
414
|
+
raw: l.raw,
|
|
415
|
+
text: l.raw,
|
|
416
|
+
tokens: [l]
|
|
417
|
+
}) : e.tokens.unshift(l);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (!d.loose) {
|
|
421
|
+
let c = e.tokens.filter((e) => e.type === "space");
|
|
422
|
+
d.loose = c.length > 0 && c.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (d.loose) for (let e of d.items) {
|
|
426
|
+
e.loose = !0;
|
|
427
|
+
for (let c of e.tokens) c.type === "text" && (c.type = "paragraph");
|
|
428
|
+
}
|
|
429
|
+
return d;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
html(e) {
|
|
433
|
+
let c = this.rules.block.html.exec(e);
|
|
434
|
+
if (c) return {
|
|
435
|
+
type: "html",
|
|
436
|
+
block: !0,
|
|
437
|
+
raw: c[0],
|
|
438
|
+
pre: c[1] === "pre" || c[1] === "script" || c[1] === "style",
|
|
439
|
+
text: c[0]
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
def(e) {
|
|
443
|
+
let c = this.rules.block.def.exec(e);
|
|
444
|
+
if (c) {
|
|
445
|
+
let e = c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), l = c[2] ? c[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", u = c[3] ? c[3].substring(1, c[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : c[3];
|
|
446
|
+
return {
|
|
447
|
+
type: "def",
|
|
448
|
+
tag: e,
|
|
449
|
+
raw: c[0],
|
|
450
|
+
href: l,
|
|
451
|
+
title: u
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
table(e) {
|
|
456
|
+
let c = this.rules.block.table.exec(e);
|
|
457
|
+
if (!c || !this.rules.other.tableDelimiter.test(c[2])) return;
|
|
458
|
+
let l = J(c[1]), u = c[2].replace(this.rules.other.tableAlignChars, "").split("|"), d = c[3]?.trim() ? c[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], f = {
|
|
459
|
+
type: "table",
|
|
460
|
+
raw: c[0],
|
|
461
|
+
header: [],
|
|
462
|
+
align: [],
|
|
463
|
+
rows: []
|
|
464
|
+
};
|
|
465
|
+
if (l.length === u.length) {
|
|
466
|
+
for (let e of u) this.rules.other.tableAlignRight.test(e) ? f.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? f.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? f.align.push("left") : f.align.push(null);
|
|
467
|
+
for (let e = 0; e < l.length; e++) f.header.push({
|
|
468
|
+
text: l[e],
|
|
469
|
+
tokens: this.lexer.inline(l[e]),
|
|
470
|
+
header: !0,
|
|
471
|
+
align: f.align[e]
|
|
472
|
+
});
|
|
473
|
+
for (let e of d) f.rows.push(J(e, f.header.length).map((e, c) => ({
|
|
474
|
+
text: e,
|
|
475
|
+
tokens: this.lexer.inline(e),
|
|
476
|
+
header: !1,
|
|
477
|
+
align: f.align[c]
|
|
478
|
+
})));
|
|
479
|
+
return f;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
lheading(e) {
|
|
483
|
+
let c = this.rules.block.lheading.exec(e);
|
|
484
|
+
if (c) return {
|
|
485
|
+
type: "heading",
|
|
486
|
+
raw: c[0],
|
|
487
|
+
depth: c[2].charAt(0) === "=" ? 1 : 2,
|
|
488
|
+
text: c[1],
|
|
489
|
+
tokens: this.lexer.inline(c[1])
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
paragraph(e) {
|
|
493
|
+
let c = this.rules.block.paragraph.exec(e);
|
|
494
|
+
if (c) {
|
|
495
|
+
let e = c[1].charAt(c[1].length - 1) === "\n" ? c[1].slice(0, -1) : c[1];
|
|
496
|
+
return {
|
|
497
|
+
type: "paragraph",
|
|
498
|
+
raw: c[0],
|
|
499
|
+
text: e,
|
|
500
|
+
tokens: this.lexer.inline(e)
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
text(e) {
|
|
505
|
+
let c = this.rules.block.text.exec(e);
|
|
506
|
+
if (c) return {
|
|
507
|
+
type: "text",
|
|
508
|
+
raw: c[0],
|
|
509
|
+
text: c[0],
|
|
510
|
+
tokens: this.lexer.inline(c[0])
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
escape(e) {
|
|
514
|
+
let c = this.rules.inline.escape.exec(e);
|
|
515
|
+
if (c) return {
|
|
516
|
+
type: "escape",
|
|
517
|
+
raw: c[0],
|
|
518
|
+
text: c[1]
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
tag(e) {
|
|
522
|
+
let c = this.rules.inline.tag.exec(e);
|
|
523
|
+
if (c) return !this.lexer.state.inLink && this.rules.other.startATag.test(c[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(c[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(c[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(c[0]) && (this.lexer.state.inRawBlock = !1), {
|
|
524
|
+
type: "html",
|
|
525
|
+
raw: c[0],
|
|
526
|
+
inLink: this.lexer.state.inLink,
|
|
527
|
+
inRawBlock: this.lexer.state.inRawBlock,
|
|
528
|
+
block: !1,
|
|
529
|
+
text: c[0]
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
link(e) {
|
|
533
|
+
let c = this.rules.inline.link.exec(e);
|
|
534
|
+
if (c) {
|
|
535
|
+
let e = c[2].trim();
|
|
536
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
|
|
537
|
+
if (!this.rules.other.endAngleBracket.test(e)) return;
|
|
538
|
+
let c = C(e.slice(0, -1), "\\");
|
|
539
|
+
if ((e.length - c.length) % 2 == 0) return;
|
|
540
|
+
} else {
|
|
541
|
+
let e = ge(c[2], "()");
|
|
542
|
+
if (e === -2) return;
|
|
543
|
+
if (e > -1) {
|
|
544
|
+
let l = (c[0].indexOf("!") === 0 ? 5 : 4) + c[1].length + e;
|
|
545
|
+
c[2] = c[2].substring(0, e), c[0] = c[0].substring(0, l).trim(), c[3] = "";
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
let l = c[2], u = "";
|
|
549
|
+
if (this.options.pedantic) {
|
|
550
|
+
let e = this.rules.other.pedanticHrefTitle.exec(l);
|
|
551
|
+
e && (l = e[1], u = e[3]);
|
|
552
|
+
} else u = c[3] ? c[3].slice(1, -1) : "";
|
|
553
|
+
return l = l.trim(), this.rules.other.startAngleBracket.test(l) && (l = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? l.slice(1) : l.slice(1, -1)), me(c, {
|
|
554
|
+
href: l && l.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
555
|
+
title: u && u.replace(this.rules.inline.anyPunctuation, "$1")
|
|
556
|
+
}, c[0], this.lexer, this.rules);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
reflink(e, c) {
|
|
560
|
+
let l;
|
|
561
|
+
if ((l = this.rules.inline.reflink.exec(e)) || (l = this.rules.inline.nolink.exec(e))) {
|
|
562
|
+
let e = c[(l[2] || l[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
|
|
563
|
+
if (!e) {
|
|
564
|
+
let e = l[0].charAt(0);
|
|
565
|
+
return {
|
|
566
|
+
type: "text",
|
|
567
|
+
raw: e,
|
|
568
|
+
text: e
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
return me(l, e, l[0], this.lexer, this.rules);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
emStrong(e, c, l = "") {
|
|
575
|
+
let u = this.rules.inline.emStrongLDelim.exec(e);
|
|
576
|
+
if (!(!u || u[3] && l.match(this.rules.other.unicodeAlphaNumeric)) && (!(u[1] || u[2]) || !l || this.rules.inline.punctuation.exec(l))) {
|
|
577
|
+
let l = [...u[0]].length - 1, d, f, p = l, h = 0, S = u[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
578
|
+
for (S.lastIndex = 0, c = c.slice(-1 * e.length + l); (u = S.exec(c)) != null;) {
|
|
579
|
+
if (d = u[1] || u[2] || u[3] || u[4] || u[5] || u[6], !d) continue;
|
|
580
|
+
if (f = [...d].length, u[3] || u[4]) {
|
|
581
|
+
p += f;
|
|
582
|
+
continue;
|
|
583
|
+
} else if ((u[5] || u[6]) && l % 3 && !((l + f) % 3)) {
|
|
584
|
+
h += f;
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
if (p -= f, p > 0) continue;
|
|
588
|
+
f = Math.min(f, f + p + h);
|
|
589
|
+
let c = [...u[0]][0].length, S = e.slice(0, l + u.index + c + f);
|
|
590
|
+
if (Math.min(l, f) % 2) {
|
|
591
|
+
let e = S.slice(1, -1);
|
|
592
|
+
return {
|
|
593
|
+
type: "em",
|
|
594
|
+
raw: S,
|
|
595
|
+
text: e,
|
|
596
|
+
tokens: this.lexer.inlineTokens(e)
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
let A = S.slice(2, -2);
|
|
600
|
+
return {
|
|
601
|
+
type: "strong",
|
|
602
|
+
raw: S,
|
|
603
|
+
text: A,
|
|
604
|
+
tokens: this.lexer.inlineTokens(A)
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
codespan(e) {
|
|
610
|
+
let c = this.rules.inline.code.exec(e);
|
|
611
|
+
if (c) {
|
|
612
|
+
let e = c[2].replace(this.rules.other.newLineCharGlobal, " "), l = this.rules.other.nonSpaceChar.test(e), u = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
|
|
613
|
+
return l && u && (e = e.substring(1, e.length - 1)), {
|
|
614
|
+
type: "codespan",
|
|
615
|
+
raw: c[0],
|
|
616
|
+
text: e
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
br(e) {
|
|
621
|
+
let c = this.rules.inline.br.exec(e);
|
|
622
|
+
if (c) return {
|
|
623
|
+
type: "br",
|
|
624
|
+
raw: c[0]
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
del(e, c, l = "") {
|
|
628
|
+
let u = this.rules.inline.delLDelim.exec(e);
|
|
629
|
+
if (u && (!u[1] || !l || this.rules.inline.punctuation.exec(l))) {
|
|
630
|
+
let l = [...u[0]].length - 1, d, f, p = l, h = this.rules.inline.delRDelim;
|
|
631
|
+
for (h.lastIndex = 0, c = c.slice(-1 * e.length + l); (u = h.exec(c)) != null;) {
|
|
632
|
+
if (d = u[1] || u[2] || u[3] || u[4] || u[5] || u[6], !d || (f = [...d].length, f !== l)) continue;
|
|
633
|
+
if (u[3] || u[4]) {
|
|
634
|
+
p += f;
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (p -= f, p > 0) continue;
|
|
638
|
+
f = Math.min(f, f + p);
|
|
639
|
+
let c = [...u[0]][0].length, h = e.slice(0, l + u.index + c + f), S = h.slice(l, -l);
|
|
640
|
+
return {
|
|
641
|
+
type: "del",
|
|
642
|
+
raw: h,
|
|
643
|
+
text: S,
|
|
644
|
+
tokens: this.lexer.inlineTokens(S)
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
autolink(e) {
|
|
650
|
+
let c = this.rules.inline.autolink.exec(e);
|
|
651
|
+
if (c) {
|
|
652
|
+
let e, l;
|
|
653
|
+
return c[2] === "@" ? (e = c[1], l = "mailto:" + e) : (e = c[1], l = e), {
|
|
654
|
+
type: "link",
|
|
655
|
+
raw: c[0],
|
|
656
|
+
text: e,
|
|
657
|
+
href: l,
|
|
658
|
+
tokens: [{
|
|
659
|
+
type: "text",
|
|
660
|
+
raw: e,
|
|
661
|
+
text: e
|
|
662
|
+
}]
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
url(e) {
|
|
667
|
+
let c;
|
|
668
|
+
if (c = this.rules.inline.url.exec(e)) {
|
|
669
|
+
let e, l;
|
|
670
|
+
if (c[2] === "@") e = c[0], l = "mailto:" + e;
|
|
671
|
+
else {
|
|
672
|
+
let u;
|
|
673
|
+
do
|
|
674
|
+
u = c[0], c[0] = this.rules.inline._backpedal.exec(c[0])?.[0] ?? "";
|
|
675
|
+
while (u !== c[0]);
|
|
676
|
+
e = c[0], l = c[1] === "www." ? "http://" + c[0] : c[0];
|
|
677
|
+
}
|
|
678
|
+
return {
|
|
679
|
+
type: "link",
|
|
680
|
+
raw: c[0],
|
|
681
|
+
text: e,
|
|
682
|
+
href: l,
|
|
683
|
+
tokens: [{
|
|
684
|
+
type: "text",
|
|
685
|
+
raw: e,
|
|
686
|
+
text: e
|
|
687
|
+
}]
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
inlineText(e) {
|
|
692
|
+
let c = this.rules.inline.text.exec(e);
|
|
693
|
+
if (c) {
|
|
694
|
+
let e = this.lexer.state.inRawBlock;
|
|
695
|
+
return {
|
|
696
|
+
type: "text",
|
|
697
|
+
raw: c[0],
|
|
698
|
+
text: c[0],
|
|
699
|
+
escaped: e
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}, x = class e {
|
|
704
|
+
tokens;
|
|
705
|
+
options;
|
|
706
|
+
state;
|
|
707
|
+
inlineQueue;
|
|
708
|
+
tokenizer;
|
|
709
|
+
constructor(e) {
|
|
710
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
711
|
+
inLink: !1,
|
|
712
|
+
inRawBlock: !1,
|
|
713
|
+
top: !0
|
|
714
|
+
};
|
|
715
|
+
let l = {
|
|
716
|
+
other: m,
|
|
717
|
+
block: E.normal,
|
|
718
|
+
inline: z.normal
|
|
719
|
+
};
|
|
720
|
+
this.options.pedantic ? (l.block = E.pedantic, l.inline = z.pedantic) : this.options.gfm && (l.block = E.gfm, this.options.breaks ? l.inline = z.breaks : l.inline = z.gfm), this.tokenizer.rules = l;
|
|
721
|
+
}
|
|
722
|
+
static get rules() {
|
|
723
|
+
return {
|
|
724
|
+
block: E,
|
|
725
|
+
inline: z
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
static lex(c, l) {
|
|
729
|
+
return new e(l).lex(c);
|
|
730
|
+
}
|
|
731
|
+
static lexInline(c, l) {
|
|
732
|
+
return new e(l).inlineTokens(c);
|
|
733
|
+
}
|
|
734
|
+
lex(e) {
|
|
735
|
+
e = e.replace(m.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
736
|
+
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
737
|
+
let c = this.inlineQueue[e];
|
|
738
|
+
this.inlineTokens(c.src, c.tokens);
|
|
739
|
+
}
|
|
740
|
+
return this.inlineQueue = [], this.tokens;
|
|
741
|
+
}
|
|
742
|
+
blockTokens(e, c = [], l = !1) {
|
|
743
|
+
for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e;) {
|
|
744
|
+
let u;
|
|
745
|
+
if (this.options.extensions?.block?.some((l) => (u = l.call({ lexer: this }, e, c)) ? (e = e.substring(u.raw.length), c.push(u), !0) : !1)) continue;
|
|
746
|
+
if (u = this.tokenizer.space(e)) {
|
|
747
|
+
e = e.substring(u.raw.length);
|
|
748
|
+
let l = c.at(-1);
|
|
749
|
+
u.raw.length === 1 && l !== void 0 ? l.raw += "\n" : c.push(u);
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
if (u = this.tokenizer.code(e)) {
|
|
753
|
+
e = e.substring(u.raw.length);
|
|
754
|
+
let l = c.at(-1);
|
|
755
|
+
l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.text, this.inlineQueue.at(-1).src = l.text) : c.push(u);
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
if (u = this.tokenizer.fences(e)) {
|
|
759
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
if (u = this.tokenizer.heading(e)) {
|
|
763
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
if (u = this.tokenizer.hr(e)) {
|
|
767
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
if (u = this.tokenizer.blockquote(e)) {
|
|
771
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
772
|
+
continue;
|
|
773
|
+
}
|
|
774
|
+
if (u = this.tokenizer.list(e)) {
|
|
775
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
776
|
+
continue;
|
|
777
|
+
}
|
|
778
|
+
if (u = this.tokenizer.html(e)) {
|
|
779
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
if (u = this.tokenizer.def(e)) {
|
|
783
|
+
e = e.substring(u.raw.length);
|
|
784
|
+
let l = c.at(-1);
|
|
785
|
+
l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[u.tag] || (this.tokens.links[u.tag] = {
|
|
786
|
+
href: u.href,
|
|
787
|
+
title: u.title
|
|
788
|
+
}, c.push(u));
|
|
789
|
+
continue;
|
|
790
|
+
}
|
|
791
|
+
if (u = this.tokenizer.table(e)) {
|
|
792
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
if (u = this.tokenizer.lheading(e)) {
|
|
796
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
let d = e;
|
|
800
|
+
if (this.options.extensions?.startBlock) {
|
|
801
|
+
let c = Infinity, l = e.slice(1), u;
|
|
802
|
+
this.options.extensions.startBlock.forEach((e) => {
|
|
803
|
+
u = e.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
|
|
804
|
+
}), c < Infinity && c >= 0 && (d = e.substring(0, c + 1));
|
|
805
|
+
}
|
|
806
|
+
if (this.state.top && (u = this.tokenizer.paragraph(d))) {
|
|
807
|
+
let f = c.at(-1);
|
|
808
|
+
l && f?.type === "paragraph" ? (f.raw += (f.raw.endsWith("\n") ? "" : "\n") + u.raw, f.text += "\n" + u.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = f.text) : c.push(u), l = d.length !== e.length, e = e.substring(u.raw.length);
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (u = this.tokenizer.text(e)) {
|
|
812
|
+
e = e.substring(u.raw.length);
|
|
813
|
+
let l = c.at(-1);
|
|
814
|
+
l?.type === "text" ? (l.raw += (l.raw.endsWith("\n") ? "" : "\n") + u.raw, l.text += "\n" + u.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : c.push(u);
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
if (e) {
|
|
818
|
+
let c = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
819
|
+
if (this.options.silent) {
|
|
820
|
+
console.error(c);
|
|
821
|
+
break;
|
|
822
|
+
} else throw Error(c);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return this.state.top = !0, c;
|
|
826
|
+
}
|
|
827
|
+
inline(e, c = []) {
|
|
828
|
+
return this.inlineQueue.push({
|
|
829
|
+
src: e,
|
|
830
|
+
tokens: c
|
|
831
|
+
}), c;
|
|
832
|
+
}
|
|
833
|
+
inlineTokens(e, c = []) {
|
|
834
|
+
let l = e, u = null;
|
|
835
|
+
if (this.tokens.links) {
|
|
836
|
+
let e = Object.keys(this.tokens.links);
|
|
837
|
+
if (e.length > 0) for (; (u = this.tokenizer.rules.inline.reflinkSearch.exec(l)) != null;) e.includes(u[0].slice(u[0].lastIndexOf("[") + 1, -1)) && (l = l.slice(0, u.index) + "[" + "a".repeat(u[0].length - 2) + "]" + l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
838
|
+
}
|
|
839
|
+
for (; (u = this.tokenizer.rules.inline.anyPunctuation.exec(l)) != null;) l = l.slice(0, u.index) + "++" + l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
840
|
+
let d;
|
|
841
|
+
for (; (u = this.tokenizer.rules.inline.blockSkip.exec(l)) != null;) d = u[2] ? u[2].length : 0, l = l.slice(0, u.index + d) + "[" + "a".repeat(u[0].length - d - 2) + "]" + l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
842
|
+
l = this.options.hooks?.emStrongMask?.call({ lexer: this }, l) ?? l;
|
|
843
|
+
let f = !1, p = "";
|
|
844
|
+
for (; e;) {
|
|
845
|
+
f || (p = ""), f = !1;
|
|
846
|
+
let u;
|
|
847
|
+
if (this.options.extensions?.inline?.some((l) => (u = l.call({ lexer: this }, e, c)) ? (e = e.substring(u.raw.length), c.push(u), !0) : !1)) continue;
|
|
848
|
+
if (u = this.tokenizer.escape(e)) {
|
|
849
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
if (u = this.tokenizer.tag(e)) {
|
|
853
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
854
|
+
continue;
|
|
855
|
+
}
|
|
856
|
+
if (u = this.tokenizer.link(e)) {
|
|
857
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
if (u = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
861
|
+
e = e.substring(u.raw.length);
|
|
862
|
+
let l = c.at(-1);
|
|
863
|
+
u.type === "text" && l?.type === "text" ? (l.raw += u.raw, l.text += u.text) : c.push(u);
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
if (u = this.tokenizer.emStrong(e, l, p)) {
|
|
867
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
if (u = this.tokenizer.codespan(e)) {
|
|
871
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
if (u = this.tokenizer.br(e)) {
|
|
875
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
876
|
+
continue;
|
|
877
|
+
}
|
|
878
|
+
if (u = this.tokenizer.del(e, l, p)) {
|
|
879
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
if (u = this.tokenizer.autolink(e)) {
|
|
883
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
if (!this.state.inLink && (u = this.tokenizer.url(e))) {
|
|
887
|
+
e = e.substring(u.raw.length), c.push(u);
|
|
888
|
+
continue;
|
|
889
|
+
}
|
|
890
|
+
let d = e;
|
|
891
|
+
if (this.options.extensions?.startInline) {
|
|
892
|
+
let c = Infinity, l = e.slice(1), u;
|
|
893
|
+
this.options.extensions.startInline.forEach((e) => {
|
|
894
|
+
u = e.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
|
|
895
|
+
}), c < Infinity && c >= 0 && (d = e.substring(0, c + 1));
|
|
896
|
+
}
|
|
897
|
+
if (u = this.tokenizer.inlineText(d)) {
|
|
898
|
+
e = e.substring(u.raw.length), u.raw.slice(-1) !== "_" && (p = u.raw.slice(-1)), f = !0;
|
|
899
|
+
let l = c.at(-1);
|
|
900
|
+
l?.type === "text" ? (l.raw += u.raw, l.text += u.text) : c.push(u);
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
if (e) {
|
|
904
|
+
let c = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
905
|
+
if (this.options.silent) {
|
|
906
|
+
console.error(c);
|
|
907
|
+
break;
|
|
908
|
+
} else throw Error(c);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return c;
|
|
912
|
+
}
|
|
913
|
+
}, y = class {
|
|
914
|
+
options;
|
|
915
|
+
parser;
|
|
916
|
+
constructor(e) {
|
|
917
|
+
this.options = e || T;
|
|
918
|
+
}
|
|
919
|
+
space(e) {
|
|
920
|
+
return "";
|
|
921
|
+
}
|
|
922
|
+
code({ text: e, lang: c, escaped: l }) {
|
|
923
|
+
let u = (c || "").match(m.notSpaceStart)?.[0], d = e.replace(m.endingNewline, "") + "\n";
|
|
924
|
+
return u ? "<pre><code class=\"language-" + O(u) + "\">" + (l ? d : O(d, !0)) + "</code></pre>\n" : "<pre><code>" + (l ? d : O(d, !0)) + "</code></pre>\n";
|
|
925
|
+
}
|
|
926
|
+
blockquote({ tokens: e }) {
|
|
927
|
+
return `<blockquote>
|
|
928
|
+
${this.parser.parse(e)}</blockquote>
|
|
929
|
+
`;
|
|
930
|
+
}
|
|
931
|
+
html({ text: e }) {
|
|
932
|
+
return e;
|
|
933
|
+
}
|
|
934
|
+
def(e) {
|
|
935
|
+
return "";
|
|
936
|
+
}
|
|
937
|
+
heading({ tokens: e, depth: c }) {
|
|
938
|
+
return `<h${c}>${this.parser.parseInline(e)}</h${c}>
|
|
939
|
+
`;
|
|
940
|
+
}
|
|
941
|
+
hr(e) {
|
|
942
|
+
return "<hr>\n";
|
|
943
|
+
}
|
|
944
|
+
list(e) {
|
|
945
|
+
let c = e.ordered, l = e.start, u = "";
|
|
946
|
+
for (let c = 0; c < e.items.length; c++) {
|
|
947
|
+
let l = e.items[c];
|
|
948
|
+
u += this.listitem(l);
|
|
949
|
+
}
|
|
950
|
+
let d = c ? "ol" : "ul", f = c && l !== 1 ? " start=\"" + l + "\"" : "";
|
|
951
|
+
return "<" + d + f + ">\n" + u + "</" + d + ">\n";
|
|
952
|
+
}
|
|
953
|
+
listitem(e) {
|
|
954
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
955
|
+
`;
|
|
956
|
+
}
|
|
957
|
+
checkbox({ checked: e }) {
|
|
958
|
+
return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
|
|
959
|
+
}
|
|
960
|
+
paragraph({ tokens: e }) {
|
|
961
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
962
|
+
`;
|
|
963
|
+
}
|
|
964
|
+
table(e) {
|
|
965
|
+
let c = "", l = "";
|
|
966
|
+
for (let c = 0; c < e.header.length; c++) l += this.tablecell(e.header[c]);
|
|
967
|
+
c += this.tablerow({ text: l });
|
|
968
|
+
let u = "";
|
|
969
|
+
for (let c = 0; c < e.rows.length; c++) {
|
|
970
|
+
let d = e.rows[c];
|
|
971
|
+
l = "";
|
|
972
|
+
for (let e = 0; e < d.length; e++) l += this.tablecell(d[e]);
|
|
973
|
+
u += this.tablerow({ text: l });
|
|
974
|
+
}
|
|
975
|
+
return u &&= `<tbody>${u}</tbody>`, "<table>\n<thead>\n" + c + "</thead>\n" + u + "</table>\n";
|
|
976
|
+
}
|
|
977
|
+
tablerow({ text: e }) {
|
|
978
|
+
return `<tr>
|
|
979
|
+
${e}</tr>
|
|
980
|
+
`;
|
|
981
|
+
}
|
|
982
|
+
tablecell(e) {
|
|
983
|
+
let c = this.parser.parseInline(e.tokens), l = e.header ? "th" : "td";
|
|
984
|
+
return (e.align ? `<${l} align="${e.align}">` : `<${l}>`) + c + `</${l}>
|
|
985
|
+
`;
|
|
986
|
+
}
|
|
987
|
+
strong({ tokens: e }) {
|
|
988
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
989
|
+
}
|
|
990
|
+
em({ tokens: e }) {
|
|
991
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
992
|
+
}
|
|
993
|
+
codespan({ text: e }) {
|
|
994
|
+
return `<code>${O(e, !0)}</code>`;
|
|
995
|
+
}
|
|
996
|
+
br(e) {
|
|
997
|
+
return "<br>";
|
|
998
|
+
}
|
|
999
|
+
del({ tokens: e }) {
|
|
1000
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1001
|
+
}
|
|
1002
|
+
link({ href: e, title: c, tokens: l }) {
|
|
1003
|
+
let u = this.parser.parseInline(l), d = X(e);
|
|
1004
|
+
if (d === null) return u;
|
|
1005
|
+
e = d;
|
|
1006
|
+
let f = "<a href=\"" + e + "\"";
|
|
1007
|
+
return c && (f += " title=\"" + O(c) + "\""), f += ">" + u + "</a>", f;
|
|
1008
|
+
}
|
|
1009
|
+
image({ href: e, title: c, text: l, tokens: u }) {
|
|
1010
|
+
u && (l = this.parser.parseInline(u, this.parser.textRenderer));
|
|
1011
|
+
let d = X(e);
|
|
1012
|
+
if (d === null) return O(l);
|
|
1013
|
+
e = d;
|
|
1014
|
+
let f = `<img src="${e}" alt="${O(l)}"`;
|
|
1015
|
+
return c && (f += ` title="${O(c)}"`), f += ">", f;
|
|
1016
|
+
}
|
|
1017
|
+
text(e) {
|
|
1018
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
|
|
1019
|
+
}
|
|
1020
|
+
}, $ = class {
|
|
1021
|
+
strong({ text: e }) {
|
|
1022
|
+
return e;
|
|
1023
|
+
}
|
|
1024
|
+
em({ text: e }) {
|
|
1025
|
+
return e;
|
|
1026
|
+
}
|
|
1027
|
+
codespan({ text: e }) {
|
|
1028
|
+
return e;
|
|
1029
|
+
}
|
|
1030
|
+
del({ text: e }) {
|
|
1031
|
+
return e;
|
|
1032
|
+
}
|
|
1033
|
+
html({ text: e }) {
|
|
1034
|
+
return e;
|
|
1035
|
+
}
|
|
1036
|
+
text({ text: e }) {
|
|
1037
|
+
return e;
|
|
1038
|
+
}
|
|
1039
|
+
link({ text: e }) {
|
|
1040
|
+
return "" + e;
|
|
1041
|
+
}
|
|
1042
|
+
image({ text: e }) {
|
|
1043
|
+
return "" + e;
|
|
1044
|
+
}
|
|
1045
|
+
br() {
|
|
1046
|
+
return "";
|
|
1047
|
+
}
|
|
1048
|
+
checkbox({ raw: e }) {
|
|
1049
|
+
return e;
|
|
1050
|
+
}
|
|
1051
|
+
}, b = class e {
|
|
1052
|
+
options;
|
|
1053
|
+
renderer;
|
|
1054
|
+
textRenderer;
|
|
1055
|
+
constructor(e) {
|
|
1056
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
1057
|
+
}
|
|
1058
|
+
static parse(c, l) {
|
|
1059
|
+
return new e(l).parse(c);
|
|
1060
|
+
}
|
|
1061
|
+
static parseInline(c, l) {
|
|
1062
|
+
return new e(l).parseInline(c);
|
|
1063
|
+
}
|
|
1064
|
+
parse(e) {
|
|
1065
|
+
let c = "";
|
|
1066
|
+
for (let l = 0; l < e.length; l++) {
|
|
1067
|
+
let u = e[l];
|
|
1068
|
+
if (this.options.extensions?.renderers?.[u.type]) {
|
|
1069
|
+
let e = u, l = this.options.extensions.renderers[e.type].call({ parser: this }, e);
|
|
1070
|
+
if (l !== !1 || ![
|
|
1071
|
+
"space",
|
|
1072
|
+
"hr",
|
|
1073
|
+
"heading",
|
|
1074
|
+
"code",
|
|
1075
|
+
"table",
|
|
1076
|
+
"blockquote",
|
|
1077
|
+
"list",
|
|
1078
|
+
"html",
|
|
1079
|
+
"def",
|
|
1080
|
+
"paragraph",
|
|
1081
|
+
"text"
|
|
1082
|
+
].includes(e.type)) {
|
|
1083
|
+
c += l || "";
|
|
1084
|
+
continue;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
let d = u;
|
|
1088
|
+
switch (d.type) {
|
|
1089
|
+
case "space":
|
|
1090
|
+
c += this.renderer.space(d);
|
|
1091
|
+
break;
|
|
1092
|
+
case "hr":
|
|
1093
|
+
c += this.renderer.hr(d);
|
|
1094
|
+
break;
|
|
1095
|
+
case "heading":
|
|
1096
|
+
c += this.renderer.heading(d);
|
|
1097
|
+
break;
|
|
1098
|
+
case "code":
|
|
1099
|
+
c += this.renderer.code(d);
|
|
1100
|
+
break;
|
|
1101
|
+
case "table":
|
|
1102
|
+
c += this.renderer.table(d);
|
|
1103
|
+
break;
|
|
1104
|
+
case "blockquote":
|
|
1105
|
+
c += this.renderer.blockquote(d);
|
|
1106
|
+
break;
|
|
1107
|
+
case "list":
|
|
1108
|
+
c += this.renderer.list(d);
|
|
1109
|
+
break;
|
|
1110
|
+
case "checkbox":
|
|
1111
|
+
c += this.renderer.checkbox(d);
|
|
1112
|
+
break;
|
|
1113
|
+
case "html":
|
|
1114
|
+
c += this.renderer.html(d);
|
|
1115
|
+
break;
|
|
1116
|
+
case "def":
|
|
1117
|
+
c += this.renderer.def(d);
|
|
1118
|
+
break;
|
|
1119
|
+
case "paragraph":
|
|
1120
|
+
c += this.renderer.paragraph(d);
|
|
1121
|
+
break;
|
|
1122
|
+
case "text":
|
|
1123
|
+
c += this.renderer.text(d);
|
|
1124
|
+
break;
|
|
1125
|
+
default: {
|
|
1126
|
+
let e = "Token with \"" + d.type + "\" type was not found.";
|
|
1127
|
+
if (this.options.silent) return console.error(e), "";
|
|
1128
|
+
throw Error(e);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
return c;
|
|
1133
|
+
}
|
|
1134
|
+
parseInline(e, c = this.renderer) {
|
|
1135
|
+
let l = "";
|
|
1136
|
+
for (let u = 0; u < e.length; u++) {
|
|
1137
|
+
let d = e[u];
|
|
1138
|
+
if (this.options.extensions?.renderers?.[d.type]) {
|
|
1139
|
+
let e = this.options.extensions.renderers[d.type].call({ parser: this }, d);
|
|
1140
|
+
if (e !== !1 || ![
|
|
1141
|
+
"escape",
|
|
1142
|
+
"html",
|
|
1143
|
+
"link",
|
|
1144
|
+
"image",
|
|
1145
|
+
"strong",
|
|
1146
|
+
"em",
|
|
1147
|
+
"codespan",
|
|
1148
|
+
"br",
|
|
1149
|
+
"del",
|
|
1150
|
+
"text"
|
|
1151
|
+
].includes(d.type)) {
|
|
1152
|
+
l += e || "";
|
|
1153
|
+
continue;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
let f = d;
|
|
1157
|
+
switch (f.type) {
|
|
1158
|
+
case "escape":
|
|
1159
|
+
l += c.text(f);
|
|
1160
|
+
break;
|
|
1161
|
+
case "html":
|
|
1162
|
+
l += c.html(f);
|
|
1163
|
+
break;
|
|
1164
|
+
case "link":
|
|
1165
|
+
l += c.link(f);
|
|
1166
|
+
break;
|
|
1167
|
+
case "image":
|
|
1168
|
+
l += c.image(f);
|
|
1169
|
+
break;
|
|
1170
|
+
case "checkbox":
|
|
1171
|
+
l += c.checkbox(f);
|
|
1172
|
+
break;
|
|
1173
|
+
case "strong":
|
|
1174
|
+
l += c.strong(f);
|
|
1175
|
+
break;
|
|
1176
|
+
case "em":
|
|
1177
|
+
l += c.em(f);
|
|
1178
|
+
break;
|
|
1179
|
+
case "codespan":
|
|
1180
|
+
l += c.codespan(f);
|
|
1181
|
+
break;
|
|
1182
|
+
case "br":
|
|
1183
|
+
l += c.br(f);
|
|
1184
|
+
break;
|
|
1185
|
+
case "del":
|
|
1186
|
+
l += c.del(f);
|
|
1187
|
+
break;
|
|
1188
|
+
case "text":
|
|
1189
|
+
l += c.text(f);
|
|
1190
|
+
break;
|
|
1191
|
+
default: {
|
|
1192
|
+
let e = "Token with \"" + f.type + "\" type was not found.";
|
|
1193
|
+
if (this.options.silent) return console.error(e), "";
|
|
1194
|
+
throw Error(e);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return l;
|
|
1199
|
+
}
|
|
1200
|
+
}, P = class {
|
|
1201
|
+
options;
|
|
1202
|
+
block;
|
|
1203
|
+
constructor(e) {
|
|
1204
|
+
this.options = e || T;
|
|
1205
|
+
}
|
|
1206
|
+
static passThroughHooks = new Set([
|
|
1207
|
+
"preprocess",
|
|
1208
|
+
"postprocess",
|
|
1209
|
+
"processAllTokens",
|
|
1210
|
+
"emStrongMask"
|
|
1211
|
+
]);
|
|
1212
|
+
static passThroughHooksRespectAsync = new Set([
|
|
1213
|
+
"preprocess",
|
|
1214
|
+
"postprocess",
|
|
1215
|
+
"processAllTokens"
|
|
1216
|
+
]);
|
|
1217
|
+
preprocess(e) {
|
|
1218
|
+
return e;
|
|
1219
|
+
}
|
|
1220
|
+
postprocess(e) {
|
|
1221
|
+
return e;
|
|
1222
|
+
}
|
|
1223
|
+
processAllTokens(e) {
|
|
1224
|
+
return e;
|
|
1225
|
+
}
|
|
1226
|
+
emStrongMask(e) {
|
|
1227
|
+
return e;
|
|
1228
|
+
}
|
|
1229
|
+
provideLexer() {
|
|
1230
|
+
return this.block ? x.lex : x.lexInline;
|
|
1231
|
+
}
|
|
1232
|
+
provideParser() {
|
|
1233
|
+
return this.block ? b.parse : b.parseInline;
|
|
1234
|
+
}
|
|
1235
|
+
}, L = new class {
|
|
1236
|
+
defaults = M();
|
|
1237
|
+
options = this.setOptions;
|
|
1238
|
+
parse = this.parseMarkdown(!0);
|
|
1239
|
+
parseInline = this.parseMarkdown(!1);
|
|
1240
|
+
Parser = b;
|
|
1241
|
+
Renderer = y;
|
|
1242
|
+
TextRenderer = $;
|
|
1243
|
+
Lexer = x;
|
|
1244
|
+
Tokenizer = w;
|
|
1245
|
+
Hooks = P;
|
|
1246
|
+
constructor(...e) {
|
|
1247
|
+
this.use(...e);
|
|
1248
|
+
}
|
|
1249
|
+
walkTokens(e, c) {
|
|
1250
|
+
let l = [];
|
|
1251
|
+
for (let u of e) switch (l = l.concat(c.call(this, u)), u.type) {
|
|
1252
|
+
case "table": {
|
|
1253
|
+
let e = u;
|
|
1254
|
+
for (let u of e.header) l = l.concat(this.walkTokens(u.tokens, c));
|
|
1255
|
+
for (let u of e.rows) for (let e of u) l = l.concat(this.walkTokens(e.tokens, c));
|
|
1256
|
+
break;
|
|
1257
|
+
}
|
|
1258
|
+
case "list": {
|
|
1259
|
+
let e = u;
|
|
1260
|
+
l = l.concat(this.walkTokens(e.items, c));
|
|
1261
|
+
break;
|
|
1262
|
+
}
|
|
1263
|
+
default: {
|
|
1264
|
+
let e = u;
|
|
1265
|
+
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((u) => {
|
|
1266
|
+
let d = e[u].flat(Infinity);
|
|
1267
|
+
l = l.concat(this.walkTokens(d, c));
|
|
1268
|
+
}) : e.tokens && (l = l.concat(this.walkTokens(e.tokens, c)));
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
return l;
|
|
1272
|
+
}
|
|
1273
|
+
use(...e) {
|
|
1274
|
+
let c = this.defaults.extensions || {
|
|
1275
|
+
renderers: {},
|
|
1276
|
+
childTokens: {}
|
|
1277
|
+
};
|
|
1278
|
+
return e.forEach((e) => {
|
|
1279
|
+
let l = { ...e };
|
|
1280
|
+
if (l.async = this.defaults.async || l.async || !1, e.extensions && (e.extensions.forEach((e) => {
|
|
1281
|
+
if (!e.name) throw Error("extension name required");
|
|
1282
|
+
if ("renderer" in e) {
|
|
1283
|
+
let l = c.renderers[e.name];
|
|
1284
|
+
l ? c.renderers[e.name] = function(...c) {
|
|
1285
|
+
let u = e.renderer.apply(this, c);
|
|
1286
|
+
return u === !1 && (u = l.apply(this, c)), u;
|
|
1287
|
+
} : c.renderers[e.name] = e.renderer;
|
|
1288
|
+
}
|
|
1289
|
+
if ("tokenizer" in e) {
|
|
1290
|
+
if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
|
|
1291
|
+
let l = c[e.level];
|
|
1292
|
+
l ? l.unshift(e.tokenizer) : c[e.level] = [e.tokenizer], e.start && (e.level === "block" ? c.startBlock ? c.startBlock.push(e.start) : c.startBlock = [e.start] : e.level === "inline" && (c.startInline ? c.startInline.push(e.start) : c.startInline = [e.start]));
|
|
1293
|
+
}
|
|
1294
|
+
"childTokens" in e && e.childTokens && (c.childTokens[e.name] = e.childTokens);
|
|
1295
|
+
}), l.extensions = c), e.renderer) {
|
|
1296
|
+
let c = this.defaults.renderer || new y(this.defaults);
|
|
1297
|
+
for (let l in e.renderer) {
|
|
1298
|
+
if (!(l in c)) throw Error(`renderer '${l}' does not exist`);
|
|
1299
|
+
if (["options", "parser"].includes(l)) continue;
|
|
1300
|
+
let u = l, d = e.renderer[u], f = c[u];
|
|
1301
|
+
c[u] = (...e) => {
|
|
1302
|
+
let l = d.apply(c, e);
|
|
1303
|
+
return l === !1 && (l = f.apply(c, e)), l || "";
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
l.renderer = c;
|
|
1307
|
+
}
|
|
1308
|
+
if (e.tokenizer) {
|
|
1309
|
+
let c = this.defaults.tokenizer || new w(this.defaults);
|
|
1310
|
+
for (let l in e.tokenizer) {
|
|
1311
|
+
if (!(l in c)) throw Error(`tokenizer '${l}' does not exist`);
|
|
1312
|
+
if ([
|
|
1313
|
+
"options",
|
|
1314
|
+
"rules",
|
|
1315
|
+
"lexer"
|
|
1316
|
+
].includes(l)) continue;
|
|
1317
|
+
let u = l, d = e.tokenizer[u], f = c[u];
|
|
1318
|
+
c[u] = (...e) => {
|
|
1319
|
+
let l = d.apply(c, e);
|
|
1320
|
+
return l === !1 && (l = f.apply(c, e)), l;
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
l.tokenizer = c;
|
|
1324
|
+
}
|
|
1325
|
+
if (e.hooks) {
|
|
1326
|
+
let c = this.defaults.hooks || new P();
|
|
1327
|
+
for (let l in e.hooks) {
|
|
1328
|
+
if (!(l in c)) throw Error(`hook '${l}' does not exist`);
|
|
1329
|
+
if (["options", "block"].includes(l)) continue;
|
|
1330
|
+
let u = l, d = e.hooks[u], f = c[u];
|
|
1331
|
+
P.passThroughHooks.has(l) ? c[u] = (e) => {
|
|
1332
|
+
if (this.defaults.async && P.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
1333
|
+
let l = await d.call(c, e);
|
|
1334
|
+
return f.call(c, l);
|
|
1335
|
+
})();
|
|
1336
|
+
let u = d.call(c, e);
|
|
1337
|
+
return f.call(c, u);
|
|
1338
|
+
} : c[u] = (...e) => {
|
|
1339
|
+
if (this.defaults.async) return (async () => {
|
|
1340
|
+
let l = await d.apply(c, e);
|
|
1341
|
+
return l === !1 && (l = await f.apply(c, e)), l;
|
|
1342
|
+
})();
|
|
1343
|
+
let l = d.apply(c, e);
|
|
1344
|
+
return l === !1 && (l = f.apply(c, e)), l;
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
l.hooks = c;
|
|
1348
|
+
}
|
|
1349
|
+
if (e.walkTokens) {
|
|
1350
|
+
let c = this.defaults.walkTokens, u = e.walkTokens;
|
|
1351
|
+
l.walkTokens = function(e) {
|
|
1352
|
+
let l = [];
|
|
1353
|
+
return l.push(u.call(this, e)), c && (l = l.concat(c.call(this, e))), l;
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
this.defaults = {
|
|
1357
|
+
...this.defaults,
|
|
1358
|
+
...l
|
|
1359
|
+
};
|
|
1360
|
+
}), this;
|
|
1361
|
+
}
|
|
1362
|
+
setOptions(e) {
|
|
1363
|
+
return this.defaults = {
|
|
1364
|
+
...this.defaults,
|
|
1365
|
+
...e
|
|
1366
|
+
}, this;
|
|
1367
|
+
}
|
|
1368
|
+
lexer(e, c) {
|
|
1369
|
+
return x.lex(e, c ?? this.defaults);
|
|
1370
|
+
}
|
|
1371
|
+
parser(e, c) {
|
|
1372
|
+
return b.parse(e, c ?? this.defaults);
|
|
1373
|
+
}
|
|
1374
|
+
parseMarkdown(e) {
|
|
1375
|
+
return (c, l) => {
|
|
1376
|
+
let u = { ...l }, d = {
|
|
1377
|
+
...this.defaults,
|
|
1378
|
+
...u
|
|
1379
|
+
}, f = this.onError(!!d.silent, !!d.async);
|
|
1380
|
+
if (this.defaults.async === !0 && u.async === !1) return f(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1381
|
+
if (typeof c > "u" || c === null) return f(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
1382
|
+
if (typeof c != "string") return f(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(c) + ", string expected"));
|
|
1383
|
+
if (d.hooks && (d.hooks.options = d, d.hooks.block = e), d.async) return (async () => {
|
|
1384
|
+
let l = d.hooks ? await d.hooks.preprocess(c) : c, u = await (d.hooks ? await d.hooks.provideLexer() : e ? x.lex : x.lexInline)(l, d), f = d.hooks ? await d.hooks.processAllTokens(u) : u;
|
|
1385
|
+
d.walkTokens && await Promise.all(this.walkTokens(f, d.walkTokens));
|
|
1386
|
+
let p = await (d.hooks ? await d.hooks.provideParser() : e ? b.parse : b.parseInline)(f, d);
|
|
1387
|
+
return d.hooks ? await d.hooks.postprocess(p) : p;
|
|
1388
|
+
})().catch(f);
|
|
1389
|
+
try {
|
|
1390
|
+
d.hooks && (c = d.hooks.preprocess(c));
|
|
1391
|
+
let l = (d.hooks ? d.hooks.provideLexer() : e ? x.lex : x.lexInline)(c, d);
|
|
1392
|
+
d.hooks && (l = d.hooks.processAllTokens(l)), d.walkTokens && this.walkTokens(l, d.walkTokens);
|
|
1393
|
+
let u = (d.hooks ? d.hooks.provideParser() : e ? b.parse : b.parseInline)(l, d);
|
|
1394
|
+
return d.hooks && (u = d.hooks.postprocess(u)), u;
|
|
1395
|
+
} catch (e) {
|
|
1396
|
+
return f(e);
|
|
1397
|
+
}
|
|
1398
|
+
};
|
|
1399
|
+
}
|
|
1400
|
+
onError(e, c) {
|
|
1401
|
+
return (l) => {
|
|
1402
|
+
if (l.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
1403
|
+
let e = "<p>An error occurred:</p><pre>" + O(l.message + "", !0) + "</pre>";
|
|
1404
|
+
return c ? Promise.resolve(e) : e;
|
|
1405
|
+
}
|
|
1406
|
+
if (c) return Promise.reject(l);
|
|
1407
|
+
throw l;
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
}();
|
|
1411
|
+
function g(e, c) {
|
|
1412
|
+
return L.parse(e, c);
|
|
1413
|
+
}
|
|
1414
|
+
g.options = g.setOptions = function(e) {
|
|
1415
|
+
return L.setOptions(e), g.defaults = L.defaults, H(g.defaults), g;
|
|
1416
|
+
}, g.getDefaults = M, g.defaults = T, g.use = function(...e) {
|
|
1417
|
+
return L.use(...e), g.defaults = L.defaults, H(g.defaults), g;
|
|
1418
|
+
}, g.walkTokens = function(e, c) {
|
|
1419
|
+
return L.walkTokens(e, c);
|
|
1420
|
+
}, g.parseInline = L.parseInline, g.Parser = b, g.parser = b.parse, g.Renderer = y, g.TextRenderer = $, g.Lexer = x, g.lexer = x.lex, g.Tokenizer = w, g.Hooks = P, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, b.parse, x.lex;
|
|
1421
|
+
export { x };
|