reactive-md 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-ch.md +66 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING-ch.md +6 -62
- package/CONTRIBUTING.md +5 -63
- package/README-ch.md +232 -67
- package/README-en.md +209 -71
- package/README.md +209 -71
- package/SECURITY-ch.md +3 -1
- package/SECURITY.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1909 -87
- package/cli/args.mjs +33 -1
- package/cli/build.mjs +62 -1
- package/cli/check.mjs +444 -0
- package/cli/help.mjs +181 -3
- package/cli/init.mjs +1577 -0
- package/cli/main.mjs +11 -1
- package/cli/package-loader.mjs +41 -0
- package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
- package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
- package/dist-library/compiler--ea2CKQF.js +61 -0
- package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
- package/dist-library/component-state-Cq2K5gkS.js +490 -0
- package/dist-library/component-state-D_cw_EHe.js +54 -0
- package/dist-library/config-validation-DXTynAw7.js +3005 -0
- package/dist-library/default-components-Z_YMio5P.js +2346 -0
- package/dist-library/identity-MYJXKSkB.js +1443 -0
- package/dist-library/math-display-BJz4gbFc.js +24000 -0
- package/dist-library/math-sample-BGEW49zY.js +1124 -0
- package/dist-library/options-CX5m5n-J.js +115 -0
- package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
- package/dist-library/props-DGlBk0e5.js +183 -0
- package/dist-library/react-ByOHunUW.js +122 -0
- package/dist-library/reactive-md-authoring.js +712 -1077
- package/dist-library/reactive-md-build.js +7966 -0
- package/dist-library/reactive-md-compiler-standard.js +33 -0
- package/dist-library/reactive-md-compiler.js +22 -0
- package/dist-library/reactive-md-default-packs.js +71 -0
- package/dist-library/reactive-md-default-preset.js +10 -0
- package/dist-library/reactive-md-export.js +111 -0
- package/dist-library/reactive-md-print.css +18 -3
- package/dist-library/reactive-md-react-runtime.js +251 -0
- package/dist-library/reactive-md-react-server.js +55 -0
- package/dist-library/reactive-md-react-unstyled.js +9 -1
- package/dist-library/reactive-md-react.js +9 -1
- package/dist-library/reactive-md-runtime-browser.js +51 -0
- package/dist-library/reactive-md-runtime.js +3 -0
- package/dist-library/reactive-md-sdk.js +6 -0
- package/dist-library/reactive-md-standalone-host.js +442 -0
- package/dist-library/reactive-md-testing-browser.js +523 -0
- package/dist-library/reactive-md-testing-react.js +221 -0
- package/dist-library/reactive-md-testing.js +638 -0
- package/dist-library/reactive-md-vite.js +959 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1080 -795
- package/dist-library/registry-B9Jc3FVe.js +1174 -0
- package/dist-library/resources-BGt8mpDA.js +204 -0
- package/dist-library/runtime-C-sbfpOX.js +1157 -0
- package/dist-library/runtime-Dkq7ldyg.js +172 -0
- package/dist-library/schema-ZFufO8V0.js +39 -0
- package/dist-library/shareable-DDVL4Fi9.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +168 -0
- package/dist-library/types/authoring/conformance.d.ts +24 -0
- package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
- package/dist-library/types/authoring/extensions.d.ts +13 -0
- package/dist-library/types/authoring/index.d.ts +14 -11
- package/dist-library/types/authoring/insert.d.ts +16 -0
- package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
- package/dist-library/types/authoring/templates.d.ts +65 -0
- package/dist-library/types/build/diagnostics.d.ts +8 -0
- package/dist-library/types/build/digest.d.ts +5 -0
- package/dist-library/types/build/entry.d.ts +9 -0
- package/dist-library/types/build/host.d.ts +36 -0
- package/dist-library/types/build/index.d.ts +99 -0
- package/dist-library/types/build/notices.d.ts +29 -0
- package/dist-library/types/build/resources.d.ts +60 -0
- package/dist-library/types/build/vite.d.ts +15 -0
- package/dist-library/types/compiler/index.d.ts +22 -0
- package/dist-library/types/compiler/result.d.ts +30 -0
- package/dist-library/types/compiler/standard.d.ts +16 -0
- package/dist-library/types/compiler/types.d.ts +69 -0
- package/dist-library/types/components/chart-motion.d.ts +12 -0
- package/dist-library/types/components/controls.d.ts +21 -0
- package/dist-library/types/{local → components}/data-table.d.ts +10 -24
- package/dist-library/types/components/default-chart-types.d.ts +22 -0
- package/dist-library/types/components/default-chart.d.ts +2 -0
- package/dist-library/types/components/default-preset.d.ts +10 -0
- package/dist-library/types/components/diagram-inspector.d.ts +24 -0
- package/dist-library/types/components/gallery.d.ts +6 -0
- package/dist-library/types/components/layout.d.ts +23 -0
- package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
- package/dist-library/types/components/mafs-visuals.d.ts +40 -0
- package/dist-library/types/components/numeric-sliders.d.ts +3 -0
- package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
- package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
- package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
- package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
- package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
- package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
- package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
- package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
- package/dist-library/types/components/use-hydrated.d.ts +6 -0
- package/dist-library/types/components/visuals.d.ts +13 -0
- package/dist-library/types/export/component-state.d.ts +39 -0
- package/dist-library/types/export/index.d.ts +47 -0
- package/dist-library/types/export/requirements.d.ts +23 -0
- package/dist-library/types/export/resources.d.ts +8 -0
- package/dist-library/types/export/restoration.d.ts +52 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
- package/dist-library/types/local/compilation/compiler.d.ts +34 -0
- package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
- package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
- package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
- package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
- package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
- package/dist-library/types/local/configuration/options-core.d.ts +120 -0
- package/dist-library/types/local/configuration/options.d.ts +17 -0
- package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
- package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
- package/dist-library/types/local/configuration/schema.d.ts +12 -0
- package/dist-library/types/local/contracts/types.d.ts +519 -0
- package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
- package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
- package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
- package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
- package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
- package/dist-library/types/local/evaluation/math.d.ts +73 -0
- package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
- package/dist-library/types/local/html/html-details.d.ts +16 -0
- package/dist-library/types/local/html/html-entities.d.ts +7 -0
- package/dist-library/types/local/html/html-policy.d.ts +43 -0
- package/dist-library/types/local/html/html-recovery.d.ts +16 -0
- package/dist-library/types/local/html/html-table-names.d.ts +9 -0
- package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
- package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
- package/dist-library/types/local/index.d.ts +31 -24
- package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
- package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
- package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
- package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
- package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
- package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
- package/dist-library/types/local/parsing/lexical.d.ts +21 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
- package/dist-library/types/local/parsing/parser.d.ts +16 -0
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
- package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
- package/dist-library/types/local/rendering/render-types.d.ts +57 -0
- package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
- package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
- package/dist-library/types/local/runtime/runtime.d.ts +34 -0
- package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
- package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
- package/dist-library/types/local/session/incremental.d.ts +48 -0
- package/dist-library/types/local/session/parse-session.d.ts +62 -0
- package/dist-library/types/local/session/row-reuse.d.ts +46 -0
- package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
- package/dist-library/types/local/source/node-walk.d.ts +3 -0
- package/dist-library/types/local/source/source-context.d.ts +63 -0
- package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
- package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
- package/dist-library/types/local/theme/theme-name.d.ts +3 -0
- package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
- package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
- package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
- package/dist-library/types/local/transport/shared-data.d.ts +10 -0
- package/dist-library/types/local/transport/worker.d.ts +265 -0
- package/dist-library/types/local/widgets/visuals.d.ts +25 -0
- package/dist-library/types/presets/default-authoring.d.ts +50 -0
- package/dist-library/types/presets/default-components.d.ts +4 -0
- package/dist-library/types/presets/default-semantics.d.ts +8 -0
- package/dist-library/types/presets/default.d.ts +11 -0
- package/dist-library/types/presets/identity.d.ts +7 -0
- package/dist-library/types/presets/packs.d.ts +4 -0
- package/dist-library/types/react/component-api.d.ts +260 -0
- package/dist-library/types/react/component-primitives.d.ts +21 -0
- package/dist-library/types/react/component-utils.d.ts +125 -0
- package/dist-library/types/react/default-theme.d.ts +6 -0
- package/dist-library/types/react/field-validation.d.ts +11 -0
- package/dist-library/types/react/index.d.ts +17 -5
- package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
- package/dist-library/types/react/package.d.ts +69 -0
- package/dist-library/types/react/runtime/common.d.ts +4 -0
- package/dist-library/types/react/runtime/index.d.ts +8 -0
- package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
- package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
- package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
- package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
- package/dist-library/types/react/sdk.d.ts +110 -0
- package/dist-library/types/react/server.d.ts +15 -0
- package/dist-library/types/react/tooltip-layer.d.ts +10 -0
- package/dist-library/types/react/use-draft-field.d.ts +17 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
- package/dist-library/types/runtime-services/component-state.d.ts +152 -0
- package/dist-library/types/runtime-services/identity.d.ts +41 -0
- package/dist-library/types/runtime-services/index.d.ts +10 -0
- package/dist-library/types/runtime-services/random.d.ts +42 -0
- package/dist-library/types/runtime-services/runtime.d.ts +51 -0
- package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
- package/dist-library/types/sdk/assembly.d.ts +73 -0
- package/dist-library/types/sdk/compat-profile.d.ts +57 -0
- package/dist-library/types/sdk/compiler-config.d.ts +33 -0
- package/dist-library/types/sdk/config-validation.d.ts +33 -0
- package/dist-library/types/sdk/config.d.ts +35 -0
- package/dist-library/types/sdk/hash.d.ts +9 -0
- package/dist-library/types/sdk/index.d.ts +10 -0
- package/dist-library/types/sdk/manifest.d.ts +49 -0
- package/dist-library/types/sdk/pattern.d.ts +11 -0
- package/dist-library/types/sdk/preset-core.d.ts +11 -0
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +33 -0
- package/dist-library/types/sdk/registry-core.d.ts +16 -0
- package/dist-library/types/sdk/registry.d.ts +18 -0
- package/dist-library/types/sdk/theme.d.ts +73 -0
- package/dist-library/types/sdk/types.d.ts +221 -0
- package/dist-library/types/sdk/version.d.ts +49 -0
- package/dist-library/types/shareable.d.ts +29 -3
- package/dist-library/types/standalone/diagnostics.d.ts +16 -0
- package/dist-library/types/standalone/events.d.ts +4 -0
- package/dist-library/types/standalone/library.d.ts +6 -0
- package/dist-library/types/standalone/payload.d.ts +15 -0
- package/dist-library/types/standalone/prepare.d.ts +21 -0
- package/dist-library/types/standalone/session.d.ts +68 -0
- package/dist-library/types/standalone/version.d.ts +7 -0
- package/dist-library/types/testing/behavior.d.ts +19 -0
- package/dist-library/types/testing/browser.d.ts +126 -0
- package/dist-library/types/testing/cases.d.ts +16 -0
- package/dist-library/types/testing/index.d.ts +13 -0
- package/dist-library/types/testing/manifest.d.ts +10 -0
- package/dist-library/types/testing/react.d.ts +45 -0
- package/dist-library/types/testing/report.d.ts +20 -0
- package/dist-library/types/testing/types.d.ts +125 -0
- package/dist-library/types/testing/values.d.ts +22 -0
- package/dist-library/types/vite/client.d.ts +36 -0
- package/dist-library/types/vite/discovery.d.ts +51 -0
- package/dist-library/types/vite/index.d.ts +31 -0
- package/dist-library/types/vite/registration.d.ts +109 -0
- package/dist-library/types-BFCrMrg0.js +52 -0
- package/dist-library/validation-W-bmny-x.js +2253 -0
- package/dist-library/values-CIt8AjiU.js +134 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +591 -95
- package/docs/README-ch.md +90 -0
- package/docs/README.md +87 -81
- package/docs/compatibility/compatibility-ch.md +22 -14
- package/docs/compatibility/compatibility-en.md +22 -14
- package/docs/compatibility/source-versioning-ch.md +15 -12
- package/docs/compatibility/source-versioning-en.md +16 -13
- package/docs/development/component-development-ch.md +51 -195
- package/docs/development/component-development-en.md +51 -195
- package/docs/development/component-development-reference-ch.md +253 -0
- package/docs/development/component-development-reference-en.md +238 -0
- package/docs/development/component-protocol-ch.md +51 -50
- package/docs/development/component-protocol-en.md +52 -49
- package/docs/development/local-module-layout-ch.md +59 -0
- package/docs/development/local-module-layout-en.md +59 -0
- package/docs/development/performance-overview-ch.md +402 -0
- package/docs/development/performance-overview-en.md +402 -0
- package/docs/development/releasing-ch.md +8 -104
- package/docs/development/releasing-en.md +8 -104
- package/docs/guides/local-guide-ch.md +28 -9
- package/docs/guides/local-guide-en.md +31 -12
- package/docs/integration/author-tools-ch.md +4 -2
- package/docs/integration/author-tools-en.md +4 -2
- package/docs/integration/codemirror-ch.md +52 -0
- package/docs/integration/codemirror-en.md +29 -0
- package/docs/integration/compiler-ch.md +47 -0
- package/docs/integration/compiler-en.md +34 -0
- package/docs/integration/directory-discovery-ch.md +53 -0
- package/docs/integration/directory-discovery-en.md +31 -0
- package/docs/integration/editor-ch.md +48 -21
- package/docs/integration/editor-en.md +48 -21
- package/docs/integration/extension-sdk-ch.md +392 -0
- package/docs/integration/extension-sdk-en.md +377 -0
- package/docs/integration/local-integration-ch.md +63 -9
- package/docs/integration/local-integration-en.md +89 -13
- package/docs/integration/repository-split-ch.md +40 -0
- package/docs/integration/repository-split-en.md +23 -0
- package/docs/integration/shareable-export-ch.md +46 -2
- package/docs/integration/shareable-export-en.md +46 -2
- package/docs/reference/computations-formatting-ch.md +4 -2
- package/docs/reference/computations-formatting-en.md +4 -2
- package/docs/reference/constraints-collections-ch.md +21 -1
- package/docs/reference/constraints-collections-en.md +21 -1
- package/docs/reference/diagnostics-counting-ch.md +1 -1
- package/docs/reference/diagnostics-counting-en.md +1 -1
- package/docs/reference/html-compatibility-ch.md +4 -0
- package/docs/reference/html-compatibility-en.md +4 -0
- package/docs/reference/local-components-v2-ch.md +2 -0
- package/docs/reference/local-components-v2-en.md +2 -0
- package/docs/reference/local-interaction-syntax-ch.md +51 -15
- package/docs/reference/local-interaction-syntax-en.md +58 -14
- package/docs/reference/theme-protocol-ch.md +79 -7
- package/docs/reference/theme-protocol-en.md +79 -7
- package/docs/reference/tolerance-ch.md +64 -0
- package/docs/reference/tolerance-en.md +57 -0
- package/docs/releases/release-0.4.0-ch.md +2 -0
- package/docs/releases/release-0.4.0-en.md +2 -0
- package/docs/releases/release-0.4.1-ch.md +2 -0
- package/docs/releases/release-0.4.1-en.md +2 -0
- package/docs/releases/release-0.5.0-ch.md +2 -0
- package/docs/releases/release-0.5.0-en.md +2 -0
- package/docs/releases/release-0.5.1-ch.md +2 -0
- package/docs/releases/release-0.5.1-en.md +2 -0
- package/docs/releases/release-0.5.2-ch.md +2 -0
- package/docs/releases/release-0.5.2-en.md +2 -0
- package/docs/releases/release-0.5.3-ch.md +2 -0
- package/docs/releases/release-0.5.3-en.md +2 -0
- package/docs/releases/release-0.6.0-ch.md +2 -0
- package/docs/releases/release-0.6.0-en.md +2 -0
- package/docs/releases/release-0.6.1-ch.md +2 -0
- package/docs/releases/release-0.6.1-en.md +2 -0
- package/docs/releases/release-0.7.0-ch.md +86 -0
- package/docs/releases/release-0.7.0-en.md +86 -0
- package/docs/releases/release-0.8.0-ch.md +126 -0
- package/docs/releases/release-0.8.0-en.md +126 -0
- package/examples/component-package/LICENSE +21 -0
- package/examples/component-package/NOTICES.md +12 -0
- package/examples/component-package/README-ch.md +101 -0
- package/examples/component-package/README.md +133 -0
- package/examples/component-package/package.json +35 -0
- package/examples/component-package/sample/document.reactive.md +14 -0
- package/examples/component-package/scripts/build-export.mjs +44 -0
- package/examples/component-package/scripts/build.mjs +130 -0
- package/examples/component-package/scripts/verify.mjs +257 -0
- package/examples/component-package/src/assets/notice.svg +4 -0
- package/examples/component-package/src/component.css +40 -0
- package/examples/component-package/src/components.tsx +105 -0
- package/examples/component-package/src/harness.tsx +34 -0
- package/examples/component-package/src/manifests.ts +71 -0
- package/examples/component-package/src/node-entry.ts +18 -0
- package/examples/component-package/src/sample.ts +4 -0
- package/examples/component-package/src/theme.css +44 -0
- package/examples/component-package/src/theme.ts +22 -0
- package/examples/component-package/tsconfig.json +15 -0
- package/examples/conformance/README-ch.md +55 -0
- package/examples/conformance/README.md +2 -0
- package/examples/conformance/local-draft-3.json +296 -0
- package/examples/game-2048-package/LICENSE +21 -0
- package/examples/game-2048-package/NOTICES.md +11 -0
- package/examples/game-2048-package/README-ch.md +97 -0
- package/examples/game-2048-package/README.md +102 -0
- package/examples/game-2048-package/package.json +35 -0
- package/examples/game-2048-package/sample/document.reactive.md +17 -0
- package/examples/game-2048-package/scripts/build-export.mjs +44 -0
- package/examples/game-2048-package/scripts/build.mjs +130 -0
- package/examples/game-2048-package/scripts/verify.mjs +180 -0
- package/examples/game-2048-package/src/component.css +161 -0
- package/examples/game-2048-package/src/components.tsx +326 -0
- package/examples/game-2048-package/src/game-engine.ts +228 -0
- package/examples/game-2048-package/src/harness.tsx +34 -0
- package/examples/game-2048-package/src/manifest.ts +85 -0
- package/examples/game-2048-package/src/node-entry.ts +30 -0
- package/examples/game-2048-package/src/sample.ts +4 -0
- package/examples/game-2048-package/tsconfig.json +15 -0
- package/examples/integration/README-ch.md +63 -0
- package/examples/integration/README.md +17 -1
- package/examples/integration/extension-sdk/README-ch.md +24 -0
- package/examples/integration/extension-sdk/README.md +24 -0
- package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
- package/examples/integration/extension-sdk/advanced.tsx +101 -0
- package/examples/integration/extension-sdk/env.d.ts +2 -0
- package/examples/integration/extension-sdk/extensions.tsx +97 -0
- package/examples/integration/extension-sdk/index.html +3 -0
- package/examples/integration/extension-sdk/main.tsx +10 -0
- package/examples/integration/extension-sdk/package.json +6 -0
- package/examples/integration/extension-sdk/standalone.ts +7 -0
- package/examples/integration/extension-sdk/tsconfig.json +8 -0
- package/examples/integration/react-comprehensive/index.html +12 -0
- package/examples/integration/react-comprehensive/main.jsx +123 -0
- package/examples/integration/react-comprehensive/package.json +18 -0
- package/examples/local/README-ch.md +76 -0
- package/examples/local/README.md +4 -2
- package/examples/local/scenarios/blog-zh.reactive.md +71 -0
- package/examples/local/scenarios/blog.reactive.md +71 -0
- package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
- package/examples/local/scenarios/classroom.reactive.md +97 -0
- package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
- package/examples/local/scenarios/proposal.reactive.md +79 -0
- package/examples/local/scenarios/survey-zh.reactive.md +74 -0
- package/examples/local/scenarios/survey.reactive.md +74 -0
- package/examples/local/showcase/README-ch.md +22 -0
- package/examples/local/showcase/README.md +9 -3
- package/examples/local/showcase/features.reactive.md +637 -0
- package/examples/local/showcase/zh/features.reactive.md +637 -0
- package/examples/sci-fi-theme/README-ch.md +131 -0
- package/examples/sci-fi-theme/README.md +146 -0
- package/examples/sci-fi-theme/demo/demo.css +532 -0
- package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
- package/examples/sci-fi-theme/demo/index.html +13 -0
- package/examples/sci-fi-theme/demo/main.tsx +180 -0
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
- package/examples/sci-fi-theme/docs/design-system.md +474 -0
- package/examples/sci-fi-theme/package.json +27 -0
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
- package/examples/sci-fi-theme/src/components.css +1460 -0
- package/examples/sci-fi-theme/src/index.ts +6 -0
- package/examples/sci-fi-theme/src/sci-fi.css +5 -0
- package/examples/sci-fi-theme/src/theme.ts +37 -0
- package/examples/sci-fi-theme/src/tokens.css +408 -0
- package/examples/sci-fi-theme/tsconfig.json +20 -0
- package/examples/sci-fi-theme/vite.config.ts +24 -0
- package/examples/tetris-package/LICENSE +21 -0
- package/examples/tetris-package/NOTICES.md +11 -0
- package/examples/tetris-package/README-ch.md +91 -0
- package/examples/tetris-package/README.md +95 -0
- package/examples/tetris-package/package.json +35 -0
- package/examples/tetris-package/sample/document.reactive.md +16 -0
- package/examples/tetris-package/scripts/build-export.mjs +44 -0
- package/examples/tetris-package/scripts/build.mjs +130 -0
- package/examples/tetris-package/scripts/verify.mjs +173 -0
- package/examples/tetris-package/src/component.css +145 -0
- package/examples/tetris-package/src/components.tsx +334 -0
- package/examples/tetris-package/src/harness.tsx +34 -0
- package/examples/tetris-package/src/manifests.ts +93 -0
- package/examples/tetris-package/src/node-entry.ts +16 -0
- package/examples/tetris-package/src/sample.ts +4 -0
- package/examples/tetris-package/src/tetris-engine.ts +325 -0
- package/examples/tetris-package/tsconfig.json +15 -0
- package/package.json +98 -44
- package/dist-library/compiler-Cm3ppMxG.js +0 -46044
- package/dist-library/react-Bh7_oxZp.js +0 -59655
- package/dist-library/reactive-md-editor.css +0 -2
- package/dist-library/reactive-md-editor.js +0 -3853
- package/dist-library/runtime-DlFYQ4s_.js +0 -498
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
- package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
- package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
- package/dist-library/types/editor/extended-native-components.d.ts +0 -58
- package/dist-library/types/editor/index.d.ts +0 -9
- package/dist-library/types/editor/locale.d.ts +0 -13
- package/dist-library/types/editor/source-authoring.d.ts +0 -59
- package/dist-library/types/editor/types.d.ts +0 -48
- package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
- package/dist-library/types/editor/use-source-history.d.ts +0 -16
- package/dist-library/types/local/compiler.d.ts +0 -4
- package/dist-library/types/local/math.d.ts +0 -48
- package/dist-library/types/local/options.d.ts +0 -36
- package/dist-library/types/local/parser.d.ts +0 -13
- package/dist-library/types/local/render-types.d.ts +0 -27
- package/dist-library/types/local/runtime.d.ts +0 -2
- package/dist-library/types/local/schema.d.ts +0 -77
- package/dist-library/types/local/types.d.ts +0 -263
- package/dist-library/types/local/visuals.d.ts +0 -12
- package/dist-library/types/local/worker.d.ts +0 -98
- package/docs/development/performance-ch.md +0 -76
- package/docs/development/performance-en.md +0 -76
- /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
- /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
- /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
- /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
- /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
- /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
- /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
- /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
- /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
- /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
- /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
- /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { _ as e, g as t, h as n, n as r, y as i } from "./compiler-core-kPiH-gOV.js";
|
|
2
|
+
import { $ as a, Q as o, S as s, et as c, it as l, nt as u, rt as d, tt as f } from "./config-validation-DXTynAw7.js";
|
|
3
|
+
import { Q as p, et as m, l as h, ot as g, w as _ } from "./validation-W-bmny-x.js";
|
|
4
|
+
import { S as v, b as y, d as b, x } from "./registry-B9Jc3FVe.js";
|
|
5
|
+
import { t as S } from "./options-CX5m5n-J.js";
|
|
6
|
+
import { t as ee } from "./compiler--ea2CKQF.js";
|
|
7
|
+
import { c as C } from "./schema-ZFufO8V0.js";
|
|
8
|
+
import { i as te, n as ne, r as re, t as w } from "./authoring-BsfSwQRm.js";
|
|
9
|
+
import { a as T, i as ie, n as ae, r as oe, t as se } from "./math-sample-BGEW49zY.js";
|
|
10
|
+
import { a as ce, i as le, n as ue, r as de, t as fe } from "./runtime-C-sbfpOX.js";
|
|
11
|
+
import { C as pe } from "./component-state-Cq2K5gkS.js";
|
|
12
|
+
import { _ as me, a as he, f as ge, g as _e, h as ve, i as ye, m as be, n as xe, p as Se, r as Ce, t as we, v as Te, y as Ee } from "./shareable-DDVL4Fi9.js";
|
|
13
|
+
import { t as De } from "./component-state-D_cw_EHe.js";
|
|
14
|
+
// src/local/source/source-migration.ts
|
|
15
|
+
var E = /* @__PURE__ */ new Set([
|
|
6
16
|
"sum",
|
|
7
17
|
"average",
|
|
8
18
|
"minOf",
|
|
@@ -20,7 +30,7 @@ var de = /* @__PURE__ */ new Set([
|
|
|
20
30
|
"slice",
|
|
21
31
|
"dateCompare",
|
|
22
32
|
"dateDiff"
|
|
23
|
-
]),
|
|
33
|
+
]), Oe = /* @__PURE__ */ new Set([
|
|
24
34
|
"jump",
|
|
25
35
|
"anchor",
|
|
26
36
|
"text",
|
|
@@ -35,107 +45,111 @@ var de = /* @__PURE__ */ new Set([
|
|
|
35
45
|
"const",
|
|
36
46
|
"validation",
|
|
37
47
|
"data-table",
|
|
38
|
-
"column"
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
"column",
|
|
49
|
+
"external"
|
|
50
|
+
]), ke = /* @__PURE__ */ new Set(["external"]), Ae = /* @__PURE__ */ new Set([
|
|
51
|
+
"local-draft-1",
|
|
52
|
+
"local-draft-2",
|
|
53
|
+
_
|
|
54
|
+
]), D = `<!-- reactive-md: ${_} -->`;
|
|
55
|
+
function O(e) {
|
|
41
56
|
let t = e.diagnostics.filter((t) => t.code.startsWith("local.version.") || t.code === "local.budget" || t.code === "local.parse" && !e.nodes.length), n = e.versionDeclaration?.version ?? null;
|
|
42
57
|
return {
|
|
43
58
|
declaredVersion: n,
|
|
44
|
-
effectiveVersion: n ?? "local-draft-
|
|
59
|
+
effectiveVersion: n ?? "local-draft-3",
|
|
45
60
|
supported: !t.some((e) => e.severity === "error"),
|
|
46
61
|
range: e.versionDeclaration ? { ...e.versionDeclaration.range } : null,
|
|
47
62
|
diagnostics: t
|
|
48
63
|
};
|
|
49
64
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
65
|
+
function je(e) {
|
|
66
|
+
return O(C(e));
|
|
52
67
|
}
|
|
53
|
-
function
|
|
54
|
-
let
|
|
68
|
+
function Me(e, t, n, r, i = "error") {
|
|
69
|
+
let o = u(t, r), s = e.slice(0, n.start), c = s.lastIndexOf("\n");
|
|
55
70
|
return {
|
|
56
71
|
code: t,
|
|
57
72
|
severity: i,
|
|
58
73
|
range: { ...n },
|
|
59
|
-
message:
|
|
60
|
-
line:
|
|
61
|
-
column: n.start -
|
|
62
|
-
messageKey:
|
|
63
|
-
...
|
|
74
|
+
message: a(o),
|
|
75
|
+
line: s.split("\n").length,
|
|
76
|
+
column: n.start - c,
|
|
77
|
+
messageKey: o.key,
|
|
78
|
+
...o.params ? { params: o.params } : {}
|
|
64
79
|
};
|
|
65
80
|
}
|
|
66
|
-
function
|
|
67
|
-
let n =
|
|
81
|
+
function k(e, t = {}) {
|
|
82
|
+
let n = C(e), r = O(n), i = typeof t == "object" && !!t && !Array.isArray(t), a = i ? t.fromVersion ?? r.effectiveVersion : r.effectiveVersion, o = typeof a == "string" ? a : "", s = {
|
|
68
83
|
ok: !1,
|
|
69
|
-
fromVersion:
|
|
70
|
-
toVersion:
|
|
71
|
-
needsMigration: !n.versionDeclaration ||
|
|
72
|
-
diagnostics:
|
|
73
|
-
},
|
|
74
|
-
report:
|
|
84
|
+
fromVersion: o,
|
|
85
|
+
toVersion: _,
|
|
86
|
+
needsMigration: !n.versionDeclaration || o !== "local-draft-3",
|
|
87
|
+
diagnostics: r.diagnostics.filter((e) => e.code !== "local.version.unsupported")
|
|
88
|
+
}, c = {
|
|
89
|
+
report: s,
|
|
75
90
|
declaration: n.versionDeclaration
|
|
76
91
|
};
|
|
77
|
-
if (typeof e != "string" ||
|
|
78
|
-
let
|
|
92
|
+
if (typeof e != "string" || s.diagnostics.some((e) => e.severity === "error")) return c;
|
|
93
|
+
let l = r.range ?? {
|
|
79
94
|
start: 0,
|
|
80
95
|
end: 0
|
|
81
|
-
},
|
|
82
|
-
if (
|
|
96
|
+
}, u = (e) => {
|
|
97
|
+
if (s.diagnostics.length >= 100) {
|
|
83
98
|
if (e.severity === "warning") return;
|
|
84
|
-
let t =
|
|
85
|
-
for (; t >= 0 &&
|
|
99
|
+
let t = s.diagnostics.length - 1;
|
|
100
|
+
for (; t >= 0 && s.diagnostics[t].severity !== "warning";) --t;
|
|
86
101
|
if (t < 0) return;
|
|
87
|
-
|
|
102
|
+
s.diagnostics.splice(t, 1);
|
|
88
103
|
}
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
104
|
+
s.diagnostics.push(e);
|
|
105
|
+
}, d = (t, n, r, i) => {
|
|
106
|
+
u(Me(e, t, n, r, i));
|
|
92
107
|
};
|
|
93
|
-
if (!
|
|
94
|
-
from:
|
|
95
|
-
detail: "use local-draft-1 or local-draft-
|
|
96
|
-
}),
|
|
97
|
-
let
|
|
98
|
-
if (
|
|
99
|
-
let e = (
|
|
100
|
-
for (let
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
if (!i || typeof a != "string" || !Ae.has(o) || t.allowSemanticChanges !== void 0 && typeof t.allowSemanticChanges != "boolean" || t.fromVersion !== void 0 && r.declaredVersion !== null && o !== r.declaredVersion) return d("local.upgrade.from-version", l, {
|
|
109
|
+
from: o,
|
|
110
|
+
detail: "use local-draft-1, local-draft-2 or local-draft-3 and match the source declaration"
|
|
111
|
+
}), c;
|
|
112
|
+
let f = n.versionDeclaration ? e.slice(0, l.start) + e.slice(l.start, l.end).replace(/[^\r\n]/g, " ") + e.slice(l.end) : e, p = n.versionDeclaration ? C(f) : n;
|
|
113
|
+
if (o === "local-draft-1" || o === "local-draft-2") {
|
|
114
|
+
let e = o === "local-draft-1" ? Oe : ke, n = (r) => {
|
|
115
|
+
for (let i of r) if (i.name && e.has(i.name)) d("local.upgrade.tag", i.range, { name: i.name });
|
|
116
|
+
else {
|
|
117
|
+
if (o === "local-draft-1") {
|
|
118
|
+
for (let e of [
|
|
119
|
+
"bind",
|
|
120
|
+
"bind-start",
|
|
121
|
+
"bind-end",
|
|
122
|
+
"bind-x",
|
|
123
|
+
"bind-y"
|
|
124
|
+
]) {
|
|
125
|
+
let t = i.attrs?.[e];
|
|
126
|
+
t && E.has(t) && d("local.upgrade.reserved-binding", i.range, { name: t });
|
|
127
|
+
}
|
|
128
|
+
(i.name === "input" || i.name === "textarea") && (i.attrs?.["max-length"] !== void 0 || Number(i.attrs?.["min-length"] ?? 0) > 0) && d("local.upgrade.text-length", i.range, void 0, t.allowSemanticChanges ? "warning" : "error");
|
|
129
|
+
let e = [...i.type === "interpolation" ? [i.value ?? ""] : [], ...Object.values(i.attrs ?? {}).flatMap((e) => [...e.matchAll(/\{\{([\s\S]*?)\}\}/g)].map((e) => e[1]))];
|
|
130
|
+
for (let t of e) {
|
|
131
|
+
let e = t.replace(/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g, "");
|
|
132
|
+
(e.includes("[") || [...E].some((t) => RegExp(`\\b${t}\\s*\\(`).test(e))) && d("local.upgrade.expression", i.range);
|
|
133
|
+
}
|
|
114
134
|
}
|
|
115
|
-
|
|
116
|
-
let n = [...r.type === "interpolation" ? [r.value ?? ""] : [], ...Object.values(r.attrs ?? {}).flatMap((e) => [...e.matchAll(/\{\{([\s\S]*?)\}\}/g)].map((e) => e[1]))];
|
|
117
|
-
for (let e of n) {
|
|
118
|
-
let t = e.replace(/'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"/g, "");
|
|
119
|
-
(t.includes("[") || [...de].some((e) => RegExp(`\\b${e}\\s*\\(`).test(t))) && p("local.upgrade.expression", r.range);
|
|
120
|
-
}
|
|
121
|
-
r.type !== "fallback" && r.children && e(r.children);
|
|
135
|
+
i.type !== "fallback" && i.children && n(i.children);
|
|
122
136
|
}
|
|
123
137
|
};
|
|
124
|
-
|
|
138
|
+
n(p.nodes);
|
|
125
139
|
}
|
|
126
|
-
if (
|
|
127
|
-
let
|
|
128
|
-
for (let e of
|
|
129
|
-
return
|
|
140
|
+
if (s.diagnostics.some((e) => e.severity === "error")) return c;
|
|
141
|
+
let m = ee(f);
|
|
142
|
+
for (let e of m.diagnostics) u(e);
|
|
143
|
+
return m.ok && (!n.versionDeclaration && s.diagnostics.length < 100 && d("local.upgrade.version-missing", {
|
|
130
144
|
start: +(e.charCodeAt(0) === 65279),
|
|
131
145
|
end: +(e.charCodeAt(0) === 65279)
|
|
132
|
-
}, { version:
|
|
146
|
+
}, { version: _ }, "warning"), s.ok = !0), c;
|
|
133
147
|
}
|
|
134
|
-
function
|
|
135
|
-
return
|
|
148
|
+
function Ne(e, t) {
|
|
149
|
+
return k(e, t).report;
|
|
136
150
|
}
|
|
137
|
-
function
|
|
138
|
-
let { report: n, declaration: r } =
|
|
151
|
+
function Pe(e, t) {
|
|
152
|
+
let { report: n, declaration: r } = k(e, t), i = {
|
|
139
153
|
...n,
|
|
140
154
|
source: e,
|
|
141
155
|
changed: !1,
|
|
@@ -145,7 +159,7 @@ function ve(e, t) {
|
|
|
145
159
|
let a = +(e.charCodeAt(0) === 65279), o = r?.range ?? {
|
|
146
160
|
start: a,
|
|
147
161
|
end: a
|
|
148
|
-
}, s = e.includes("\r\n") ? "\r\n" : "\n", c = r ?
|
|
162
|
+
}, s = e.includes("\r\n") ? "\r\n" : "\n", c = r ? D : `${D}${s}${s}`, l = e.slice(0, o.start) + c + e.slice(o.end);
|
|
149
163
|
return {
|
|
150
164
|
...n,
|
|
151
165
|
source: l,
|
|
@@ -156,525 +170,640 @@ function ve(e, t) {
|
|
|
156
170
|
}]
|
|
157
171
|
};
|
|
158
172
|
}
|
|
159
|
-
// src/local/
|
|
160
|
-
var
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
message: t.length > 2e3 ? `${t.slice(0, m - 1)}…` : t,
|
|
171
|
-
severity: "error",
|
|
172
|
-
range: {
|
|
173
|
-
start: 0,
|
|
174
|
-
end: 0
|
|
175
|
-
},
|
|
176
|
-
line: 1,
|
|
177
|
-
column: 1
|
|
178
|
-
};
|
|
173
|
+
// src/local/transport/compile-patch.ts
|
|
174
|
+
var A = "patch-v1", j = 1, Fe = 4096, M = [
|
|
175
|
+
"initialState",
|
|
176
|
+
"bindings",
|
|
177
|
+
"bindingSlots",
|
|
178
|
+
"computations",
|
|
179
|
+
"dependencies",
|
|
180
|
+
"tableShapes"
|
|
181
|
+
];
|
|
182
|
+
function N(e) {
|
|
183
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
179
184
|
}
|
|
180
|
-
function
|
|
181
|
-
e.
|
|
185
|
+
function P(e) {
|
|
186
|
+
return N(e) && typeof e.start == "number" && Number.isFinite(e.start) && typeof e.end == "number" && Number.isFinite(e.end);
|
|
182
187
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
188
|
+
function F() {
|
|
189
|
+
throw TypeError("Invalid local compile result patch");
|
|
185
190
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (n >= 56320 && n <= 57343) return !1;
|
|
191
|
+
function I(e, t) {
|
|
192
|
+
if (e === t) return !0;
|
|
193
|
+
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
194
|
+
let n = Array.isArray(e);
|
|
195
|
+
if (n !== Array.isArray(t)) return !1;
|
|
196
|
+
if (n) {
|
|
197
|
+
let n = e, r = t;
|
|
198
|
+
if (n.length !== r.length) return !1;
|
|
199
|
+
for (let e = 0; e < n.length; e += 1) if (!I(n[e], r[e])) return !1;
|
|
200
|
+
return !0;
|
|
198
201
|
}
|
|
202
|
+
let r = e, i = t, a = Object.keys(r);
|
|
203
|
+
if (a.length !== Object.keys(i).length) return !1;
|
|
204
|
+
for (let e of a) if (!Object.hasOwn(i, e) || !I(r[e], i[e])) return !1;
|
|
199
205
|
return !0;
|
|
200
206
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
203
|
-
let t = T.encode(e), n = be;
|
|
204
|
-
for (let e = 0; e < t.length; e += 1) n ^= t[e], n = Math.imul(n, xe) >>> 0;
|
|
205
|
-
return `fnv1a32:${n.toString(16).padStart(8, "0")}`;
|
|
207
|
+
function L(e) {
|
|
208
|
+
return r(e, !1);
|
|
206
209
|
}
|
|
207
|
-
function
|
|
208
|
-
if (typeof e
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
message: "contains malformed Unicode."
|
|
214
|
-
};
|
|
215
|
-
if (typeof e == "number") return Number.isFinite(e) ? {
|
|
216
|
-
ok: !0,
|
|
217
|
-
value: e
|
|
218
|
-
} : {
|
|
219
|
-
ok: !1,
|
|
220
|
-
message: "must be a finite number."
|
|
221
|
-
};
|
|
222
|
-
if (typeof e == "boolean" || e === null) return {
|
|
223
|
-
ok: !0,
|
|
224
|
-
value: e
|
|
225
|
-
};
|
|
226
|
-
if (Array.isArray(e)) {
|
|
227
|
-
let t = [];
|
|
228
|
-
for (let n = 0; n < e.length; n += 1) {
|
|
229
|
-
let r = e[n];
|
|
230
|
-
if (typeof r != "string") return {
|
|
231
|
-
ok: !1,
|
|
232
|
-
message: "must be an array of strings."
|
|
233
|
-
};
|
|
234
|
-
if (!k(r)) return {
|
|
235
|
-
ok: !1,
|
|
236
|
-
message: "contains malformed Unicode."
|
|
237
|
-
};
|
|
238
|
-
t.push(r);
|
|
239
|
-
}
|
|
240
|
-
return {
|
|
241
|
-
ok: !0,
|
|
242
|
-
value: Object.freeze(t)
|
|
243
|
-
};
|
|
244
|
-
}
|
|
210
|
+
function R(e, t) {
|
|
211
|
+
if (typeof e != "string" || typeof t != "string" || e === t) return null;
|
|
212
|
+
let n = Math.min(e.length, t.length), r = 0;
|
|
213
|
+
for (; r < n && e.charCodeAt(r) === t.charCodeAt(r);) r += 1;
|
|
214
|
+
let i = e.length, a = t.length;
|
|
215
|
+
for (; i > r && a > r && e.charCodeAt(i - 1) === t.charCodeAt(a - 1);) --i, --a;
|
|
245
216
|
return {
|
|
246
|
-
|
|
247
|
-
|
|
217
|
+
from: r,
|
|
218
|
+
to: i,
|
|
219
|
+
insert: t.slice(r, a)
|
|
248
220
|
};
|
|
249
221
|
}
|
|
250
|
-
function
|
|
251
|
-
if (
|
|
252
|
-
let t =
|
|
253
|
-
return t
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
222
|
+
function Ie(e) {
|
|
223
|
+
if (!N(e)) return null;
|
|
224
|
+
let { from: t, to: n, insert: r } = e;
|
|
225
|
+
return typeof t != "number" || !Number.isSafeInteger(t) || typeof n != "number" || !Number.isSafeInteger(n) || typeof r != "string" || t < 0 || n < t ? null : {
|
|
226
|
+
from: t,
|
|
227
|
+
to: n,
|
|
228
|
+
insert: r
|
|
229
|
+
};
|
|
257
230
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (!k(e.name) || !k(e.version)) throw TypeError("generator name and version must be well-formed Unicode strings.");
|
|
262
|
-
return Object.freeze({
|
|
263
|
-
name: e.name,
|
|
264
|
-
version: e.version
|
|
265
|
-
});
|
|
231
|
+
function Le(e, t) {
|
|
232
|
+
let n = Ie(t);
|
|
233
|
+
return n === null || typeof e != "string" || n.to > e.length ? null : e.slice(0, n.from) + n.insert + e.slice(n.to);
|
|
266
234
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
235
|
+
function z(e) {
|
|
236
|
+
let t = {};
|
|
237
|
+
for (let [n, r] of Object.entries(e)) n !== "children" && (t[n] = r);
|
|
238
|
+
return t;
|
|
269
239
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
240
|
+
function Re(e, t) {
|
|
241
|
+
let n = Object.keys(e).filter((e) => e !== "children"), r = Object.keys(t).filter((e) => e !== "children");
|
|
242
|
+
if (n.length !== r.length) return !1;
|
|
243
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !I(e[r], t[r])) return !1;
|
|
244
|
+
return !0;
|
|
272
245
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
275
|
-
try {
|
|
276
|
-
let t = JSON.stringify(e);
|
|
277
|
-
if (typeof t != "string") return null;
|
|
278
|
-
n = t;
|
|
279
|
-
} catch {
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
return I(n, t);
|
|
246
|
+
function B(e) {
|
|
247
|
+
return e.children === void 0 ? void 0 : e.children.map((e) => e.id);
|
|
283
248
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
286
|
-
if (
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return t;
|
|
249
|
+
function ze(e, t) {
|
|
250
|
+
let n = B(e), r = B(t);
|
|
251
|
+
if (n === void 0 || r === void 0) return n === r;
|
|
252
|
+
if (n.length !== r.length) return !1;
|
|
253
|
+
for (let e = 0; e < n.length; e += 1) if (n[e] !== r[e]) return !1;
|
|
254
|
+
return !0;
|
|
291
255
|
}
|
|
292
|
-
function
|
|
293
|
-
if (!e
|
|
294
|
-
if (!
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
if (Object.hasOwn(e.computations ?? {}, n)) continue;
|
|
298
|
-
if (n.startsWith("@")) {
|
|
299
|
-
if (!Object.hasOwn(e.bindings, n)) throw Error(`Cannot persist parameter "${n}": it is not a binding of this document.`);
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
if (!a.has(n)) throw Error(`Cannot persist parameter "${n}": it is not a public binding of this document.`);
|
|
303
|
-
let r = j(t[n]);
|
|
304
|
-
if (!r.ok) throw TypeError(`Cannot persist parameter "${n}": the value ${r.message}`);
|
|
305
|
-
o.set(n, r.value);
|
|
306
|
-
}
|
|
307
|
-
let s = {};
|
|
308
|
-
for (let e of i) {
|
|
309
|
-
if (!o.has(e)) throw Error(`Cannot persist the document: parameter "${e}" is missing from the supplied state.`);
|
|
310
|
-
s[e] = o.get(e);
|
|
311
|
-
}
|
|
312
|
-
let c = {
|
|
313
|
-
format: C,
|
|
314
|
-
syntax: r,
|
|
315
|
-
sourceDigest: A(e.source),
|
|
316
|
-
parameters: s
|
|
317
|
-
};
|
|
318
|
-
return n !== void 0 && (c.generator = P(n)), N(c);
|
|
256
|
+
function Be(e, t) {
|
|
257
|
+
if (!Re(e, t) || !ze(e, t)) return !1;
|
|
258
|
+
if (!e.children || !t.children) return !0;
|
|
259
|
+
for (let n = 0; n < e.children.length; n += 1) if (!Be(e.children[n], t.children[n])) return !1;
|
|
260
|
+
return !0;
|
|
319
261
|
}
|
|
320
|
-
function
|
|
321
|
-
let n =
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
};
|
|
331
|
-
try {
|
|
332
|
-
a = JSON.parse(e);
|
|
333
|
-
} catch (e) {
|
|
334
|
-
return {
|
|
335
|
-
ok: !1,
|
|
336
|
-
diagnostics: [E("local.state.json", `The state payload is not valid JSON: ${O(e)}`)]
|
|
337
|
-
};
|
|
338
|
-
}
|
|
262
|
+
function Ve(e, t) {
|
|
263
|
+
let n = Object.keys(e).filter((e) => e !== "children" && e !== "range"), r = Object.keys(t).filter((e) => e !== "children" && e !== "range");
|
|
264
|
+
if (n.length !== r.length) return null;
|
|
265
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !I(e[r], t[r])) return null;
|
|
266
|
+
if (!P(e.range) || !P(t.range)) return null;
|
|
267
|
+
let i = e.range.start - t.range.start;
|
|
268
|
+
if (e.range.end !== t.range.end + i) return null;
|
|
269
|
+
let a = B(e), o = B(t);
|
|
270
|
+
if (a === void 0 || o === void 0) {
|
|
271
|
+
if (a !== o) return null;
|
|
339
272
|
} else {
|
|
340
|
-
|
|
341
|
-
if (n
|
|
342
|
-
ok: !1,
|
|
343
|
-
diagnostics: [E("local.state.shape", "The state payload must be a JSON object.")]
|
|
344
|
-
};
|
|
345
|
-
if (n > t) return {
|
|
346
|
-
ok: !1,
|
|
347
|
-
diagnostics: [E("local.state.size", `The state payload exceeds the ${t}-byte limit.`)]
|
|
348
|
-
};
|
|
273
|
+
if (a.length !== o.length) return null;
|
|
274
|
+
for (let n = 0; n < a.length; n += 1) if (a[n] !== o[n] || Ve(e.children[n], t.children[n]) !== i) return null;
|
|
349
275
|
}
|
|
350
|
-
|
|
351
|
-
ok: !1,
|
|
352
|
-
diagnostics: [E("local.state.shape", "The state payload must be a JSON object.")]
|
|
353
|
-
};
|
|
354
|
-
Object.getOwnPropertySymbols(a).length > 0 && i("local.state.shape", "The state payload cannot use symbol keys.");
|
|
355
|
-
for (let e of Object.keys(a)) Se.has(e) || i("local.state.key", `Unknown top-level state key "${e}".`);
|
|
356
|
-
let o = a.format;
|
|
357
|
-
o !== "reactive-md-state/v1" && i("local.state.format", `Unsupported state format ${F(o)}; expected "${C}".`);
|
|
358
|
-
let s = a.syntax;
|
|
359
|
-
s !== "local-draft-2" && i("local.state.syntax", `Unsupported state syntax ${F(s)}; expected "${r}".`);
|
|
360
|
-
let c = a.sourceDigest;
|
|
361
|
-
typeof c == "string" && ye.test(c) || i("local.state.digest", "sourceDigest must match \"fnv1a32:\" followed by 8 lowercase hexadecimal digits.");
|
|
362
|
-
let l = {}, u = a.parameters;
|
|
363
|
-
if (!M(u)) i("local.state.parameters", "parameters must be a JSON object of public binding values.");
|
|
364
|
-
else for (let e of Object.keys(u).sort()) {
|
|
365
|
-
if (e === "__proto__") {
|
|
366
|
-
i("local.state.parameter.prototype", "Parameter names cannot be \"__proto__\".");
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
if (e.startsWith("@")) {
|
|
370
|
-
i("local.state.parameter.internal", `Internal parameter "${e}" cannot be persisted.`);
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
let t = j(u[e]);
|
|
374
|
-
t.ok ? l[e] = t.value : i("local.state.parameter.value", `Parameter "${e}" ${t.message}`);
|
|
375
|
-
}
|
|
376
|
-
let d;
|
|
377
|
-
if (Object.hasOwn(a, "generator")) {
|
|
378
|
-
let e = a.generator;
|
|
379
|
-
if (!M(e)) i("local.state.generator", "generator must be an object with string name and version.");
|
|
380
|
-
else {
|
|
381
|
-
for (let t of Object.keys(e)) Ce.has(t) || i("local.state.generator", `generator has unknown key "${t}".`);
|
|
382
|
-
typeof e.name != "string" || typeof e.version != "string" ? i("local.state.generator", "generator must have string name and version.") : !k(e.name) || !k(e.version) ? i("local.state.utf", "generator contains malformed Unicode.") : d = Object.freeze({
|
|
383
|
-
name: e.name,
|
|
384
|
-
version: e.version
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
if (n.length) return {
|
|
389
|
-
ok: !1,
|
|
390
|
-
diagnostics: n
|
|
391
|
-
};
|
|
392
|
-
let f = {
|
|
393
|
-
format: C,
|
|
394
|
-
syntax: r,
|
|
395
|
-
sourceDigest: c,
|
|
396
|
-
parameters: l
|
|
397
|
-
};
|
|
398
|
-
return d && (f.generator = d), {
|
|
399
|
-
ok: !0,
|
|
400
|
-
file: N(f)
|
|
401
|
-
};
|
|
276
|
+
return i;
|
|
402
277
|
}
|
|
403
|
-
function
|
|
404
|
-
let n =
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
278
|
+
function He(e, t) {
|
|
279
|
+
let n = Object.keys(e).filter((e) => e !== "children" && e !== "range"), r = Object.keys(t).filter((e) => e !== "children" && e !== "range");
|
|
280
|
+
if (n.length !== r.length) return null;
|
|
281
|
+
for (let r of n) if (!Object.hasOwn(t, r) || !I(e[r], t[r])) return null;
|
|
282
|
+
if (!P(e.range) || !P(t.range)) return null;
|
|
283
|
+
let i = e.range.start - t.range.start;
|
|
284
|
+
return e.range.end === t.range.end + i ? i : null;
|
|
285
|
+
}
|
|
286
|
+
function Ue(e) {
|
|
287
|
+
let t = /* @__PURE__ */ new Map(), n = [...e].reverse();
|
|
288
|
+
for (; n.length > 0;) {
|
|
289
|
+
let e = n.pop();
|
|
290
|
+
if (t.set(e.id, e), e.children) for (let t = e.children.length - 1; t >= 0; --t) n.push(e.children[t]);
|
|
412
291
|
}
|
|
292
|
+
return t;
|
|
413
293
|
}
|
|
414
|
-
function
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
function z(e) {
|
|
421
|
-
let t = De(e), n = /* @__PURE__ */ new Map(), r = [];
|
|
422
|
-
for (let [i, a] of Object.entries(e.bindingSlots ?? {})) {
|
|
423
|
-
let e = t.get(i);
|
|
424
|
-
if (!e) continue;
|
|
425
|
-
let o = {
|
|
426
|
-
node: e,
|
|
427
|
-
slots: []
|
|
428
|
-
};
|
|
429
|
-
for (let [t, r] of Object.entries(a)) o.slots.push({
|
|
430
|
-
slot: t,
|
|
431
|
-
key: r
|
|
432
|
-
}), r.startsWith("@") || n.set(r, {
|
|
433
|
-
node: e,
|
|
434
|
-
slot: t
|
|
294
|
+
function We(e, t, n, r) {
|
|
295
|
+
if (t !== void 0 && Be(e, t)) return;
|
|
296
|
+
if (t === void 0) {
|
|
297
|
+
r.push({
|
|
298
|
+
id: e.id,
|
|
299
|
+
node: e
|
|
435
300
|
});
|
|
436
|
-
|
|
301
|
+
return;
|
|
437
302
|
}
|
|
438
|
-
let i =
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
key: r,
|
|
445
|
-
binding: a,
|
|
446
|
-
node: e.node,
|
|
447
|
-
slot: e.slot
|
|
448
|
-
});
|
|
449
|
-
continue;
|
|
450
|
-
}
|
|
451
|
-
let o = a.owner && t.has(a.owner) ? a.owner : a.nodeIds.find((e) => t.has(e));
|
|
452
|
-
i.push({
|
|
453
|
-
key: r,
|
|
454
|
-
binding: a,
|
|
455
|
-
node: o ? t.get(o) : void 0
|
|
303
|
+
let i = Ve(e, t);
|
|
304
|
+
if (i !== null) {
|
|
305
|
+
i !== 0 && r.push({
|
|
306
|
+
id: e.id,
|
|
307
|
+
shift: i,
|
|
308
|
+
subtree: !0
|
|
456
309
|
});
|
|
310
|
+
return;
|
|
457
311
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
function B(e, t, n) {
|
|
464
|
-
let r = [];
|
|
465
|
-
for (let i of t.plans) i.slot === void 0 && Object.hasOwn(n, i.key) && (i.node ? Object.is(e.get(i.node), n[i.key]) || r.push(...e.set(i.node, n[i.key])) : r.push(E("local.state.document", `The document has no component for parameter "${i.key}".`)));
|
|
466
|
-
for (let i of t.groups) {
|
|
467
|
-
let t = {}, a = !1;
|
|
468
|
-
for (let { slot: e, key: r } of i.slots) Object.hasOwn(n, r) && (t[e] = n[r], a = !0);
|
|
469
|
-
a && r.push(...e.setMany(i.node, t));
|
|
312
|
+
let a = { id: e.id };
|
|
313
|
+
if (!Re(e, t)) {
|
|
314
|
+
let n = He(e, t);
|
|
315
|
+
n !== null && n !== 0 ? a.shift = n : a.data = z(e);
|
|
470
316
|
}
|
|
471
|
-
|
|
317
|
+
ze(e, t) || (a.children = e.children === void 0 ? null : e.children.map((e) => e.id));
|
|
318
|
+
let o = r.length;
|
|
319
|
+
if (e.children) for (let t of e.children) We(t, n.get(t.id), n, r);
|
|
320
|
+
Object.keys(a).length > 1 ? r.splice(o, 0, a) : r.length > o && r.splice(o, 0, { id: e.id });
|
|
321
|
+
}
|
|
322
|
+
function Ge(e, t) {
|
|
323
|
+
if (!N(e)) return { set: t };
|
|
324
|
+
let n = {}, r = [];
|
|
325
|
+
for (let [r, i] of Object.entries(t)) Object.hasOwn(e, r) && I(e[r], i) || (n[r] = i);
|
|
326
|
+
for (let n of Object.keys(e)) Object.hasOwn(t, n) || r.push(n);
|
|
327
|
+
return Object.keys(n).length === 0 && r.length === 0 ? null : {
|
|
328
|
+
...Object.keys(n).length === 0 ? {} : { set: n },
|
|
329
|
+
...r.length === 0 ? {} : { remove: r }
|
|
330
|
+
};
|
|
472
331
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
r
|
|
332
|
+
var Ke = /* @__PURE__ */ new WeakMap();
|
|
333
|
+
function qe(e) {
|
|
334
|
+
let t = 2;
|
|
335
|
+
for (let n = 0; n < e.length; n++) {
|
|
336
|
+
let r = e.charCodeAt(n);
|
|
337
|
+
if (r === 34 || r === 92) t += 2;
|
|
338
|
+
else if (r < 32) t += r === 8 || r === 9 || r === 10 || r === 12 || r === 13 ? 2 : 6;
|
|
339
|
+
else if (r < 128) t++;
|
|
340
|
+
else if (r < 2048) t += 2;
|
|
341
|
+
else if (r >= 55296 && r <= 56319) {
|
|
342
|
+
let r = e.charCodeAt(n + 1);
|
|
343
|
+
r >= 56320 && r <= 57343 ? (t += 4, n++) : t += 6;
|
|
344
|
+
} else t += r >= 56320 && r <= 57343 ? 6 : 3;
|
|
478
345
|
}
|
|
479
|
-
return
|
|
346
|
+
return t;
|
|
480
347
|
}
|
|
481
|
-
function V(e, t
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
ok: !1,
|
|
486
|
-
diagnostics: [E("local.state.document", "resolveLocalState requires a compiled local document.")]
|
|
348
|
+
function V(e, t) {
|
|
349
|
+
if (e === null) return {
|
|
350
|
+
bytes: 4,
|
|
351
|
+
nodes: 0
|
|
487
352
|
};
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
353
|
+
let n = typeof e;
|
|
354
|
+
if (n === "string") return {
|
|
355
|
+
bytes: qe(e),
|
|
356
|
+
nodes: 0
|
|
491
357
|
};
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
|
|
358
|
+
if (n === "number") return {
|
|
359
|
+
bytes: Number.isFinite(e) ? String(e).length : 4,
|
|
360
|
+
nodes: 0
|
|
495
361
|
};
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if (c.length) return {
|
|
500
|
-
ok: !1,
|
|
501
|
-
diagnostics: c
|
|
362
|
+
if (n === "boolean") return {
|
|
363
|
+
bytes: e === !0 ? 4 : 5,
|
|
364
|
+
nodes: 0
|
|
502
365
|
};
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
366
|
+
if (n !== "object") return {
|
|
367
|
+
bytes: 0,
|
|
368
|
+
nodes: 0
|
|
369
|
+
};
|
|
370
|
+
let r = e, i = Ke.get(r);
|
|
371
|
+
if (i !== void 0) return i;
|
|
372
|
+
if (t.has(r)) return {
|
|
373
|
+
bytes: 0,
|
|
374
|
+
nodes: 0
|
|
375
|
+
};
|
|
376
|
+
t.add(r);
|
|
377
|
+
let a, o = +!!et(e);
|
|
378
|
+
if (Array.isArray(e)) {
|
|
379
|
+
a = 2;
|
|
380
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
381
|
+
n > 0 && (a += 1);
|
|
382
|
+
let r = V(e[n], t);
|
|
383
|
+
a += r.bytes || 4, o += r.nodes;
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
a = 2;
|
|
387
|
+
let e = 0;
|
|
388
|
+
for (let n in r) {
|
|
389
|
+
if (!Object.hasOwn(r, n)) continue;
|
|
390
|
+
let i = r[n];
|
|
391
|
+
if (i === void 0) continue;
|
|
392
|
+
e > 0 && (a += 1), e += 1, a += qe(n) + 1;
|
|
393
|
+
let s = V(i, t);
|
|
394
|
+
a += s.bytes, o += s.nodes;
|
|
395
|
+
}
|
|
511
396
|
}
|
|
397
|
+
t.delete(r);
|
|
398
|
+
let s = {
|
|
399
|
+
bytes: a,
|
|
400
|
+
nodes: o
|
|
401
|
+
};
|
|
402
|
+
return Ke.set(r, s), s;
|
|
403
|
+
}
|
|
404
|
+
function Je(e, t) {
|
|
405
|
+
let n = e.document.nodes ?? [];
|
|
512
406
|
try {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
let e = B(l, o, a.file.parameters);
|
|
521
|
-
if (e.length) return {
|
|
522
|
-
ok: !1,
|
|
523
|
-
diagnostics: e
|
|
407
|
+
let r = V(e, /* @__PURE__ */ new Set()), i = t.ok && typeof t.document.source == "string" ? t.document.source.length : 0;
|
|
408
|
+
if (r.bytes <= Math.max(i, Fe)) return {
|
|
409
|
+
patchBytes: r.bytes,
|
|
410
|
+
patchNodes: n.length,
|
|
411
|
+
preferFull: !1
|
|
524
412
|
};
|
|
525
|
-
let
|
|
413
|
+
let a = V(t, /* @__PURE__ */ new Set()), o = 0;
|
|
414
|
+
for (let e of n) e.node === void 0 ? e.data !== void 0 && (o += 1) : o += V(e.node, /* @__PURE__ */ new Set()).nodes;
|
|
415
|
+
let s = r.bytes * j >= a.bytes, c = a.nodes > 0 && o * j >= a.nodes;
|
|
526
416
|
return {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
417
|
+
patchBytes: r.bytes,
|
|
418
|
+
fullBytes: a.bytes,
|
|
419
|
+
patchNodes: n.length,
|
|
420
|
+
fullNodes: a.nodes,
|
|
421
|
+
preferFull: s || c,
|
|
422
|
+
...s ? { reason: "bytes" } : c ? { reason: "nodes" } : {}
|
|
530
423
|
};
|
|
531
|
-
}
|
|
532
|
-
l.dispose();
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
function H(e, t, n) {
|
|
536
|
-
try {
|
|
537
|
-
return V(e, t, void 0, n);
|
|
538
|
-
} catch (e) {
|
|
424
|
+
} catch {
|
|
539
425
|
return {
|
|
540
|
-
|
|
541
|
-
|
|
426
|
+
patchBytes: 0,
|
|
427
|
+
patchNodes: n.length,
|
|
428
|
+
preferFull: !1
|
|
542
429
|
};
|
|
543
430
|
}
|
|
544
431
|
}
|
|
545
|
-
function
|
|
546
|
-
|
|
547
|
-
try {
|
|
548
|
-
r = V(e.document, t, e.snapshot().state, n);
|
|
549
|
-
} catch (e) {
|
|
550
|
-
return [E("local.state.invalid", `Cannot apply the local state: ${O(e)}`)];
|
|
551
|
-
}
|
|
552
|
-
if (!r.ok) return r.diagnostics;
|
|
553
|
-
let i = z(e.document);
|
|
554
|
-
try {
|
|
555
|
-
return B(e, i, r.state);
|
|
556
|
-
} catch (e) {
|
|
557
|
-
return [E("local.state.invalid", `Cannot apply the local state: ${O(e)}`)];
|
|
558
|
-
}
|
|
432
|
+
function Ye(e, t) {
|
|
433
|
+
return Qe(e, t);
|
|
559
434
|
}
|
|
560
|
-
function
|
|
561
|
-
|
|
435
|
+
function Xe(e, t) {
|
|
436
|
+
let n = Qe(e, t);
|
|
437
|
+
return n ? {
|
|
438
|
+
patch: n,
|
|
439
|
+
cost: Je(n, t)
|
|
440
|
+
} : null;
|
|
562
441
|
}
|
|
563
|
-
function
|
|
564
|
-
let r =
|
|
565
|
-
return r
|
|
442
|
+
function Ze(e, t) {
|
|
443
|
+
let n = e.recoveries, r = t.recoveries;
|
|
444
|
+
return n === void 0 ? r === void 0 ? {} : { recoveries: r } : r !== void 0 && I(n, r) ? {} : { recoveries: r === void 0 ? null : r };
|
|
566
445
|
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
446
|
+
function Qe(e, t) {
|
|
447
|
+
try {
|
|
448
|
+
if (!e.ok || !t.ok) return null;
|
|
449
|
+
let n = e.document, r = t.document;
|
|
450
|
+
if (!N(n) || !N(r)) return null;
|
|
451
|
+
let i = {};
|
|
452
|
+
if (typeof n.source == "string" && typeof r.source == "string") {
|
|
453
|
+
let e = R(n.source, r.source);
|
|
454
|
+
e !== null && (i.source = e);
|
|
455
|
+
} else if (n.source !== r.source) return null;
|
|
456
|
+
let a = [], o = {}, s = {}, c = new Set(M), l = /* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)]);
|
|
457
|
+
for (let e of l) {
|
|
458
|
+
if (e === "source" || e === "nodes" || c.has(e)) continue;
|
|
459
|
+
let t = Object.hasOwn(r, e) && r[e] !== void 0, i = Object.hasOwn(n, e) && n[e] !== void 0;
|
|
460
|
+
t ? i && I(n[e], r[e]) || (o[e] = r[e]) : i && a.push(e);
|
|
461
|
+
}
|
|
462
|
+
for (let e of M) {
|
|
463
|
+
let t = Object.hasOwn(r, e) && r[e] !== void 0, i = Object.hasOwn(n, e) && n[e] !== void 0, c = i ? n[e] : void 0, l = t ? r[e] : void 0;
|
|
464
|
+
if (!t) {
|
|
465
|
+
i && a.push(e);
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
if (!N(l)) {
|
|
469
|
+
i && I(c, l) || (o[e] = l);
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (!i) {
|
|
473
|
+
s[e] = { set: l };
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
if (!N(c)) {
|
|
477
|
+
o[e] = l;
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
let u = Ge(c, l);
|
|
481
|
+
u !== null && (s[e] = u);
|
|
482
|
+
}
|
|
483
|
+
let u = Array.isArray(n.nodes) ? n.nodes : [], d = Array.isArray(r.nodes) ? r.nodes : [], f = u.map((e) => e.id), p = d.map((e) => e.id), m = f.length !== p.length;
|
|
484
|
+
if (!m) {
|
|
485
|
+
for (let e = 0; e < f.length; e += 1) if (f[e] !== p[e]) {
|
|
486
|
+
m = !0;
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
let h = [], g = Ue(u);
|
|
491
|
+
for (let e of d) We(e, g.get(e.id), g, h);
|
|
492
|
+
return m && (i.roots = p), h.length > 0 && (i.nodes = h), a.length > 0 && (i.removed = a), Object.keys(o).length > 0 && (i.values = o), Object.keys(s).length > 0 && (i.records = s), {
|
|
493
|
+
kind: "result-patch",
|
|
494
|
+
protocol: A,
|
|
495
|
+
document: i,
|
|
496
|
+
...I(e.diagnostics, t.diagnostics) ? {} : { diagnostics: t.diagnostics },
|
|
497
|
+
...Ze(e, t)
|
|
588
498
|
};
|
|
499
|
+
} catch {
|
|
500
|
+
return null;
|
|
589
501
|
}
|
|
590
|
-
return JSON.stringify(n);
|
|
591
|
-
}
|
|
592
|
-
// src/local/retention.ts
|
|
593
|
-
function Me(e) {
|
|
594
|
-
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
595
|
-
for (let r of e) t.set(r.id, r), r.children && n(r.children);
|
|
596
|
-
};
|
|
597
|
-
return n(e.nodes), t;
|
|
598
502
|
}
|
|
599
|
-
function
|
|
600
|
-
let
|
|
601
|
-
return
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
for (let [r, i] of Object.entries(e.bindings)) {
|
|
606
|
-
let a = i.nodeIds.flatMap((e) => {
|
|
607
|
-
let n = t.get(e);
|
|
608
|
-
return n ? [n] : [];
|
|
609
|
-
});
|
|
610
|
-
if (!a.length || r.startsWith("@") || a.some((t) => t.attrs?.bind !== r && !Ne(e, t, r) || t.name === "timer" || t.name === "checklist")) continue;
|
|
611
|
-
let o = a.flatMap((e) => Object.hasOwn(e.attrs ?? {}, "initial") ? [e.attrs.initial] : []).sort();
|
|
612
|
-
n.set(r, {
|
|
613
|
-
type: i.type,
|
|
614
|
-
initialDefinition: JSON.stringify([i.initial, o])
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
return n;
|
|
503
|
+
function $e(e, t) {
|
|
504
|
+
let n = z(e);
|
|
505
|
+
return P(n.range) || F(), n.range = {
|
|
506
|
+
start: n.range.start + t,
|
|
507
|
+
end: n.range.end + t
|
|
508
|
+
}, e.children && (n.children = e.children.map((e) => $e(e, t))), n;
|
|
618
509
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
621
|
-
|
|
622
|
-
|
|
510
|
+
function et(e) {
|
|
511
|
+
return N(e) && typeof e.id == "string" && typeof e.type == "string" && P(e.range);
|
|
512
|
+
}
|
|
513
|
+
function tt(e, t) {
|
|
514
|
+
N(t) || F(), t.set !== void 0 && !N(t.set) && F(), t.remove !== void 0 && !Array.isArray(t.remove) && F();
|
|
515
|
+
let n = {};
|
|
516
|
+
if (N(e)) for (let [t, r] of Object.entries(e)) Object.defineProperty(n, t, {
|
|
517
|
+
value: r,
|
|
518
|
+
enumerable: !0,
|
|
519
|
+
configurable: !0,
|
|
520
|
+
writable: !0
|
|
521
|
+
});
|
|
522
|
+
else e !== void 0 && F();
|
|
523
|
+
if (t.set) for (let [e, r] of Object.entries(t.set)) Object.defineProperty(n, e, {
|
|
524
|
+
value: L(r),
|
|
525
|
+
enumerable: !0,
|
|
526
|
+
configurable: !0,
|
|
527
|
+
writable: !0
|
|
623
528
|
});
|
|
529
|
+
if (t.remove) for (let e of t.remove) typeof e != "string" && F(), delete n[e];
|
|
530
|
+
return n;
|
|
624
531
|
}
|
|
625
|
-
function
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
532
|
+
function nt(e, t) {
|
|
533
|
+
try {
|
|
534
|
+
if (!e.ok || !N(t) || t.kind !== "result-patch" || t.protocol !== "patch-v1") return null;
|
|
535
|
+
let n = t.document;
|
|
536
|
+
if (!N(n)) return null;
|
|
537
|
+
let r = e.document;
|
|
538
|
+
if (!N(r)) return null;
|
|
539
|
+
let i = {};
|
|
540
|
+
for (let [e, t] of Object.entries(r)) Object.defineProperty(i, e, {
|
|
541
|
+
value: t,
|
|
542
|
+
enumerable: !0,
|
|
543
|
+
configurable: !0,
|
|
544
|
+
writable: !0
|
|
545
|
+
});
|
|
546
|
+
if (n.removed !== void 0) {
|
|
547
|
+
if (!Array.isArray(n.removed)) return null;
|
|
548
|
+
for (let e of n.removed) {
|
|
549
|
+
if (typeof e != "string" || e === "nodes" || e === "source") return null;
|
|
550
|
+
delete i[e];
|
|
551
|
+
}
|
|
631
552
|
}
|
|
632
|
-
if (
|
|
633
|
-
|
|
634
|
-
|
|
553
|
+
if (n.values !== void 0) {
|
|
554
|
+
if (!N(n.values)) return null;
|
|
555
|
+
for (let [e, t] of Object.entries(n.values)) {
|
|
556
|
+
if (e === "nodes" || e === "source") return null;
|
|
557
|
+
Object.defineProperty(i, e, {
|
|
558
|
+
value: L(t),
|
|
559
|
+
enumerable: !0,
|
|
560
|
+
configurable: !0,
|
|
561
|
+
writable: !0
|
|
562
|
+
});
|
|
563
|
+
}
|
|
635
564
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
565
|
+
if (n.records !== void 0) {
|
|
566
|
+
if (!N(n.records)) return null;
|
|
567
|
+
for (let e of Object.keys(n.records)) {
|
|
568
|
+
if (!M.includes(e)) return null;
|
|
569
|
+
let t = n.records[e];
|
|
570
|
+
t !== void 0 && (i[e] = tt(r[e], t));
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
let a = typeof r.source == "string" ? r.source : null;
|
|
574
|
+
if (a === null) return null;
|
|
575
|
+
if (n.source !== void 0) {
|
|
576
|
+
let e = Ie(n.source);
|
|
577
|
+
if (e === null) return null;
|
|
578
|
+
let t = Le(a, e);
|
|
579
|
+
if (t === null) return null;
|
|
580
|
+
a = t;
|
|
581
|
+
}
|
|
582
|
+
i.source = a;
|
|
583
|
+
let o = Array.isArray(r.nodes) ? r.nodes : [], s = Ue(o), c = /* @__PURE__ */ new Map();
|
|
584
|
+
if (n.nodes !== void 0) {
|
|
585
|
+
if (!Array.isArray(n.nodes)) return null;
|
|
586
|
+
for (let e of n.nodes) {
|
|
587
|
+
if (!N(e) || typeof e.id != "string" || c.has(e.id)) return null;
|
|
588
|
+
c.set(e.id, e);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
let l;
|
|
592
|
+
if (n.roots !== void 0) {
|
|
593
|
+
if (!Array.isArray(n.roots)) return null;
|
|
594
|
+
l = [];
|
|
595
|
+
for (let e of n.roots) {
|
|
596
|
+
if (typeof e != "string") return null;
|
|
597
|
+
l.push(e);
|
|
598
|
+
}
|
|
599
|
+
} else l = o.map((e) => e.id);
|
|
600
|
+
let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set(), f = (e) => {
|
|
601
|
+
let t = u.get(e);
|
|
602
|
+
if (t !== void 0) return t;
|
|
603
|
+
d.has(e) && F();
|
|
604
|
+
let n = c.get(e), r = s.get(e);
|
|
605
|
+
if (n === void 0) return r === void 0 && F(), u.set(e, r), r;
|
|
606
|
+
if (N(n) || F(), n.node !== void 0) {
|
|
607
|
+
(n.data !== void 0 || n.children !== void 0 || n.shift !== void 0 || n.subtree) && F(), et(n.node) && n.node.id === e || F();
|
|
608
|
+
let t = L(n.node);
|
|
609
|
+
return u.set(e, t), t;
|
|
610
|
+
}
|
|
611
|
+
r === void 0 && n.data === void 0 && F(), n.subtree !== void 0 && n.subtree !== !0 && F(), n.shift !== void 0 && !Number.isSafeInteger(n.shift) && F(), n.data !== void 0 && n.shift !== void 0 && F(), n.children !== void 0 && n.children !== null && (!Array.isArray(n.children) || n.children.some((e) => typeof e != "string")) && F(), d.add(e);
|
|
612
|
+
let i;
|
|
613
|
+
if (n.subtree === !0) (r === void 0 || n.shift === void 0 || n.data !== void 0 || n.children !== void 0) && F(), i = $e(r, n.shift);
|
|
614
|
+
else {
|
|
615
|
+
let t;
|
|
616
|
+
n.data === void 0 ? (r === void 0 && F(), t = z(r), n.shift !== void 0 && (P(t.range) || F(), t.range = {
|
|
617
|
+
start: t.range.start + n.shift,
|
|
618
|
+
end: t.range.end + n.shift
|
|
619
|
+
})) : (N(n.data) || F(), t = L(n.data), delete t.children, t.id !== e && F());
|
|
620
|
+
let a;
|
|
621
|
+
if (n.children !== void 0) a = n.children === null ? null : [...n.children];
|
|
622
|
+
else {
|
|
623
|
+
let e = r?.children;
|
|
624
|
+
a = e === void 0 ? void 0 : e.map((e) => e.id);
|
|
625
|
+
}
|
|
626
|
+
a === null ? delete t.children : a !== void 0 && (t.children = a.map(f)), i = t;
|
|
627
|
+
}
|
|
628
|
+
return d.delete(e), u.set(e, i), i;
|
|
629
|
+
}, p = l.map(f);
|
|
630
|
+
i.nodes = n.roots === void 0 && n.nodes === void 0 ? r.nodes : p;
|
|
631
|
+
let m = t.diagnostics === void 0 ? e.diagnostics : Array.isArray(t.diagnostics) ? L(t.diagnostics) : F();
|
|
632
|
+
if (t.recoveries !== void 0 && t.recoveries !== null && !Array.isArray(t.recoveries)) return null;
|
|
633
|
+
if (t.recoveries === null) return {
|
|
634
|
+
ok: !0,
|
|
635
|
+
document: i,
|
|
636
|
+
diagnostics: m
|
|
637
|
+
};
|
|
638
|
+
let h = t.recoveries === void 0 ? e.recoveries : L([...t.recoveries]);
|
|
639
|
+
return {
|
|
640
|
+
ok: !0,
|
|
641
|
+
document: i,
|
|
642
|
+
diagnostics: m,
|
|
643
|
+
...h === void 0 ? {} : { recoveries: h }
|
|
644
|
+
};
|
|
645
|
+
} catch {
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
// src/local/transport/flat-compiled-data.ts
|
|
650
|
+
var H = "flat-v1";
|
|
651
|
+
function rt(e) {
|
|
652
|
+
if (!e.ok) return !1;
|
|
653
|
+
let t = e.document.nodes.map((e) => ({
|
|
654
|
+
node: e,
|
|
655
|
+
depth: 0
|
|
656
|
+
}));
|
|
657
|
+
for (; t.length;) {
|
|
658
|
+
let { node: e, depth: n } = t.pop();
|
|
659
|
+
if (n >= 100) return !0;
|
|
660
|
+
if (e.children) for (let r of e.children) t.push({
|
|
661
|
+
node: r,
|
|
662
|
+
depth: n + 1
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
return !1;
|
|
666
|
+
}
|
|
667
|
+
function it(e) {
|
|
668
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = [], i = (e) => {
|
|
669
|
+
if (typeof e == "object" && e) {
|
|
670
|
+
let i = n.get(e);
|
|
671
|
+
if (i !== void 0) return i;
|
|
672
|
+
let a = t.length, o = Array.isArray(e) ? [
|
|
673
|
+
1,
|
|
674
|
+
e.length,
|
|
675
|
+
[]
|
|
676
|
+
] : [2, []];
|
|
677
|
+
return n.set(e, a), t.push(o), r.push({
|
|
678
|
+
value: e,
|
|
679
|
+
record: o
|
|
680
|
+
}), a;
|
|
640
681
|
}
|
|
641
|
-
if (
|
|
642
|
-
|
|
682
|
+
if (e !== null && ![
|
|
683
|
+
"string",
|
|
684
|
+
"number",
|
|
685
|
+
"boolean",
|
|
686
|
+
"undefined"
|
|
687
|
+
].includes(typeof e)) throw TypeError("Unsupported compiler wire value");
|
|
688
|
+
let i = t.length;
|
|
689
|
+
return t.push([0, e]), i;
|
|
690
|
+
};
|
|
691
|
+
for (i(e); r.length;) {
|
|
692
|
+
let { value: e, record: t } = r.pop(), n = t[0] === 1 ? t[2] : t[1];
|
|
693
|
+
for (let t of Object.keys(e)) n.push([t, i(e[t])]);
|
|
694
|
+
}
|
|
695
|
+
return {
|
|
696
|
+
version: H,
|
|
697
|
+
records: t
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
function at(e) {
|
|
701
|
+
if (!e || typeof e != "object") return null;
|
|
702
|
+
let t = e;
|
|
703
|
+
if (t.version !== "flat-v1" || !Array.isArray(t.records) || t.records.length === 0 || t.records.length > 2e6) return null;
|
|
704
|
+
let n = t.records, r = Array(n.length), i = Array(n.length), a = 0;
|
|
705
|
+
for (let e = 0; e < n.length; e++) {
|
|
706
|
+
let t = n[e];
|
|
707
|
+
if (!Array.isArray(t)) return null;
|
|
708
|
+
if (t[0] === 0) {
|
|
709
|
+
if (t.length !== 2 || t[1] !== null && ![
|
|
710
|
+
"string",
|
|
711
|
+
"number",
|
|
712
|
+
"boolean",
|
|
713
|
+
"undefined"
|
|
714
|
+
].includes(typeof t[1])) return null;
|
|
715
|
+
r[e] = t[1], i[e] = [];
|
|
643
716
|
continue;
|
|
644
717
|
}
|
|
645
|
-
|
|
646
|
-
|
|
718
|
+
let o = t[0] === 1;
|
|
719
|
+
if (!o && t[0] !== 2 || t.length !== (o ? 3 : 2) || o && (!Number.isSafeInteger(t[1]) || t[1] < 0 || t[1] > 1e6)) return null;
|
|
720
|
+
let s = o ? t[2] : t[1];
|
|
721
|
+
if (!Array.isArray(s)) return null;
|
|
722
|
+
let c = /* @__PURE__ */ new Set(), l = [];
|
|
723
|
+
for (let e of s) if (!Array.isArray(e) || e.length !== 2 || typeof e[0] != "string" || !Number.isSafeInteger(e[1]) || e[1] < 0 || e[1] >= n.length || c.has(e[0]) || o && (e[0] === "length" || !/^(0|[1-9][0-9]*)$/.test(e[0]) || Number(e[0]) >= t[1]) || (c.add(e[0]), l.push(e[1]), ++a > 4e6)) return null;
|
|
724
|
+
r[e] = o ? Array(t[1]) : {}, i[e] = l;
|
|
725
|
+
}
|
|
726
|
+
let o = new Uint8Array(n.length), s = [{
|
|
727
|
+
index: 0,
|
|
728
|
+
child: 0
|
|
729
|
+
}];
|
|
730
|
+
o[0] = 1;
|
|
731
|
+
let c = 1;
|
|
732
|
+
for (; s.length;) {
|
|
733
|
+
let e = s[s.length - 1], t = i[e.index];
|
|
734
|
+
if (e.child === t.length) {
|
|
735
|
+
o[e.index] = 2, s.pop();
|
|
647
736
|
continue;
|
|
648
737
|
}
|
|
649
|
-
let
|
|
650
|
-
|
|
738
|
+
let n = t[e.child++];
|
|
739
|
+
if (o[n] === 1) return null;
|
|
740
|
+
o[n] === 0 && (o[n] = 1, c++, s.push({
|
|
741
|
+
index: n,
|
|
742
|
+
child: 0
|
|
743
|
+
}));
|
|
651
744
|
}
|
|
652
|
-
return
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
745
|
+
if (c !== n.length) return null;
|
|
746
|
+
for (let e = 0; e < n.length; e++) {
|
|
747
|
+
let t = n[e];
|
|
748
|
+
if (t[0] === 0) continue;
|
|
749
|
+
let i = t[0] === 1 ? t[2] : t[1];
|
|
750
|
+
for (let [t, n] of i) Object.defineProperty(r[e], t, {
|
|
751
|
+
value: r[n],
|
|
752
|
+
enumerable: !0,
|
|
753
|
+
writable: !0,
|
|
754
|
+
configurable: !0
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
return r[0];
|
|
758
|
+
}
|
|
759
|
+
// src/local/transport/worker.ts
|
|
760
|
+
var ot = 150, st = 200, ct = [
|
|
761
|
+
"maxSyntaxNodes",
|
|
762
|
+
"maxParseWork",
|
|
763
|
+
"maxMarkdownDepth"
|
|
764
|
+
];
|
|
765
|
+
function U(e) {
|
|
766
|
+
return e instanceof Error ? e.message : String(e);
|
|
657
767
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
660
|
-
retained: Object.freeze([...e]),
|
|
661
|
-
dropped: Object.freeze(t.map((e) => Object.freeze({ ...e }))),
|
|
662
|
-
diagnostics: Object.freeze([...n])
|
|
663
|
-
});
|
|
768
|
+
function W() {
|
|
769
|
+
return typeof performance < "u" ? performance.now() : Date.now();
|
|
664
770
|
}
|
|
665
|
-
function
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
771
|
+
function G(e) {
|
|
772
|
+
return Number.isFinite(e) ? Math.max(0, Math.round(e)) : 0;
|
|
773
|
+
}
|
|
774
|
+
function K(e, t, n) {
|
|
775
|
+
let r = {
|
|
776
|
+
tokens: [],
|
|
777
|
+
bindings: [],
|
|
778
|
+
diagnostics: []
|
|
779
|
+
};
|
|
780
|
+
if (n.ok && n.document.source !== e || !n.ok && n.diagnostics.some((e) => e.code.startsWith("local.budget") || e.code.startsWith("local.options."))) return r;
|
|
781
|
+
try {
|
|
782
|
+
return w(e, t, {
|
|
783
|
+
...n.ok ? { document: n.document } : {},
|
|
784
|
+
diagnostics: !1
|
|
785
|
+
});
|
|
786
|
+
} catch {
|
|
787
|
+
return {
|
|
788
|
+
tokens: [],
|
|
789
|
+
bindings: [],
|
|
790
|
+
diagnostics: []
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
function lt(e, t) {
|
|
795
|
+
if (!e || typeof e != "object") return !1;
|
|
796
|
+
let n = e, r = (e) => e && Number.isSafeInteger(e.start) && Number.isSafeInteger(e.end) && e.start >= 0 && e.end >= e.start && e.end <= t;
|
|
797
|
+
if (!Array.isArray(n.tokens) || n.tokens.length > t + 1 || !Array.isArray(n.bindings) || n.bindings.length > t + 1 || !Array.isArray(n.diagnostics)) return !1;
|
|
798
|
+
let i = 0, a = 0;
|
|
799
|
+
for (let e of n.tokens) {
|
|
800
|
+
if (!e || typeof e.kind != "string" || !r(e.range) || e.range.start < i) return !1;
|
|
801
|
+
i = e.range.end;
|
|
672
802
|
}
|
|
673
|
-
|
|
803
|
+
for (let e of n.bindings) if (!e || typeof e.name != "string" || !Array.isArray(e.declarations) || !Array.isArray(e.references) || (a += e.declarations.length + e.references.length, a > t + 1 || !e.declarations.every(r) || !e.references.every(r))) return !1;
|
|
804
|
+
return !0;
|
|
674
805
|
}
|
|
675
|
-
|
|
676
|
-
var Re = 150;
|
|
677
|
-
function ze(e) {
|
|
806
|
+
function ut(e) {
|
|
678
807
|
return Array.isArray(e) ? e.length > 32 ? Array(33) : e.map((e) => {
|
|
679
808
|
if (!e || typeof e != "object" || Array.isArray(e)) return e;
|
|
680
809
|
let t = e, n = { ...t }, r = t.props;
|
|
@@ -691,22 +820,42 @@ function ze(e) {
|
|
|
691
820
|
return n.props = i, n;
|
|
692
821
|
}) : e;
|
|
693
822
|
}
|
|
694
|
-
function
|
|
823
|
+
function q(e) {
|
|
695
824
|
if (e !== void 0) try {
|
|
696
825
|
if (typeof e != "object" || !e || Array.isArray(e)) return e;
|
|
697
826
|
let t = e, n = {};
|
|
698
|
-
for (let e of
|
|
699
|
-
if (Object.hasOwn(t, "markdownBreaks") && (n.markdownBreaks = t.markdownBreaks), Object.hasOwn(t, "limits")) {
|
|
827
|
+
for (let e of h) Object.hasOwn(t, e) && (n[e] = t[e]);
|
|
828
|
+
if (Object.hasOwn(t, "markdownBreaks") && (n.markdownBreaks = t.markdownBreaks), Object.hasOwn(t, "strict") && (n.strict = t.strict), Object.hasOwn(t, "limits")) {
|
|
700
829
|
let e = t.limits;
|
|
701
|
-
|
|
830
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
831
|
+
let t = {};
|
|
832
|
+
for (let n of ct) Object.hasOwn(e, n) && (t[n] = e[n]);
|
|
833
|
+
n.limits = t;
|
|
834
|
+
} else n.limits = e;
|
|
702
835
|
}
|
|
703
|
-
return Object.hasOwn(t, "hostComponents") && (n.hostComponents =
|
|
836
|
+
return Object.hasOwn(t, "hostComponents") && (n.hostComponents = ut(t.hostComponents)), Object.hasOwn(t, "config") && (n.config = b(t.config)), n;
|
|
704
837
|
} catch {
|
|
705
838
|
return e;
|
|
706
839
|
}
|
|
707
840
|
}
|
|
708
|
-
function
|
|
709
|
-
|
|
841
|
+
function dt(e) {
|
|
842
|
+
try {
|
|
843
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return "";
|
|
844
|
+
let t = e.limits;
|
|
845
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return "";
|
|
846
|
+
let n = (e) => {
|
|
847
|
+
let n = t;
|
|
848
|
+
if (!Object.hasOwn(n, e) || n[e] === void 0) return "-";
|
|
849
|
+
let r = n[e];
|
|
850
|
+
return `${typeof r}:${String(r)}`;
|
|
851
|
+
};
|
|
852
|
+
return `:${n("maxParseWork")}:${n("maxMarkdownDepth")}`;
|
|
853
|
+
} catch {
|
|
854
|
+
return ":unreadable";
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function ft(e) {
|
|
858
|
+
let t = S(e);
|
|
710
859
|
if (t !== "invalid") return t;
|
|
711
860
|
try {
|
|
712
861
|
return `invalid:${JSON.stringify(e)}`;
|
|
@@ -714,29 +863,33 @@ function Ve(e) {
|
|
|
714
863
|
return "invalid";
|
|
715
864
|
}
|
|
716
865
|
}
|
|
717
|
-
function
|
|
866
|
+
function J(e) {
|
|
867
|
+
return `${ft(e)}${dt(e)}`;
|
|
868
|
+
}
|
|
869
|
+
function pt(e, t) {
|
|
870
|
+
let n = q(t);
|
|
718
871
|
return {
|
|
719
872
|
source: e,
|
|
720
|
-
options:
|
|
721
|
-
optionsKey:
|
|
873
|
+
options: n,
|
|
874
|
+
optionsKey: J(n),
|
|
875
|
+
scheduledAt: W()
|
|
722
876
|
};
|
|
723
877
|
}
|
|
724
|
-
function
|
|
878
|
+
function Y(e, t) {
|
|
725
879
|
return e.source === t.source && e.optionsKey === t.optionsKey;
|
|
726
880
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
881
|
+
function mt(e) {
|
|
882
|
+
if (!e || typeof e != "object") return !1;
|
|
883
|
+
let t = e;
|
|
884
|
+
return !(typeof t.ok != "boolean" || !Array.isArray(t.diagnostics) || t.ok && (!t.document || typeof t.document != "object"));
|
|
729
885
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
886
|
+
function ht(e) {
|
|
887
|
+
return e.ok && "patch" in e && e.patch !== void 0;
|
|
732
888
|
}
|
|
733
|
-
function
|
|
734
|
-
return Number.isFinite(e) ? Math.max(0, Math.round(e)) : 0;
|
|
735
|
-
}
|
|
736
|
-
function Y(e) {
|
|
889
|
+
function X(e) {
|
|
737
890
|
return {
|
|
738
891
|
code: "local.worker.compile",
|
|
739
|
-
message: `Compilation failed: ${
|
|
892
|
+
message: `Compilation failed: ${U(e)}`,
|
|
740
893
|
severity: "error",
|
|
741
894
|
range: {
|
|
742
895
|
start: 0,
|
|
@@ -746,7 +899,7 @@ function Y(e) {
|
|
|
746
899
|
column: 1
|
|
747
900
|
};
|
|
748
901
|
}
|
|
749
|
-
var
|
|
902
|
+
var gt = class {
|
|
750
903
|
options;
|
|
751
904
|
delay;
|
|
752
905
|
worker = null;
|
|
@@ -754,8 +907,12 @@ var Ue = class {
|
|
|
754
907
|
queued = null;
|
|
755
908
|
inFlight = null;
|
|
756
909
|
nextId = 1;
|
|
910
|
+
nextRevision = 1;
|
|
757
911
|
pending = !1;
|
|
912
|
+
fallbackSession = null;
|
|
758
913
|
disposed = !1;
|
|
914
|
+
baseline = null;
|
|
915
|
+
patchState = "unknown";
|
|
759
916
|
constructor(e) {
|
|
760
917
|
this.options = e;
|
|
761
918
|
let t = e.delay;
|
|
@@ -767,17 +924,20 @@ var Ue = class {
|
|
|
767
924
|
this.handleWorkerFailure(t || "The compile worker encountered an error");
|
|
768
925
|
}, t.onmessageerror = () => this.handleWorkerFailure("The compile worker could not deliver the compile result"), this.worker = t;
|
|
769
926
|
} catch (t) {
|
|
770
|
-
this.worker = null, e.onModeChange?.("fallback", `Could not start the compile worker: ${
|
|
927
|
+
this.worker = null, e.onModeChange?.("fallback", `Could not start the compile worker: ${U(t)}`);
|
|
771
928
|
}
|
|
772
929
|
}
|
|
773
|
-
schedule(e, t) {
|
|
774
|
-
this.disposed || (this.queued =
|
|
930
|
+
schedule(e, t, n) {
|
|
931
|
+
this.disposed || (this.queued = pt(e, t), n && typeof n.baseSource == "string" && $(n.edit) && n.edit.to <= n.baseSource.length && n.baseSource.slice(0, n.edit.from) + n.edit.insert + n.baseSource.slice(n.edit.to) === e && (this.queued.editHint = {
|
|
932
|
+
baseSource: n.baseSource,
|
|
933
|
+
edit: { ...n.edit }
|
|
934
|
+
}), this.clearTimer(), this.timer = setTimeout(() => {
|
|
775
935
|
this.timer = null, this.drain();
|
|
776
936
|
}, this.delay), this.setPending(!0));
|
|
777
937
|
}
|
|
778
938
|
dispose() {
|
|
779
939
|
if (this.disposed) return;
|
|
780
|
-
this.disposed = !0, this.clearTimer(), this.queued = null, this.inFlight = null;
|
|
940
|
+
this.disposed = !0, this.clearTimer(), this.queued = null, this.inFlight = null, this.resetProtocol();
|
|
781
941
|
let e = this.worker;
|
|
782
942
|
if (this.worker = null, e) {
|
|
783
943
|
e.onmessage = null, e.onerror = null, e.onmessageerror = null;
|
|
@@ -785,7 +945,7 @@ var Ue = class {
|
|
|
785
945
|
e.terminate();
|
|
786
946
|
} catch {}
|
|
787
947
|
}
|
|
788
|
-
this.pending = !1;
|
|
948
|
+
this.pending = !1, this.fallbackSession?.dispose(), this.fallbackSession = null;
|
|
789
949
|
}
|
|
790
950
|
drain() {
|
|
791
951
|
if (this.disposed || this.timer !== null || this.inFlight !== null) return;
|
|
@@ -798,75 +958,167 @@ var Ue = class {
|
|
|
798
958
|
this.compileFallback(e);
|
|
799
959
|
return;
|
|
800
960
|
}
|
|
801
|
-
let n = this.nextId
|
|
802
|
-
|
|
961
|
+
let n = this.nextId++, r = this.nextRevision++, i = W(), a = this.baseline, o = this.patchState === "enabled" && a !== null && a.optionsKey === e.optionsKey ? {
|
|
962
|
+
id: n,
|
|
963
|
+
protocol: A,
|
|
964
|
+
baseRevision: a.revision,
|
|
965
|
+
revision: r,
|
|
966
|
+
edit: e.editHint?.baseSource === a.source ? e.editHint.edit : R(a.source, e.source) ?? {
|
|
967
|
+
from: 0,
|
|
968
|
+
to: 0,
|
|
969
|
+
insert: ""
|
|
970
|
+
},
|
|
971
|
+
targetLength: e.source.length,
|
|
972
|
+
optionsKey: e.optionsKey
|
|
973
|
+
} : {
|
|
803
974
|
id: n,
|
|
804
|
-
|
|
975
|
+
source: e.source,
|
|
976
|
+
...e.options === void 0 ? {} : { options: e.options },
|
|
977
|
+
protocol: A,
|
|
978
|
+
revision: r,
|
|
979
|
+
flatResults: H
|
|
805
980
|
};
|
|
981
|
+
this.inFlight = {
|
|
982
|
+
id: n,
|
|
983
|
+
job: e,
|
|
984
|
+
startedAt: i,
|
|
985
|
+
revision: r
|
|
986
|
+
}, this.options.includeAuthorAnalysis && (o.includeAuthorAnalysis = !0);
|
|
806
987
|
try {
|
|
807
|
-
t.postMessage(
|
|
808
|
-
id: n,
|
|
809
|
-
source: e.source,
|
|
810
|
-
...e.options === void 0 ? {} : { options: e.options }
|
|
811
|
-
});
|
|
988
|
+
t.postMessage(o);
|
|
812
989
|
} catch (t) {
|
|
813
990
|
this.inFlight = null;
|
|
814
|
-
let n = `Could not send the source to the compile worker: ${
|
|
815
|
-
if (r !== null && !
|
|
816
|
-
this.degrade(n), this.finishRun();
|
|
991
|
+
let n = `Could not send the source to the compile worker: ${U(t)}`, r = this.queued;
|
|
992
|
+
if (r !== null && !Y(r, e)) {
|
|
993
|
+
this.resetProtocol(), this.degrade(n), this.finishRun();
|
|
817
994
|
return;
|
|
818
995
|
}
|
|
819
|
-
r !== null && (this.queued = null, this.clearTimer()), this.degrade(n), this.compileFallback(e);
|
|
996
|
+
r !== null && (this.queued = null, this.clearTimer()), this.resetProtocol(), this.degrade(n), this.compileFallback(e);
|
|
820
997
|
}
|
|
821
998
|
}
|
|
822
999
|
compileFallback(e) {
|
|
823
1000
|
if (this.disposed) return;
|
|
824
|
-
let t =
|
|
1001
|
+
let t = W(), n;
|
|
825
1002
|
try {
|
|
826
|
-
let t = this.options.fallbackCompile ??
|
|
1003
|
+
let t = this.options.fallbackCompile ?? ((e, t) => (this.fallbackSession ??= T(), this.fallbackSession.compile(e, t)));
|
|
827
1004
|
n = e.options === void 0 ? t(e.source) : t(e.source, e.options);
|
|
828
1005
|
} catch (e) {
|
|
829
1006
|
n = {
|
|
830
1007
|
ok: !1,
|
|
831
|
-
diagnostics: [
|
|
1008
|
+
diagnostics: [X(e)]
|
|
832
1009
|
};
|
|
833
1010
|
}
|
|
834
1011
|
this.deliver({
|
|
835
1012
|
source: e.source,
|
|
836
1013
|
result: n,
|
|
837
|
-
duration:
|
|
1014
|
+
duration: G(W() - t),
|
|
838
1015
|
mode: "fallback",
|
|
839
|
-
...
|
|
1016
|
+
...this.options.includeAuthorAnalysis ? { analysis: K(e.source, e.options, n) } : {},
|
|
1017
|
+
...e.options === void 0 ? {} : { options: e.options },
|
|
1018
|
+
metrics: { queueMs: G(t - e.scheduledAt) }
|
|
840
1019
|
}), this.finishRun();
|
|
841
1020
|
}
|
|
842
1021
|
receive(e) {
|
|
843
1022
|
if (this.disposed) return;
|
|
844
1023
|
let t = this.inFlight;
|
|
845
1024
|
if (!t || !e || e.id !== t.id) return;
|
|
1025
|
+
let n, r = 0;
|
|
1026
|
+
if (e.ok && "flatResult" in e) {
|
|
1027
|
+
let t = W(), i = at(e.flatResult);
|
|
1028
|
+
r = G(W() - t), n = mt(i) ? {
|
|
1029
|
+
...e,
|
|
1030
|
+
result: i
|
|
1031
|
+
} : {
|
|
1032
|
+
id: e.id,
|
|
1033
|
+
ok: !1,
|
|
1034
|
+
retryFull: !0,
|
|
1035
|
+
message: "Invalid flat compile result"
|
|
1036
|
+
};
|
|
1037
|
+
} else n = e;
|
|
846
1038
|
this.inFlight = null;
|
|
847
|
-
let
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1039
|
+
let i = t.job, a = G(W() - t.startedAt), o = G(t.startedAt - i.scheduledAt), s = null, c = r, l = null, u = "worker", d;
|
|
1040
|
+
if (n.ok) {
|
|
1041
|
+
if (ht(n)) {
|
|
1042
|
+
let e = W(), t = this.applyResponsePatch(i, n);
|
|
1043
|
+
c = G(W() - e), t !== null && (s = t, d = n.revision);
|
|
1044
|
+
} else {
|
|
1045
|
+
let e = n;
|
|
1046
|
+
mt(e.result) ? (s = e.result, d = typeof e.revision == "number" ? e.revision : void 0, e.protocol === "patch-v1" && typeof e.revision == "number" && Number.isSafeInteger(e.revision) ? (this.patchState = "enabled", this.baseline = e.result.ok ? {
|
|
1047
|
+
source: i.source,
|
|
1048
|
+
optionsKey: i.optionsKey,
|
|
1049
|
+
revision: e.revision,
|
|
1050
|
+
result: e.result
|
|
1051
|
+
} : null) : (this.patchState = "legacy", this.baseline = null)) : l = "The compile worker returned an invalid result";
|
|
1052
|
+
}
|
|
1053
|
+
} else n.retryFull !== !0 && (l = n.message);
|
|
1054
|
+
let f = this.queued, p = f !== null && !Y(f, i);
|
|
1055
|
+
f !== null && !p && (this.queued = null, this.clearTimer()), s === null ? l === null ? (p || !this.recoverWithFullResult(i)) && (p ? this.resetProtocol() : (this.patchState = "disabled", this.baseline = null, this.deliver({
|
|
1056
|
+
source: i.source,
|
|
856
1057
|
result: {
|
|
857
1058
|
ok: !1,
|
|
858
|
-
diagnostics: [
|
|
1059
|
+
diagnostics: [X("The compile worker could not apply an incremental result patch")]
|
|
859
1060
|
},
|
|
860
1061
|
duration: 0,
|
|
861
|
-
mode:
|
|
862
|
-
...
|
|
863
|
-
|
|
1062
|
+
mode: u,
|
|
1063
|
+
...i.options === void 0 ? {} : { options: i.options },
|
|
1064
|
+
metrics: {
|
|
1065
|
+
queueMs: o,
|
|
1066
|
+
roundTripMs: a,
|
|
1067
|
+
...c > 0 ? { applyMs: c } : {}
|
|
1068
|
+
}
|
|
1069
|
+
})), this.finishRun()) : (p || this.deliver({
|
|
1070
|
+
source: i.source,
|
|
1071
|
+
result: {
|
|
1072
|
+
ok: !1,
|
|
1073
|
+
diagnostics: [X(l)]
|
|
1074
|
+
},
|
|
1075
|
+
duration: 0,
|
|
1076
|
+
mode: u,
|
|
1077
|
+
...i.options === void 0 ? {} : { options: i.options },
|
|
1078
|
+
metrics: {
|
|
1079
|
+
queueMs: o,
|
|
1080
|
+
roundTripMs: a
|
|
1081
|
+
}
|
|
1082
|
+
}), this.finishRun()) : (p || this.deliver({
|
|
1083
|
+
source: i.source,
|
|
1084
|
+
result: s,
|
|
1085
|
+
duration: G(n.ok ? n.duration : 0),
|
|
1086
|
+
mode: u,
|
|
1087
|
+
...n.ok && this.options.includeAuthorAnalysis && lt(n.analysis, i.source.length) ? { analysis: n.analysis } : {},
|
|
1088
|
+
...i.options === void 0 ? {} : { options: i.options },
|
|
1089
|
+
metrics: {
|
|
1090
|
+
queueMs: o,
|
|
1091
|
+
roundTripMs: a,
|
|
1092
|
+
...c > 0 ? { applyMs: c } : {},
|
|
1093
|
+
...n.ok && n.metrics ? { worker: n.metrics } : {}
|
|
1094
|
+
},
|
|
1095
|
+
...d === void 0 ? {} : { revision: d }
|
|
1096
|
+
}), this.finishRun());
|
|
1097
|
+
}
|
|
1098
|
+
applyResponsePatch(e, t) {
|
|
1099
|
+
let n = this.baseline;
|
|
1100
|
+
if (n === null || n.optionsKey !== e.optionsKey || !Number.isSafeInteger(t.revision) || t.revision <= n.revision || t.baseRevision !== n.revision || t.protocol !== "patch-v1") return null;
|
|
1101
|
+
let r = nt(n.result, t.patch);
|
|
1102
|
+
return r === null || !r.ok || r.document.source !== e.source ? null : (this.baseline = {
|
|
1103
|
+
source: e.source,
|
|
1104
|
+
optionsKey: e.optionsKey,
|
|
1105
|
+
revision: t.revision,
|
|
1106
|
+
result: r
|
|
1107
|
+
}, r);
|
|
1108
|
+
}
|
|
1109
|
+
recoverWithFullResult(e) {
|
|
1110
|
+
if (this.worker === null || (e.recovery ?? 0) >= 1) return !1;
|
|
1111
|
+
let t = this.queued;
|
|
1112
|
+
return t !== null && !Y(t, e) ? !1 : (t !== null && (this.queued = null, this.clearTimer()), this.resetProtocol(), this.compile({
|
|
1113
|
+
...e,
|
|
1114
|
+
recovery: (e.recovery ?? 0) + 1
|
|
1115
|
+
}), !0);
|
|
864
1116
|
}
|
|
865
1117
|
handleWorkerFailure(e) {
|
|
866
1118
|
if (this.disposed) return;
|
|
867
|
-
this.degrade(e);
|
|
1119
|
+
this.resetProtocol(), this.degrade(e);
|
|
868
1120
|
let t = this.inFlight;
|
|
869
|
-
this.inFlight = null, t && (this.queued === null ||
|
|
1121
|
+
this.inFlight = null, t && (this.queued === null || Y(this.queued, t.job)) && (this.queued !== null && (this.queued = null, this.clearTimer()), this.compileFallback(t.job)), this.finishRun();
|
|
870
1122
|
}
|
|
871
1123
|
degrade(e) {
|
|
872
1124
|
let t = this.worker;
|
|
@@ -878,11 +1130,19 @@ var Ue = class {
|
|
|
878
1130
|
this.options.onModeChange?.("fallback", e);
|
|
879
1131
|
}
|
|
880
1132
|
}
|
|
1133
|
+
resetProtocol() {
|
|
1134
|
+
this.baseline = null, this.patchState = "unknown";
|
|
1135
|
+
}
|
|
881
1136
|
finishRun() {
|
|
882
1137
|
this.disposed || (this.drain(), !this.disposed && this.setPending(this.timer !== null || this.inFlight !== null || this.queued !== null));
|
|
883
1138
|
}
|
|
884
1139
|
deliver(e) {
|
|
885
|
-
this.disposed
|
|
1140
|
+
if (this.disposed) return;
|
|
1141
|
+
let t = this.baseline !== null && this.baseline.result === e.result, n = this.options.shareResults === !0 || !t ? e.result : L(e.result);
|
|
1142
|
+
this.options.onResult({
|
|
1143
|
+
...e,
|
|
1144
|
+
result: n
|
|
1145
|
+
});
|
|
886
1146
|
}
|
|
887
1147
|
setPending(e) {
|
|
888
1148
|
this.pending !== e && (this.pending = e, this.options.onPendingChange?.(e));
|
|
@@ -891,7 +1151,14 @@ var Ue = class {
|
|
|
891
1151
|
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
892
1152
|
}
|
|
893
1153
|
};
|
|
894
|
-
function
|
|
1154
|
+
function _t(e, t, n) {
|
|
1155
|
+
let r = e;
|
|
1156
|
+
return typeof r.compileShared == "function" ? r.compileShared(t, n) : e.compile(t, n);
|
|
1157
|
+
}
|
|
1158
|
+
function Z(e) {
|
|
1159
|
+
return e.stats;
|
|
1160
|
+
}
|
|
1161
|
+
function Q(e, t, n) {
|
|
895
1162
|
try {
|
|
896
1163
|
e.postMessage({
|
|
897
1164
|
id: t,
|
|
@@ -900,218 +1167,236 @@ function We(e, t, n) {
|
|
|
900
1167
|
});
|
|
901
1168
|
} catch {}
|
|
902
1169
|
}
|
|
903
|
-
function
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1170
|
+
function vt(e, t, n, r, i) {
|
|
1171
|
+
try {
|
|
1172
|
+
e.postMessage({
|
|
1173
|
+
id: t,
|
|
1174
|
+
ok: !1,
|
|
1175
|
+
message: n,
|
|
1176
|
+
retryFull: !0,
|
|
1177
|
+
code: r,
|
|
1178
|
+
...i === void 0 ? {} : { revision: i }
|
|
1179
|
+
});
|
|
1180
|
+
} catch {}
|
|
1181
|
+
}
|
|
1182
|
+
function yt(e) {
|
|
1183
|
+
return !!e && typeof e == "object" && (e.control === "dispose" || e.control === "cancel-preparation");
|
|
1184
|
+
}
|
|
1185
|
+
function $(e) {
|
|
1186
|
+
if (!e || typeof e != "object") return !1;
|
|
1187
|
+
let t = e;
|
|
1188
|
+
return typeof t.from == "number" && Number.isSafeInteger(t.from) && typeof t.to == "number" && Number.isSafeInteger(t.to) && t.from >= 0 && t.to >= t.from && typeof t.insert == "string";
|
|
1189
|
+
}
|
|
1190
|
+
function bt(e, t = {}) {
|
|
1191
|
+
let n = e === void 0 ? globalThis : e;
|
|
1192
|
+
if (!n || typeof n.postMessage != "function") throw TypeError("startLocalCompileWorker requires a worker scope with postMessage");
|
|
1193
|
+
let r = t.createSession ? t.createSession() : T(), i = r, a = t.preparationDelay, o = typeof a == "number" && Number.isFinite(a) ? Math.max(0, a) : 200, s = typeof i.prepareAsync == "function", c = null, l = 0, u = !1, d = null, f = null, p = 0, m, h = () => {
|
|
1194
|
+
p += 1, f !== null && (f.aborted = !0, f = null), d !== null && (clearTimeout(d), d = null);
|
|
1195
|
+
}, g = () => new Promise((e) => {
|
|
1196
|
+
typeof setTimeout == "function" ? setTimeout(e, 0) : e();
|
|
1197
|
+
}), _ = async (e) => {
|
|
1198
|
+
if (u || e !== p) return;
|
|
1199
|
+
let t = i.prepareAsync;
|
|
1200
|
+
if (typeof t != "function") return;
|
|
1201
|
+
let n = { aborted: !1 };
|
|
1202
|
+
f = n;
|
|
1203
|
+
let r = W(), a = !1;
|
|
910
1204
|
try {
|
|
911
|
-
|
|
1205
|
+
a = await t.call(i, n, g);
|
|
1206
|
+
} catch {} finally {
|
|
1207
|
+
f === n && (f = null), a && !n.aborted && !u && e === p && (m = G(W() - r));
|
|
1208
|
+
}
|
|
1209
|
+
}, v = () => {
|
|
1210
|
+
if (u || !s) return;
|
|
1211
|
+
h();
|
|
1212
|
+
let e = p;
|
|
1213
|
+
d = setTimeout(() => {
|
|
1214
|
+
d = null, _(e);
|
|
1215
|
+
}, o);
|
|
1216
|
+
}, y = () => {
|
|
1217
|
+
if (!u) {
|
|
1218
|
+
u = !0, h();
|
|
912
1219
|
try {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1220
|
+
r.dispose();
|
|
1221
|
+
} catch {}
|
|
1222
|
+
n.onmessage = null;
|
|
1223
|
+
}
|
|
1224
|
+
}, b = (e) => ({
|
|
1225
|
+
compileMs: e,
|
|
1226
|
+
...m === void 0 ? {} : { preparationMs: m }
|
|
1227
|
+
}), x = (e) => {
|
|
1228
|
+
let t = typeof e == "number" && Number.isSafeInteger(e) && e > 0 ? e : null;
|
|
1229
|
+
return t === null ? l + 1 : t > l ? t : l + 1;
|
|
1230
|
+
}, S = (e, t, i, a, o = !1, s) => {
|
|
1231
|
+
let l = c;
|
|
1232
|
+
if (l === null) return !1;
|
|
1233
|
+
let u = G(i), d = s === void 0 ? b(u) : {
|
|
1234
|
+
...b(u),
|
|
1235
|
+
...s
|
|
1236
|
+
};
|
|
1237
|
+
try {
|
|
1238
|
+
let i = a ? {
|
|
1239
|
+
id: e,
|
|
1240
|
+
ok: !0,
|
|
1241
|
+
result: l.result,
|
|
1242
|
+
duration: u,
|
|
1243
|
+
incremental: Z(r),
|
|
1244
|
+
protocol: A,
|
|
1245
|
+
revision: t,
|
|
1246
|
+
metrics: d
|
|
1247
|
+
} : {
|
|
1248
|
+
id: e,
|
|
1249
|
+
ok: !0,
|
|
1250
|
+
result: l.result,
|
|
1251
|
+
duration: u,
|
|
1252
|
+
incremental: Z(r)
|
|
1253
|
+
};
|
|
1254
|
+
if (o && i.ok) {
|
|
1255
|
+
let e = W();
|
|
1256
|
+
i.analysis = K(l.source, l.options, l.result), i.metrics = {
|
|
1257
|
+
...i.metrics,
|
|
1258
|
+
analysisMs: G(W() - e)
|
|
1259
|
+
};
|
|
921
1260
|
}
|
|
922
|
-
|
|
923
|
-
|
|
1261
|
+
if (l.deep && l.flatResults && i.ok) {
|
|
1262
|
+
let { result: e, ...t } = i, r = {
|
|
1263
|
+
...t,
|
|
1264
|
+
flatResult: it(e)
|
|
1265
|
+
};
|
|
1266
|
+
n.postMessage(r);
|
|
1267
|
+
} else n.postMessage(i);
|
|
1268
|
+
return !0;
|
|
1269
|
+
} catch (t) {
|
|
1270
|
+
return Q(n, e, `Could not return the compile result: ${U(t)}`), !1;
|
|
924
1271
|
}
|
|
925
1272
|
};
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
return t && (n = n.replace(/"/g, """).replace(/'/g, "'")), n;
|
|
932
|
-
}
|
|
933
|
-
function et(e) {
|
|
934
|
-
return e.replace(/<\/style/gi, "<\\/style");
|
|
935
|
-
}
|
|
936
|
-
function tt(e) {
|
|
937
|
-
return e.replace(/<\/script/gi, "<\\/script").replace(/<!--/g, "<\\!--");
|
|
938
|
-
}
|
|
939
|
-
function Z(e) {
|
|
940
|
-
return X(e, !0);
|
|
941
|
-
}
|
|
942
|
-
function nt(e) {
|
|
943
|
-
let t = JSON.stringify(e);
|
|
944
|
-
if (typeof t != "string") throw TypeError("Cannot serialize a non-JSON value for an inline script.");
|
|
945
|
-
return t.replace(/[<>&\u2028\u2029]/g, (e) => {
|
|
946
|
-
switch (e) {
|
|
947
|
-
case "<": return "\\u003c";
|
|
948
|
-
case ">": return "\\u003e";
|
|
949
|
-
case "&": return "\\u0026";
|
|
950
|
-
case "\u2028": return "\\u2028";
|
|
951
|
-
default: return "\\u2029";
|
|
1273
|
+
return n.onmessage = (e) => {
|
|
1274
|
+
let t = e?.data;
|
|
1275
|
+
if (yt(t)) {
|
|
1276
|
+
t.control === "dispose" ? y() : h();
|
|
1277
|
+
return;
|
|
952
1278
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
for (let r of t.childNodes) {
|
|
976
|
-
if (e.isElementNode(r)) {
|
|
977
|
-
let t = r.tagName.toLowerCase();
|
|
978
|
-
if (t === "script") continue;
|
|
979
|
-
it(t === "template" ? e.getTemplateContent(r) : r);
|
|
1279
|
+
if (!t || typeof t.id != "number") return;
|
|
1280
|
+
if (typeof t.source == "string") {
|
|
1281
|
+
h();
|
|
1282
|
+
let e = t, i = q(e.options), a = J(i), o = e.protocol === A, s = x(e.revision), u = W();
|
|
1283
|
+
try {
|
|
1284
|
+
if (c !== null && c.optionsKey !== a) try {
|
|
1285
|
+
r.clear();
|
|
1286
|
+
} catch {}
|
|
1287
|
+
let t = _t(r, e.source, i), n = G(W() - u);
|
|
1288
|
+
l = s, c = {
|
|
1289
|
+
source: e.source,
|
|
1290
|
+
revision: s,
|
|
1291
|
+
options: i,
|
|
1292
|
+
optionsKey: a,
|
|
1293
|
+
result: t,
|
|
1294
|
+
deep: rt(t),
|
|
1295
|
+
flatResults: e.flatResults === H
|
|
1296
|
+
}, S(e.id, s, n, o, e.includeAuthorAnalysis === !0) && v();
|
|
1297
|
+
} catch (t) {
|
|
1298
|
+
Q(n, e.id, U(t));
|
|
1299
|
+
}
|
|
1300
|
+
return;
|
|
980
1301
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
let e = a.attrs.filter((e) => {
|
|
990
|
-
let t = e.name.toLowerCase();
|
|
991
|
-
return t !== "srcdoc" && t !== "sandbox";
|
|
992
|
-
});
|
|
993
|
-
e.push({
|
|
994
|
-
name: "srcdoc",
|
|
995
|
-
value: n
|
|
996
|
-
}), e.push({
|
|
997
|
-
name: "sandbox",
|
|
998
|
-
value: r
|
|
999
|
-
}), a.attrs = e, i = !0;
|
|
1302
|
+
if (t.protocol !== "patch-v1") return;
|
|
1303
|
+
h();
|
|
1304
|
+
let i = t, a = c, o = (e, t) => {
|
|
1305
|
+
vt(n, i.id, e, t, a?.revision);
|
|
1306
|
+
};
|
|
1307
|
+
if (a === null) {
|
|
1308
|
+
o("No complete compile is available to patch", "stale-base");
|
|
1309
|
+
return;
|
|
1000
1310
|
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1311
|
+
if (typeof i.baseRevision != "number" || i.baseRevision !== a.revision) {
|
|
1312
|
+
o("The requested base revision is not current", "stale-base");
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
if (i.optionsKey !== void 0 && i.optionsKey !== a.optionsKey) {
|
|
1316
|
+
o("The options signature changed since the baseline", "options-mismatch");
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
if (!$(i.edit)) {
|
|
1320
|
+
o("The source edit is invalid", "invalid-edit");
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1323
|
+
let s = i.edit;
|
|
1324
|
+
if (s.to > a.source.length) {
|
|
1325
|
+
o("The source edit does not fit the baseline", "invalid-edit");
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1328
|
+
let u = a.source.slice(0, s.from) + s.insert + a.source.slice(s.to);
|
|
1329
|
+
if (typeof i.targetLength == "number" && u.length !== i.targetLength) {
|
|
1330
|
+
o("The source edit produced an unexpected length", "invalid-edit");
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
let d = x(i.revision), f = W();
|
|
1334
|
+
try {
|
|
1335
|
+
let e = _t(r, u, a.options), t = G(W() - f), o = a.revision, s = a.result;
|
|
1336
|
+
l = d, c = {
|
|
1337
|
+
source: u,
|
|
1338
|
+
revision: d,
|
|
1339
|
+
options: a.options,
|
|
1340
|
+
optionsKey: a.optionsKey,
|
|
1341
|
+
result: e,
|
|
1342
|
+
deep: rt(e),
|
|
1343
|
+
flatResults: a.flatResults
|
|
1344
|
+
};
|
|
1345
|
+
let p = null, h = 0;
|
|
1346
|
+
if (e.ok && s.ok && !c.deep && !a.deep) {
|
|
1347
|
+
let t = W();
|
|
1348
|
+
p = Xe(s, e), h = G(W() - t);
|
|
1349
|
+
}
|
|
1350
|
+
let g = p?.patch ?? null;
|
|
1351
|
+
if (g === null) {
|
|
1352
|
+
S(i.id, d, t, !0, i.includeAuthorAnalysis === !0) && v();
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
if (p !== null && p.cost.preferFull) {
|
|
1356
|
+
let e = p.cost, n = {
|
|
1357
|
+
patchEncodeMs: h,
|
|
1358
|
+
patchFallback: "cost",
|
|
1359
|
+
patchBytes: e.patchBytes,
|
|
1360
|
+
...e.fullBytes === void 0 ? {} : { fullBytes: e.fullBytes }
|
|
1361
|
+
};
|
|
1362
|
+
S(i.id, d, t, !0, i.includeAuthorAnalysis === !0, n) && v();
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
let _ = {
|
|
1366
|
+
compileMs: t,
|
|
1367
|
+
patchEncodeMs: h,
|
|
1368
|
+
patchNodes: g.document.nodes?.length ?? 0,
|
|
1369
|
+
...m === void 0 ? {} : { preparationMs: m }
|
|
1370
|
+
};
|
|
1371
|
+
try {
|
|
1372
|
+
let s = {
|
|
1373
|
+
id: i.id,
|
|
1374
|
+
ok: !0,
|
|
1375
|
+
protocol: A,
|
|
1376
|
+
baseRevision: o,
|
|
1377
|
+
revision: d,
|
|
1378
|
+
patch: g,
|
|
1379
|
+
duration: t,
|
|
1380
|
+
incremental: Z(r),
|
|
1381
|
+
metrics: _
|
|
1382
|
+
};
|
|
1383
|
+
if (i.includeAuthorAnalysis === !0) {
|
|
1384
|
+
let t = W();
|
|
1385
|
+
s.analysis = K(u, a.options, e), _.analysisMs = G(W() - t);
|
|
1386
|
+
}
|
|
1387
|
+
n.postMessage(s), v();
|
|
1388
|
+
} catch (e) {
|
|
1389
|
+
Q(n, i.id, `Could not return the compile result: ${U(e)}`);
|
|
1390
|
+
}
|
|
1391
|
+
} catch (e) {
|
|
1392
|
+
Q(n, i.id, U(e));
|
|
1393
|
+
}
|
|
1394
|
+
}, {
|
|
1395
|
+
dispose: y,
|
|
1396
|
+
cancelPreparation: h,
|
|
1397
|
+
get disposed() {
|
|
1398
|
+
return u;
|
|
1053
1399
|
}
|
|
1054
1400
|
};
|
|
1055
1401
|
}
|
|
1056
|
-
|
|
1057
|
-
function dt(e) {
|
|
1058
|
-
let t = e.targetId ?? "reactive-md-document";
|
|
1059
|
-
if (!qe.test(t)) throw TypeError("targetId must start with a letter and contain only letters, digits, underscores or hyphens.");
|
|
1060
|
-
let n = e.mode === "static" ? "static" : "interactive";
|
|
1061
|
-
if (!e.staticMarkup.trim()) throw TypeError("createShareableHtml requires rendered document markup.");
|
|
1062
|
-
if (!e.css.trim()) throw TypeError("createShareableHtml requires the document stylesheet.");
|
|
1063
|
-
if (e.state.sourceDigest !== A(e.source)) throw Error("The state file does not belong to the exported source.");
|
|
1064
|
-
if (n === "interactive" && !e.runtimeScript?.trim()) throw TypeError("Interactive HTML requires the standalone runtime script.");
|
|
1065
|
-
let r = rt(e.compileOptions), i = _(r);
|
|
1066
|
-
if (!i.ok) throw TypeError(`createShareableHtml received invalid compileOptions: ${i.message}`);
|
|
1067
|
-
let a = i.htmlActive, o = e.staticMarkup;
|
|
1068
|
-
if (a && (n === "static" || !i.html.enableJavaScript)) {
|
|
1069
|
-
let t = {
|
|
1070
|
-
enableCss: i.html.enableCss,
|
|
1071
|
-
enableJavaScript: !1,
|
|
1072
|
-
enableExtendedHtml: i.html.enableExtendedHtml
|
|
1073
|
-
}, n = te(e.source, t, i.maxSyntaxNodes);
|
|
1074
|
-
if (!n.markup) throw Error("The native HTML document could not be regenerated without author JavaScript.");
|
|
1075
|
-
o = ot(e.staticMarkup, n.markup, ee(t));
|
|
1076
|
-
}
|
|
1077
|
-
let s = e.locale === "zh" ? "zh" : "en", c = s === "zh" ? "zh-CN" : "en", l = e.colorScheme === "light" || e.colorScheme === "dark" ? e.colorScheme : "auto", u = e.assets === "omit" ? "omit" : "inline", d = e.generator ?? {
|
|
1078
|
-
name: "reactive-md",
|
|
1079
|
-
version: "unknown"
|
|
1080
|
-
}, f = ct(e.images), p = Number.isSafeInteger(e.imageCount) && (e.imageCount ?? 0) > 0 ? String(e.imageCount) : String(Object.keys(f ?? {}).length), m = n === "interactive", h = {
|
|
1081
|
-
version: 1,
|
|
1082
|
-
target: t,
|
|
1083
|
-
source: e.source,
|
|
1084
|
-
state: e.state,
|
|
1085
|
-
locale: s,
|
|
1086
|
-
colorScheme: l,
|
|
1087
|
-
hydrate: !0,
|
|
1088
|
-
...r === void 0 ? {} : { compileOptions: r },
|
|
1089
|
-
...f ? { images: f } : {}
|
|
1090
|
-
}, g = st(m, a ? i.html : void 0), v = m ? `<script type="application/reactive-md+json" data-reactive-md-auto>${nt(h)}<\/script>
|
|
1091
|
-
<script>${tt(e.runtimeScript)}<\/script>` : "", y = e.notices?.trim() ? `<template id="reactive-md-notices"><pre>${X(e.notices)}</pre></template>` : "";
|
|
1092
|
-
return `<!doctype html>
|
|
1093
|
-
<html lang="${X(Je.test(c) ? c : "en", !0)}">
|
|
1094
|
-
<head>
|
|
1095
|
-
<meta charset="utf-8">
|
|
1096
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1097
|
-
<meta name="referrer" content="no-referrer">
|
|
1098
|
-
<meta http-equiv="Content-Security-Policy" content="${Z(g)}">
|
|
1099
|
-
<meta name="generator" content="${Z(`${d.name} ${d.version}`)}">
|
|
1100
|
-
<meta name="reactive-md-html-format" content="${Ke}">
|
|
1101
|
-
<meta name="reactive-md-syntax" content="${Z(e.state.syntax)}">
|
|
1102
|
-
<meta name="reactive-md-output" content="${n}">
|
|
1103
|
-
<meta name="reactive-md-state" content="${Z(e.state.sourceDigest)}">
|
|
1104
|
-
<meta name="reactive-md-images" content="${u}">
|
|
1105
|
-
<meta name="reactive-md-image-count" content="${p}">
|
|
1106
|
-
<title>${X(e.title || "Reactive MD document")}</title>
|
|
1107
|
-
<style>${et(e.css)}${ut}</style>
|
|
1108
|
-
</head>
|
|
1109
|
-
<body class="reactive-md-export">
|
|
1110
|
-
<div id="${t}" class="reactive-md-export-root">${o}</div>
|
|
1111
|
-
${v}
|
|
1112
|
-
${y}
|
|
1113
|
-
</body>
|
|
1114
|
-
</html>
|
|
1115
|
-
`;
|
|
1116
|
-
}
|
|
1117
|
-
export { c as DEFAULT_LOCAL_THEME, Re as LOCAL_COMPILE_DELAY_MS, ne as LOCAL_DIAGNOSTIC_CODES, C as LOCAL_STATE_FORMAT, r as LOCAL_SYNTAX_VERSION, ie as LOCAL_THEME_PROTOCOL, Ue as LocalCompileScheduler, o as LocalExpressionError, Ke as SHAREABLE_HTML_FORMAT, le as analyzeLocalSource, U as applyLocalState, Le as applyLocalStateRetention, _e as checkLocalUpgrade, s as compileExpression, Y as compileFailureDiagnostic, n as compileLatex, x as compileLocal, se as completeLocalSource, v as countLocalCodePoints, ue as createLocalRuntime, L as createLocalStateFile, dt as createShareableHtml, ke as exportLocalState, l as formatLocalDiagnostic, ce as formatLocalSource, Ae as importLocalState, he as inspectLocalSourceVersion, y as isLocalDiagnosticCode, ae as isLocalThemeName, b as localCompileOptionsKey, d as localDiagnosticTemplate, g as localDiagnosticTemplateKeys, A as localSourceDigest, ve as migrateLocalSource, R as parseLocalState, Fe as planLocalStateRetention, oe as renameLocalBinding, H as resolveLocalState, lt as resolveLocalStateBaseline, u as resolveLocalTheme, t as samplePlot, nt as serializeForScript, je as serializeLocalState, Ge as startLocalCompileWorker };
|
|
1402
|
+
export { y as DEFAULT_LOCAL_THEME, ot as LOCAL_COMPILE_DELAY_MS, st as LOCAL_COMPILE_PREPARATION_DELAY_MS, o as LOCAL_DIAGNOSTIC_CODES, A as LOCAL_RESULT_PATCH_PROTOCOL, ge as LOCAL_STATE_FORMAT, _ as LOCAL_SYNTAX_VERSION, x as LOCAL_THEME_PROTOCOL, gt as LocalCompileScheduler, ie as LocalCompileSession, p as LocalExpressionError, we as SHAREABLE_HTML_FORMAT, xe as SHAREABLE_HTML_FORMAT_V2, w as analyzeLocalSource, nt as applyLocalResultPatch, Se as applyLocalState, le as applyLocalStateRetention, Le as applySourceEdit, Ne as checkLocalUpgrade, m as compileExpression, X as compileFailureDiagnostic, n as compileLatex, ee as compileLocal, t as compilePlotFormula, ne as completeLocalSource, g as countLocalCodePoints, T as createLocalCompileSession, fe as createLocalRuntime, be as createLocalStateFile, Ce as createShareableHtml, R as diffSourceEdit, Ye as encodeLocalResultPatch, ve as exportLocalState, c as formatLocalDiagnostic, re as formatLocalSource, e as implicitGridSize, _e as importLocalState, je as inspectLocalSourceVersion, f as isLocalDiagnosticCode, s as isLocalThemeName, S as localCompileOptionsKey, d as localDiagnosticTemplate, l as localDiagnosticTemplateKeys, pe as localSourceDigest, J as localWorkerOptionsKey, Pe as migrateLocalSource, ue as notifyLocalRuntime, me as parseLocalState, ce as planLocalStateRetention, i as plotFormulaKind, te as renameLocalBinding, De as resolveLocalComponentStateExport, Te as resolveLocalState, ye as resolveLocalStateBaseline, v as resolveLocalTheme, se as sampleImplicit, ae as sampleParametric, oe as samplePlot, he as serializeForScript, Ee as serializeLocalState, bt as startLocalCompileWorker, de as updateLocalRuntime };
|