@tea-agent/loop-agent 0.39.0-next.9 → 0.39.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/AGENTS.md +4 -1
- package/CHANGELOG.md +262 -69
- package/README.md +11 -5
- package/bin/loop-agent.js +7 -3
- package/dist/application/dag/generate-task-dag.js +9 -0
- package/dist/application/task-lifecycle/advance.js +4 -0
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +16 -5
- package/dist/cli/program.js +16 -2
- package/dist/cli/update/notifier.js +2 -2
- package/dist/cli.js +2 -1
- package/dist/commands/dag-rerun.js +55 -1
- package/dist/commands/init-model-catalog.js +464 -0
- package/dist/commands/init-upgrade.js +265 -97
- package/dist/commands/init.js +428 -27
- package/dist/commands/inspect-next.js +8 -0
- package/dist/commands/task-advance.js +31 -0
- package/dist/executors/dag-pi-executor.js +124 -18
- package/dist/executors/pi-event-serializer.js +42 -1
- package/dist/executors/pi-executor.js +51 -0
- package/dist/executors/pi-extension-resolver.js +233 -0
- package/dist/executors/pi-playwright-cli-tool.js +74 -28
- package/dist/executors/pi-sdk-executor.js +187 -59
- package/dist/executors/shell-executor.js +554 -33
- package/dist/executors/shell-write-guard.js +7 -0
- package/dist/shared/dag-failure-category.js +138 -0
- package/dist/shared/dag-prompt-override.js +28 -0
- package/dist/shared/operator/capabilities.js +181 -27
- package/dist/shared/playwright-cli-command-policy.js +15 -0
- package/dist/shared/update/console-notifier.js +100 -0
- package/dist/{cli → shared}/update/npm-client.js +41 -8
- package/dist/{cli → shared}/update/state.js +41 -13
- package/dist/task/config-types.js +28 -0
- package/dist/task/contract/constants.js +1 -0
- package/dist/task/contract/diff.js +26 -0
- package/dist/task/contract/project.js +5 -0
- package/dist/task/contract/schema.js +6 -1
- package/dist/task/source-prepare/build-draft.js +15 -0
- package/dist/task/source-prepare/parse-intent.js +24 -4
- package/dist/worker/cli.js +31 -1
- package/dist/worker/console/chat/deferred-turn.js +91 -0
- package/dist/worker/console/chat/mcp-inventory.js +221 -0
- package/dist/worker/console/chat/operation-card.js +8 -1
- package/dist/worker/console/chat/pi-console-config.js +81 -10
- package/dist/worker/console/chat/pi-runtime.js +165 -83
- package/dist/worker/console/chat/repo-walk.js +10 -1
- package/dist/worker/console/chat/routes.js +480 -55
- package/dist/worker/console/chat/semantic-activity.js +20 -8
- package/dist/worker/console/chat/session-store.js +146 -2
- package/dist/worker/console/chat/turn-process.js +10 -10
- package/dist/worker/console/dag-execution-receipt.js +33 -0
- package/dist/worker/console/inspect-split.js +18 -0
- package/dist/worker/console/operation-run-facts.js +19 -3
- package/dist/worker/console/operator-actions.js +195 -4
- package/dist/worker/console/operator-user-error.js +2 -2
- package/dist/worker/console/pi-readiness.js +5 -4
- package/dist/worker/console/recovery-cta.js +4 -4
- package/dist/worker/console/recovery-error-copy.js +4 -4
- package/dist/worker/console/routes.js +43 -2
- package/dist/worker/console/security.js +63 -9
- package/dist/worker/console/server.js +42 -6
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-BLXFe4qI.js → abnfDiagram-N423BO3Z-Br92EGb7.js} +1 -1
- package/dist/worker/console/static/assets/{arc-7iOJeqho.js → arc-oulImtQq.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-CYoyj5K7.js → architectureDiagram-T3A2C74G-tyHc6aqO.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-fK01JNlR.js → blockDiagram-VBNYF7ZC-CY86BSpT.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-bzbw5D_Z.js → c4Diagram-5PPSVZJV-BKKsDmNs.js} +1 -1
- package/dist/worker/console/static/assets/channel-TY36zt-i.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Cf6hJFFG.js → chunk-2GRJ4B5K-CXZdjl3B.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-DSFXR-et.js → chunk-2Q5K7J3B-B-aIFDQ5.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-BagJechl.js → chunk-5RXB4S5H-BDgAW_B2.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-E7QNMFaW.js → chunk-5VM5RSS4-DABa4UPR.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-BG_eOBrC.js → chunk-6Q2QTUOP-aGbysVOx.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-Bo42dqol.js → chunk-GF5L2VYU-B8MSZDVs.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-dibM-87v.js → chunk-JWPE2WC7-CpelV73g.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-Bytrp3Oe.js → chunk-KBJHAD2P-BE04ty3z.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DBABILrr.js → chunk-RYQCIY6F-BUxTkaaR.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-DCUk5Pf9.js → chunk-XXDRQBXY-CYYBVKfX.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-Dk7QCChM.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-Dk7QCChM.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-BlGE9v6E.js → cose-bilkent-JH36ORCC-CEQF_xmQ.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-DGl5ewph.js → cynefin-VYW2F7L2-CqpxN5IT.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-DsJ_SVH_.js → cynefinDiagram-MW4NZA55-B3PzanVi.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BIhjFdzv.js → dagre-VZM6K2ZE-BSUGCNx1.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-Dmy1ctTb.js → diagram-7IWD3JNH-CdLevU5T.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-DYCtWUF3.js → diagram-B4RE2ZJO-BjpF_Kok.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-BMZFHVd2.js → diagram-LBJQPF4R-C4I6NJny.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-b_U8gfaO.js → diagram-Q27KOJAE-C8hecCr5.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-Dzy_bn-I.js → diagram-UB23O5K3-Daod6tOS.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-DJCiMNEI.js → ebnfDiagram-BXEA7PRR-BvvmazGv.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-28lD016B.js → erDiagram-JOGREHBK-DeN_vfV4.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-DGyHJmIw.js → flowDiagram-UKHOOZJN-D6dq1t9z.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-CzdwUjrO.js → ganttDiagram-PKOTCBZU-DziIdNY4.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-D9bGwuo8.js → gitGraphDiagram-DS77QQ5N-Dy4s5CXr.js} +1 -1
- package/dist/worker/console/static/assets/index-C3GgHg-g.css +1 -0
- package/dist/worker/console/static/assets/index-Ci8ksvBm.js +406 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-LJgJUQFC.js → infoDiagram-6WML65LV-Czv5eYx2.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-98LaB8zb.js → ishikawaDiagram-WSZJBQD7-Bsk3nFRT.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-D-ISzwlQ.js → journeyDiagram-NVQOT4AX-DxGmNj5K.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-gfYOI-EL.js → kanban-definition-27J2QSJJ-CYCFqkO_.js} +1 -1
- package/dist/worker/console/static/assets/{linear-CyntZgKV.js → linear-B0YzRwrd.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-BBOR7dg0.js → mermaid.core-t3EZtIGh.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-CQAgwPMk.js → mindmap-definition-FAOFIHXS-BTXpTv0T.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-DkMiZFuV.js → pegDiagram-VL7TDLO6-DU8UkKqA.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-DLNXa_0J.js → pieDiagram-7S7Q4E2Y-DP4y8ohp.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-Dc7bdzjm.js → quadrantDiagram-CIZ2JOQS-B07vNaYR.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-BxMB0QqW.js → railroadDiagram-AXF67PYL-xDWktb2i.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-FjumoKn4.js → requirementDiagram-LRYGKXZP-BLNMKqeS.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-CkhKc_E3.js → sankeyDiagram-W5VNT64P-n0adalxH.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DoBWqTTH.js → sequenceDiagram-SI44F4Z6-BbnS-2DL.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-CQeh_YeE.js → sizeCapture-X5ZJPWSS-B4uPpCLu.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-LuHmFW-I.js → stateDiagram-OKZ733FA--MMbB0fX.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BqOigMQ4.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-CHwbDctY.js → swimlanes-SLNWSIFB-BXUgp2QY.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Caxz9UA2.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CoMngk0X.js → timeline-definition-Z64GVDOM-CsaMxki7.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-CURYbtbO.js → vennDiagram-T6HMQDX7-C2IuG9iH.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BdqSECjU.js → wardleyDiagram-T6FBY63Y-CmEWOXCW.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-DbMUYuAg.js → xychartDiagram-ELKLHX3M-D_9LE0MG.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/app/useOperatorActions.js +1 -1
- package/dist/worker/console/static-src/app/useRecoveryActions.js +2 -2
- package/dist/worker/console/static-src/app/useRecoveryConsole.js +38 -2
- package/dist/worker/console/static-src/app/useRunProgress.js +46 -0
- package/dist/worker/console/static-src/operator-chat/cards/failure-category-advice.js +25 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +74 -26
- package/dist/worker/console/static-src/operator-chat/input-history.js +76 -0
- package/dist/worker/console/static-src/operator-chat/mutation-gate.js +1 -1
- package/dist/worker/console/static-src/operator-chat/open-preview-in-browser.js +328 -0
- package/dist/worker/console/static-src/operator-chat/resource-diagnostics.js +204 -0
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +8 -1
- package/dist/worker/console/static-src/operator-chat/turn-submission.js +54 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +3 -0
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +237 -11
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +50 -22
- package/dist/worker/console/static-src/operator-chat/useComposer.js +32 -0
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +26 -1
- package/dist/worker/console/static-src/pages/tasks/run-id-resolution.js +79 -0
- package/dist/worker/console/static-src/pages/tasks/run-ownership-verify.js +23 -0
- package/dist/worker/console/static-src/pages/tasks/run-panel-progress.js +110 -0
- package/dist/worker/loop-agent/loop-agent-client.js +7 -3
- package/dist/worker/materialize/harness-task-lineage.js +5 -2
- package/dist/worker/observability/read-model.js +22 -0
- package/dist/worker/observe/node-input.js +74 -3
- package/dist/worker/observe/node-process.js +377 -0
- package/dist/worker/observe/routes.js +36 -3
- package/dist/worker/observe/shell-handler-keys.js +34 -0
- package/dist/worker/observe/static/api.js +66 -0
- package/dist/worker/observe/static/constants.js +8 -1
- package/dist/worker/observe/static/dag-history-labels.js +4 -0
- package/dist/worker/observe/static/format.js +23 -0
- package/dist/worker/observe/static/markdown-render.js +20 -1
- package/dist/worker/observe/static/operator-chrome.js +4 -0
- package/dist/worker/observe/static/state.js +13 -2
- package/dist/worker/observe/static/styles.css +73 -0
- package/dist/worker/observe/static/views/dag-inspector.js +612 -8
- package/dist/worker/observe/static/views/dag.js +8 -1
- package/dist/worker/observe/static/views/failures.js +5 -2
- package/dist/worker/observe/static/views/session-timeline.js +78 -9
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +827 -53
- package/dist/workflows/dag/backend-test-case-manifest.js +4 -0
- package/dist/workflows/dag/backend-test-execution-contract.js +18 -9
- package/dist/workflows/dag/backend-test-gap-fill.js +205 -0
- package/dist/workflows/dag/backend-test-intake-context.js +32 -0
- package/dist/workflows/dag/backend-test-layout.js +133 -0
- package/dist/workflows/dag/backend-test-markdown-workflow.js +167 -32
- package/dist/workflows/dag/backend-test-module-stem.js +5 -0
- package/dist/workflows/dag/backend-test-pytest-collection.js +368 -33
- package/dist/workflows/dag/backend-test-result-contract.js +1 -1
- package/dist/workflows/dag/backend-test-scenario-param.js +884 -140
- package/dist/workflows/dag/backend-test-scenario-partitions.js +321 -0
- package/dist/workflows/dag/backend-test-writer-completeness.js +100 -56
- package/dist/workflows/dag/contract-output-registry.js +15 -0
- package/dist/workflows/dag/contract-validator-registrations.js +3 -1
- package/dist/workflows/dag/convergence/controller.js +141 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +1 -1
- package/dist/workflows/dag/dynamic-runtime/map.js +25 -9
- package/dist/workflows/dag/dynamic-runtime/shared.js +1 -1
- package/dist/workflows/dag/failure-category.js +7 -116
- package/dist/workflows/dag/frontend-implementation-contract.js +377 -4
- package/dist/workflows/dag/frontend-prewrite-gate.js +96 -84
- package/dist/workflows/dag/frontend-repair.js +14 -0
- package/dist/workflows/dag/frontend-risk.js +15 -2
- package/dist/workflows/dag/frontend-test-case-checklist.js +30 -4
- package/dist/workflows/dag/frontend-test-case-manifest.js +11 -4
- package/dist/workflows/dag/frontend-test-case-quality.js +11 -16
- package/dist/workflows/dag/frontend-test-environment-probe.js +230 -0
- package/dist/workflows/dag/frontend-test-html-report.js +3 -1
- package/dist/workflows/dag/frontend-test-l5-report.js +3 -1
- package/dist/workflows/dag/frontend-test-layout.js +159 -0
- package/dist/workflows/dag/frontend-test-markdown.js +61 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +188 -42
- package/dist/workflows/dag/frontend-test-standard-scenarios.js +70 -0
- package/dist/workflows/dag/frontend-verification-trace.js +29 -4
- package/dist/workflows/dag/init-hybrid.js +894 -205
- package/dist/workflows/dag/node-execution.js +183 -15
- package/dist/workflows/dag/prompt.js +60 -1
- package/dist/workflows/dag/rerun-feedback.js +212 -0
- package/dist/workflows/dag/rerun-plan.js +224 -27
- package/dist/workflows/dag/rerun-run.js +61 -6
- package/dist/workflows/dag/rerun-task.js +61 -2
- package/dist/workflows/dag/retry-policy.js +109 -0
- package/dist/workflows/dag/structured-output-repair.js +712 -0
- package/dist/workflows/dag/types.js +143 -1
- package/dist/workflows/dag/validate.js +64 -20
- package/docs/init-surface.manifest.json +5 -0
- package/docs/operations/README.md +1 -1
- package/docs/operations/local-development-environment.md +1 -5
- package/docs/skills/vetted-skill-registry.md +14 -0
- package/docs/templates/README.md +1 -1
- package/docs/templates/agent-dag.schema.json +44 -0
- package/docs/templates/backend-test-dag.json +60 -35
- package/docs/templates/frontend-test-case-checklist.md +2 -2
- package/docs/templates/frontend-test-dag.json +8 -10
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +1 -1
- package/docs/templates/init-managed-agents.md +13 -3
- package/harness.json +6 -4
- package/package.json +12 -4
- package/scripts/next-info.mjs +356 -0
- package/scripts/next-publish-gate.mjs +238 -0
- package/scripts/release-source-binding.mjs +251 -0
- package/skills/analyze-product-requirements/SKILL.md +8 -5
- package/skills/analyze-product-requirements/references/acceptance-criteria.md +1 -1
- package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +10 -6
- package/skills/analyze-product-requirements/references/example.md +50 -0
- package/skills/analyze-product-requirements/references/forward-test-cases.md +11 -7
- package/skills/analyze-product-requirements/references/kb-integration.md +5 -5
- package/skills/analyze-product-requirements/references/product-analysis-schema.md +8 -4
- package/skills/analyze-product-requirements/references/product-requirement-schema.md +2 -2
- package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +1 -1
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +11 -1
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +20 -1
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +9 -0
- package/skills/codebase-scout/SKILL.md +1 -1
- package/skills/fe-test-ui-scout/SKILL.md +65 -0
- package/skills/fe-test-ui-scout/references/ledger-schema.md +62 -0
- package/skills/fe-test-ui-scout/references/recon-protocol.md +54 -0
- package/skills/frontend-implementation/references/node-contracts.md +2 -2
- package/skills/improve-codebase-architecture/SKILL.md +81 -0
- package/skills/improve-codebase-architecture/deepening.md +37 -0
- package/skills/improve-codebase-architecture/html-report.md +123 -0
- package/skills/improve-codebase-architecture/interface-design.md +44 -0
- package/skills/improve-codebase-architecture/language.md +53 -0
- package/skills/loop-agent/references/command-reference.md +11 -4
- package/skills/playwright-cli/SKILL.md +23 -1
- package/skills/playwright-cli-case-generator/SKILL.md +29 -8
- package/dist/worker/console/static/assets/channel-BBOTJHvD.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-Cm8Yf8tD.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-Cm8Yf8tD.js +0 -1
- package/dist/worker/console/static/assets/index-B-qWGThd.js +0 -325
- package/dist/worker/console/static/assets/index-C-xRgY_0.css +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DZihfdKc.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CKnXCjHX.js +0 -8
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hf={exports:{}},lo={};var lv;function s8(){if(lv)return lo;lv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:l}}return lo.Fragment=t,lo.jsx=n,lo.jsxs=n,lo}var ov;function l8(){return ov||(ov=1,hf.exports=s8()),hf.exports}var f=l8(),pf={exports:{}},pt={};var cv;function o8(){if(cv)return pt;cv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),y=Symbol.iterator;function x(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,R={};function C(U,q,A){this.props=U,this.context=q,this.refs=R,this.updater=A||k}C.prototype.isReactComponent={},C.prototype.setState=function(U,q){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,q,"setState")},C.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function _(){}_.prototype=C.prototype;function I(U,q,A){this.props=U,this.context=q,this.refs=R,this.updater=A||k}var G=I.prototype=new _;G.constructor=I,T(G,C.prototype),G.isPureReactComponent=!0;var D=Array.isArray;function M(){}var B={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function $(U,q,A){var ae=A.ref;return{$$typeof:e,type:U,key:q,ref:ae!==void 0?ae:null,props:A}}function j(U,q){return $(U.type,q,U.props)}function F(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function H(U){var q={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(A){return q[A]})}var ne=/\/+/g;function V(U,q){return typeof U=="object"&&U!==null&&U.key!=null?H(""+U.key):q.toString(36)}function Y(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(q){U.status==="pending"&&(U.status="fulfilled",U.value=q)},function(q){U.status==="pending"&&(U.status="rejected",U.reason=q)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function K(U,q,A,ae,pe){var te=typeof U;(te==="undefined"||te==="boolean")&&(U=null);var ee=!1;if(U===null)ee=!0;else switch(te){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(U.$$typeof){case e:case t:ee=!0;break;case p:return ee=U._init,K(ee(U._payload),q,A,ae,pe)}}if(ee)return pe=pe(U),ee=ae===""?"."+V(U,0):ae,D(pe)?(A="",ee!=null&&(A=ee.replace(ne,"$&/")+"/"),K(pe,q,A,"",function(Ae){return Ae})):pe!=null&&(F(pe)&&(pe=j(pe,A+(pe.key==null||U&&U.key===pe.key?"":(""+pe.key).replace(ne,"$&/")+"/")+ee)),q.push(pe)),1;ee=0;var ce=ae===""?".":ae+":";if(D(U))for(var ge=0;ge<U.length;ge++)ae=U[ge],te=ce+V(ae,ge),ee+=K(ae,q,A,te,pe);else if(ge=x(U),typeof ge=="function")for(U=ge.call(U),ge=0;!(ae=U.next()).done;)ae=ae.value,te=ce+V(ae,ge++),ee+=K(ae,q,A,te,pe);else if(te==="object"){if(typeof U.then=="function")return K(Y(U),q,A,ae,pe);throw q=String(U),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ee}function re(U,q,A){if(U==null)return U;var ae=[],pe=0;return K(U,ae,"","",function(te){return q.call(A,te,pe++)}),ae}function ue(U){if(U._status===-1){var q=U._result;q=q(),q.then(function(A){(U._status===0||U._status===-1)&&(U._status=1,U._result=A)},function(A){(U._status===0||U._status===-1)&&(U._status=2,U._result=A)}),U._status===-1&&(U._status=0,U._result=q)}if(U._status===1)return U._result.default;throw U._result}var Te=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},P={map:re,forEach:function(U,q,A){re(U,function(){q.apply(this,arguments)},A)},count:function(U){var q=0;return re(U,function(){q++}),q},toArray:function(U){return re(U,function(q){return q})||[]},only:function(U){if(!F(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return pt.Activity=b,pt.Children=P,pt.Component=C,pt.Fragment=n,pt.Profiler=s,pt.PureComponent=I,pt.StrictMode=a,pt.Suspense=m,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,pt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return B.H.useMemoCache(U)}},pt.cache=function(U){return function(){return U.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(U,q,A){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var ae=T({},U.props),pe=U.key;if(q!=null)for(te in q.key!==void 0&&(pe=""+q.key),q)!X.call(q,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&q.ref===void 0||(ae[te]=q[te]);var te=arguments.length-2;if(te===1)ae.children=A;else if(1<te){for(var ee=Array(te),ce=0;ce<te;ce++)ee[ce]=arguments[ce+2];ae.children=ee}return $(U.type,pe,ae)},pt.createContext=function(U){return U={$$typeof:c,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:l,_context:U},U},pt.createElement=function(U,q,A){var ae,pe={},te=null;if(q!=null)for(ae in q.key!==void 0&&(te=""+q.key),q)X.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(pe[ae]=q[ae]);var ee=arguments.length-2;if(ee===1)pe.children=A;else if(1<ee){for(var ce=Array(ee),ge=0;ge<ee;ge++)ce[ge]=arguments[ge+2];pe.children=ce}if(U&&U.defaultProps)for(ae in ee=U.defaultProps,ee)pe[ae]===void 0&&(pe[ae]=ee[ae]);return $(U,te,pe)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(U){return{$$typeof:d,render:U}},pt.isValidElement=F,pt.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:ue}},pt.memo=function(U,q){return{$$typeof:h,type:U,compare:q===void 0?null:q}},pt.startTransition=function(U){var q=B.T,A={};B.T=A;try{var ae=U(),pe=B.S;pe!==null&&pe(A,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(M,Te)}catch(te){Te(te)}finally{q!==null&&A.types!==null&&(q.types=A.types),B.T=q}},pt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},pt.use=function(U){return B.H.use(U)},pt.useActionState=function(U,q,A){return B.H.useActionState(U,q,A)},pt.useCallback=function(U,q){return B.H.useCallback(U,q)},pt.useContext=function(U){return B.H.useContext(U)},pt.useDebugValue=function(){},pt.useDeferredValue=function(U,q){return B.H.useDeferredValue(U,q)},pt.useEffect=function(U,q){return B.H.useEffect(U,q)},pt.useEffectEvent=function(U){return B.H.useEffectEvent(U)},pt.useId=function(){return B.H.useId()},pt.useImperativeHandle=function(U,q,A){return B.H.useImperativeHandle(U,q,A)},pt.useInsertionEffect=function(U,q){return B.H.useInsertionEffect(U,q)},pt.useLayoutEffect=function(U,q){return B.H.useLayoutEffect(U,q)},pt.useMemo=function(U,q){return B.H.useMemo(U,q)},pt.useOptimistic=function(U,q){return B.H.useOptimistic(U,q)},pt.useReducer=function(U,q,A){return B.H.useReducer(U,q,A)},pt.useRef=function(U){return B.H.useRef(U)},pt.useState=function(U){return B.H.useState(U)},pt.useSyncExternalStore=function(U,q,A){return B.H.useSyncExternalStore(U,q,A)},pt.useTransition=function(){return B.H.useTransition()},pt.version="19.2.8",pt}var uv;function Bh(){return uv||(uv=1,pf.exports=o8()),pf.exports}var S=Bh();const zn=qu(S);var gf={exports:{}},oo={},bf={exports:{}},vf={};var dv;function c8(){return dv||(dv=1,(function(e){function t(K,re){var ue=K.length;K.push(re);e:for(;0<ue;){var Te=ue-1>>>1,P=K[Te];if(0<s(P,re))K[Te]=re,K[ue]=P,ue=Te;else break e}}function n(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var re=K[0],ue=K.pop();if(ue!==re){K[0]=ue;e:for(var Te=0,P=K.length,U=P>>>1;Te<U;){var q=2*(Te+1)-1,A=K[q],ae=q+1,pe=K[ae];if(0>s(A,ue))ae<P&&0>s(pe,A)?(K[Te]=pe,K[ae]=ue,Te=ae):(K[Te]=A,K[q]=ue,Te=q);else if(ae<P&&0>s(pe,ue))K[Te]=pe,K[ae]=ue,Te=ae;else break e}}return re}function s(K,re){var ue=K.sortIndex-re.sortIndex;return ue!==0?ue:K.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],h=[],p=1,b=null,y=3,x=!1,k=!1,T=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function G(K){for(var re=n(h);re!==null;){if(re.callback===null)a(h);else if(re.startTime<=K)a(h),re.sortIndex=re.expirationTime,t(m,re);else break;re=n(h)}}function D(K){if(T=!1,G(K),!k)if(n(m)!==null)k=!0,M||(M=!0,H());else{var re=n(h);re!==null&&Y(D,re.startTime-K)}}var M=!1,B=-1,X=5,$=-1;function j(){return R?!0:!(e.unstable_now()-$<X)}function F(){if(R=!1,M){var K=e.unstable_now();$=K;var re=!0;try{e:{k=!1,T&&(T=!1,_(B),B=-1),x=!0;var ue=y;try{t:{for(G(K),b=n(m);b!==null&&!(b.expirationTime>K&&j());){var Te=b.callback;if(typeof Te=="function"){b.callback=null,y=b.priorityLevel;var P=Te(b.expirationTime<=K);if(K=e.unstable_now(),typeof P=="function"){b.callback=P,G(K),re=!0;break t}b===n(m)&&a(m),G(K)}else a(m);b=n(m)}if(b!==null)re=!0;else{var U=n(h);U!==null&&Y(D,U.startTime-K),re=!1}}break e}finally{b=null,y=ue,x=!1}re=void 0}}finally{re?H():M=!1}}}var H;if(typeof I=="function")H=function(){I(F)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,V=ne.port2;ne.port1.onmessage=F,H=function(){V.postMessage(null)}}else H=function(){C(F,0)};function Y(K,re){B=C(function(){K(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var re=3;break;default:re=y}var ue=y;y=re;try{return K()}finally{y=ue}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(K,re){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var ue=y;y=K;try{return re()}finally{y=ue}},e.unstable_scheduleCallback=function(K,re,ue){var Te=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Te+ue:Te):ue=Te,K){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=ue+P,K={id:p++,callback:re,priorityLevel:K,startTime:ue,expirationTime:P,sortIndex:-1},ue>Te?(K.sortIndex=ue,t(h,K),n(m)===null&&K===n(h)&&(T?(_(B),B=-1):T=!0,Y(D,ue-Te))):(K.sortIndex=P,t(m,K),k||x||(k=!0,M||(M=!0,H()))),K},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(K){var re=y;return function(){var ue=y;y=re;try{return K.apply(this,arguments)}finally{y=ue}}}})(vf)),vf}var fv;function u8(){return fv||(fv=1,bf.exports=c8()),bf.exports}var yf={exports:{}},er={};var mv;function d8(){if(mv)return er;mv=1;var e=Bh();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(m,h,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:m,containerInfo:h,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,er.createPortal=function(m,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,p)},er.flushSync=function(m){var h=c.T,p=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=p,a.d.f()}},er.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},er.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},er.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var p=h.as,b=d(p,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:y,fetchPriority:x}):p==="script"&&a.d.X(m,{crossOrigin:b,integrity:y,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},er.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},er.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,b=d(p,h.crossOrigin);a.d.L(m,p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},er.preloadModule=function(m,h){if(typeof m=="string")if(h){var p=d(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},er.requestFormReset=function(m){a.d.r(m)},er.unstable_batchedUpdates=function(m,h){return m(h)},er.useFormState=function(m,h,p){return c.H.useFormState(m,h,p)},er.useFormStatus=function(){return c.H.useHostTransitionStatus()},er.version="19.2.8",er}var hv;function q2(){if(hv)return yf.exports;hv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),yf.exports=d8(),yf.exports}var pv;function f8(){if(pv)return oo;pv=1;var e=u8(),t=Bh(),n=q2();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var i=r,o=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(o=i.return),r=i.return;while(r)}return i.tag===3?o:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(l(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=l(r),i===null)throw Error(a(188));return i!==r?null:r}for(var o=r,u=i;;){var g=o.return;if(g===null)break;var v=g.alternate;if(v===null){if(u=g.return,u!==null){o=u;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===o)return m(g),r;if(v===u)return m(g),i;v=v.sibling}throw Error(a(188))}if(o.return!==u.return)o=g,u=v;else{for(var N=!1,L=g.child;L;){if(L===o){N=!0,o=g,u=v;break}if(L===u){N=!0,u=g,o=v;break}L=L.sibling}if(!N){for(L=v.child;L;){if(L===o){N=!0,o=v,u=g;break}if(L===u){N=!0,u=v,o=g;break}L=L.sibling}if(!N)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var b=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),I=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function H(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var ne=Symbol.for("react.client.reference");function V(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ne?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case C:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case $:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case I:return r.displayName||"Context";case _:return(r._context.displayName||"Context")+".Consumer";case G:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case B:return i=r.displayName||null,i!==null?i:V(r.type)||"Memo";case X:i=r._payload,r=r._init;try{return V(r(i))}catch{}}return null}var Y=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},Te=[],P=-1;function U(r){return{current:r}}function q(r){0>P||(r.current=Te[P],Te[P]=null,P--)}function A(r,i){P++,Te[P]=r.current,r.current=i}var ae=U(null),pe=U(null),te=U(null),ee=U(null);function ce(r,i){switch(A(te,i),A(pe,r),A(ae,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?_b(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=_b(i),r=Ib(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}q(ae),A(ae,r)}function ge(){q(ae),q(pe),q(te)}function Ae(r){r.memoizedState!==null&&A(ee,r);var i=ae.current,o=Ib(i,r.type);i!==o&&(A(pe,r),A(ae,o))}function Oe(r){pe.current===r&&(q(ae),q(pe)),ee.current===r&&(q(ee),ro._currentValue=ue)}var ve,Ue;function Ve(r){if(ve===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);ve=i&&i[1]||"",Ue=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ve+r+Ue}var nt=!1;function lt(r,i){if(!r||nt)return"";nt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(be){var he=be}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(be){he=be}r.call(Ee.prototype)}}else{try{throw Error()}catch(be){he=be}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(be){if(be&&he&&typeof be.stack=="string")return[be.stack,he.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),N=v[0],L=v[1];if(N&&L){var J=N.split(`
|
|
4
|
+
`),fe=L.split(`
|
|
5
|
+
`);for(g=u=0;u<J.length&&!J[u].includes("DetermineComponentFrameRoot");)u++;for(;g<fe.length&&!fe[g].includes("DetermineComponentFrameRoot");)g++;if(u===J.length||g===fe.length)for(u=J.length-1,g=fe.length-1;1<=u&&0<=g&&J[u]!==fe[g];)g--;for(;1<=u&&0<=g;u--,g--)if(J[u]!==fe[g]){if(u!==1||g!==1)do if(u--,g--,0>g||J[u]!==fe[g]){var we=`
|
|
6
|
+
`+J[u].replace(" at new "," at ");return r.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",r.displayName)),we}while(1<=u&&0<=g);break}}}finally{nt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Ve(o):""}function Lt(r,i){switch(r.tag){case 26:case 27:case 5:return Ve(r.type);case 16:return Ve("Lazy");case 13:return r.child!==i&&i!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return lt(r.type,!1);case 11:return lt(r.type.render,!1);case 1:return lt(r.type,!0);case 31:return Ve("Activity");default:return""}}function _t(r){try{var i="",o=null;do i+=Lt(r,o),o=r,r=r.return;while(r);return i}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var ut=Object.prototype.hasOwnProperty,Ye=e.unstable_scheduleCallback,Fe=e.unstable_cancelCallback,ct=e.unstable_shouldYield,zt=e.unstable_requestPaint,Pe=e.unstable_now,Wt=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,qe=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,rt=e.unstable_IdlePriority,tn=e.log,un=e.unstable_setDisableYieldValue,Bt=null,dt=null;function Ht(r){if(typeof tn=="function"&&un(r),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Bt,r)}catch{}}var bt=Math.clz32?Math.clz32:it,Wn=Math.log,wn=Math.LN2;function it(r){return r>>>=0,r===0?32:31-(Wn(r)/wn|0)|0}var We=256,St=262144,Dt=4194304;function Ft(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Q(r,i,o){var u=r.pendingLanes;if(u===0)return 0;var g=0,v=r.suspendedLanes,N=r.pingedLanes;r=r.warmLanes;var L=u&134217727;return L!==0?(u=L&~v,u!==0?g=Ft(u):(N&=L,N!==0?g=Ft(N):o||(o=L&~r,o!==0&&(g=Ft(o))))):(L=u&~v,L!==0?g=Ft(L):N!==0?g=Ft(N):o||(o=u&~r,o!==0&&(g=Ft(o)))),g===0?0:i!==0&&i!==g&&(i&v)===0&&(v=g&-g,o=i&-i,v>=o||v===32&&(o&4194048)!==0)?i:g}function xe(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function je(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var r=Dt;return Dt<<=1,(Dt&62914560)===0&&(Dt=4194304),r}function ht(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function kt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ie(r,i,o,u,g,v){var N=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var L=r.entanglements,J=r.expirationTimes,fe=r.hiddenUpdates;for(o=N&~o;0<o;){var we=31-bt(o),Ee=1<<we;L[we]=0,J[we]=-1;var he=fe[we];if(he!==null)for(fe[we]=null,we=0;we<he.length;we++){var be=he[we];be!==null&&(be.lane&=-536870913)}o&=~Ee}u!==0&&Se(r,u,0),v!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=v&~(N&~i))}function Se(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var u=31-bt(i);r.entangledLanes|=i,r.entanglements[u]=r.entanglements[u]|1073741824|o&261930}function Be(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var u=31-bt(o),g=1<<u;g&i|r[u]&i&&(r[u]|=i),o&=~g}}function yt(r,i){var o=i&-i;return o=(o&42)!==0?1:Et(o),(o&(r.suspendedLanes|i))!==0?0:o}function Et(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Sn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Un(){var r=re.p;return r!==0?r:(r=window.event,r===void 0?32:ev(r.type))}function Qn(r,i){var o=re.p;try{return re.p=r,i()}finally{re.p=o}}var $n=Math.random().toString(36).slice(2),Pt="__reactFiber$"+$n,kn="__reactProps$"+$n,Ka="__reactContainer$"+$n,hl="__reactEvents$"+$n,Uo="__reactListeners$"+$n,fs="__reactHandles$"+$n,qo="__reactResources$"+$n,Mi="__reactMarker$"+$n;function pl(r){delete r[Pt],delete r[kn],delete r[hl],delete r[Uo],delete r[fs]}function ir(r){var i=r[Pt];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Ka]||o[Pt]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Bb(r);r!==null;){if(o=r[Pt])return o;r=Bb(r)}return i}r=o,o=r.parentNode}return null}function ga(r){if(r=r[Pt]||r[Ka]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Va(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ya(r){var i=r[qo];return i||(i=r[qo]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Rn(r){r[Mi]=!0}var Ho=new Set,Oi={};function ba(r,i){Re(r,i),Re(r+"Capture",i)}function Re(r,i){for(Oi[r]=i,r=0;r<i.length;r++)Ho.add(i[r])}var Je=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tt={},Vt={};function En(r){return ut.call(Vt,r)?!0:ut.call(Tt,r)?!1:Je.test(r)?Vt[r]=!0:(Tt[r]=!0,!1)}function Jn(r,i,o){if(En(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+o)}}function kr(r,i,o){if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+o)}}function fr(r,i,o,u){if(u===null)r.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+u)}}function ln(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Er(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Fo(r,i,o){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,v=u.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return g.call(this)},set:function(N){o=""+N,v.call(this,N)}}),Object.defineProperty(r,i,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(N){o=""+N},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function ms(r){if(!r._valueTracker){var i=Er(r)?"checked":"value";r._valueTracker=Fo(r,i,""+r[i])}}function gl(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),u="";return r&&(u=Er(r)?r.checked?"true":"false":r.value),r=u,r!==o?(i.setValue(r),!0):!1}function hs(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var f0=/[\n"\\]/g;function mr(r){return r.replace(f0,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function bl(r,i,o,u,g,v,N,L){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),i!=null?N==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ln(i)):r.value!==""+ln(i)&&(r.value=""+ln(i)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),i!=null?ps(r,N,ln(i)):o!=null?ps(r,N,ln(o)):u!=null&&r.removeAttribute("value"),g==null&&v!=null&&(r.defaultChecked=!!v),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?r.name=""+ln(L):r.removeAttribute("name")}function Di(r,i,o,u,g,v,N,L){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||o!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){ms(r);return}o=o!=null?""+ln(o):"",i=i!=null?""+ln(i):o,L||i===r.value||(r.value=i),r.defaultValue=i}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=L?r.checked:!!u,r.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N),ms(r)}function ps(r,i,o){i==="number"&&hs(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function Kn(r,i,o,u){if(r=r.options,i){i={};for(var g=0;g<o.length;g++)i["$"+o[g]]=!0;for(o=0;o<r.length;o++)g=i.hasOwnProperty("$"+r[o].value),r[o].selected!==g&&(r[o].selected=g),g&&u&&(r[o].defaultSelected=!0)}else{for(o=""+ln(o),i=null,g=0;g<r.length;g++){if(r[g].value===o){r[g].selected=!0,u&&(r[g].defaultSelected=!0);return}i!==null||r[g].disabled||(i=r[g])}i!==null&&(i.selected=!0)}}function Po(r,i,o){if(i!=null&&(i=""+ln(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+ln(o):""}function gs(r,i,o,u){if(i==null){if(u!=null){if(o!=null)throw Error(a(92));if(Y(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),i=o}o=ln(i),r.defaultValue=o,u=r.textContent,u===o&&u!==""&&u!==null&&(r.value=u),ms(r)}function st(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var $o=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function An(r,i,o){var u=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":u?r.setProperty(i,o):typeof o!="number"||o===0||$o.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function Yt(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var g in i)u=i[g],i.hasOwnProperty(g)&&o[g]!==u&&An(r,g,u)}else for(var v in i)i.hasOwnProperty(v)&&An(r,v,i[v])}function Xa(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var va=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vl=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Za(r){return vl.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Le(){}var Ge=null;function gt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var It=null,hn=null;function Ur(r){var i=ga(r);if(i&&(r=i.stateNode)){var o=r[kn]||null;e:switch(r=i.stateNode,i.type){case"input":if(bl(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+mr(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var u=o[i];if(u!==r&&u.form===r.form){var g=u[kn]||null;if(!g)throw Error(a(90));bl(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<o.length;i++)u=o[i],u.form===r.form&&gl(u)}break e;case"textarea":Po(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&Kn(r,!!o.multiple,i,!1)}}}var yl=!1;function Go(r,i,o){if(yl)return r(i,o);yl=!0;try{var u=r(i);return u}finally{if(yl=!1,(It!==null||hn!==null)&&(Mc(),It&&(i=It,r=hn,hn=It=null,Ur(i),r)))for(i=0;i<r.length;i++)Ur(r[i])}}function xl(r,i){var o=r.stateNode;if(o===null)return null;var u=o[kn]||null;if(u===null)return null;o=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var ya=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m0=!1;if(ya)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){m0=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{m0=!1}var Wa=null,h0=null,Ko=null;function Ip(){if(Ko)return Ko;var r,i=h0,o=i.length,u,g="value"in Wa?Wa.value:Wa.textContent,v=g.length;for(r=0;r<o&&i[r]===g[r];r++);var N=o-r;for(u=1;u<=N&&i[o-u]===g[v-u];u++);return Ko=g.slice(r,1<u?1-u:void 0)}function Vo(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Yo(){return!0}function Mp(){return!1}function hr(r){function i(o,u,g,v,N){this._reactName=o,this._targetInst=g,this.type=u,this.nativeEvent=v,this.target=N,this.currentTarget=null;for(var L in r)r.hasOwnProperty(L)&&(o=r[L],this[L]=o?o(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Yo:Mp,this.isPropagationStopped=Mp,this}return b(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Yo)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Yo)},persist:function(){},isPersistent:Yo}),i}var ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xo=hr(ji),Sl=b({},ji,{view:0,detail:0}),ax=hr(Sl),p0,g0,kl,Zo=b({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v0,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==kl&&(kl&&r.type==="mousemove"?(p0=r.screenX-kl.screenX,g0=r.screenY-kl.screenY):g0=p0=0,kl=r),p0)},movementY:function(r){return"movementY"in r?r.movementY:g0}}),Op=hr(Zo),ix=b({},Zo,{dataTransfer:0}),sx=hr(ix),lx=b({},Sl,{relatedTarget:0}),b0=hr(lx),ox=b({},ji,{animationName:0,elapsedTime:0,pseudoElement:0}),cx=hr(ox),ux=b({},ji,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),dx=hr(ux),fx=b({},ji,{data:0}),Dp=hr(fx),mx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gx(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=px[r])?!!i[r]:!1}function v0(){return gx}var bx=b({},Sl,{key:function(r){if(r.key){var i=mx[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Vo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?hx[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v0,charCode:function(r){return r.type==="keypress"?Vo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Vo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),vx=hr(bx),yx=b({},Zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jp=hr(yx),xx=b({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v0}),wx=hr(xx),Sx=b({},ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),kx=hr(Sx),Ex=b({},Zo,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Tx=hr(Ex),Nx=b({},ji,{newState:0,oldState:0}),Cx=hr(Nx),Rx=[9,13,27,32],y0=ya&&"CompositionEvent"in window,El=null;ya&&"documentMode"in document&&(El=document.documentMode);var Ax=ya&&"TextEvent"in window&&!El,Lp=ya&&(!y0||El&&8<El&&11>=El),zp=" ",Bp=!1;function Up(r,i){switch(r){case"keyup":return Rx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var bs=!1;function _x(r,i){switch(r){case"compositionend":return qp(i);case"keypress":return i.which!==32?null:(Bp=!0,zp);case"textInput":return r=i.data,r===zp&&Bp?null:r;default:return null}}function Ix(r,i){if(bs)return r==="compositionend"||!y0&&Up(r,i)?(r=Ip(),Ko=h0=Wa=null,bs=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Lp&&i.locale!=="ko"?null:i.data;default:return null}}var Mx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hp(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!Mx[r.type]:i==="textarea"}function Fp(r,i,o,u){It?hn?hn.push(u):hn=[u]:It=u,i=Uc(i,"onChange"),0<i.length&&(o=new Xo("onChange","change",null,o,u),r.push({event:o,listeners:i}))}var Tl=null,Nl=null;function Ox(r){Eb(r,0)}function Wo(r){var i=Va(r);if(gl(i))return r}function Pp(r,i){if(r==="change")return i}var $p=!1;if(ya){var x0;if(ya){var w0="oninput"in document;if(!w0){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),w0=typeof Gp.oninput=="function"}x0=w0}else x0=!1;$p=x0&&(!document.documentMode||9<document.documentMode)}function Kp(){Tl&&(Tl.detachEvent("onpropertychange",Vp),Nl=Tl=null)}function Vp(r){if(r.propertyName==="value"&&Wo(Nl)){var i=[];Fp(i,Nl,r,gt(r)),Go(Ox,i)}}function Dx(r,i,o){r==="focusin"?(Kp(),Tl=i,Nl=o,Tl.attachEvent("onpropertychange",Vp)):r==="focusout"&&Kp()}function jx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Wo(Nl)}function Lx(r,i){if(r==="click")return Wo(i)}function zx(r,i){if(r==="input"||r==="change")return Wo(i)}function Bx(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Tr=typeof Object.is=="function"?Object.is:Bx;function Cl(r,i){if(Tr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),u=Object.keys(i);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var g=o[u];if(!ut.call(i,g)||!Tr(r[g],i[g]))return!1}return!0}function Yp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xp(r,i){var o=Yp(r);r=0;for(var u;o;){if(o.nodeType===3){if(u=r+o.textContent.length,r<=i&&u>=i)return{node:o,offset:i-r};r=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Yp(o)}}function Zp(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zp(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Wp(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=hs(r.document);i instanceof r.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)r=i.contentWindow;else break;i=hs(r.document)}return i}function S0(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Ux=ya&&"documentMode"in document&&11>=document.documentMode,vs=null,k0=null,Rl=null,E0=!1;function Qp(r,i,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;E0||vs==null||vs!==hs(u)||(u=vs,"selectionStart"in u&&S0(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Rl&&Cl(Rl,u)||(Rl=u,u=Uc(k0,"onSelect"),0<u.length&&(i=new Xo("onSelect","select",null,i,o),r.push({event:i,listeners:u}),i.target=vs)))}function Li(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var ys={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},T0={},Jp={};ya&&(Jp=document.createElement("div").style,"AnimationEvent"in window||(delete ys.animationend.animation,delete ys.animationiteration.animation,delete ys.animationstart.animation),"TransitionEvent"in window||delete ys.transitionend.transition);function zi(r){if(T0[r])return T0[r];if(!ys[r])return r;var i=ys[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in Jp)return T0[r]=i[o];return r}var e1=zi("animationend"),t1=zi("animationiteration"),n1=zi("animationstart"),qx=zi("transitionrun"),Hx=zi("transitionstart"),Fx=zi("transitioncancel"),r1=zi("transitionend"),a1=new Map,N0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");N0.push("scrollEnd");function Qr(r,i){a1.set(r,i),ba(i,[r])}var Qo=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},qr=[],xs=0,C0=0;function Jo(){for(var r=xs,i=C0=xs=0;i<r;){var o=qr[i];qr[i++]=null;var u=qr[i];qr[i++]=null;var g=qr[i];qr[i++]=null;var v=qr[i];if(qr[i++]=null,u!==null&&g!==null){var N=u.pending;N===null?g.next=g:(g.next=N.next,N.next=g),u.pending=g}v!==0&&i1(o,g,v)}}function ec(r,i,o,u){qr[xs++]=r,qr[xs++]=i,qr[xs++]=o,qr[xs++]=u,C0|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function R0(r,i,o,u){return ec(r,i,o,u),tc(r)}function Bi(r,i){return ec(r,null,null,i),tc(r)}function i1(r,i,o){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o);for(var g=!1,v=r.return;v!==null;)v.childLanes|=o,u=v.alternate,u!==null&&(u.childLanes|=o),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(g=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,g&&i!==null&&(g=31-bt(o),r=v.hiddenUpdates,u=r[g],u===null?r[g]=[i]:u.push(i),i.lane=o|536870912),v):null}function tc(r){if(50<Zl)throw Zl=0,zd=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var ws={};function Px(r,i,o,u){this.tag=r,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(r,i,o,u){return new Px(r,i,o,u)}function A0(r){return r=r.prototype,!(!r||!r.isReactComponent)}function xa(r,i){var o=r.alternate;return o===null?(o=Nr(r.tag,i,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=i,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,i=r.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function s1(r,i){r.flags&=65011714;var o=r.alternate;return o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function nc(r,i,o,u,g,v){var N=0;if(u=r,typeof r=="function")A0(r)&&(N=1);else if(typeof r=="string")N=Y7(r,o,ae.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case $:return r=Nr(31,o,i,g),r.elementType=$,r.lanes=v,r;case T:return Ui(o.children,g,v,i);case R:N=8,g|=24;break;case C:return r=Nr(12,o,i,g|2),r.elementType=C,r.lanes=v,r;case D:return r=Nr(13,o,i,g),r.elementType=D,r.lanes=v,r;case M:return r=Nr(19,o,i,g),r.elementType=M,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case I:N=10;break e;case _:N=9;break e;case G:N=11;break e;case B:N=14;break e;case X:N=16,u=null;break e}N=29,o=Error(a(130,r===null?"null":typeof r,"")),u=null}return i=Nr(N,o,i,g),i.elementType=r,i.type=u,i.lanes=v,i}function Ui(r,i,o,u){return r=Nr(7,r,u,i),r.lanes=o,r}function _0(r,i,o){return r=Nr(6,r,null,i),r.lanes=o,r}function l1(r){var i=Nr(18,null,null,0);return i.stateNode=r,i}function I0(r,i,o){return i=Nr(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var o1=new WeakMap;function Hr(r,i){if(typeof r=="object"&&r!==null){var o=o1.get(r);return o!==void 0?o:(i={value:r,source:i,stack:_t(i)},o1.set(r,i),i)}return{value:r,source:i,stack:_t(i)}}var Ss=[],ks=0,rc=null,Al=0,Fr=[],Pr=0,Qa=null,ra=1,aa="";function wa(r,i){Ss[ks++]=Al,Ss[ks++]=rc,rc=r,Al=i}function c1(r,i,o){Fr[Pr++]=ra,Fr[Pr++]=aa,Fr[Pr++]=Qa,Qa=r;var u=ra;r=aa;var g=32-bt(u)-1;u&=~(1<<g),o+=1;var v=32-bt(i)+g;if(30<v){var N=g-g%5;v=(u&(1<<N)-1).toString(32),u>>=N,g-=N,ra=1<<32-bt(i)+g|o<<g|u,aa=v+r}else ra=1<<v|o<<g|u,aa=r}function M0(r){r.return!==null&&(wa(r,1),c1(r,1,0))}function O0(r){for(;r===rc;)rc=Ss[--ks],Ss[ks]=null,Al=Ss[--ks],Ss[ks]=null;for(;r===Qa;)Qa=Fr[--Pr],Fr[Pr]=null,aa=Fr[--Pr],Fr[Pr]=null,ra=Fr[--Pr],Fr[Pr]=null}function u1(r,i){Fr[Pr++]=ra,Fr[Pr++]=aa,Fr[Pr++]=Qa,ra=i.id,aa=i.overflow,Qa=r}var Vn=null,on=null,jt=!1,Ja=null,$r=!1,D0=Error(a(519));function ei(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _l(Hr(i,r)),D0}function d1(r){var i=r.stateNode,o=r.type,u=r.memoizedProps;switch(i[Pt]=r,i[kn]=u,o){case"dialog":Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":case"embed":Rt("load",i);break;case"video":case"audio":for(o=0;o<Ql.length;o++)Rt(Ql[o],i);break;case"source":Rt("error",i);break;case"img":case"image":case"link":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"input":Rt("invalid",i),Di(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Rt("invalid",i);break;case"textarea":Rt("invalid",i),gs(i,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||u.suppressHydrationWarning===!0||Rb(i.textContent,o)?(u.popover!=null&&(Rt("beforetoggle",i),Rt("toggle",i)),u.onScroll!=null&&Rt("scroll",i),u.onScrollEnd!=null&&Rt("scrollend",i),u.onClick!=null&&(i.onclick=Le),i=!0):i=!1,i||ei(r,!0)}function f1(r){for(Vn=r.return;Vn;)switch(Vn.tag){case 5:case 31:case 13:$r=!1;return;case 27:case 3:$r=!0;return;default:Vn=Vn.return}}function Es(r){if(r!==Vn)return!1;if(!jt)return f1(r),jt=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||Qd(r.type,r.memoizedProps)),o=!o),o&&on&&ei(r),f1(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));on=zb(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));on=zb(r)}else i===27?(i=on,hi(r.type)?(r=rf,rf=null,on=r):on=i):on=Vn?Kr(r.stateNode.nextSibling):null;return!0}function qi(){on=Vn=null,jt=!1}function j0(){var r=Ja;return r!==null&&(vr===null?vr=r:vr.push.apply(vr,r),Ja=null),r}function _l(r){Ja===null?Ja=[r]:Ja.push(r)}var L0=U(null),Hi=null,Sa=null;function ti(r,i,o){A(L0,i._currentValue),i._currentValue=o}function ka(r){r._currentValue=L0.current,q(L0)}function z0(r,i,o){for(;r!==null;){var u=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),r===o)break;r=r.return}}function B0(r,i,o,u){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var v=g.dependencies;if(v!==null){var N=g.child;v=v.firstContext;e:for(;v!==null;){var L=v;v=g;for(var J=0;J<i.length;J++)if(L.context===i[J]){v.lanes|=o,L=v.alternate,L!==null&&(L.lanes|=o),z0(v.return,o,r),u||(N=null);break e}v=L.next}}else if(g.tag===18){if(N=g.return,N===null)throw Error(a(341));N.lanes|=o,v=N.alternate,v!==null&&(v.lanes|=o),z0(N,o,r),N=null}else N=g.child;if(N!==null)N.return=g;else for(N=g;N!==null;){if(N===r){N=null;break}if(g=N.sibling,g!==null){g.return=N.return,N=g;break}N=N.return}g=N}}function Ts(r,i,o,u){r=null;for(var g=i,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var N=g.alternate;if(N===null)throw Error(a(387));if(N=N.memoizedProps,N!==null){var L=g.type;Tr(g.pendingProps.value,N.value)||(r!==null?r.push(L):r=[L])}}else if(g===ee.current){if(N=g.alternate,N===null)throw Error(a(387));N.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(ro):r=[ro])}g=g.return}r!==null&&B0(i,r,o,u),i.flags|=262144}function ac(r){for(r=r.firstContext;r!==null;){if(!Tr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Fi(r){Hi=r,Sa=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Yn(r){return m1(Hi,r)}function ic(r,i){return Hi===null&&Fi(r),m1(r,i)}function m1(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Sa===null){if(r===null)throw Error(a(308));Sa=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Sa=Sa.next=i;return o}var $x=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,u){r.push(u)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},Gx=e.unstable_scheduleCallback,Kx=e.unstable_NormalPriority,_n={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function U0(){return{controller:new $x,data:new Map,refCount:0}}function Il(r){r.refCount--,r.refCount===0&&Gx(Kx,function(){r.controller.abort()})}var Ml=null,q0=0,Ns=0,Cs=null;function Vx(r,i){if(Ml===null){var o=Ml=[];q0=0,Ns=Pd(),Cs={status:"pending",value:void 0,then:function(u){o.push(u)}}}return q0++,i.then(h1,h1),i}function h1(){if(--q0===0&&Ml!==null){Cs!==null&&(Cs.status="fulfilled");var r=Ml;Ml=null,Ns=0,Cs=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Yx(r,i){var o=[],u={status:"pending",value:null,reason:null,then:function(g){o.push(g)}};return r.then(function(){u.status="fulfilled",u.value=i;for(var g=0;g<o.length;g++)(0,o[g])(i)},function(g){for(u.status="rejected",u.reason=g,g=0;g<o.length;g++)(0,o[g])(void 0)}),u}var p1=K.S;K.S=function(r,i){Qg=Pe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Vx(r,i),p1!==null&&p1(r,i)};var Pi=U(null);function H0(){var r=Pi.current;return r!==null?r:nn.pooledCache}function sc(r,i){i===null?A(Pi,Pi.current):A(Pi,i.pool)}function g1(){var r=H0();return r===null?null:{parent:_n._currentValue,pool:r}}var Rs=Error(a(460)),F0=Error(a(474)),lc=Error(a(542)),oc={then:function(){}};function b1(r){return r=r.status,r==="fulfilled"||r==="rejected"}function v1(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(Le,Le),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,x1(r),r;default:if(typeof i.status=="string")i.then(Le,Le);else{if(r=nn,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(u){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=u}},function(u){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,x1(r),r}throw Gi=i,Rs}}function $i(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Gi=o,Rs):o}}var Gi=null;function y1(){if(Gi===null)throw Error(a(459));var r=Gi;return Gi=null,r}function x1(r){if(r===Rs||r===lc)throw Error(a(483))}var As=null,Ol=0;function cc(r){var i=Ol;return Ol+=1,As===null&&(As=[]),v1(As,r,i)}function Dl(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function uc(r,i){throw i.$$typeof===y?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function w1(r){function i(oe,se){if(r){var de=oe.deletions;de===null?(oe.deletions=[se],oe.flags|=16):de.push(se)}}function o(oe,se){if(!r)return null;for(;se!==null;)i(oe,se),se=se.sibling;return null}function u(oe){for(var se=new Map;oe!==null;)oe.key!==null?se.set(oe.key,oe):se.set(oe.index,oe),oe=oe.sibling;return se}function g(oe,se){return oe=xa(oe,se),oe.index=0,oe.sibling=null,oe}function v(oe,se,de){return oe.index=de,r?(de=oe.alternate,de!==null?(de=de.index,de<se?(oe.flags|=67108866,se):de):(oe.flags|=67108866,se)):(oe.flags|=1048576,se)}function N(oe){return r&&oe.alternate===null&&(oe.flags|=67108866),oe}function L(oe,se,de,ke){return se===null||se.tag!==6?(se=_0(de,oe.mode,ke),se.return=oe,se):(se=g(se,de),se.return=oe,se)}function J(oe,se,de,ke){var et=de.type;return et===T?we(oe,se,de.props.children,ke,de.key):se!==null&&(se.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===X&&$i(et)===se.type)?(se=g(se,de.props),Dl(se,de),se.return=oe,se):(se=nc(de.type,de.key,de.props,null,oe.mode,ke),Dl(se,de),se.return=oe,se)}function fe(oe,se,de,ke){return se===null||se.tag!==4||se.stateNode.containerInfo!==de.containerInfo||se.stateNode.implementation!==de.implementation?(se=I0(de,oe.mode,ke),se.return=oe,se):(se=g(se,de.children||[]),se.return=oe,se)}function we(oe,se,de,ke,et){return se===null||se.tag!==7?(se=Ui(de,oe.mode,ke,et),se.return=oe,se):(se=g(se,de),se.return=oe,se)}function Ee(oe,se,de){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=_0(""+se,oe.mode,de),se.return=oe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return de=nc(se.type,se.key,se.props,null,oe.mode,de),Dl(de,se),de.return=oe,de;case k:return se=I0(se,oe.mode,de),se.return=oe,se;case X:return se=$i(se),Ee(oe,se,de)}if(Y(se)||H(se))return se=Ui(se,oe.mode,de,null),se.return=oe,se;if(typeof se.then=="function")return Ee(oe,cc(se),de);if(se.$$typeof===I)return Ee(oe,ic(oe,se),de);uc(oe,se)}return null}function he(oe,se,de,ke){var et=se!==null?se.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return et!==null?null:L(oe,se,""+de,ke);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return de.key===et?J(oe,se,de,ke):null;case k:return de.key===et?fe(oe,se,de,ke):null;case X:return de=$i(de),he(oe,se,de,ke)}if(Y(de)||H(de))return et!==null?null:we(oe,se,de,ke,null);if(typeof de.then=="function")return he(oe,se,cc(de),ke);if(de.$$typeof===I)return he(oe,se,ic(oe,de),ke);uc(oe,de)}return null}function be(oe,se,de,ke,et){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return oe=oe.get(de)||null,L(se,oe,""+ke,et);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case x:return oe=oe.get(ke.key===null?de:ke.key)||null,J(se,oe,ke,et);case k:return oe=oe.get(ke.key===null?de:ke.key)||null,fe(se,oe,ke,et);case X:return ke=$i(ke),be(oe,se,de,ke,et)}if(Y(ke)||H(ke))return oe=oe.get(de)||null,we(se,oe,ke,et,null);if(typeof ke.then=="function")return be(oe,se,de,cc(ke),et);if(ke.$$typeof===I)return be(oe,se,de,ic(se,ke),et);uc(se,ke)}return null}function $e(oe,se,de,ke){for(var et=null,Ut=null,Ke=se,xt=se=0,Ot=null;Ke!==null&&xt<de.length;xt++){Ke.index>xt?(Ot=Ke,Ke=null):Ot=Ke.sibling;var qt=he(oe,Ke,de[xt],ke);if(qt===null){Ke===null&&(Ke=Ot);break}r&&Ke&&qt.alternate===null&&i(oe,Ke),se=v(qt,se,xt),Ut===null?et=qt:Ut.sibling=qt,Ut=qt,Ke=Ot}if(xt===de.length)return o(oe,Ke),jt&&wa(oe,xt),et;if(Ke===null){for(;xt<de.length;xt++)Ke=Ee(oe,de[xt],ke),Ke!==null&&(se=v(Ke,se,xt),Ut===null?et=Ke:Ut.sibling=Ke,Ut=Ke);return jt&&wa(oe,xt),et}for(Ke=u(Ke);xt<de.length;xt++)Ot=be(Ke,oe,xt,de[xt],ke),Ot!==null&&(r&&Ot.alternate!==null&&Ke.delete(Ot.key===null?xt:Ot.key),se=v(Ot,se,xt),Ut===null?et=Ot:Ut.sibling=Ot,Ut=Ot);return r&&Ke.forEach(function(yi){return i(oe,yi)}),jt&&wa(oe,xt),et}function at(oe,se,de,ke){if(de==null)throw Error(a(151));for(var et=null,Ut=null,Ke=se,xt=se=0,Ot=null,qt=de.next();Ke!==null&&!qt.done;xt++,qt=de.next()){Ke.index>xt?(Ot=Ke,Ke=null):Ot=Ke.sibling;var yi=he(oe,Ke,qt.value,ke);if(yi===null){Ke===null&&(Ke=Ot);break}r&&Ke&&yi.alternate===null&&i(oe,Ke),se=v(yi,se,xt),Ut===null?et=yi:Ut.sibling=yi,Ut=yi,Ke=Ot}if(qt.done)return o(oe,Ke),jt&&wa(oe,xt),et;if(Ke===null){for(;!qt.done;xt++,qt=de.next())qt=Ee(oe,qt.value,ke),qt!==null&&(se=v(qt,se,xt),Ut===null?et=qt:Ut.sibling=qt,Ut=qt);return jt&&wa(oe,xt),et}for(Ke=u(Ke);!qt.done;xt++,qt=de.next())qt=be(Ke,oe,xt,qt.value,ke),qt!==null&&(r&&qt.alternate!==null&&Ke.delete(qt.key===null?xt:qt.key),se=v(qt,se,xt),Ut===null?et=qt:Ut.sibling=qt,Ut=qt);return r&&Ke.forEach(function(i8){return i(oe,i8)}),jt&&wa(oe,xt),et}function en(oe,se,de,ke){if(typeof de=="object"&&de!==null&&de.type===T&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case x:e:{for(var et=de.key;se!==null;){if(se.key===et){if(et=de.type,et===T){if(se.tag===7){o(oe,se.sibling),ke=g(se,de.props.children),ke.return=oe,oe=ke;break e}}else if(se.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===X&&$i(et)===se.type){o(oe,se.sibling),ke=g(se,de.props),Dl(ke,de),ke.return=oe,oe=ke;break e}o(oe,se);break}else i(oe,se);se=se.sibling}de.type===T?(ke=Ui(de.props.children,oe.mode,ke,de.key),ke.return=oe,oe=ke):(ke=nc(de.type,de.key,de.props,null,oe.mode,ke),Dl(ke,de),ke.return=oe,oe=ke)}return N(oe);case k:e:{for(et=de.key;se!==null;){if(se.key===et)if(se.tag===4&&se.stateNode.containerInfo===de.containerInfo&&se.stateNode.implementation===de.implementation){o(oe,se.sibling),ke=g(se,de.children||[]),ke.return=oe,oe=ke;break e}else{o(oe,se);break}else i(oe,se);se=se.sibling}ke=I0(de,oe.mode,ke),ke.return=oe,oe=ke}return N(oe);case X:return de=$i(de),en(oe,se,de,ke)}if(Y(de))return $e(oe,se,de,ke);if(H(de)){if(et=H(de),typeof et!="function")throw Error(a(150));return de=et.call(de),at(oe,se,de,ke)}if(typeof de.then=="function")return en(oe,se,cc(de),ke);if(de.$$typeof===I)return en(oe,se,ic(oe,de),ke);uc(oe,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,se!==null&&se.tag===6?(o(oe,se.sibling),ke=g(se,de),ke.return=oe,oe=ke):(o(oe,se),ke=_0(de,oe.mode,ke),ke.return=oe,oe=ke),N(oe)):o(oe,se)}return function(oe,se,de,ke){try{Ol=0;var et=en(oe,se,de,ke);return As=null,et}catch(Ke){if(Ke===Rs||Ke===lc)throw Ke;var Ut=Nr(29,Ke,null,oe.mode);return Ut.lanes=ke,Ut.return=oe,Ut}}}var Ki=w1(!0),S1=w1(!1),ni=!1;function P0(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $0(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ri(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ai(r,i,o){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,($t&2)!==0){var g=u.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),u.pending=i,i=tc(r),i1(r,null,o),i}return ec(r,u,i,o),tc(r)}function jl(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var u=i.lanes;u&=r.pendingLanes,o|=u,i.lanes=o,Be(r,o)}}function G0(r,i){var o=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var g=null,v=null;if(o=o.firstBaseUpdate,o!==null){do{var N={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};v===null?g=v=N:v=v.next=N,o=o.next}while(o!==null);v===null?g=v=i:v=v.next=i}else g=v=i;o={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var K0=!1;function Ll(){if(K0){var r=Cs;if(r!==null)throw r}}function zl(r,i,o,u){K0=!1;var g=r.updateQueue;ni=!1;var v=g.firstBaseUpdate,N=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var J=L,fe=J.next;J.next=null,N===null?v=fe:N.next=fe,N=J;var we=r.alternate;we!==null&&(we=we.updateQueue,L=we.lastBaseUpdate,L!==N&&(L===null?we.firstBaseUpdate=fe:L.next=fe,we.lastBaseUpdate=J))}if(v!==null){var Ee=g.baseState;N=0,we=fe=J=null,L=v;do{var he=L.lane&-536870913,be=he!==L.lane;if(be?(Mt&he)===he:(u&he)===he){he!==0&&he===Ns&&(K0=!0),we!==null&&(we=we.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var $e=r,at=L;he=i;var en=o;switch(at.tag){case 1:if($e=at.payload,typeof $e=="function"){Ee=$e.call(en,Ee,he);break e}Ee=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=at.payload,he=typeof $e=="function"?$e.call(en,Ee,he):$e,he==null)break e;Ee=b({},Ee,he);break e;case 2:ni=!0}}he=L.callback,he!==null&&(r.flags|=64,be&&(r.flags|=8192),be=g.callbacks,be===null?g.callbacks=[he]:be.push(he))}else be={lane:he,tag:L.tag,payload:L.payload,callback:L.callback,next:null},we===null?(fe=we=be,J=Ee):we=we.next=be,N|=he;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;be=L,L=be.next,be.next=null,g.lastBaseUpdate=be,g.shared.pending=null}}while(!0);we===null&&(J=Ee),g.baseState=J,g.firstBaseUpdate=fe,g.lastBaseUpdate=we,v===null&&(g.shared.lanes=0),ci|=N,r.lanes=N,r.memoizedState=Ee}}function k1(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function E1(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)k1(o[r],i)}var _s=U(null),dc=U(0);function T1(r,i){r=Ma,A(dc,r),A(_s,i),Ma=r|i.baseLanes}function V0(){A(dc,Ma),A(_s,_s.current)}function Y0(){Ma=dc.current,q(_s),q(dc)}var Cr=U(null),Gr=null;function ii(r){var i=r.alternate;A(Tn,Tn.current&1),A(Cr,r),Gr===null&&(i===null||_s.current!==null||i.memoizedState!==null)&&(Gr=r)}function X0(r){A(Tn,Tn.current),A(Cr,r),Gr===null&&(Gr=r)}function N1(r){r.tag===22?(A(Tn,Tn.current),A(Cr,r),Gr===null&&(Gr=r)):si()}function si(){A(Tn,Tn.current),A(Cr,Cr.current)}function Rr(r){q(Cr),Gr===r&&(Gr=null),q(Tn)}var Tn=U(0);function fc(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||tf(o)||nf(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ea=0,vt=null,Qt=null,In=null,mc=!1,Is=!1,Vi=!1,hc=0,Bl=0,Ms=null,Xx=0;function bn(){throw Error(a(321))}function Z0(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!Tr(r[o],i[o]))return!1;return!0}function W0(r,i,o,u,g,v){return Ea=v,vt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,K.H=r===null||r.memoizedState===null?cg:fd,Vi=!1,v=o(u,g),Vi=!1,Is&&(v=R1(i,o,u,g)),C1(r),v}function C1(r){K.H=Hl;var i=Qt!==null&&Qt.next!==null;if(Ea=0,In=Qt=vt=null,mc=!1,Bl=0,Ms=null,i)throw Error(a(300));r===null||Mn||(r=r.dependencies,r!==null&&ac(r)&&(Mn=!0))}function R1(r,i,o,u){vt=r;var g=0;do{if(Is&&(Ms=null),Bl=0,Is=!1,25<=g)throw Error(a(301));if(g+=1,In=Qt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}K.H=ug,v=i(o,u)}while(Is);return v}function Zx(){var r=K.H,i=r.useState()[0];return i=typeof i.then=="function"?Ul(i):i,r=r.useState()[0],(Qt!==null?Qt.memoizedState:null)!==r&&(vt.flags|=1024),i}function Q0(){var r=hc!==0;return hc=0,r}function J0(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function ed(r){if(mc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}mc=!1}Ea=0,In=Qt=vt=null,Is=!1,Bl=hc=0,Ms=null}function sr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?vt.memoizedState=In=r:In=In.next=r,In}function Nn(){if(Qt===null){var r=vt.alternate;r=r!==null?r.memoizedState:null}else r=Qt.next;var i=In===null?vt.memoizedState:In.next;if(i!==null)In=i,Qt=r;else{if(r===null)throw vt.alternate===null?Error(a(467)):Error(a(310));Qt=r,r={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},In===null?vt.memoizedState=In=r:In=In.next=r}return In}function pc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ul(r){var i=Bl;return Bl+=1,Ms===null&&(Ms=[]),r=v1(Ms,r,i),i=vt,(In===null?i.memoizedState:In.next)===null&&(i=i.alternate,K.H=i===null||i.memoizedState===null?cg:fd),r}function gc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ul(r);if(r.$$typeof===I)return Yn(r)}throw Error(a(438,String(r)))}function td(r){var i=null,o=vt.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var u=vt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=pc(),vt.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),u=0;u<r;u++)o[u]=j;return i.index++,o}function Ta(r,i){return typeof i=="function"?i(r):i}function bc(r){var i=Nn();return nd(i,Qt,r)}function nd(r,i,o){var u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var g=r.baseQueue,v=u.pending;if(v!==null){if(g!==null){var N=g.next;g.next=v.next,v.next=N}i.baseQueue=g=v,u.pending=null}if(v=r.baseState,g===null)r.memoizedState=v;else{i=g.next;var L=N=null,J=null,fe=i,we=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(Mt&Ee)===Ee:(Ea&Ee)===Ee){var he=fe.revertLane;if(he===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===Ns&&(we=!0);else if((Ea&he)===he){fe=fe.next,he===Ns&&(we=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(L=J=Ee,N=v):J=J.next=Ee,vt.lanes|=he,ci|=he;Ee=fe.action,Vi&&o(v,Ee),v=fe.hasEagerState?fe.eagerState:o(v,Ee)}else he={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(L=J=he,N=v):J=J.next=he,vt.lanes|=Ee,ci|=Ee;fe=fe.next}while(fe!==null&&fe!==i);if(J===null?N=v:J.next=L,!Tr(v,r.memoizedState)&&(Mn=!0,we&&(o=Cs,o!==null)))throw o;r.memoizedState=v,r.baseState=N,r.baseQueue=J,u.lastRenderedState=v}return g===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function rd(r){var i=Nn(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var u=o.dispatch,g=o.pending,v=i.memoizedState;if(g!==null){o.pending=null;var N=g=g.next;do v=r(v,N.action),N=N.next;while(N!==g);Tr(v,i.memoizedState)||(Mn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),o.lastRenderedState=v}return[v,u]}function A1(r,i,o){var u=vt,g=Nn(),v=jt;if(v){if(o===void 0)throw Error(a(407));o=o()}else o=i();var N=!Tr((Qt||g).memoizedState,o);if(N&&(g.memoizedState=o,Mn=!0),g=g.queue,sd(M1.bind(null,u,g,r),[r]),g.getSnapshot!==i||N||In!==null&&In.memoizedState.tag&1){if(u.flags|=2048,Os(9,{destroy:void 0},I1.bind(null,u,g,o,i),null),nn===null)throw Error(a(349));v||(Ea&127)!==0||_1(u,i,o)}return o}function _1(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=vt.updateQueue,i===null?(i=pc(),vt.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function I1(r,i,o,u){i.value=o,i.getSnapshot=u,O1(i)&&D1(r)}function M1(r,i,o){return o(function(){O1(i)&&D1(r)})}function O1(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!Tr(r,o)}catch{return!0}}function D1(r){var i=Bi(r,2);i!==null&&yr(i,r,2)}function ad(r){var i=sr();if(typeof r=="function"){var o=r;if(r=o(),Vi){Ht(!0);try{o()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:r},i}function j1(r,i,o,u){return r.baseState=o,nd(r,Qt,typeof u=="function"?u:Ta)}function Wx(r,i,o,u,g){if(xc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){v.listeners.push(N)}};K.T!==null?o(!0):v.isTransition=!1,u(v),o=i.pending,o===null?(v.next=i.pending=v,L1(i,v)):(v.next=o.next,i.pending=o.next=v)}}function L1(r,i){var o=i.action,u=i.payload,g=r.state;if(i.isTransition){var v=K.T,N={};K.T=N;try{var L=o(g,u),J=K.S;J!==null&&J(N,L),z1(r,i,L)}catch(fe){id(r,i,fe)}finally{v!==null&&N.types!==null&&(v.types=N.types),K.T=v}}else try{v=o(g,u),z1(r,i,v)}catch(fe){id(r,i,fe)}}function z1(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){B1(r,i,u)},function(u){return id(r,i,u)}):B1(r,i,o)}function B1(r,i,o){i.status="fulfilled",i.value=o,U1(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,L1(r,o)))}function id(r,i,o){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=o,U1(i),i=i.next;while(i!==u)}r.action=null}function U1(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function q1(r,i){return i}function H1(r,i){if(jt){var o=nn.formState;if(o!==null){e:{var u=vt;if(jt){if(on){t:{for(var g=on,v=$r;g.nodeType!==8;){if(!v){g=null;break t}if(g=Kr(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){on=Kr(g.nextSibling),u=g.data==="F!";break e}}ei(u)}u=!1}u&&(i=o[0])}}return o=sr(),o.memoizedState=o.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:q1,lastRenderedState:i},o.queue=u,o=sg.bind(null,vt,u),u.dispatch=o,u=ad(!1),v=dd.bind(null,vt,!1,u.queue),u=sr(),g={state:i,dispatch:null,action:r,pending:null},u.queue=g,o=Wx.bind(null,vt,g,v,o),g.dispatch=o,u.memoizedState=r,[i,o,!1]}function F1(r){var i=Nn();return P1(i,Qt,r)}function P1(r,i,o){if(i=nd(r,i,q1)[0],r=bc(Ta)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=Ul(i)}catch(N){throw N===Rs?lc:N}else u=i;i=Nn();var g=i.queue,v=g.dispatch;return o!==i.memoizedState&&(vt.flags|=2048,Os(9,{destroy:void 0},Qx.bind(null,g,o),null)),[u,v,r]}function Qx(r,i){r.action=i}function $1(r){var i=Nn(),o=Qt;if(o!==null)return P1(i,o,r);Nn(),i=i.memoizedState,o=Nn();var u=o.queue.dispatch;return o.memoizedState=r,[i,u,!1]}function Os(r,i,o,u){return r={tag:r,create:o,deps:u,inst:i,next:null},i=vt.updateQueue,i===null&&(i=pc(),vt.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(u=o.next,o.next=r,r.next=u,i.lastEffect=r),r}function G1(){return Nn().memoizedState}function vc(r,i,o,u){var g=sr();vt.flags|=r,g.memoizedState=Os(1|i,{destroy:void 0},o,u===void 0?null:u)}function yc(r,i,o,u){var g=Nn();u=u===void 0?null:u;var v=g.memoizedState.inst;Qt!==null&&u!==null&&Z0(u,Qt.memoizedState.deps)?g.memoizedState=Os(i,v,o,u):(vt.flags|=r,g.memoizedState=Os(1|i,v,o,u))}function K1(r,i){vc(8390656,8,r,i)}function sd(r,i){yc(2048,8,r,i)}function Jx(r){vt.flags|=4;var i=vt.updateQueue;if(i===null)i=pc(),vt.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function V1(r){var i=Nn().memoizedState;return Jx({ref:i,nextImpl:r}),function(){if(($t&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Y1(r,i){return yc(4,2,r,i)}function X1(r,i){return yc(4,4,r,i)}function Z1(r,i){if(typeof i=="function"){r=r();var o=i(r);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function W1(r,i,o){o=o!=null?o.concat([r]):null,yc(4,4,Z1.bind(null,i,r),o)}function ld(){}function Q1(r,i){var o=Nn();i=i===void 0?null:i;var u=o.memoizedState;return i!==null&&Z0(i,u[1])?u[0]:(o.memoizedState=[r,i],r)}function J1(r,i){var o=Nn();i=i===void 0?null:i;var u=o.memoizedState;if(i!==null&&Z0(i,u[1]))return u[0];if(u=r(),Vi){Ht(!0);try{r()}finally{Ht(!1)}}return o.memoizedState=[u,i],u}function od(r,i,o){return o===void 0||(Ea&1073741824)!==0&&(Mt&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=eb(),vt.lanes|=r,ci|=r,o)}function eg(r,i,o,u){return Tr(o,i)?o:_s.current!==null?(r=od(r,o,u),Tr(r,i)||(Mn=!0),r):(Ea&42)===0||(Ea&1073741824)!==0&&(Mt&261930)===0?(Mn=!0,r.memoizedState=o):(r=eb(),vt.lanes|=r,ci|=r,i)}function tg(r,i,o,u,g){var v=re.p;re.p=v!==0&&8>v?v:8;var N=K.T,L={};K.T=L,dd(r,!1,i,o);try{var J=g(),fe=K.S;if(fe!==null&&fe(L,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var we=Yx(J,u);ql(r,i,we,Ir(r))}else ql(r,i,u,Ir(r))}catch(Ee){ql(r,i,{then:function(){},status:"rejected",reason:Ee},Ir())}finally{re.p=v,N!==null&&L.types!==null&&(N.types=L.types),K.T=N}}function e7(){}function cd(r,i,o,u){if(r.tag!==5)throw Error(a(476));var g=ng(r).queue;tg(r,g,i,ue,o===null?e7:function(){return rg(r),o(u)})}function ng(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:ue},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function rg(r){var i=ng(r);i.next===null&&(i=r.alternate.memoizedState),ql(r,i.next.queue,{},Ir())}function ud(){return Yn(ro)}function ag(){return Nn().memoizedState}function ig(){return Nn().memoizedState}function t7(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=Ir();r=ri(o);var u=ai(i,r,o);u!==null&&(yr(u,i,o),jl(u,i,o)),i={cache:U0()},r.payload=i;return}i=i.return}}function n7(r,i,o){var u=Ir();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xc(r)?lg(i,o):(o=R0(r,i,o,u),o!==null&&(yr(o,r,u),og(o,i,u)))}function sg(r,i,o){var u=Ir();ql(r,i,o,u)}function ql(r,i,o,u){var g={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(xc(r))lg(i,g);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var N=i.lastRenderedState,L=v(N,o);if(g.hasEagerState=!0,g.eagerState=L,Tr(L,N))return ec(r,i,g,0),nn===null&&Jo(),!1}catch{}if(o=R0(r,i,g,u),o!==null)return yr(o,r,u),og(o,i,u),!0}return!1}function dd(r,i,o,u){if(u={lane:2,revertLane:Pd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},xc(r)){if(i)throw Error(a(479))}else i=R0(r,o,u,2),i!==null&&yr(i,r,2)}function xc(r){var i=r.alternate;return r===vt||i!==null&&i===vt}function lg(r,i){Is=mc=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function og(r,i,o){if((o&4194048)!==0){var u=i.lanes;u&=r.pendingLanes,o|=u,i.lanes=o,Be(r,o)}}var Hl={readContext:Yn,use:gc,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useLayoutEffect:bn,useInsertionEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useSyncExternalStore:bn,useId:bn,useHostTransitionStatus:bn,useFormState:bn,useActionState:bn,useOptimistic:bn,useMemoCache:bn,useCacheRefresh:bn};Hl.useEffectEvent=bn;var cg={readContext:Yn,use:gc,useCallback:function(r,i){return sr().memoizedState=[r,i===void 0?null:i],r},useContext:Yn,useEffect:K1,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,vc(4194308,4,Z1.bind(null,i,r),o)},useLayoutEffect:function(r,i){return vc(4194308,4,r,i)},useInsertionEffect:function(r,i){vc(4,2,r,i)},useMemo:function(r,i){var o=sr();i=i===void 0?null:i;var u=r();if(Vi){Ht(!0);try{r()}finally{Ht(!1)}}return o.memoizedState=[u,i],u},useReducer:function(r,i,o){var u=sr();if(o!==void 0){var g=o(i);if(Vi){Ht(!0);try{o(i)}finally{Ht(!1)}}}else g=i;return u.memoizedState=u.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},u.queue=r,r=r.dispatch=n7.bind(null,vt,r),[u.memoizedState,r]},useRef:function(r){var i=sr();return r={current:r},i.memoizedState=r},useState:function(r){r=ad(r);var i=r.queue,o=sg.bind(null,vt,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:ld,useDeferredValue:function(r,i){var o=sr();return od(o,r,i)},useTransition:function(){var r=ad(!1);return r=tg.bind(null,vt,r.queue,!0,!1),sr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var u=vt,g=sr();if(jt){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),nn===null)throw Error(a(349));(Mt&127)!==0||_1(u,i,o)}g.memoizedState=o;var v={value:o,getSnapshot:i};return g.queue=v,K1(M1.bind(null,u,v,r),[r]),u.flags|=2048,Os(9,{destroy:void 0},I1.bind(null,u,v,o,i),null),o},useId:function(){var r=sr(),i=nn.identifierPrefix;if(jt){var o=aa,u=ra;o=(u&~(1<<32-bt(u)-1)).toString(32)+o,i="_"+i+"R_"+o,o=hc++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=Xx++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:ud,useFormState:H1,useActionState:H1,useOptimistic:function(r){var i=sr();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=dd.bind(null,vt,!0,o),o.dispatch=i,[r,i]},useMemoCache:td,useCacheRefresh:function(){return sr().memoizedState=t7.bind(null,vt)},useEffectEvent:function(r){var i=sr(),o={impl:r};return i.memoizedState=o,function(){if(($t&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},fd={readContext:Yn,use:gc,useCallback:Q1,useContext:Yn,useEffect:sd,useImperativeHandle:W1,useInsertionEffect:Y1,useLayoutEffect:X1,useMemo:J1,useReducer:bc,useRef:G1,useState:function(){return bc(Ta)},useDebugValue:ld,useDeferredValue:function(r,i){var o=Nn();return eg(o,Qt.memoizedState,r,i)},useTransition:function(){var r=bc(Ta)[0],i=Nn().memoizedState;return[typeof r=="boolean"?r:Ul(r),i]},useSyncExternalStore:A1,useId:ag,useHostTransitionStatus:ud,useFormState:F1,useActionState:F1,useOptimistic:function(r,i){var o=Nn();return j1(o,Qt,r,i)},useMemoCache:td,useCacheRefresh:ig};fd.useEffectEvent=V1;var ug={readContext:Yn,use:gc,useCallback:Q1,useContext:Yn,useEffect:sd,useImperativeHandle:W1,useInsertionEffect:Y1,useLayoutEffect:X1,useMemo:J1,useReducer:rd,useRef:G1,useState:function(){return rd(Ta)},useDebugValue:ld,useDeferredValue:function(r,i){var o=Nn();return Qt===null?od(o,r,i):eg(o,Qt.memoizedState,r,i)},useTransition:function(){var r=rd(Ta)[0],i=Nn().memoizedState;return[typeof r=="boolean"?r:Ul(r),i]},useSyncExternalStore:A1,useId:ag,useHostTransitionStatus:ud,useFormState:$1,useActionState:$1,useOptimistic:function(r,i){var o=Nn();return Qt!==null?j1(o,Qt,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:td,useCacheRefresh:ig};ug.useEffectEvent=V1;function md(r,i,o,u){i=r.memoizedState,o=o(u,i),o=o==null?i:b({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var hd={enqueueSetState:function(r,i,o){r=r._reactInternals;var u=Ir(),g=ri(u);g.payload=i,o!=null&&(g.callback=o),i=ai(r,g,u),i!==null&&(yr(i,r,u),jl(i,r,u))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var u=Ir(),g=ri(u);g.tag=1,g.payload=i,o!=null&&(g.callback=o),i=ai(r,g,u),i!==null&&(yr(i,r,u),jl(i,r,u))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=Ir(),u=ri(o);u.tag=2,i!=null&&(u.callback=i),i=ai(r,u,o),i!==null&&(yr(i,r,o),jl(i,r,o))}};function dg(r,i,o,u,g,v,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,N):i.prototype&&i.prototype.isPureReactComponent?!Cl(o,u)||!Cl(g,v):!0}function fg(r,i,o,u){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,u),i.state!==r&&hd.enqueueReplaceState(i,i.state,null)}function Yi(r,i){var o=i;if("ref"in i){o={};for(var u in i)u!=="ref"&&(o[u]=i[u])}if(r=r.defaultProps){o===i&&(o=b({},o));for(var g in r)o[g]===void 0&&(o[g]=r[g])}return o}function mg(r){Qo(r)}function hg(r){console.error(r)}function pg(r){Qo(r)}function wc(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function gg(r,i,o){try{var u=r.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function pd(r,i,o){return o=ri(o),o.tag=3,o.payload={element:null},o.callback=function(){wc(r,i)},o}function bg(r){return r=ri(r),r.tag=3,r}function vg(r,i,o,u){var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var v=u.value;r.payload=function(){return g(v)},r.callback=function(){gg(i,o,u)}}var N=o.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){gg(i,o,u),typeof g!="function"&&(ui===null?ui=new Set([this]):ui.add(this));var L=u.stack;this.componentDidCatch(u.value,{componentStack:L!==null?L:""})})}function r7(r,i,o,u,g){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=o.alternate,i!==null&&Ts(i,o,g,!0),o=Cr.current,o!==null){switch(o.tag){case 31:case 13:return Gr===null?Oc():o.alternate===null&&vn===0&&(vn=3),o.flags&=-257,o.flags|=65536,o.lanes=g,u===oc?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([u]):i.add(u),qd(r,u,g)),!1;case 22:return o.flags|=65536,u===oc?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([u]):o.add(u)),qd(r,u,g)),!1}throw Error(a(435,o.tag))}return qd(r,u,g),Oc(),!1}if(jt)return i=Cr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,u!==D0&&(r=Error(a(422),{cause:u}),_l(Hr(r,o)))):(u!==D0&&(i=Error(a(423),{cause:u}),_l(Hr(i,o))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,u=Hr(u,o),g=pd(r.stateNode,u,g),G0(r,g),vn!==4&&(vn=2)),!1;var v=Error(a(520),{cause:u});if(v=Hr(v,o),Xl===null?Xl=[v]:Xl.push(v),vn!==4&&(vn=2),i===null)return!0;u=Hr(u,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=g&-g,o.lanes|=r,r=pd(o.stateNode,u,r),G0(o,r),!1;case 1:if(i=o.type,v=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ui===null||!ui.has(v))))return o.flags|=65536,g&=-g,o.lanes|=g,g=bg(g),vg(g,r,o,u),G0(o,g),!1}o=o.return}while(o!==null);return!1}var gd=Error(a(461)),Mn=!1;function Xn(r,i,o,u){i.child=r===null?S1(i,null,o,u):Ki(i,r.child,o,u)}function yg(r,i,o,u,g){o=o.render;var v=i.ref;if("ref"in u){var N={};for(var L in u)L!=="ref"&&(N[L]=u[L])}else N=u;return Fi(i),u=W0(r,i,o,N,v,g),L=Q0(),r!==null&&!Mn?(J0(r,i,g),Na(r,i,g)):(jt&&L&&M0(i),i.flags|=1,Xn(r,i,u,g),i.child)}function xg(r,i,o,u,g){if(r===null){var v=o.type;return typeof v=="function"&&!A0(v)&&v.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=v,wg(r,i,v,u,g)):(r=nc(o.type,null,u,i,i.mode,g),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Ed(r,g)){var N=v.memoizedProps;if(o=o.compare,o=o!==null?o:Cl,o(N,u)&&r.ref===i.ref)return Na(r,i,g)}return i.flags|=1,r=xa(v,u),r.ref=i.ref,r.return=i,i.child=r}function wg(r,i,o,u,g){if(r!==null){var v=r.memoizedProps;if(Cl(v,u)&&r.ref===i.ref)if(Mn=!1,i.pendingProps=u=v,Ed(r,g))(r.flags&131072)!==0&&(Mn=!0);else return i.lanes=r.lanes,Na(r,i,g)}return bd(r,i,o,u,g)}function Sg(r,i,o,u){var g=u.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|o:o,r!==null){for(u=i.child=r.child,g=0;u!==null;)g=g|u.lanes|u.childLanes,u=u.sibling;u=g&~v}else u=0,i.child=null;return kg(r,i,v,o,u)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&sc(i,v!==null?v.cachePool:null),v!==null?T1(i,v):V0(),N1(i);else return u=i.lanes=536870912,kg(r,i,v!==null?v.baseLanes|o:o,o,u)}else v!==null?(sc(i,v.cachePool),T1(i,v),si(),i.memoizedState=null):(r!==null&&sc(i,null),V0(),si());return Xn(r,i,g,o),i.child}function Fl(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function kg(r,i,o,u,g){var v=H0();return v=v===null?null:{parent:_n._currentValue,pool:v},i.memoizedState={baseLanes:o,cachePool:v},r!==null&&sc(i,null),V0(),N1(i),r!==null&&Ts(r,i,u,!0),i.childLanes=g,null}function Sc(r,i){return i=Ec({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Eg(r,i,o){return Ki(i,r.child,null,o),r=Sc(i,i.pendingProps),r.flags|=2,Rr(i),i.memoizedState=null,r}function a7(r,i,o){var u=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(jt){if(u.mode==="hidden")return r=Sc(i,u),i.lanes=536870912,Fl(null,r);if(X0(i),(r=on)?(r=Lb(r,$r),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Qa!==null?{id:ra,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},o=l1(r),o.return=i,i.child=o,Vn=i,on=null)):r=null,r===null)throw ei(i);return i.lanes=536870912,null}return Sc(i,u)}var v=r.memoizedState;if(v!==null){var N=v.dehydrated;if(X0(i),g)if(i.flags&256)i.flags&=-257,i=Eg(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Mn||Ts(r,i,o,!1),g=(o&r.childLanes)!==0,Mn||g){if(u=nn,u!==null&&(N=yt(u,o),N!==0&&N!==v.retryLane))throw v.retryLane=N,Bi(r,N),yr(u,r,N),gd;Oc(),i=Eg(r,i,o)}else r=v.treeContext,on=Kr(N.nextSibling),Vn=i,jt=!0,Ja=null,$r=!1,r!==null&&u1(i,r),i=Sc(i,u),i.flags|=4096;return i}return r=xa(r.child,{mode:u.mode,children:u.children}),r.ref=i.ref,i.child=r,r.return=i,r}function kc(r,i){var o=i.ref;if(o===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(r===null||r.ref!==o)&&(i.flags|=4194816)}}function bd(r,i,o,u,g){return Fi(i),o=W0(r,i,o,u,void 0,g),u=Q0(),r!==null&&!Mn?(J0(r,i,g),Na(r,i,g)):(jt&&u&&M0(i),i.flags|=1,Xn(r,i,o,g),i.child)}function Tg(r,i,o,u,g,v){return Fi(i),i.updateQueue=null,o=R1(i,u,o,g),C1(r),u=Q0(),r!==null&&!Mn?(J0(r,i,v),Na(r,i,v)):(jt&&u&&M0(i),i.flags|=1,Xn(r,i,o,v),i.child)}function Ng(r,i,o,u,g){if(Fi(i),i.stateNode===null){var v=ws,N=o.contextType;typeof N=="object"&&N!==null&&(v=Yn(N)),v=new o(u,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=hd,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=u,v.state=i.memoizedState,v.refs={},P0(i),N=o.contextType,v.context=typeof N=="object"&&N!==null?Yn(N):ws,v.state=i.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(md(i,o,N,u),v.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(N=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),N!==v.state&&hd.enqueueReplaceState(v,v.state,null),zl(i,u,v,g),Ll(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(r===null){v=i.stateNode;var L=i.memoizedProps,J=Yi(o,L);v.props=J;var fe=v.context,we=o.contextType;N=ws,typeof we=="object"&&we!==null&&(N=Yn(we));var Ee=o.getDerivedStateFromProps;we=typeof Ee=="function"||typeof v.getSnapshotBeforeUpdate=="function",L=i.pendingProps!==L,we||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L||fe!==N)&&fg(i,v,u,N),ni=!1;var he=i.memoizedState;v.state=he,zl(i,u,v,g),Ll(),fe=i.memoizedState,L||he!==fe||ni?(typeof Ee=="function"&&(md(i,o,Ee,u),fe=i.memoizedState),(J=ni||dg(i,o,J,u,he,fe,N))?(we||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=fe),v.props=u,v.state=fe,v.context=N,u=J):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{v=i.stateNode,$0(r,i),N=i.memoizedProps,we=Yi(o,N),v.props=we,Ee=i.pendingProps,he=v.context,fe=o.contextType,J=ws,typeof fe=="object"&&fe!==null&&(J=Yn(fe)),L=o.getDerivedStateFromProps,(fe=typeof L=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==Ee||he!==J)&&fg(i,v,u,J),ni=!1,he=i.memoizedState,v.state=he,zl(i,u,v,g),Ll();var be=i.memoizedState;N!==Ee||he!==be||ni||r!==null&&r.dependencies!==null&&ac(r.dependencies)?(typeof L=="function"&&(md(i,o,L,u),be=i.memoizedState),(we=ni||dg(i,o,we,u,he,be,J)||r!==null&&r.dependencies!==null&&ac(r.dependencies))?(fe||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,be,J),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,be,J)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&he===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&he===r.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=be),v.props=u,v.state=be,v.context=J,u=we):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&he===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&he===r.memoizedState||(i.flags|=1024),u=!1)}return v=u,kc(r,i),u=(i.flags&128)!==0,v||u?(v=i.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&u?(i.child=Ki(i,r.child,null,g),i.child=Ki(i,null,o,g)):Xn(r,i,o,g),i.memoizedState=v.state,r=i.child):r=Na(r,i,g),r}function Cg(r,i,o,u){return qi(),i.flags|=256,Xn(r,i,o,u),i.child}var vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yd(r){return{baseLanes:r,cachePool:g1()}}function xd(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=_r),r}function Rg(r,i,o){var u=i.pendingProps,g=!1,v=(i.flags&128)!==0,N;if((N=v)||(N=r!==null&&r.memoizedState===null?!1:(Tn.current&2)!==0),N&&(g=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,r===null){if(jt){if(g?ii(i):si(),(r=on)?(r=Lb(r,$r),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Qa!==null?{id:ra,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},o=l1(r),o.return=i,i.child=o,Vn=i,on=null)):r=null,r===null)throw ei(i);return nf(r)?i.lanes=32:i.lanes=536870912,null}var L=u.children;return u=u.fallback,g?(si(),g=i.mode,L=Ec({mode:"hidden",children:L},g),u=Ui(u,g,o,null),L.return=i,u.return=i,L.sibling=u,i.child=L,u=i.child,u.memoizedState=yd(o),u.childLanes=xd(r,N,o),i.memoizedState=vd,Fl(null,u)):(ii(i),wd(i,L))}var J=r.memoizedState;if(J!==null&&(L=J.dehydrated,L!==null)){if(v)i.flags&256?(ii(i),i.flags&=-257,i=Sd(r,i,o)):i.memoizedState!==null?(si(),i.child=r.child,i.flags|=128,i=null):(si(),L=u.fallback,g=i.mode,u=Ec({mode:"visible",children:u.children},g),L=Ui(L,g,o,null),L.flags|=2,u.return=i,L.return=i,u.sibling=L,i.child=u,Ki(i,r.child,null,o),u=i.child,u.memoizedState=yd(o),u.childLanes=xd(r,N,o),i.memoizedState=vd,i=Fl(null,u));else if(ii(i),nf(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var fe=N.dgst;N=fe,u=Error(a(419)),u.stack="",u.digest=N,_l({value:u,source:null,stack:null}),i=Sd(r,i,o)}else if(Mn||Ts(r,i,o,!1),N=(o&r.childLanes)!==0,Mn||N){if(N=nn,N!==null&&(u=yt(N,o),u!==0&&u!==J.retryLane))throw J.retryLane=u,Bi(r,u),yr(N,r,u),gd;tf(L)||Oc(),i=Sd(r,i,o)}else tf(L)?(i.flags|=192,i.child=r.child,i=null):(r=J.treeContext,on=Kr(L.nextSibling),Vn=i,jt=!0,Ja=null,$r=!1,r!==null&&u1(i,r),i=wd(i,u.children),i.flags|=4096);return i}return g?(si(),L=u.fallback,g=i.mode,J=r.child,fe=J.sibling,u=xa(J,{mode:"hidden",children:u.children}),u.subtreeFlags=J.subtreeFlags&65011712,fe!==null?L=xa(fe,L):(L=Ui(L,g,o,null),L.flags|=2),L.return=i,u.return=i,u.sibling=L,i.child=u,Fl(null,u),u=i.child,L=r.child.memoizedState,L===null?L=yd(o):(g=L.cachePool,g!==null?(J=_n._currentValue,g=g.parent!==J?{parent:J,pool:J}:g):g=g1(),L={baseLanes:L.baseLanes|o,cachePool:g}),u.memoizedState=L,u.childLanes=xd(r,N,o),i.memoizedState=vd,Fl(r.child,u)):(ii(i),o=r.child,r=o.sibling,o=xa(o,{mode:"visible",children:u.children}),o.return=i,o.sibling=null,r!==null&&(N=i.deletions,N===null?(i.deletions=[r],i.flags|=16):N.push(r)),i.child=o,i.memoizedState=null,o)}function wd(r,i){return i=Ec({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Ec(r,i){return r=Nr(22,r,null,i),r.lanes=0,r}function Sd(r,i,o){return Ki(i,r.child,null,o),r=wd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Ag(r,i,o){r.lanes|=i;var u=r.alternate;u!==null&&(u.lanes|=i),z0(r.return,i,o)}function kd(r,i,o,u,g,v){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:g,treeForkCount:v}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=u,N.tail=o,N.tailMode=g,N.treeForkCount=v)}function _g(r,i,o){var u=i.pendingProps,g=u.revealOrder,v=u.tail;u=u.children;var N=Tn.current,L=(N&2)!==0;if(L?(N=N&1|2,i.flags|=128):N&=1,A(Tn,N),Xn(r,i,u,o),u=jt?Al:0,!L&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ag(r,o,i);else if(r.tag===19)Ag(r,o,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(g){case"forwards":for(o=i.child,g=null;o!==null;)r=o.alternate,r!==null&&fc(r)===null&&(g=o),o=o.sibling;o=g,o===null?(g=i.child,i.child=null):(g=o.sibling,o.sibling=null),kd(i,!1,g,o,v,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,g=i.child,i.child=null;g!==null;){if(r=g.alternate,r!==null&&fc(r)===null){i.child=g;break}r=g.sibling,g.sibling=o,o=g,g=r}kd(i,!0,o,null,v,u);break;case"together":kd(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Na(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),ci|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(Ts(r,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,o=xa(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=xa(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Ed(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&ac(r)))}function i7(r,i,o){switch(i.tag){case 3:ce(i,i.stateNode.containerInfo),ti(i,_n,r.memoizedState.cache),qi();break;case 27:case 5:Ae(i);break;case 4:ce(i,i.stateNode.containerInfo);break;case 10:ti(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,X0(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ii(i),i.flags|=128,null):(o&i.child.childLanes)!==0?Rg(r,i,o):(ii(i),r=Na(r,i,o),r!==null?r.sibling:null);ii(i);break;case 19:var g=(r.flags&128)!==0;if(u=(o&i.childLanes)!==0,u||(Ts(r,i,o,!1),u=(o&i.childLanes)!==0),g){if(u)return _g(r,i,o);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),A(Tn,Tn.current),u)break;return null;case 22:return i.lanes=0,Sg(r,i,o,i.pendingProps);case 24:ti(i,_n,r.memoizedState.cache)}return Na(r,i,o)}function Ig(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)Mn=!0;else{if(!Ed(r,o)&&(i.flags&128)===0)return Mn=!1,i7(r,i,o);Mn=(r.flags&131072)!==0}else Mn=!1,jt&&(i.flags&1048576)!==0&&c1(i,Al,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(r=$i(i.elementType),i.type=r,typeof r=="function")A0(r)?(u=Yi(r,u),i.tag=1,i=Ng(null,i,r,u,o)):(i.tag=0,i=bd(null,i,r,u,o));else{if(r!=null){var g=r.$$typeof;if(g===G){i.tag=11,i=yg(null,i,r,u,o);break e}else if(g===B){i.tag=14,i=xg(null,i,r,u,o);break e}}throw i=V(r)||r,Error(a(306,i,""))}}return i;case 0:return bd(r,i,i.type,i.pendingProps,o);case 1:return u=i.type,g=Yi(u,i.pendingProps),Ng(r,i,u,g,o);case 3:e:{if(ce(i,i.stateNode.containerInfo),r===null)throw Error(a(387));u=i.pendingProps;var v=i.memoizedState;g=v.element,$0(r,i),zl(i,u,null,o);var N=i.memoizedState;if(u=N.cache,ti(i,_n,u),u!==v.cache&&B0(i,[_n],o,!0),Ll(),u=N.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Cg(r,i,u,o);break e}else if(u!==g){g=Hr(Error(a(424)),i),_l(g),i=Cg(r,i,u,o);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,on=Kr(r.firstChild),Vn=i,jt=!0,Ja=null,$r=!0,o=S1(i,null,u,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(qi(),u===g){i=Na(r,i,o);break e}Xn(r,i,u,o)}i=i.child}return i;case 26:return kc(r,i),r===null?(o=Fb(i.type,null,i.pendingProps,null))?i.memoizedState=o:jt||(o=i.type,r=i.pendingProps,u=qc(te.current).createElement(o),u[Pt]=i,u[kn]=r,Zn(u,o,r),Rn(u),i.stateNode=u):i.memoizedState=Fb(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ae(i),r===null&&jt&&(u=i.stateNode=Ub(i.type,i.pendingProps,te.current),Vn=i,$r=!0,g=on,hi(i.type)?(rf=g,on=Kr(u.firstChild)):on=g),Xn(r,i,i.pendingProps.children,o),kc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&jt&&((g=u=on)&&(u=j7(u,i.type,i.pendingProps,$r),u!==null?(i.stateNode=u,Vn=i,on=Kr(u.firstChild),$r=!1,g=!0):g=!1),g||ei(i)),Ae(i),g=i.type,v=i.pendingProps,N=r!==null?r.memoizedProps:null,u=v.children,Qd(g,v)?u=null:N!==null&&Qd(g,N)&&(i.flags|=32),i.memoizedState!==null&&(g=W0(r,i,Zx,null,null,o),ro._currentValue=g),kc(r,i),Xn(r,i,u,o),i.child;case 6:return r===null&&jt&&((r=o=on)&&(o=L7(o,i.pendingProps,$r),o!==null?(i.stateNode=o,Vn=i,on=null,r=!0):r=!1),r||ei(i)),null;case 13:return Rg(r,i,o);case 4:return ce(i,i.stateNode.containerInfo),u=i.pendingProps,r===null?i.child=Ki(i,null,u,o):Xn(r,i,u,o),i.child;case 11:return yg(r,i,i.type,i.pendingProps,o);case 7:return Xn(r,i,i.pendingProps,o),i.child;case 8:return Xn(r,i,i.pendingProps.children,o),i.child;case 12:return Xn(r,i,i.pendingProps.children,o),i.child;case 10:return u=i.pendingProps,ti(i,i.type,u.value),Xn(r,i,u.children,o),i.child;case 9:return g=i.type._context,u=i.pendingProps.children,Fi(i),g=Yn(g),u=u(g),i.flags|=1,Xn(r,i,u,o),i.child;case 14:return xg(r,i,i.type,i.pendingProps,o);case 15:return wg(r,i,i.type,i.pendingProps,o);case 19:return _g(r,i,o);case 31:return a7(r,i,o);case 22:return Sg(r,i,o,i.pendingProps);case 24:return Fi(i),u=Yn(_n),r===null?(g=H0(),g===null&&(g=nn,v=U0(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=o),g=v),i.memoizedState={parent:u,cache:g},P0(i),ti(i,_n,g)):((r.lanes&o)!==0&&($0(r,i),zl(i,null,null,o),Ll()),g=r.memoizedState,v=i.memoizedState,g.parent!==u?(g={parent:u,cache:u},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),ti(i,_n,u)):(u=v.cache,ti(i,_n,u),u!==g.cache&&B0(i,[_n],o,!0))),Xn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ca(r){r.flags|=4}function Td(r,i,o,u,g){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(ab())r.flags|=8192;else throw Gi=oc,F0}else r.flags&=-16777217}function Mg(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Vb(i))if(ab())r.flags|=8192;else throw Gi=oc,F0}function Tc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Xe():536870912,r.lanes|=i,zs|=i)}function Pl(r,i){if(!jt)switch(r.tailMode){case"hidden":i=r.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function cn(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,u=0;if(i)for(var g=r.child;g!==null;)o|=g.lanes|g.childLanes,u|=g.subtreeFlags&65011712,u|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)o|=g.lanes|g.childLanes,u|=g.subtreeFlags,u|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=u,r.childLanes=o,i}function s7(r,i,o){var u=i.pendingProps;switch(O0(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(i),null;case 1:return cn(i),null;case 3:return o=i.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),ka(_n),ge(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(Es(i)?Ca(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,j0())),cn(i),null;case 26:var g=i.type,v=i.memoizedState;return r===null?(Ca(i),v!==null?(cn(i),Mg(i,v)):(cn(i),Td(i,g,null,u,o))):v?v!==r.memoizedState?(Ca(i),cn(i),Mg(i,v)):(cn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==u&&Ca(i),cn(i),Td(i,g,r,u,o)),null;case 27:if(Oe(i),o=te.current,g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==u&&Ca(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return cn(i),null}r=ae.current,Es(i)?d1(i):(r=Ub(g,u,o),i.stateNode=r,Ca(i))}return cn(i),null;case 5:if(Oe(i),g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==u&&Ca(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return cn(i),null}if(v=ae.current,Es(i))d1(i);else{var N=qc(te.current);switch(v){case 1:v=N.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=N.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=N.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=N.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=N.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?N.createElement("select",{is:u.is}):N.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?N.createElement(g,{is:u.is}):N.createElement(g)}}v[Pt]=i,v[kn]=u;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)v.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=v;e:switch(Zn(v,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ca(i)}}return cn(i),Td(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==u&&Ca(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(r=te.current,Es(i)){if(r=i.stateNode,o=i.memoizedProps,u=null,g=Vn,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}r[Pt]=i,r=!!(r.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||Rb(r.nodeValue,o)),r||ei(i,!0)}else r=qc(r).createTextNode(u),r[Pt]=i,i.stateNode=r}return cn(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(u=Es(i),o!==null){if(r===null){if(!u)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Pt]=i}else qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),r=!1}else o=j0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Rr(i),i):(Rr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return cn(i),null;case 13:if(u=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=Es(i),u!==null&&u.dehydrated!==null){if(r===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[Pt]=i}else qi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),g=!1}else g=j0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Rr(i),i):(Rr(i),null)}return Rr(i),(i.flags&128)!==0?(i.lanes=o,i):(o=u!==null,r=r!==null&&r.memoizedState!==null,o&&(u=i.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==g&&(u.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),Tc(i,i.updateQueue),cn(i),null);case 4:return ge(),r===null&&Vd(i.stateNode.containerInfo),cn(i),null;case 10:return ka(i.type),cn(i),null;case 19:if(q(Tn),u=i.memoizedState,u===null)return cn(i),null;if(g=(i.flags&128)!==0,v=u.rendering,v===null)if(g)Pl(u,!1);else{if(vn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=fc(r),v!==null){for(i.flags|=128,Pl(u,!1),r=v.updateQueue,i.updateQueue=r,Tc(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)s1(o,r),o=o.sibling;return A(Tn,Tn.current&1|2),jt&&wa(i,u.treeForkCount),i.child}r=r.sibling}u.tail!==null&&Pe()>_c&&(i.flags|=128,g=!0,Pl(u,!1),i.lanes=4194304)}else{if(!g)if(r=fc(v),r!==null){if(i.flags|=128,g=!0,r=r.updateQueue,i.updateQueue=r,Tc(i,r),Pl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!jt)return cn(i),null}else 2*Pe()-u.renderingStartTime>_c&&o!==536870912&&(i.flags|=128,g=!0,Pl(u,!1),i.lanes=4194304);u.isBackwards?(v.sibling=i.child,i.child=v):(r=u.last,r!==null?r.sibling=v:i.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=Pe(),r.sibling=null,o=Tn.current,A(Tn,g?o&1|2:o&1),jt&&wa(i,u.treeForkCount),r):(cn(i),null);case 22:case 23:return Rr(i),Y0(),u=i.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(o&536870912)!==0&&(i.flags&128)===0&&(cn(i),i.subtreeFlags&6&&(i.flags|=8192)):cn(i),o=i.updateQueue,o!==null&&Tc(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==o&&(i.flags|=2048),r!==null&&q(Pi),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),ka(_n),cn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function l7(r,i){switch(O0(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ka(_n),ge(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Oe(i),null;case 31:if(i.memoizedState!==null){if(Rr(i),i.alternate===null)throw Error(a(340));qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Rr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));qi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return q(Tn),null;case 4:return ge(),null;case 10:return ka(i.type),null;case 22:case 23:return Rr(i),Y0(),r!==null&&q(Pi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ka(_n),null;case 25:return null;default:return null}}function Og(r,i){switch(O0(i),i.tag){case 3:ka(_n),ge();break;case 26:case 27:case 5:Oe(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&Rr(i);break;case 13:Rr(i);break;case 19:q(Tn);break;case 10:ka(i.type);break;case 22:case 23:Rr(i),Y0(),r!==null&&q(Pi);break;case 24:ka(_n)}}function $l(r,i){try{var o=i.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var g=u.next;o=g;do{if((o.tag&r)===r){u=void 0;var v=o.create,N=o.inst;u=v(),N.destroy=u}o=o.next}while(o!==g)}}catch(L){Zt(i,i.return,L)}}function li(r,i,o){try{var u=i.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var v=g.next;u=v;do{if((u.tag&r)===r){var N=u.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,g=i;var J=o,fe=L;try{fe()}catch(we){Zt(g,J,we)}}}u=u.next}while(u!==v)}}catch(we){Zt(i,i.return,we)}}function Dg(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{E1(i,o)}catch(u){Zt(r,r.return,u)}}}function jg(r,i,o){o.props=Yi(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(u){Zt(r,i,u)}}function Gl(r,i){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof o=="function"?r.refCleanup=o(u):o.current=u}}catch(g){Zt(r,i,g)}}function ia(r,i){var o=r.ref,u=r.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(g){Zt(r,i,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(g){Zt(r,i,g)}else o.current=null}function Lg(r){var i=r.type,o=r.memoizedProps,u=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(g){Zt(r,r.return,g)}}function Nd(r,i,o){try{var u=r.stateNode;A7(u,r.type,o,i),u[kn]=i}catch(g){Zt(r,r.return,g)}}function zg(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&hi(r.type)||r.tag===4}function Cd(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||zg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&hi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Rd(r,i,o){var u=r.tag;if(u===5||u===6)r=r.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(r),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Le));else if(u!==4&&(u===27&&hi(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(Rd(r,i,o),r=r.sibling;r!==null;)Rd(r,i,o),r=r.sibling}function Nc(r,i,o){var u=r.tag;if(u===5||u===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(u!==4&&(u===27&&hi(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Nc(r,i,o),r=r.sibling;r!==null;)Nc(r,i,o),r=r.sibling}function Bg(r){var i=r.stateNode,o=r.memoizedProps;try{for(var u=r.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);Zn(i,u,o),i[Pt]=r,i[kn]=o}catch(v){Zt(r,r.return,v)}}var Ra=!1,On=!1,Ad=!1,Ug=typeof WeakSet=="function"?WeakSet:Set,Gn=null;function o7(r,i){if(r=r.containerInfo,Zd=Vc,r=Wp(r),S0(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var g=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{o.nodeType,v.nodeType}catch{o=null;break e}var N=0,L=-1,J=-1,fe=0,we=0,Ee=r,he=null;t:for(;;){for(var be;Ee!==o||g!==0&&Ee.nodeType!==3||(L=N+g),Ee!==v||u!==0&&Ee.nodeType!==3||(J=N+u),Ee.nodeType===3&&(N+=Ee.nodeValue.length),(be=Ee.firstChild)!==null;)he=Ee,Ee=be;for(;;){if(Ee===r)break t;if(he===o&&++fe===g&&(L=N),he===v&&++we===u&&(J=N),(be=Ee.nextSibling)!==null)break;Ee=he,he=Ee.parentNode}Ee=be}o=L===-1||J===-1?null:{start:L,end:J}}else o=null}o=o||{start:0,end:0}}else o=null;for(Wd={focusedElem:r,selectionRange:o},Vc=!1,Gn=i;Gn!==null;)if(i=Gn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Gn=r;else for(;Gn!==null;){switch(i=Gn,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(o=0;o<r.length;o++)g=r[o],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,o=i,g=v.memoizedProps,v=v.memoizedState,u=o.stateNode;try{var $e=Yi(o.type,g);r=u.getSnapshotBeforeUpdate($e,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(at){Zt(o,o.return,at)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)ef(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ef(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Gn=r;break}Gn=i.return}}function qg(r,i,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:_a(r,o),u&4&&$l(5,o);break;case 1:if(_a(r,o),u&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(N){Zt(o,o.return,N)}else{var g=Yi(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(g,i,r.__reactInternalSnapshotBeforeUpdate)}catch(N){Zt(o,o.return,N)}}u&64&&Dg(o),u&512&&Gl(o,o.return);break;case 3:if(_a(r,o),u&64&&(r=o.updateQueue,r!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{E1(r,i)}catch(N){Zt(o,o.return,N)}}break;case 27:i===null&&u&4&&Bg(o);case 26:case 5:_a(r,o),i===null&&u&4&&Lg(o),u&512&&Gl(o,o.return);break;case 12:_a(r,o);break;case 31:_a(r,o),u&4&&Pg(r,o);break;case 13:_a(r,o),u&4&&$g(r,o),u&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=b7.bind(null,o),z7(r,o))));break;case 22:if(u=o.memoizedState!==null||Ra,!u){i=i!==null&&i.memoizedState!==null||On,g=Ra;var v=On;Ra=u,(On=i)&&!v?Ia(r,o,(o.subtreeFlags&8772)!==0):_a(r,o),Ra=g,On=v}break;case 30:break;default:_a(r,o)}}function Hg(r){var i=r.alternate;i!==null&&(r.alternate=null,Hg(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&pl(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var dn=null,pr=!1;function Aa(r,i,o){for(o=o.child;o!==null;)Fg(r,i,o),o=o.sibling}function Fg(r,i,o){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Bt,o)}catch{}switch(o.tag){case 26:On||ia(o,i),Aa(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:On||ia(o,i);var u=dn,g=pr;hi(o.type)&&(dn=o.stateNode,pr=!1),Aa(r,i,o),eo(o.stateNode),dn=u,pr=g;break;case 5:On||ia(o,i);case 6:if(u=dn,g=pr,dn=null,Aa(r,i,o),dn=u,pr=g,dn!==null)if(pr)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(o.stateNode)}catch(v){Zt(o,i,v)}else try{dn.removeChild(o.stateNode)}catch(v){Zt(o,i,v)}break;case 18:dn!==null&&(pr?(r=dn,Db(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),Gs(r)):Db(dn,o.stateNode));break;case 4:u=dn,g=pr,dn=o.stateNode.containerInfo,pr=!0,Aa(r,i,o),dn=u,pr=g;break;case 0:case 11:case 14:case 15:li(2,o,i),On||li(4,o,i),Aa(r,i,o);break;case 1:On||(ia(o,i),u=o.stateNode,typeof u.componentWillUnmount=="function"&&jg(o,i,u)),Aa(r,i,o);break;case 21:Aa(r,i,o);break;case 22:On=(u=On)||o.memoizedState!==null,Aa(r,i,o),On=u;break;default:Aa(r,i,o)}}function Pg(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Gs(r)}catch(o){Zt(i,i.return,o)}}}function $g(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Gs(r)}catch(o){Zt(i,i.return,o)}}function c7(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Ug),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Ug),i;default:throw Error(a(435,r.tag))}}function Cc(r,i){var o=c7(r);i.forEach(function(u){if(!o.has(u)){o.add(u);var g=v7.bind(null,r,u);u.then(g,g)}})}function gr(r,i){var o=i.deletions;if(o!==null)for(var u=0;u<o.length;u++){var g=o[u],v=r,N=i,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(hi(L.type)){dn=L.stateNode,pr=!1;break e}break;case 5:dn=L.stateNode,pr=!1;break e;case 3:case 4:dn=L.stateNode.containerInfo,pr=!0;break e}L=L.return}if(dn===null)throw Error(a(160));Fg(v,N,g),dn=null,pr=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Gg(i,r),i=i.sibling}var Jr=null;function Gg(r,i){var o=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:gr(i,r),br(r),u&4&&(li(3,r,r.return),$l(3,r),li(5,r,r.return));break;case 1:gr(i,r),br(r),u&512&&(On||o===null||ia(o,o.return)),u&64&&Ra&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var g=Jr;if(gr(i,r),br(r),u&512&&(On||o===null||ia(o,o.return)),u&4){var v=o!==null?o.memoizedState:null;if(u=r.memoizedState,o===null)if(u===null)if(r.stateNode===null){e:{u=r.type,o=r.memoizedProps,g=g.ownerDocument||g;t:switch(u){case"title":v=g.getElementsByTagName("title")[0],(!v||v[Mi]||v[Pt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(u),g.head.insertBefore(v,g.querySelector("head > title"))),Zn(v,u,o),v[Pt]=r,Rn(v),u=v;break e;case"link":var N=Gb("link","href",g).get(u+(o.href||""));if(N){for(var L=0;L<N.length;L++)if(v=N[L],v.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&v.getAttribute("rel")===(o.rel==null?null:o.rel)&&v.getAttribute("title")===(o.title==null?null:o.title)&&v.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){N.splice(L,1);break t}}v=g.createElement(u),Zn(v,u,o),g.head.appendChild(v);break;case"meta":if(N=Gb("meta","content",g).get(u+(o.content||""))){for(L=0;L<N.length;L++)if(v=N[L],v.getAttribute("content")===(o.content==null?null:""+o.content)&&v.getAttribute("name")===(o.name==null?null:o.name)&&v.getAttribute("property")===(o.property==null?null:o.property)&&v.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&v.getAttribute("charset")===(o.charSet==null?null:o.charSet)){N.splice(L,1);break t}}v=g.createElement(u),Zn(v,u,o),g.head.appendChild(v);break;default:throw Error(a(468,u))}v[Pt]=r,Rn(v),u=v}r.stateNode=u}else Kb(g,r.type,r.stateNode);else r.stateNode=$b(g,u,r.memoizedProps);else v!==u?(v===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):v.count--,u===null?Kb(g,r.type,r.stateNode):$b(g,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Nd(r,r.memoizedProps,o.memoizedProps)}break;case 27:gr(i,r),br(r),u&512&&(On||o===null||ia(o,o.return)),o!==null&&u&4&&Nd(r,r.memoizedProps,o.memoizedProps);break;case 5:if(gr(i,r),br(r),u&512&&(On||o===null||ia(o,o.return)),r.flags&32){g=r.stateNode;try{st(g,"")}catch($e){Zt(r,r.return,$e)}}u&4&&r.stateNode!=null&&(g=r.memoizedProps,Nd(r,g,o!==null?o.memoizedProps:g)),u&1024&&(Ad=!0);break;case 6:if(gr(i,r),br(r),u&4){if(r.stateNode===null)throw Error(a(162));u=r.memoizedProps,o=r.stateNode;try{o.nodeValue=u}catch($e){Zt(r,r.return,$e)}}break;case 3:if(Pc=null,g=Jr,Jr=Hc(i.containerInfo),gr(i,r),Jr=g,br(r),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Gs(i.containerInfo)}catch($e){Zt(r,r.return,$e)}Ad&&(Ad=!1,Kg(r));break;case 4:u=Jr,Jr=Hc(r.stateNode.containerInfo),gr(i,r),br(r),Jr=u;break;case 12:gr(i,r),br(r);break;case 31:gr(i,r),br(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Cc(r,u)));break;case 13:gr(i,r),br(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Ac=Pe()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Cc(r,u)));break;case 22:g=r.memoizedState!==null;var J=o!==null&&o.memoizedState!==null,fe=Ra,we=On;if(Ra=fe||g,On=we||J,gr(i,r),On=we,Ra=fe,br(r),u&8192)e:for(i=r.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(o===null||J||Ra||On||Xi(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){J=o=i;try{if(v=J.stateNode,g)N=v.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=J.stateNode;var Ee=J.memoizedProps.style,he=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;L.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch($e){Zt(J,J.return,$e)}}}else if(i.tag===6){if(o===null){J=i;try{J.stateNode.nodeValue=g?"":J.memoizedProps}catch($e){Zt(J,J.return,$e)}}}else if(i.tag===18){if(o===null){J=i;try{var be=J.stateNode;g?jb(be,!0):jb(J.stateNode,!1)}catch($e){Zt(J,J.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=r.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Cc(r,o))));break;case 19:gr(i,r),br(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,Cc(r,u)));break;case 30:break;case 21:break;default:gr(i,r),br(r)}}function br(r){var i=r.flags;if(i&2){try{for(var o,u=r.return;u!==null;){if(zg(u)){o=u;break}u=u.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var g=o.stateNode,v=Cd(r);Nc(r,v,g);break;case 5:var N=o.stateNode;o.flags&32&&(st(N,""),o.flags&=-33);var L=Cd(r);Nc(r,L,N);break;case 3:case 4:var J=o.stateNode.containerInfo,fe=Cd(r);Rd(r,fe,J);break;default:throw Error(a(161))}}catch(we){Zt(r,r.return,we)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Kg(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Kg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function _a(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qg(r,i.alternate,i),i=i.sibling}function Xi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:li(4,i,i.return),Xi(i);break;case 1:ia(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&jg(i,i.return,o),Xi(i);break;case 27:eo(i.stateNode);case 26:case 5:ia(i,i.return),Xi(i);break;case 22:i.memoizedState===null&&Xi(i);break;case 30:Xi(i);break;default:Xi(i)}r=r.sibling}}function Ia(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,g=r,v=i,N=v.flags;switch(v.tag){case 0:case 11:case 15:Ia(g,v,o),$l(4,v);break;case 1:if(Ia(g,v,o),u=v,g=u.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(fe){Zt(u,u.return,fe)}if(u=v,g=u.updateQueue,g!==null){var L=u.stateNode;try{var J=g.shared.hiddenCallbacks;if(J!==null)for(g.shared.hiddenCallbacks=null,g=0;g<J.length;g++)k1(J[g],L)}catch(fe){Zt(u,u.return,fe)}}o&&N&64&&Dg(v),Gl(v,v.return);break;case 27:Bg(v);case 26:case 5:Ia(g,v,o),o&&u===null&&N&4&&Lg(v),Gl(v,v.return);break;case 12:Ia(g,v,o);break;case 31:Ia(g,v,o),o&&N&4&&Pg(g,v);break;case 13:Ia(g,v,o),o&&N&4&&$g(g,v);break;case 22:v.memoizedState===null&&Ia(g,v,o),Gl(v,v.return);break;case 30:break;default:Ia(g,v,o)}i=i.sibling}}function _d(r,i){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&Il(o))}function Id(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Il(r))}function ea(r,i,o,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Vg(r,i,o,u),i=i.sibling}function Vg(r,i,o,u){var g=i.flags;switch(i.tag){case 0:case 11:case 15:ea(r,i,o,u),g&2048&&$l(9,i);break;case 1:ea(r,i,o,u);break;case 3:ea(r,i,o,u),g&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Il(r)));break;case 12:if(g&2048){ea(r,i,o,u),r=i.stateNode;try{var v=i.memoizedProps,N=v.id,L=v.onPostCommit;typeof L=="function"&&L(N,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(J){Zt(i,i.return,J)}}else ea(r,i,o,u);break;case 31:ea(r,i,o,u);break;case 13:ea(r,i,o,u);break;case 23:break;case 22:v=i.stateNode,N=i.alternate,i.memoizedState!==null?v._visibility&2?ea(r,i,o,u):Kl(r,i):v._visibility&2?ea(r,i,o,u):(v._visibility|=2,Ds(r,i,o,u,(i.subtreeFlags&10256)!==0||!1)),g&2048&&_d(N,i);break;case 24:ea(r,i,o,u),g&2048&&Id(i.alternate,i);break;default:ea(r,i,o,u)}}function Ds(r,i,o,u,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,N=i,L=o,J=u,fe=N.flags;switch(N.tag){case 0:case 11:case 15:Ds(v,N,L,J,g),$l(8,N);break;case 23:break;case 22:var we=N.stateNode;N.memoizedState!==null?we._visibility&2?Ds(v,N,L,J,g):Kl(v,N):(we._visibility|=2,Ds(v,N,L,J,g)),g&&fe&2048&&_d(N.alternate,N);break;case 24:Ds(v,N,L,J,g),g&&fe&2048&&Id(N.alternate,N);break;default:Ds(v,N,L,J,g)}i=i.sibling}}function Kl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,u=i,g=u.flags;switch(u.tag){case 22:Kl(o,u),g&2048&&_d(u.alternate,u);break;case 24:Kl(o,u),g&2048&&Id(u.alternate,u);break;default:Kl(o,u)}i=i.sibling}}var Vl=8192;function js(r,i,o){if(r.subtreeFlags&Vl)for(r=r.child;r!==null;)Yg(r,i,o),r=r.sibling}function Yg(r,i,o){switch(r.tag){case 26:js(r,i,o),r.flags&Vl&&r.memoizedState!==null&&X7(o,Jr,r.memoizedState,r.memoizedProps);break;case 5:js(r,i,o);break;case 3:case 4:var u=Jr;Jr=Hc(r.stateNode.containerInfo),js(r,i,o),Jr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Vl,Vl=16777216,js(r,i,o),Vl=u):js(r,i,o));break;default:js(r,i,o)}}function Xg(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Yl(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Gn=u,Wg(u,r)}Xg(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Zg(r),r=r.sibling}function Zg(r){switch(r.tag){case 0:case 11:case 15:Yl(r),r.flags&2048&&li(9,r,r.return);break;case 3:Yl(r);break;case 12:Yl(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Rc(r)):Yl(r);break;default:Yl(r)}}function Rc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var u=i[o];Gn=u,Wg(u,r)}Xg(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:li(8,i,i.return),Rc(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,Rc(i));break;default:Rc(i)}r=r.sibling}}function Wg(r,i){for(;Gn!==null;){var o=Gn;switch(o.tag){case 0:case 11:case 15:li(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Il(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,Gn=u;else e:for(o=r;Gn!==null;){u=Gn;var g=u.sibling,v=u.return;if(Hg(u),u===o){Gn=null;break e}if(g!==null){g.return=v,Gn=g;break e}Gn=v}}}var u7={getCacheForType:function(r){var i=Yn(_n),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return Yn(_n).controller.signal}},d7=typeof WeakMap=="function"?WeakMap:Map,$t=0,nn=null,Ct=null,Mt=0,Xt=0,Ar=null,oi=!1,Ls=!1,Md=!1,Ma=0,vn=0,ci=0,Zi=0,Od=0,_r=0,zs=0,Xl=null,vr=null,Dd=!1,Ac=0,Qg=0,_c=1/0,Ic=null,ui=null,qn=0,di=null,Bs=null,Oa=0,jd=0,Ld=null,Jg=null,Zl=0,zd=null;function Ir(){return($t&2)!==0&&Mt!==0?Mt&-Mt:K.T!==null?Pd():Un()}function eb(){if(_r===0)if((Mt&536870912)===0||jt){var r=St;St<<=1,(St&3932160)===0&&(St=262144),_r=r}else _r=536870912;return r=Cr.current,r!==null&&(r.flags|=32),_r}function yr(r,i,o){(r===nn&&(Xt===2||Xt===9)||r.cancelPendingCommit!==null)&&(Us(r,0),fi(r,Mt,_r,!1)),kt(r,o),(($t&2)===0||r!==nn)&&(r===nn&&(($t&2)===0&&(Zi|=o),vn===4&&fi(r,Mt,_r,!1)),sa(r))}function tb(r,i,o){if(($t&6)!==0)throw Error(a(327));var u=!o&&(i&127)===0&&(i&r.expiredLanes)===0||xe(r,i),g=u?h7(r,i):Ud(r,i,!0),v=u;do{if(g===0){Ls&&!u&&fi(r,i,0,!1);break}else{if(o=r.current.alternate,v&&!f7(o)){g=Ud(r,i,!1),v=!1;continue}if(g===2){if(v=i,r.errorRecoveryDisabledLanes&v)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var L=r;g=Xl;var J=L.current.memoizedState.isDehydrated;if(J&&(Us(L,N).flags|=256),N=Ud(L,N,!1),N!==2){if(Md&&!J){L.errorRecoveryDisabledLanes|=v,Zi|=v,g=4;break e}v=vr,vr=g,v!==null&&(vr===null?vr=v:vr.push.apply(vr,v))}g=N}if(v=!1,g!==2)continue}}if(g===1){Us(r,0),fi(r,i,0,!0);break}e:{switch(u=r,v=g,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:fi(u,i,_r,!oi);break e;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=Ac+300-Pe(),10<g)){if(fi(u,i,_r,!oi),Q(u,0,!0)!==0)break e;Oa=i,u.timeoutHandle=Mb(nb.bind(null,u,o,vr,Ic,Dd,i,_r,Zi,zs,oi,v,"Throttled",-0,0),g);break e}nb(u,o,vr,Ic,Dd,i,_r,Zi,zs,oi,v,null,-0,0)}}break}while(!0);sa(r)}function nb(r,i,o,u,g,v,N,L,J,fe,we,Ee,he,be){if(r.timeoutHandle=-1,Ee=i.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Le},Yg(i,v,Ee);var $e=(v&62914560)===v?Ac-Pe():(v&4194048)===v?Qg-Pe():0;if($e=Z7(Ee,$e),$e!==null){Oa=v,r.cancelPendingCommit=$e(ub.bind(null,r,i,v,o,u,g,N,L,J,we,Ee,null,he,be)),fi(r,v,N,!fe);return}}ub(r,i,v,o,u,g,N,L,J)}function f7(r){for(var i=r;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var g=o[u],v=g.getSnapshot;g=g.value;try{if(!Tr(v(),g))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function fi(r,i,o,u){i&=~Od,i&=~Zi,r.suspendedLanes|=i,r.pingedLanes&=~i,u&&(r.warmLanes|=i),u=r.expirationTimes;for(var g=i;0<g;){var v=31-bt(g),N=1<<v;u[v]=-1,g&=~N}o!==0&&Se(r,o,i)}function Mc(){return($t&6)===0?(Wl(0),!1):!0}function Bd(){if(Ct!==null){if(Xt===0)var r=Ct.return;else r=Ct,Sa=Hi=null,ed(r),As=null,Ol=0,r=Ct;for(;r!==null;)Og(r.alternate,r),r=r.return;Ct=null}}function Us(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,M7(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),Oa=0,Bd(),nn=r,Ct=o=xa(r.current,null),Mt=i,Xt=0,Ar=null,oi=!1,Ls=xe(r,i),Md=!1,zs=_r=Od=Zi=ci=vn=0,vr=Xl=null,Dd=!1,(i&8)!==0&&(i|=i&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=i;0<u;){var g=31-bt(u),v=1<<g;i|=r[g],u&=~v}return Ma=i,Jo(),o}function rb(r,i){vt=null,K.H=Hl,i===Rs||i===lc?(i=y1(),Xt=3):i===F0?(i=y1(),Xt=4):Xt=i===gd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ar=i,Ct===null&&(vn=1,wc(r,Hr(i,r.current)))}function ab(){var r=Cr.current;return r===null?!0:(Mt&4194048)===Mt?Gr===null:(Mt&62914560)===Mt||(Mt&536870912)!==0?r===Gr:!1}function ib(){var r=K.H;return K.H=Hl,r===null?Hl:r}function sb(){var r=K.A;return K.A=u7,r}function Oc(){vn=4,oi||(Mt&4194048)!==Mt&&Cr.current!==null||(Ls=!0),(ci&134217727)===0&&(Zi&134217727)===0||nn===null||fi(nn,Mt,_r,!1)}function Ud(r,i,o){var u=$t;$t|=2;var g=ib(),v=sb();(nn!==r||Mt!==i)&&(Ic=null,Us(r,i)),i=!1;var N=vn;e:do try{if(Xt!==0&&Ct!==null){var L=Ct,J=Ar;switch(Xt){case 8:Bd(),N=6;break e;case 3:case 2:case 9:case 6:Cr.current===null&&(i=!0);var fe=Xt;if(Xt=0,Ar=null,qs(r,L,J,fe),o&&Ls){N=0;break e}break;default:fe=Xt,Xt=0,Ar=null,qs(r,L,J,fe)}}m7(),N=vn;break}catch(we){rb(r,we)}while(!0);return i&&r.shellSuspendCounter++,Sa=Hi=null,$t=u,K.H=g,K.A=v,Ct===null&&(nn=null,Mt=0,Jo()),N}function m7(){for(;Ct!==null;)lb(Ct)}function h7(r,i){var o=$t;$t|=2;var u=ib(),g=sb();nn!==r||Mt!==i?(Ic=null,_c=Pe()+500,Us(r,i)):Ls=xe(r,i);e:do try{if(Xt!==0&&Ct!==null){i=Ct;var v=Ar;t:switch(Xt){case 1:Xt=0,Ar=null,qs(r,i,v,1);break;case 2:case 9:if(b1(v)){Xt=0,Ar=null,ob(i);break}i=function(){Xt!==2&&Xt!==9||nn!==r||(Xt=7),sa(r)},v.then(i,i);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:b1(v)?(Xt=0,Ar=null,ob(i)):(Xt=0,Ar=null,qs(r,i,v,7));break;case 5:var N=null;switch(Ct.tag){case 26:N=Ct.memoizedState;case 5:case 27:var L=Ct;if(N?Vb(N):L.stateNode.complete){Xt=0,Ar=null;var J=L.sibling;if(J!==null)Ct=J;else{var fe=L.return;fe!==null?(Ct=fe,Dc(fe)):Ct=null}break t}}Xt=0,Ar=null,qs(r,i,v,5);break;case 6:Xt=0,Ar=null,qs(r,i,v,6);break;case 8:Bd(),vn=6;break e;default:throw Error(a(462))}}p7();break}catch(we){rb(r,we)}while(!0);return Sa=Hi=null,K.H=u,K.A=g,$t=o,Ct!==null?0:(nn=null,Mt=0,Jo(),vn)}function p7(){for(;Ct!==null&&!ct();)lb(Ct)}function lb(r){var i=Ig(r.alternate,r,Ma);r.memoizedProps=r.pendingProps,i===null?Dc(r):Ct=i}function ob(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=Tg(o,i,i.pendingProps,i.type,void 0,Mt);break;case 11:i=Tg(o,i,i.pendingProps,i.type.render,i.ref,Mt);break;case 5:ed(i);default:Og(o,i),i=Ct=s1(i,Ma),i=Ig(o,i,Ma)}r.memoizedProps=r.pendingProps,i===null?Dc(r):Ct=i}function qs(r,i,o,u){Sa=Hi=null,ed(i),As=null,Ol=0;var g=i.return;try{if(r7(r,g,i,o,Mt)){vn=1,wc(r,Hr(o,r.current)),Ct=null;return}}catch(v){if(g!==null)throw Ct=g,v;vn=1,wc(r,Hr(o,r.current)),Ct=null;return}i.flags&32768?(jt||u===1?r=!0:Ls||(Mt&536870912)!==0?r=!1:(oi=r=!0,(u===2||u===9||u===3||u===6)&&(u=Cr.current,u!==null&&u.tag===13&&(u.flags|=16384))),cb(i,r)):Dc(i)}function Dc(r){var i=r;do{if((i.flags&32768)!==0){cb(i,oi);return}r=i.return;var o=s7(i.alternate,i,Ma);if(o!==null){Ct=o;return}if(i=i.sibling,i!==null){Ct=i;return}Ct=i=r}while(i!==null);vn===0&&(vn=5)}function cb(r,i){do{var o=l7(r.alternate,r);if(o!==null){o.flags&=32767,Ct=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Ct=r;return}Ct=r=o}while(r!==null);vn=6,Ct=null}function ub(r,i,o,u,g,v,N,L,J){r.cancelPendingCommit=null;do jc();while(qn!==0);if(($t&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=C0,ie(r,o,v,N,L,J),r===nn&&(Ct=nn=null,Mt=0),Bs=i,di=r,Oa=o,jd=v,Ld=g,Jg=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,y7(qe,function(){return pb(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=K.T,K.T=null,g=re.p,re.p=2,N=$t,$t|=4;try{o7(r,i,o)}finally{$t=N,re.p=g,K.T=u}}qn=1,db(),fb(),mb()}}function db(){if(qn===1){qn=0;var r=di,i=Bs,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=K.T,K.T=null;var u=re.p;re.p=2;var g=$t;$t|=4;try{Gg(i,r);var v=Wd,N=Wp(r.containerInfo),L=v.focusedElem,J=v.selectionRange;if(N!==L&&L&&L.ownerDocument&&Zp(L.ownerDocument.documentElement,L)){if(J!==null&&S0(L)){var fe=J.start,we=J.end;if(we===void 0&&(we=fe),"selectionStart"in L)L.selectionStart=fe,L.selectionEnd=Math.min(we,L.value.length);else{var Ee=L.ownerDocument||document,he=Ee&&Ee.defaultView||window;if(he.getSelection){var be=he.getSelection(),$e=L.textContent.length,at=Math.min(J.start,$e),en=J.end===void 0?at:Math.min(J.end,$e);!be.extend&&at>en&&(N=en,en=at,at=N);var oe=Xp(L,at),se=Xp(L,en);if(oe&&se&&(be.rangeCount!==1||be.anchorNode!==oe.node||be.anchorOffset!==oe.offset||be.focusNode!==se.node||be.focusOffset!==se.offset)){var de=Ee.createRange();de.setStart(oe.node,oe.offset),be.removeAllRanges(),at>en?(be.addRange(de),be.extend(se.node,se.offset)):(de.setEnd(se.node,se.offset),be.addRange(de))}}}}for(Ee=[],be=L;be=be.parentNode;)be.nodeType===1&&Ee.push({element:be,left:be.scrollLeft,top:be.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Ee.length;L++){var ke=Ee[L];ke.element.scrollLeft=ke.left,ke.element.scrollTop=ke.top}}Vc=!!Zd,Wd=Zd=null}finally{$t=g,re.p=u,K.T=o}}r.current=i,qn=2}}function fb(){if(qn===2){qn=0;var r=di,i=Bs,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=K.T,K.T=null;var u=re.p;re.p=2;var g=$t;$t|=4;try{qg(r,i.alternate,i)}finally{$t=g,re.p=u,K.T=o}}qn=3}}function mb(){if(qn===4||qn===3){qn=0,zt();var r=di,i=Bs,o=Oa,u=Jg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?qn=5:(qn=0,Bs=di=null,hb(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(ui=null),Sn(o),i=i.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Bt,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=K.T,g=re.p,re.p=2,K.T=null;try{for(var v=r.onRecoverableError,N=0;N<u.length;N++){var L=u[N];v(L.value,{componentStack:L.stack})}}finally{K.T=i,re.p=g}}(Oa&3)!==0&&jc(),sa(r),g=r.pendingLanes,(o&261930)!==0&&(g&42)!==0?r===zd?Zl++:(Zl=0,zd=r):Zl=0,Wl(0)}}function hb(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Il(i)))}function jc(){return db(),fb(),mb(),pb()}function pb(){if(qn!==5)return!1;var r=di,i=jd;jd=0;var o=Sn(Oa),u=K.T,g=re.p;try{re.p=32>o?32:o,K.T=null,o=Ld,Ld=null;var v=di,N=Oa;if(qn=0,Bs=di=null,Oa=0,($t&6)!==0)throw Error(a(331));var L=$t;if($t|=4,Zg(v.current),Vg(v,v.current,N,o),$t=L,Wl(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Bt,v)}catch{}return!0}finally{re.p=g,K.T=u,hb(r,i)}}function gb(r,i,o){i=Hr(o,i),i=pd(r.stateNode,i,2),r=ai(r,i,2),r!==null&&(kt(r,2),sa(r))}function Zt(r,i,o){if(r.tag===3)gb(r,r,o);else for(;i!==null;){if(i.tag===3){gb(i,r,o);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ui===null||!ui.has(u))){r=Hr(o,r),o=bg(2),u=ai(i,o,2),u!==null&&(vg(o,u,i,r),kt(u,2),sa(u));break}}i=i.return}}function qd(r,i,o){var u=r.pingCache;if(u===null){u=r.pingCache=new d7;var g=new Set;u.set(i,g)}else g=u.get(i),g===void 0&&(g=new Set,u.set(i,g));g.has(o)||(Md=!0,g.add(o),r=g7.bind(null,r,i,o),i.then(r,r))}function g7(r,i,o){var u=r.pingCache;u!==null&&u.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,nn===r&&(Mt&o)===o&&(vn===4||vn===3&&(Mt&62914560)===Mt&&300>Pe()-Ac?($t&2)===0&&Us(r,0):Od|=o,zs===Mt&&(zs=0)),sa(r)}function bb(r,i){i===0&&(i=Xe()),r=Bi(r,i),r!==null&&(kt(r,i),sa(r))}function b7(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),bb(r,o)}function v7(r,i){var o=0;switch(r.tag){case 31:case 13:var u=r.stateNode,g=r.memoizedState;g!==null&&(o=g.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),bb(r,o)}function y7(r,i){return Ye(r,i)}var Lc=null,Hs=null,Hd=!1,zc=!1,Fd=!1,mi=0;function sa(r){r!==Hs&&r.next===null&&(Hs===null?Lc=Hs=r:Hs=Hs.next=r),zc=!0,Hd||(Hd=!0,w7())}function Wl(r,i){if(!Fd&&zc){Fd=!0;do for(var o=!1,u=Lc;u!==null;){if(r!==0){var g=u.pendingLanes;if(g===0)var v=0;else{var N=u.suspendedLanes,L=u.pingedLanes;v=(1<<31-bt(42|r)+1)-1,v&=g&~(N&~L),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(o=!0,wb(u,v))}else v=Mt,v=Q(u,u===nn?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||xe(u,v)||(o=!0,wb(u,v));u=u.next}while(o);Fd=!1}}function x7(){vb()}function vb(){zc=Hd=!1;var r=0;mi!==0&&I7()&&(r=mi);for(var i=Pe(),o=null,u=Lc;u!==null;){var g=u.next,v=yb(u,i);v===0?(u.next=null,o===null?Lc=g:o.next=g,g===null&&(Hs=o)):(o=u,(r!==0||(v&3)!==0)&&(zc=!0)),u=g}qn!==0&&qn!==5||Wl(r),mi!==0&&(mi=0)}function yb(r,i){for(var o=r.suspendedLanes,u=r.pingedLanes,g=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var N=31-bt(v),L=1<<N,J=g[N];J===-1?((L&o)===0||(L&u)!==0)&&(g[N]=je(L,i)):J<=i&&(r.expiredLanes|=L),v&=~L}if(i=nn,o=Mt,o=Q(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,o===0||r===i&&(Xt===2||Xt===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Fe(u),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||xe(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(u!==null&&Fe(u),Sn(o)){case 2:case 8:o=ye;break;case 32:o=qe;break;case 268435456:o=rt;break;default:o=qe}return u=xb.bind(null,r),o=Ye(o,u),r.callbackPriority=i,r.callbackNode=o,i}return u!==null&&u!==null&&Fe(u),r.callbackPriority=2,r.callbackNode=null,2}function xb(r,i){if(qn!==0&&qn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(jc()&&r.callbackNode!==o)return null;var u=Mt;return u=Q(r,r===nn?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(tb(r,u,i),yb(r,Pe()),r.callbackNode!=null&&r.callbackNode===o?xb.bind(null,r):null)}function wb(r,i){if(jc())return null;tb(r,i,!0)}function w7(){O7(function(){($t&6)!==0?Ye(me,x7):vb()})}function Pd(){if(mi===0){var r=Ns;r===0&&(r=We,We<<=1,(We&261888)===0&&(We=256)),mi=r}return mi}function Sb(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Za(""+r)}function kb(r,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,r.id&&o.setAttribute("form",r.id),i.parentNode.insertBefore(o,i),r=new FormData(r),o.parentNode.removeChild(o),r}function S7(r,i,o,u,g){if(i==="submit"&&o&&o.stateNode===g){var v=Sb((g[kn]||null).action),N=u.submitter;N&&(i=(i=N[kn]||null)?Sb(i.formAction):N.getAttribute("formAction"),i!==null&&(v=i,N=null));var L=new Xo("action","action",null,u,g);r.push({event:L,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(mi!==0){var J=N?kb(g,N):new FormData(g);cd(o,{pending:!0,data:J,method:g.method,action:v},null,J)}}else typeof v=="function"&&(L.preventDefault(),J=N?kb(g,N):new FormData(g),cd(o,{pending:!0,data:J,method:g.method,action:v},v,J))},currentTarget:g}]})}}for(var $d=0;$d<N0.length;$d++){var Gd=N0[$d],k7=Gd.toLowerCase(),E7=Gd[0].toUpperCase()+Gd.slice(1);Qr(k7,"on"+E7)}Qr(e1,"onAnimationEnd"),Qr(t1,"onAnimationIteration"),Qr(n1,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(qx,"onTransitionRun"),Qr(Hx,"onTransitionStart"),Qr(Fx,"onTransitionCancel"),Qr(r1,"onTransitionEnd"),Re("onMouseEnter",["mouseout","mouseover"]),Re("onMouseLeave",["mouseout","mouseover"]),Re("onPointerEnter",["pointerout","pointerover"]),Re("onPointerLeave",["pointerout","pointerover"]),ba("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ba("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ba("onBeforeInput",["compositionend","keypress","textInput","paste"]),ba("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),T7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ql));function Eb(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var u=r[o],g=u.event;u=u.listeners;e:{var v=void 0;if(i)for(var N=u.length-1;0<=N;N--){var L=u[N],J=L.instance,fe=L.currentTarget;if(L=L.listener,J!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=fe;try{v(g)}catch(we){Qo(we)}g.currentTarget=null,v=J}else for(N=0;N<u.length;N++){if(L=u[N],J=L.instance,fe=L.currentTarget,L=L.listener,J!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=fe;try{v(g)}catch(we){Qo(we)}g.currentTarget=null,v=J}}}}function Rt(r,i){var o=i[hl];o===void 0&&(o=i[hl]=new Set);var u=r+"__bubble";o.has(u)||(Tb(i,r,2,!1),o.add(u))}function Kd(r,i,o){var u=0;i&&(u|=4),Tb(o,r,u,i)}var Bc="_reactListening"+Math.random().toString(36).slice(2);function Vd(r){if(!r[Bc]){r[Bc]=!0,Ho.forEach(function(o){o!=="selectionchange"&&(T7.has(o)||Kd(o,!1,r),Kd(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Bc]||(i[Bc]=!0,Kd("selectionchange",!1,i))}}function Tb(r,i,o,u){switch(ev(i)){case 2:var g=J7;break;case 8:g=e8;break;default:g=cf}o=g.bind(null,i,o,r),g=void 0,!m0||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),u?g!==void 0?r.addEventListener(i,o,{capture:!0,passive:g}):r.addEventListener(i,o,!0):g!==void 0?r.addEventListener(i,o,{passive:g}):r.addEventListener(i,o,!1)}function Yd(r,i,o,u,g){var v=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var L=u.stateNode.containerInfo;if(L===g)break;if(N===4)for(N=u.return;N!==null;){var J=N.tag;if((J===3||J===4)&&N.stateNode.containerInfo===g)return;N=N.return}for(;L!==null;){if(N=ir(L),N===null)return;if(J=N.tag,J===5||J===6||J===26||J===27){u=v=N;continue e}L=L.parentNode}}u=u.return}Go(function(){var fe=v,we=gt(o),Ee=[];e:{var he=a1.get(r);if(he!==void 0){var be=Xo,$e=r;switch(r){case"keypress":if(Vo(o)===0)break e;case"keydown":case"keyup":be=vx;break;case"focusin":$e="focus",be=b0;break;case"focusout":$e="blur",be=b0;break;case"beforeblur":case"afterblur":be=b0;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=Op;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=sx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=wx;break;case e1:case t1:case n1:be=cx;break;case r1:be=kx;break;case"scroll":case"scrollend":be=ax;break;case"wheel":be=Tx;break;case"copy":case"cut":case"paste":be=dx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=jp;break;case"toggle":case"beforetoggle":be=Cx}var at=(i&4)!==0,en=!at&&(r==="scroll"||r==="scrollend"),oe=at?he!==null?he+"Capture":null:he;at=[];for(var se=fe,de;se!==null;){var ke=se;if(de=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||de===null||oe===null||(ke=xl(se,oe),ke!=null&&at.push(Jl(se,ke,de))),en)break;se=se.return}0<at.length&&(he=new be(he,$e,null,o,we),Ee.push({event:he,listeners:at}))}}if((i&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",be=r==="mouseout"||r==="pointerout",he&&o!==Ge&&($e=o.relatedTarget||o.fromElement)&&(ir($e)||$e[Ka]))break e;if((be||he)&&(he=we.window===we?we:(he=we.ownerDocument)?he.defaultView||he.parentWindow:window,be?($e=o.relatedTarget||o.toElement,be=fe,$e=$e?ir($e):null,$e!==null&&(en=l($e),at=$e.tag,$e!==en||at!==5&&at!==27&&at!==6)&&($e=null)):(be=null,$e=fe),be!==$e)){if(at=Op,ke="onMouseLeave",oe="onMouseEnter",se="mouse",(r==="pointerout"||r==="pointerover")&&(at=jp,ke="onPointerLeave",oe="onPointerEnter",se="pointer"),en=be==null?he:Va(be),de=$e==null?he:Va($e),he=new at(ke,se+"leave",be,o,we),he.target=en,he.relatedTarget=de,ke=null,ir(we)===fe&&(at=new at(oe,se+"enter",$e,o,we),at.target=de,at.relatedTarget=en,ke=at),en=ke,be&&$e)t:{for(at=N7,oe=be,se=$e,de=0,ke=oe;ke;ke=at(ke))de++;ke=0;for(var et=se;et;et=at(et))ke++;for(;0<de-ke;)oe=at(oe),de--;for(;0<ke-de;)se=at(se),ke--;for(;de--;){if(oe===se||se!==null&&oe===se.alternate){at=oe;break t}oe=at(oe),se=at(se)}at=null}else at=null;be!==null&&Nb(Ee,he,be,at,!1),$e!==null&&en!==null&&Nb(Ee,en,$e,at,!0)}}e:{if(he=fe?Va(fe):window,be=he.nodeName&&he.nodeName.toLowerCase(),be==="select"||be==="input"&&he.type==="file")var Ut=Pp;else if(Hp(he))if($p)Ut=zx;else{Ut=jx;var Ke=Dx}else be=he.nodeName,!be||be.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&Xa(fe.elementType)&&(Ut=Pp):Ut=Lx;if(Ut&&(Ut=Ut(r,fe))){Fp(Ee,Ut,o,we);break e}Ke&&Ke(r,he,fe),r==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&ps(he,"number",he.value)}switch(Ke=fe?Va(fe):window,r){case"focusin":(Hp(Ke)||Ke.contentEditable==="true")&&(vs=Ke,k0=fe,Rl=null);break;case"focusout":Rl=k0=vs=null;break;case"mousedown":E0=!0;break;case"contextmenu":case"mouseup":case"dragend":E0=!1,Qp(Ee,o,we);break;case"selectionchange":if(Ux)break;case"keydown":case"keyup":Qp(Ee,o,we)}var xt;if(y0)e:{switch(r){case"compositionstart":var Ot="onCompositionStart";break e;case"compositionend":Ot="onCompositionEnd";break e;case"compositionupdate":Ot="onCompositionUpdate";break e}Ot=void 0}else bs?Up(r,o)&&(Ot="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Ot="onCompositionStart");Ot&&(Lp&&o.locale!=="ko"&&(bs||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&bs&&(xt=Ip()):(Wa=we,h0="value"in Wa?Wa.value:Wa.textContent,bs=!0)),Ke=Uc(fe,Ot),0<Ke.length&&(Ot=new Dp(Ot,r,null,o,we),Ee.push({event:Ot,listeners:Ke}),xt?Ot.data=xt:(xt=qp(o),xt!==null&&(Ot.data=xt)))),(xt=Ax?_x(r,o):Ix(r,o))&&(Ot=Uc(fe,"onBeforeInput"),0<Ot.length&&(Ke=new Dp("onBeforeInput","beforeinput",null,o,we),Ee.push({event:Ke,listeners:Ot}),Ke.data=xt)),S7(Ee,r,fe,o,we)}Eb(Ee,i)})}function Jl(r,i,o){return{instance:r,listener:i,currentTarget:o}}function Uc(r,i){for(var o=i+"Capture",u=[];r!==null;){var g=r,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=xl(r,o),g!=null&&u.unshift(Jl(r,g,v)),g=xl(r,i),g!=null&&u.push(Jl(r,g,v))),r.tag===3)return u;r=r.return}return[]}function N7(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Nb(r,i,o,u,g){for(var v=i._reactName,N=[];o!==null&&o!==u;){var L=o,J=L.alternate,fe=L.stateNode;if(L=L.tag,J!==null&&J===u)break;L!==5&&L!==26&&L!==27||fe===null||(J=fe,g?(fe=xl(o,v),fe!=null&&N.unshift(Jl(o,fe,J))):g||(fe=xl(o,v),fe!=null&&N.push(Jl(o,fe,J)))),o=o.return}N.length!==0&&r.push({event:i,listeners:N})}var C7=/\r\n?/g,R7=/\u0000|\uFFFD/g;function Cb(r){return(typeof r=="string"?r:""+r).replace(C7,`
|
|
9
|
+
`).replace(R7,"")}function Rb(r,i){return i=Cb(i),Cb(r)===i}function Jt(r,i,o,u,g,v){switch(o){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||st(r,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&st(r,""+u);break;case"className":kr(r,"class",u);break;case"tabIndex":kr(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":kr(r,o,u);break;case"style":Yt(r,u,v);break;case"data":if(i!=="object"){kr(r,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(o);break}u=Za(""+u),r.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(o==="formAction"?(i!=="input"&&Jt(r,i,"name",g.name,g,null),Jt(r,i,"formEncType",g.formEncType,g,null),Jt(r,i,"formMethod",g.formMethod,g,null),Jt(r,i,"formTarget",g.formTarget,g,null)):(Jt(r,i,"encType",g.encType,g,null),Jt(r,i,"method",g.method,g,null),Jt(r,i,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(o);break}u=Za(""+u),r.setAttribute(o,u);break;case"onClick":u!=null&&(r.onclick=Le);break;case"onScroll":u!=null&&Rt("scroll",r);break;case"onScrollEnd":u!=null&&Rt("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}o=Za(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(o,""+u):r.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(o,""):r.removeAttribute(o);break;case"capture":case"download":u===!0?r.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(o,u):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(o,u):r.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(o):r.setAttribute(o,u);break;case"popover":Rt("beforetoggle",r),Rt("toggle",r),Jn(r,"popover",u);break;case"xlinkActuate":fr(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":fr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":fr(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":fr(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":fr(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":fr(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":fr(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":fr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":fr(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Jn(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=va.get(o)||o,Jn(r,o,u))}}function Xd(r,i,o,u,g,v){switch(o){case"style":Yt(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof u=="string"?st(r,u):(typeof u=="number"||typeof u=="bigint")&&st(r,""+u);break;case"onScroll":u!=null&&Rt("scroll",r);break;case"onScrollEnd":u!=null&&Rt("scrollend",r);break;case"onClick":u!=null&&(r.onclick=Le);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oi.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(g=o.endsWith("Capture"),i=o.slice(2,g?o.length-7:void 0),v=r[kn]||null,v=v!=null?v[o]:null,typeof v=="function"&&r.removeEventListener(i,v,g),typeof u=="function")){typeof v!="function"&&v!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,u,g);break e}o in r?r[o]=u:u===!0?r.setAttribute(o,""):Jn(r,o,u)}}}function Zn(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",r),Rt("load",r);var u=!1,g=!1,v;for(v in o)if(o.hasOwnProperty(v)){var N=o[v];if(N!=null)switch(v){case"src":u=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Jt(r,i,v,N,o,null)}}g&&Jt(r,i,"srcSet",o.srcSet,o,null),u&&Jt(r,i,"src",o.src,o,null);return;case"input":Rt("invalid",r);var L=v=N=g=null,J=null,fe=null;for(u in o)if(o.hasOwnProperty(u)){var we=o[u];if(we!=null)switch(u){case"name":g=we;break;case"type":N=we;break;case"checked":J=we;break;case"defaultChecked":fe=we;break;case"value":v=we;break;case"defaultValue":L=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(a(137,i));break;default:Jt(r,i,u,we,o,null)}}Di(r,v,L,J,fe,N,g,!1);return;case"select":Rt("invalid",r),u=N=v=null;for(g in o)if(o.hasOwnProperty(g)&&(L=o[g],L!=null))switch(g){case"value":v=L;break;case"defaultValue":N=L;break;case"multiple":u=L;default:Jt(r,i,g,L,o,null)}i=v,o=N,r.multiple=!!u,i!=null?Kn(r,!!u,i,!1):o!=null&&Kn(r,!!u,o,!0);return;case"textarea":Rt("invalid",r),v=g=u=null;for(N in o)if(o.hasOwnProperty(N)&&(L=o[N],L!=null))switch(N){case"value":u=L;break;case"defaultValue":g=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(91));break;default:Jt(r,i,N,L,o,null)}gs(r,u,g,v);return;case"option":for(J in o)o.hasOwnProperty(J)&&(u=o[J],u!=null)&&(J==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Jt(r,i,J,u,o,null));return;case"dialog":Rt("beforetoggle",r),Rt("toggle",r),Rt("cancel",r),Rt("close",r);break;case"iframe":case"object":Rt("load",r);break;case"video":case"audio":for(u=0;u<Ql.length;u++)Rt(Ql[u],r);break;case"image":Rt("error",r),Rt("load",r);break;case"details":Rt("toggle",r);break;case"embed":case"source":case"link":Rt("error",r),Rt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in o)if(o.hasOwnProperty(fe)&&(u=o[fe],u!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Jt(r,i,fe,u,o,null)}return;default:if(Xa(i)){for(we in o)o.hasOwnProperty(we)&&(u=o[we],u!==void 0&&Xd(r,i,we,u,o,void 0));return}}for(L in o)o.hasOwnProperty(L)&&(u=o[L],u!=null&&Jt(r,i,L,u,o,null))}function A7(r,i,o,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,N=null,L=null,J=null,fe=null,we=null;for(be in o){var Ee=o[be];if(o.hasOwnProperty(be)&&Ee!=null)switch(be){case"checked":break;case"value":break;case"defaultValue":J=Ee;default:u.hasOwnProperty(be)||Jt(r,i,be,null,u,Ee)}}for(var he in u){var be=u[he];if(Ee=o[he],u.hasOwnProperty(he)&&(be!=null||Ee!=null))switch(he){case"type":v=be;break;case"name":g=be;break;case"checked":fe=be;break;case"defaultChecked":we=be;break;case"value":N=be;break;case"defaultValue":L=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(a(137,i));break;default:be!==Ee&&Jt(r,i,he,be,u,Ee)}}bl(r,N,L,J,fe,we,v,g);return;case"select":be=N=L=he=null;for(v in o)if(J=o[v],o.hasOwnProperty(v)&&J!=null)switch(v){case"value":break;case"multiple":be=J;default:u.hasOwnProperty(v)||Jt(r,i,v,null,u,J)}for(g in u)if(v=u[g],J=o[g],u.hasOwnProperty(g)&&(v!=null||J!=null))switch(g){case"value":he=v;break;case"defaultValue":L=v;break;case"multiple":N=v;default:v!==J&&Jt(r,i,g,v,u,J)}i=L,o=N,u=be,he!=null?Kn(r,!!o,he,!1):!!u!=!!o&&(i!=null?Kn(r,!!o,i,!0):Kn(r,!!o,o?[]:"",!1));return;case"textarea":be=he=null;for(L in o)if(g=o[L],o.hasOwnProperty(L)&&g!=null&&!u.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Jt(r,i,L,null,u,g)}for(N in u)if(g=u[N],v=o[N],u.hasOwnProperty(N)&&(g!=null||v!=null))switch(N){case"value":he=g;break;case"defaultValue":be=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==v&&Jt(r,i,N,g,u,v)}Po(r,he,be);return;case"option":for(var $e in o)he=o[$e],o.hasOwnProperty($e)&&he!=null&&!u.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Jt(r,i,$e,null,u,he));for(J in u)he=u[J],be=o[J],u.hasOwnProperty(J)&&he!==be&&(he!=null||be!=null)&&(J==="selected"?r.selected=he&&typeof he!="function"&&typeof he!="symbol":Jt(r,i,J,he,u,be));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var at in o)he=o[at],o.hasOwnProperty(at)&&he!=null&&!u.hasOwnProperty(at)&&Jt(r,i,at,null,u,he);for(fe in u)if(he=u[fe],be=o[fe],u.hasOwnProperty(fe)&&he!==be&&(he!=null||be!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(a(137,i));break;default:Jt(r,i,fe,he,u,be)}return;default:if(Xa(i)){for(var en in o)he=o[en],o.hasOwnProperty(en)&&he!==void 0&&!u.hasOwnProperty(en)&&Xd(r,i,en,void 0,u,he);for(we in u)he=u[we],be=o[we],!u.hasOwnProperty(we)||he===be||he===void 0&&be===void 0||Xd(r,i,we,he,u,be);return}}for(var oe in o)he=o[oe],o.hasOwnProperty(oe)&&he!=null&&!u.hasOwnProperty(oe)&&Jt(r,i,oe,null,u,he);for(Ee in u)he=u[Ee],be=o[Ee],!u.hasOwnProperty(Ee)||he===be||he==null&&be==null||Jt(r,i,Ee,he,u,be)}function Ab(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _7(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var g=o[u],v=g.transferSize,N=g.initiatorType,L=g.duration;if(v&&L&&Ab(N)){for(N=0,L=g.responseEnd,u+=1;u<o.length;u++){var J=o[u],fe=J.startTime;if(fe>L)break;var we=J.transferSize,Ee=J.initiatorType;we&&Ab(Ee)&&(J=J.responseEnd,N+=we*(J<L?1:(L-fe)/(J-fe)))}if(--u,i+=8*(v+N)/(g.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Zd=null,Wd=null;function qc(r){return r.nodeType===9?r:r.ownerDocument}function _b(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ib(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Qd(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Jd=null;function I7(){var r=window.event;return r&&r.type==="popstate"?r===Jd?!1:(Jd=r,!0):(Jd=null,!1)}var Mb=typeof setTimeout=="function"?setTimeout:void 0,M7=typeof clearTimeout=="function"?clearTimeout:void 0,Ob=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof Ob<"u"?function(r){return Ob.resolve(null).then(r).catch(D7)}:Mb;function D7(r){setTimeout(function(){throw r})}function hi(r){return r==="head"}function Db(r,i){var o=i,u=0;do{var g=o.nextSibling;if(r.removeChild(o),g&&g.nodeType===8)if(o=g.data,o==="/$"||o==="/&"){if(u===0){r.removeChild(g),Gs(i);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")eo(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,eo(o);for(var v=o.firstChild;v;){var N=v.nextSibling,L=v.nodeName;v[Mi]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||o.removeChild(v),v=N}}else o==="body"&&eo(r.ownerDocument.body);o=g}while(o);Gs(i)}function jb(r,i){var o=r;r=0;do{var u=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=u}while(o)}function ef(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ef(o),pl(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function j7(r,i,o,u){for(;r.nodeType===1;){var g=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[Mi])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Kr(r.nextSibling),r===null)break}return null}function L7(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Kr(r.nextSibling),r===null))return null;return r}function Lb(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Kr(r.nextSibling),r===null))return null;return r}function tf(r){return r.data==="$?"||r.data==="$~"}function nf(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function z7(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var u=function(){i(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function Kr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var rf=null;function zb(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return Kr(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Bb(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return r;i--}else o!=="/$"&&o!=="/&"||i++}r=r.previousSibling}return null}function Ub(r,i,o){switch(i=qc(o),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function eo(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);pl(r)}var Vr=new Map,qb=new Set;function Hc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Da=re.d;re.d={f:B7,r:U7,D:q7,C:H7,L:F7,m:P7,X:G7,S:$7,M:K7};function B7(){var r=Da.f(),i=Mc();return r||i}function U7(r){var i=ga(r);i!==null&&i.tag===5&&i.type==="form"?rg(i):Da.r(r)}var Fs=typeof document>"u"?null:document;function Hb(r,i,o){var u=Fs;if(u&&typeof i=="string"&&i){var g=mr(i);g='link[rel="'+r+'"][href="'+g+'"]',typeof o=="string"&&(g+='[crossorigin="'+o+'"]'),qb.has(g)||(qb.add(g),r={rel:r,crossOrigin:o,href:i},u.querySelector(g)===null&&(i=u.createElement("link"),Zn(i,"link",r),Rn(i),u.head.appendChild(i)))}}function q7(r){Da.D(r),Hb("dns-prefetch",r,null)}function H7(r,i){Da.C(r,i),Hb("preconnect",r,i)}function F7(r,i,o){Da.L(r,i,o);var u=Fs;if(u&&r&&i){var g='link[rel="preload"][as="'+mr(i)+'"]';i==="image"&&o&&o.imageSrcSet?(g+='[imagesrcset="'+mr(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(g+='[imagesizes="'+mr(o.imageSizes)+'"]')):g+='[href="'+mr(r)+'"]';var v=g;switch(i){case"style":v=Ps(r);break;case"script":v=$s(r)}Vr.has(v)||(r=b({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),Vr.set(v,r),u.querySelector(g)!==null||i==="style"&&u.querySelector(to(v))||i==="script"&&u.querySelector(no(v))||(i=u.createElement("link"),Zn(i,"link",r),Rn(i),u.head.appendChild(i)))}}function P7(r,i){Da.m(r,i);var o=Fs;if(o&&r){var u=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+mr(u)+'"][href="'+mr(r)+'"]',v=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=$s(r)}if(!Vr.has(v)&&(r=b({rel:"modulepreload",href:r},i),Vr.set(v,r),o.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(no(v)))return}u=o.createElement("link"),Zn(u,"link",r),Rn(u),o.head.appendChild(u)}}}function $7(r,i,o){Da.S(r,i,o);var u=Fs;if(u&&r){var g=Ya(u).hoistableStyles,v=Ps(r);i=i||"default";var N=g.get(v);if(!N){var L={loading:0,preload:null};if(N=u.querySelector(to(v)))L.loading=5;else{r=b({rel:"stylesheet",href:r,"data-precedence":i},o),(o=Vr.get(v))&&af(r,o);var J=N=u.createElement("link");Rn(J),Zn(J,"link",r),J._p=new Promise(function(fe,we){J.onload=fe,J.onerror=we}),J.addEventListener("load",function(){L.loading|=1}),J.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Fc(N,i,u)}N={type:"stylesheet",instance:N,count:1,state:L},g.set(v,N)}}}function G7(r,i){Da.X(r,i);var o=Fs;if(o&&r){var u=Ya(o).hoistableScripts,g=$s(r),v=u.get(g);v||(v=o.querySelector(no(g)),v||(r=b({src:r,async:!0},i),(i=Vr.get(g))&&sf(r,i),v=o.createElement("script"),Rn(v),Zn(v,"link",r),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(g,v))}}function K7(r,i){Da.M(r,i);var o=Fs;if(o&&r){var u=Ya(o).hoistableScripts,g=$s(r),v=u.get(g);v||(v=o.querySelector(no(g)),v||(r=b({src:r,async:!0,type:"module"},i),(i=Vr.get(g))&&sf(r,i),v=o.createElement("script"),Rn(v),Zn(v,"link",r),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(g,v))}}function Fb(r,i,o,u){var g=(g=te.current)?Hc(g):null;if(!g)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=Ps(o.href),o=Ya(g).hoistableStyles,u=o.get(i),u||(u={type:"style",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=Ps(o.href);var v=Ya(g).hoistableStyles,N=v.get(r);if(N||(g=g.ownerDocument||g,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,N),(v=g.querySelector(to(r)))&&!v._p&&(N.instance=v,N.state.loading=5),Vr.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Vr.set(r,o),v||V7(g,r,o,N.state))),i&&u===null)throw Error(a(528,""));return N}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=$s(o),o=Ya(g).hoistableScripts,u=o.get(i),u||(u={type:"script",instance:null,count:0,state:null},o.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Ps(r){return'href="'+mr(r)+'"'}function to(r){return'link[rel="stylesheet"]['+r+"]"}function Pb(r){return b({},r,{"data-precedence":r.precedence,precedence:null})}function V7(r,i,o,u){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=r.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Zn(i,"link",o),Rn(i),r.head.appendChild(i))}function $s(r){return'[src="'+mr(r)+'"]'}function no(r){return"script[async]"+r}function $b(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var u=r.querySelector('style[data-href~="'+mr(o.href)+'"]');if(u)return i.instance=u,Rn(u),u;var g=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Rn(u),Zn(u,"style",g),Fc(u,o.precedence,r),i.instance=u;case"stylesheet":g=Ps(o.href);var v=r.querySelector(to(g));if(v)return i.state.loading|=4,i.instance=v,Rn(v),v;u=Pb(o),(g=Vr.get(g))&&af(u,g),v=(r.ownerDocument||r).createElement("link"),Rn(v);var N=v;return N._p=new Promise(function(L,J){N.onload=L,N.onerror=J}),Zn(v,"link",u),i.state.loading|=4,Fc(v,o.precedence,r),i.instance=v;case"script":return v=$s(o.src),(g=r.querySelector(no(v)))?(i.instance=g,Rn(g),g):(u=o,(g=Vr.get(v))&&(u=b({},o),sf(u,g)),r=r.ownerDocument||r,g=r.createElement("script"),Rn(g),Zn(g,"link",u),r.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,Fc(u,o.precedence,r));return i.instance}function Fc(r,i,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,v=g,N=0;N<u.length;N++){var L=u[N];if(L.dataset.precedence===i)v=L;else if(v!==g)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function af(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function sf(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Pc=null;function Gb(r,i,o){if(Pc===null){var u=new Map,g=Pc=new Map;g.set(o,u)}else g=Pc,u=g.get(o),u||(u=new Map,g.set(o,u));if(u.has(r))return u;for(u.set(r,null),o=o.getElementsByTagName(r),g=0;g<o.length;g++){var v=o[g];if(!(v[Mi]||v[Pt]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var N=v.getAttribute(i)||"";N=r+N;var L=u.get(N);L?L.push(v):u.set(N,[v])}}return u}function Kb(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function Y7(r,i,o){if(o===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Vb(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function X7(r,i,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var g=Ps(u.href),v=i.querySelector(to(g));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=$c.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=v,Rn(v);return}v=i.ownerDocument||i,u=Pb(u),(g=Vr.get(g))&&af(u,g),v=v.createElement("link"),Rn(v);var N=v;N._p=new Promise(function(L,J){N.onload=L,N.onerror=J}),Zn(v,"link",u),o.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=$c.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var lf=0;function Z7(r,i){return r.stylesheets&&r.count===0&&Kc(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var u=setTimeout(function(){if(r.stylesheets&&Kc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&lf===0&&(lf=62500*_7());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Kc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>lf?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function $c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Gc=null;function Kc(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Gc=new Map,i.forEach(W7,r),Gc=null,$c.call(r))}function W7(r,i){if(!(i.state.loading&4)){var o=Gc.get(r);if(o)var u=o.get(null);else{o=new Map,Gc.set(r,o);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var N=g[v];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(o.set(N.dataset.precedence,N),u=N)}u&&o.set(null,u)}g=i.instance,N=g.getAttribute("data-precedence"),v=o.get(N)||u,v===u&&o.set(null,g),o.set(N,g),this.count++,u=$c.bind(this),g.addEventListener("load",u),g.addEventListener("error",u),v?v.parentNode.insertBefore(g,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),i.state.loading|=4}}var ro={$$typeof:I,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function Q7(r,i,o,u,g,v,N,L,J){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=u,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function Yb(r,i,o,u,g,v,N,L,J,fe,we,Ee){return r=new Q7(r,i,o,N,J,fe,we,Ee,L),i=1,v===!0&&(i|=24),v=Nr(3,null,null,i),r.current=v,v.stateNode=r,i=U0(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:u,isDehydrated:o,cache:i},P0(v),r}function Xb(r){return r?(r=ws,r):ws}function Zb(r,i,o,u,g,v){g=Xb(g),u.context===null?u.context=g:u.pendingContext=g,u=ri(i),u.payload={element:o},v=v===void 0?null:v,v!==null&&(u.callback=v),o=ai(r,u,i),o!==null&&(yr(o,r,i),jl(o,r,i))}function Wb(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function of(r,i){Wb(r,i),(r=r.alternate)&&Wb(r,i)}function Qb(r){if(r.tag===13||r.tag===31){var i=Bi(r,67108864);i!==null&&yr(i,r,67108864),of(r,67108864)}}function Jb(r){if(r.tag===13||r.tag===31){var i=Ir();i=Et(i);var o=Bi(r,i);o!==null&&yr(o,r,i),of(r,i)}}var Vc=!0;function J7(r,i,o,u){var g=K.T;K.T=null;var v=re.p;try{re.p=2,cf(r,i,o,u)}finally{re.p=v,K.T=g}}function e8(r,i,o,u){var g=K.T;K.T=null;var v=re.p;try{re.p=8,cf(r,i,o,u)}finally{re.p=v,K.T=g}}function cf(r,i,o,u){if(Vc){var g=uf(u);if(g===null)Yd(r,i,u,Yc,o),tv(r,u);else if(n8(g,r,i,o,u))u.stopPropagation();else if(tv(r,u),i&4&&-1<t8.indexOf(r)){for(;g!==null;){var v=ga(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var N=Ft(v.pendingLanes);if(N!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var J=1<<31-bt(N);L.entanglements[1]|=J,N&=~J}sa(v),($t&6)===0&&(_c=Pe()+500,Wl(0))}}break;case 31:case 13:L=Bi(v,2),L!==null&&yr(L,v,2),Mc(),of(v,2)}if(v=uf(u),v===null&&Yd(r,i,u,Yc,o),v===g)break;g=v}g!==null&&u.stopPropagation()}else Yd(r,i,u,null,o)}}function uf(r){return r=gt(r),df(r)}var Yc=null;function df(r){if(Yc=null,r=ir(r),r!==null){var i=l(r);if(i===null)r=null;else{var o=i.tag;if(o===13){if(r=c(i),r!==null)return r;r=null}else if(o===31){if(r=d(i),r!==null)return r;r=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Yc=r,null}function ev(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wt()){case me:return 2;case ye:return 8;case qe:case Qe:return 32;case rt:return 268435456;default:return 32}default:return 32}}var ff=!1,pi=null,gi=null,bi=null,ao=new Map,io=new Map,vi=[],t8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function tv(r,i){switch(r){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":gi=null;break;case"mouseover":case"mouseout":bi=null;break;case"pointerover":case"pointerout":ao.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":io.delete(i.pointerId)}}function so(r,i,o,u,g,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:o,eventSystemFlags:u,nativeEvent:v,targetContainers:[g]},i!==null&&(i=ga(i),i!==null&&Qb(i)),r):(r.eventSystemFlags|=u,i=r.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),r)}function n8(r,i,o,u,g){switch(i){case"focusin":return pi=so(pi,r,i,o,u,g),!0;case"dragenter":return gi=so(gi,r,i,o,u,g),!0;case"mouseover":return bi=so(bi,r,i,o,u,g),!0;case"pointerover":var v=g.pointerId;return ao.set(v,so(ao.get(v)||null,r,i,o,u,g)),!0;case"gotpointercapture":return v=g.pointerId,io.set(v,so(io.get(v)||null,r,i,o,u,g)),!0}return!1}function nv(r){var i=ir(r.target);if(i!==null){var o=l(i);if(o!==null){if(i=o.tag,i===13){if(i=c(o),i!==null){r.blockedOn=i,Qn(r.priority,function(){Jb(o)});return}}else if(i===31){if(i=d(o),i!==null){r.blockedOn=i,Qn(r.priority,function(){Jb(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Xc(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=uf(r.nativeEvent);if(o===null){o=r.nativeEvent;var u=new o.constructor(o.type,o);Ge=u,o.target.dispatchEvent(u),Ge=null}else return i=ga(o),i!==null&&Qb(i),r.blockedOn=o,!1;i.shift()}return!0}function rv(r,i,o){Xc(r)&&o.delete(i)}function r8(){ff=!1,pi!==null&&Xc(pi)&&(pi=null),gi!==null&&Xc(gi)&&(gi=null),bi!==null&&Xc(bi)&&(bi=null),ao.forEach(rv),io.forEach(rv)}function Zc(r,i){r.blockedOn===i&&(r.blockedOn=null,ff||(ff=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,r8)))}var Wc=null;function av(r){Wc!==r&&(Wc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wc===r&&(Wc=null);for(var i=0;i<r.length;i+=3){var o=r[i],u=r[i+1],g=r[i+2];if(typeof u!="function"){if(df(u||o)===null)continue;break}var v=ga(o);v!==null&&(r.splice(i,3),i-=3,cd(v,{pending:!0,data:g,method:o.method,action:u},u,g))}}))}function Gs(r){function i(J){return Zc(J,r)}pi!==null&&Zc(pi,r),gi!==null&&Zc(gi,r),bi!==null&&Zc(bi,r),ao.forEach(i),io.forEach(i);for(var o=0;o<vi.length;o++){var u=vi[o];u.blockedOn===r&&(u.blockedOn=null)}for(;0<vi.length&&(o=vi[0],o.blockedOn===null);)nv(o),o.blockedOn===null&&vi.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var g=o[u],v=o[u+1],N=g[kn]||null;if(typeof v=="function")N||av(o);else if(N){var L=null;if(v&&v.hasAttribute("formAction")){if(g=v,N=v[kn]||null)L=N.formAction;else if(df(g)!==null)continue}else L=N.action;typeof L=="function"?o[u+1]=L:(o.splice(u,3),u-=3),av(o)}}}function iv(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(N){return g=N})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function mf(r){this._internalRoot=r}Qc.prototype.render=mf.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,u=Ir();Zb(o,u,r,i,null,null)},Qc.prototype.unmount=mf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Zb(r.current,2,null,r,null,null),Mc(),i[Ka]=null}};function Qc(r){this._internalRoot=r}Qc.prototype.unstable_scheduleHydration=function(r){if(r){var i=Un();r={blockedOn:null,target:r,priority:i};for(var o=0;o<vi.length&&i!==0&&i<vi[o].priority;o++);vi.splice(o,0,r),o===0&&nv(r)}};var sv=t.version;if(sv!=="19.2.8")throw Error(a(527,sv,"19.2.8"));re.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var a8={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jc.isDisabled&&Jc.supportsFiber)try{Bt=Jc.inject(a8),dt=Jc}catch{}}return oo.createRoot=function(r,i){if(!s(r))throw Error(a(299));var o=!1,u="",g=mg,v=hg,N=pg;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Yb(r,1,!1,null,null,o,u,null,g,v,N,iv),r[Ka]=i.current,Vd(r),new mf(i)},oo.hydrateRoot=function(r,i,o){if(!s(r))throw Error(a(299));var u=!1,g="",v=mg,N=hg,L=pg,J=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(N=o.onCaughtError),o.onRecoverableError!==void 0&&(L=o.onRecoverableError),o.formState!==void 0&&(J=o.formState)),i=Yb(r,1,!0,i,o??null,u,g,J,v,N,L,iv),i.context=Xb(null),o=i.current,u=Ir(),u=Et(u),g=ri(u),g.callback=null,ai(o,g,u),o=u,i.current.lanes=o,kt(i,o),sa(i),r[Ka]=i.current,Vd(r),new Qc(i)},oo.version="19.2.8",oo}var gv;function m8(){if(gv)return gf.exports;gv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gf.exports=f8(),gf.exports}var h8=m8();function Wi(e){if(e==null)return null;if(typeof e=="string")return e.trim()||null;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object"){const t=e;if(typeof t.text=="string"&&t.text.trim())return t.text.trim();if(typeof t.errorMessage=="string"&&t.errorMessage.trim())return t.errorMessage.trim();if(Array.isArray(t.content)){const n=t.content.map(a=>{if(typeof a=="string")return a;if(a&&typeof a=="object"){const s=a;if(typeof s.text=="string")return s.text}return""}).filter(Boolean);if(n.length)return n.join(`
|
|
10
|
+
`).slice(0,240)}if(typeof t.role=="string")return`${t.role} 消息`}return null}function p8(e){const t=Wi(e.at)??Wi(e.timestamp)??Wi(e.recordedAt)??"",n=Wi(e.errorMessage)??Wi(e.label)??Wi(e.type)??Wi(e.message)??"运行事件";return t?`${t} · ${n}`:n}function go(e){return String(e.nodeId??e.id??"").trim()}function xf(e){const t=go(e);return String(e.label??e.name??(t||"未命名节点"))}function bv(e,t){if(e.length===0)return;const n=t?.trim();if(n){const l=e.find(c=>go(c)===n);if(l)return l}const a=e.find(l=>{const c=String(l.status??"").toLowerCase();return c.includes("fail")||c.includes("error")||c==="blocked"});return a||(e.find(l=>{const c=String(l.status??"").toLowerCase();return c==="running"||c==="in_progress"||c==="active"})??e[0])}const g8=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function Qm(e){if(!e)return!1;const t=String(e.effectiveStatus??e.status??"").toLowerCase();return g8.has(t)}const b8=5e3;function v8({dagRunId:e,nodeId:t,onClose:n,onOpenFull:a}){const s=S.useRef(null),[l,c]=S.useState(null),[d,m]=S.useState([]),[h,p]=S.useState(null),[b,y]=S.useState(!0),x=Qm(l);S.useEffect(()=>{s.current?.focus();const _=I=>{I.key==="Escape"&&n()};return document.addEventListener("keydown",_),document.title=`检视 · DAG ${e} · Loop Operator`,()=>document.removeEventListener("keydown",_)},[e,n]),S.useEffect(()=>{const _=new AbortController;let I;const G=async D=>{D&&(y(!0),p(null),m([]));try{const M=await fetch(`/api/dag-runs/${encodeURIComponent(e)}`,{signal:_.signal,credentials:"same-origin"});if(!M.ok)throw new Error(`DAG 查询失败(HTTP ${M.status})`);const B=await M.json();if(_.signal.aborted)return;c(B),p(null);const X=Array.isArray(B.nodes)?B.nodes:[],$=bv(X,t),j=$?go($):t?.trim();if(j){const F=await fetch(`/api/dag-runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(j)}/session-events`,{signal:_.signal,credentials:"same-origin"});if(F.ok){const H=await F.json();_.signal.aborted||m((H.events??[]).slice(-20))}}Qm(B)&&I!==void 0&&(window.clearInterval(I),I=void 0)}catch(M){_.signal.aborted||p(M instanceof Error?M.message:String(M))}finally{!_.signal.aborted&&D&&y(!1)}};return G(!0),I=window.setInterval(()=>{G(!1)},b8),()=>{_.abort(),I!==void 0&&window.clearInterval(I)}},[e,t]);const k=S.useMemo(()=>Array.isArray(l?.nodes)?l.nodes:[],[l]),T=bv(k,t),R=T?go(T):"",C=String(l?.effectiveStatus??l?.status??(b?"加载中…":"未知"));return f.jsxs("aside",{className:"inspect-split-panel","aria-label":"DAG 紧凑检视",children:[f.jsxs("div",{className:"inspect-split-header",children:[f.jsxs("div",{children:[f.jsx("p",{className:"inspect-split-kicker",children:"Inspect"}),f.jsx("h2",{children:"检视 DAG"})]}),f.jsx("button",{ref:s,type:"button","aria-label":"关闭检视面板",onClick:n,children:"关闭"})]}),f.jsx("p",{className:"inspect-split-id",children:f.jsx("code",{children:e})}),l?f.jsx("p",{className:`inspect-split-refresh${x?" is-terminal":""}`,"data-testid":"inspect-split-refresh",children:x?"已结束 · 停止自动刷新":"进行中 · 每 5 秒自动刷新"}):null,h?f.jsx("p",{className:"error",children:h}):null,b&&!l?f.jsx("p",{className:"muted",children:"正在加载 DAG…"}):null,f.jsxs("dl",{className:"inspect-split-facts",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"状态"}),f.jsx("dd",{children:C})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"当前节点"}),f.jsx("dd",{children:T?xf(T):"暂无节点"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"节点状态"}),f.jsx("dd",{children:T?.status??"—"})]}),T?.errorPreview?f.jsxs("div",{children:[f.jsx("dt",{children:"错误摘要"}),f.jsx("dd",{children:T.errorPreview})]}):null]}),f.jsxs("section",{children:[f.jsxs("h3",{children:["节点(",k.length,")"]}),k.length?f.jsx("ul",{className:"inspect-split-nodes",children:k.slice(0,24).map(_=>{const I=go(_)||xf(_),G=I===R;return f.jsxs("li",{"data-active":G?"true":void 0,className:G?"is-active":void 0,children:[f.jsx("span",{children:xf(_)}),f.jsx("code",{children:_.status??"—"})]},I)})}):f.jsx("p",{className:"muted",children:b?"加载节点中…":"该运行暂无节点。"})]}),f.jsxs("section",{children:[f.jsxs("h3",{children:["最近事件",R?` · ${R}`:""]}),d.length?f.jsx("ul",{className:"inspect-split-events",children:d.map((_,I)=>f.jsx("li",{children:p8(_)},`${_.at??I}-${I}`))}):f.jsx("p",{className:"muted",children:b?"加载事件中…":"节点事件将在可用时显示。"})]}),f.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,children:"全屏观测"}),f.jsx("p",{className:"muted",children:"全屏后点顶栏「返回操作台」可回来。"})]})}function y8(e){const{board:t,busy:n}=e;return f.jsxs("details",{className:"night-advanced","data-testid":"night-advanced",open:t.advancedOpen,onToggle:a=>t.setAdvancedOpen(a.target.open),children:[f.jsx("summary",{children:"高级 / Inspect"}),f.jsxs("p",{className:"muted",children:["只读深链:"," ",f.jsx("a",{className:"external-link",href:"/inspect/#/night",children:"/inspect/#/night"})]}),f.jsx("div",{className:"cta-row",children:f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-morning-btn",onClick:()=>{t.onMorningReport()},children:"早晨 night 报告"})}),t.morningPreview?f.jsx("pre",{className:"cmd","data-testid":"night-morning-preview",children:t.morningPreview}):null]})}function eu(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Cn(e,t){const n=e[t];return typeof n=="string"&&n.trim()?n.trim():void 0}function vv(e,t){const n=e[t];if(!Array.isArray(n))return;const a=n.filter(s=>typeof s=="string");return a.length>0?a:void 0}function x8(e){const t=eu(e);if(!t)return null;const n=eu(t.result),a=[eu(t.reviewPacket),n?eu(n.reviewPacket):null,n,t].filter(Boolean);for(const s of a){const l=Cn(s,"scheduleId")??Cn(s,"id"),c=Cn(s,"gateToken")??Cn(s,"approveGate")??Cn(s,"writeSetGateToken");if(!(!l||!c))return{scheduleId:l,gateToken:c,...Cn(s,"featureId")?{featureId:Cn(s,"featureId")}:{},...Cn(s,"taskId")?{taskId:Cn(s,"taskId")}:{},...vv(s,"writeSet")?{writeSet:vv(s,"writeSet")}:{},...Cn(s,"worktreePath")?{worktreePath:Cn(s,"worktreePath")}:{},...Cn(s,"branch")?{branch:Cn(s,"branch")}:{},...Cn(s,"baseBranch")?{baseBranch:Cn(s,"baseBranch")}:{},...Cn(s,"baseCommit")?{baseCommit:Cn(s,"baseCommit")}:{},...Cn(s,"executeAtUtc")?{executeAtUtc:Cn(s,"executeAtUtc")}:{},...Cn(s,"taskCard")?{taskCard:Cn(s,"taskCard")}:{}}}return null}function yv(e){return`docs/features/${e.trim().replace(/^\/+|\/+$/g,"")}`}function w8(e){const t=e.trim(),n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/.exec(t);return n?`${n[1]} ${n[2]}`:null}function xv(){const e=new Date;e.setHours(20,0,0,0);const t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function H2(e){if(!e)return"—";const t=Date.parse(e);if(Number.isNaN(t))return e;try{return new Intl.DateTimeFormat("zh-CN",{dateStyle:"short",timeStyle:"short",timeZone:"Asia/Shanghai"}).format(new Date(t))}catch{return e}}function S8(e){return e.mergeState==="pending-harvest"||/\bscheduler harvest\b/i.test(e.nextAction)}function k8(e){return e.status==="failed"||e.status==="human_required"||e.status==="cancelled"||/\bscheduler discard\b/i.test(e.nextAction)}function wu(e){return e==="failed"||e==="human_required"}function E8(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function F2(e){return{submitted:"已提交",validating:"校验中",validated:"待预约确认",scheduled:"已预约",waiting:"等待触发",dispatching:"派发中",running:"执行中",succeeded:"成功",failed:"失败",human_required:"需人工",cancelled:"已取消",rejected:"已拒绝",cancel_requested:"取消中"}[e]??e}function T8(e){const{target:t,reason:n,onReasonChange:a,force:s,onForceChange:l,busy:c}=e;return f.jsxs("div",{className:"night-discard-card","data-testid":"night-discard-card",children:[f.jsx("h3",{children:"确认 Discard"}),f.jsxs("p",{className:"muted",children:[t.featureId,"/",t.taskId,"(",F2(t.status),")"]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"原因"}),f.jsx("input",{"data-testid":"night-discard-reason",value:n,disabled:c,placeholder:"human discard reason",onChange:d=>a(d.target.value)})]}),wu(t.status)?f.jsxs("label",{className:"field checkbox-field",children:[f.jsx("input",{type:"checkbox","data-testid":"night-discard-force",checked:s,disabled:c,onChange:d=>l(d.target.checked)}),f.jsx("span",{className:"muted",children:"强制 Discard(failed / human_required)"})]}):null,f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:c||wu(t.status)&&!s,"data-testid":"night-discard-confirm",onClick:e.onConfirm,children:"确认 Discard"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:c,onClick:e.onCancel,children:"返回"})]})]})}function N8(e){const{board:t}=e,{doctor:n,list:a,clockHint:s,doctorIssues:l,auxTicker:c}=t;return f.jsxs("div",{className:"night-health","data-testid":"night-health-bar",children:[f.jsxs("div",{className:"night-health-main",children:[f.jsx("span",{className:`night-health-pill${n?.ok===!1?" is-bad":""}`,children:n?.ok===!1?"Scheduler 异常":"Scheduler 健康"}),f.jsxs("span",{className:"muted",children:["计划 ",n?.scheduleCount??a?.summary.total??"—"," · 活动"," ",n?.activeCount??a?.summary.active??"—"]})]}),s?f.jsxs("p",{className:"muted night-health-hint","data-testid":"night-clock-hint",children:["时钟:",s.message,"(安装/启停请用 CLI:",f.jsx("code",{children:"agent-worker scheduler clock status --repo ."}),")"]}):f.jsxs("p",{className:"muted night-health-hint",children:["到点执行依赖本机 clock / tick,不在此面板安装。详见"," ",f.jsx("a",{className:"external-link",href:"/inspect/#/night",children:"/inspect/#/night"})]}),f.jsxs("div",{className:"night-aux-ticker","data-testid":"night-aux-ticker",children:[f.jsxs("p",{className:"night-aux-ticker-label",children:["开着 Console 时辅助 tick(每 ",c?.intervalSec??60,"s)"]}),f.jsx("p",{className:"muted night-health-hint","data-testid":"night-aux-ticker-disclaimer",children:c?.disclaimer??"仅在本 Console 进程开着时有效;过夜无人值守仍需 OS clock。"}),c?.lastOutcome?f.jsxs("p",{className:"muted","data-testid":"night-aux-ticker-last",children:["上次:",c.lastOutcome,c.running?"(进行中)":"",c.lastSummary?` · ${c.lastSummary}`:"",c.lastError?` · ${c.lastError}`:""]}):null]}),l.length>0?f.jsx("ul",{className:"night-doctor-list","data-testid":"night-doctor-findings",children:l.slice(0,4).map(d=>f.jsxs("li",{children:[f.jsx("strong",{children:d.severity})," ",d.message]},`${d.code}-${d.scheduleId??""}-${d.message}`))}):null]})}function C8(e){const{board:t,busy:n,onHarvest:a,onOpenDiscard:s}=e,{list:l}=t;return f.jsxs(f.Fragment,{children:[l?f.jsxs("div",{className:"night-kpi","data-testid":"night-kpi",children:[f.jsxs("span",{children:["合计 ",l.summary.total]}),f.jsxs("span",{children:["活动 ",l.summary.active]}),f.jsxs("span",{children:["待收成 ",l.summary.pendingHarvest]}),f.jsxs("span",{children:["需人工 ",l.summary.humanRequired]}),f.jsxs("span",{children:["失败 ",l.summary.failed]})]}):null,f.jsxs("div",{className:"night-board","data-testid":"night-board",children:[f.jsx("h3",{children:"计划列表"}),!l||l.schedules.length===0?f.jsxs("div",{className:"empty-state","data-testid":"night-board-empty",children:[f.jsx("p",{className:"empty-title",children:"暂无夜间计划"}),f.jsx("p",{className:"muted",children:"用下方向导预约第一个任务。"})]}):f.jsx("ul",{className:"night-schedule-list",children:l.schedules.map(c=>f.jsxs("li",{className:"night-schedule-row","data-testid":"night-schedule-row","data-status":c.status,children:[f.jsxs("div",{className:"night-schedule-head",children:[f.jsxs("strong",{children:[c.featureId,"/",c.taskId]}),f.jsx("span",{className:"night-status-chip",children:F2(c.status)})]}),f.jsxs("p",{className:"muted",children:["执行 ",H2(c.executeAtUtc),c.mergeState?` · merge ${c.mergeState}`:"",c.taskCard?` · ${c.taskCard}`:""]}),c.waitingReason?f.jsxs("p",{className:"muted",children:["等待原因:",c.waitingReason]}):null,f.jsxs("p",{className:"muted night-next-action",children:["下一步:",c.nextAction]}),f.jsxs("div",{className:"cta-row",children:[S8(c)?f.jsx("button",{type:"button",className:"btn btn-primary",disabled:n,"data-testid":"night-row-harvest",onClick:()=>a(c),children:"Harvest"}):null,k8(c)?f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-row-discard",onClick:()=>s(c),children:"Discard"}):null,f.jsx("a",{className:"external-link",href:`/inspect/#/night/${encodeURIComponent(c.scheduleId)}`,children:"Inspect"})]})]},c.scheduleId))})]})]})}function R8(e){const{wizard:t,busy:n}=e;return f.jsxs("div",{className:"night-wizard","data-testid":"night-wizard",children:[f.jsx("h3",{children:"预约夜间任务"}),t.phase==="pick"?f.jsxs(f.Fragment,{children:[t.selectableTasks.length===0?f.jsxs("div",{className:"empty-state","data-testid":"night-task-empty",children:[f.jsx("p",{className:"empty-title",children:"没有可选任务"}),f.jsx("p",{className:"muted",children:"请先在 Feature Packet / Task Pool 中创建任务,再回到此处刷新。"})]}):f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"Feature / Task"}),f.jsxs("select",{"data-testid":"night-task-select",value:t.selectedKey,disabled:n,onChange:a=>t.setSelectedKey(a.target.value),children:[f.jsx("option",{value:"",children:"选择任务…"}),t.selectableTasks.map(a=>{const s=`${a.featureId}::${a.taskId}`;return f.jsxs("option",{value:s,children:[a.featureId,"/",a.taskId,a.status?` · ${a.status}`:""]},s)})]})]}),t.derivedFeatureDir?f.jsxs("p",{className:"muted","data-testid":"night-feature-dir",children:["Feature 目录:",f.jsx("code",{children:t.derivedFeatureDir})]}):null,f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"本地执行时间"}),f.jsx("input",{type:"datetime-local","data-testid":"night-at",value:t.nightAt,disabled:n,onChange:a=>t.setNightAt(a.target.value)})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"任务卡片(可选)"}),f.jsx("input",{"data-testid":"night-task-card",value:t.taskCard,disabled:n,placeholder:"UCP-LOOP#11",onChange:a=>t.setTaskCard(a.target.value)})]}),f.jsx("div",{className:"cta-row",children:f.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.selectedKey||!t.nightAt,"data-testid":"night-prepare-btn",onClick:()=>{t.onPrepare()},children:"准备并审阅"})})]}):f.jsxs("div",{className:"night-review-card","data-testid":"night-review-card",children:[f.jsx("p",{className:"muted",children:"请确认 writeSet 与执行环境后预约。Token 已隐藏。"}),f.jsxs("dl",{className:"kv",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"Schedule"}),f.jsx("dd",{children:f.jsx("code",{children:t.review?.scheduleId})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"任务"}),f.jsxs("dd",{children:[t.review?.featureId,"/",t.review?.taskId]})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"执行时间 (UTC)"}),f.jsx("dd",{children:H2(t.review?.executeAtUtc)})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Worktree"}),f.jsx("dd",{children:f.jsx("code",{children:t.review?.worktreePath??"—"})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"分支"}),f.jsx("dd",{children:f.jsx("code",{children:t.review?.branch??"—"})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Base"}),f.jsx("dd",{children:f.jsxs("code",{children:[t.review?.baseBranch??"—","@",(t.review?.baseCommit??"").slice(0,12)||"—"]})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"WriteSet"}),f.jsx("dd",{children:t.review?.writeSet&&t.review.writeSet.length>0?f.jsx("ul",{className:"night-writeset",children:t.review.writeSet.map(a=>f.jsx("li",{children:f.jsx("code",{children:a})},a))}):f.jsx("span",{className:"muted",children:"(未返回显式 writeSet)"})})]})]}),f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.review,"data-testid":"night-confirm-add-btn",onClick:()=>{t.onConfirmAdd()},children:"确认预约"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-review-back-btn",onClick:t.onCancelWizard,children:"返回修改"})]})]})]})}function A8(e){const{setOpError:t}=e,[n,a]=S.useState(null),[s,l]=S.useState(null),[c,d]=S.useState([]),[m,h]=S.useState(null),[p,b]=S.useState(!1),[y,x]=S.useState(!1),[k,T]=S.useState(null),[R,C]=S.useState(null),_=S.useCallback(async()=>{b(!0),h(null);try{const[M,B,X,$]=await Promise.all([fetch("/api/night-jobs",{credentials:"same-origin"}),fetch("/api/night-jobs/doctor",{credentials:"same-origin"}),fetch("/api/tasks",{credentials:"same-origin"}),fetch("/api/operator/v1/night-aux-ticker",{credentials:"same-origin"})]);if(!M.ok)throw new Error(`加载计划列表失败(HTTP ${M.status})`);const j=await M.json();if(a(j),B.ok?l(await B.json()):l(null),X.ok){const F=await X.json();d(Array.isArray(F)?F:[])}else d([]);if($.ok){const F=await $.json();F.ticker&&C(F.ticker)}}catch(M){h(M instanceof Error?M.message:String(M))}finally{b(!1)}},[]);S.useEffect(()=>{_()},[_]);const I=S.useCallback(async()=>{try{const M=await fetch("/api/night-jobs/morning",{credentials:"same-origin"});if(!M.ok){t(`早晨报告加载失败(HTTP ${M.status})`);return}const B=await M.json();T(JSON.stringify(B,null,2).slice(0,4e3)),x(!0)}catch(M){t(M instanceof Error?M.message:String(M))}},[t]),G=(s?.findings??[]).filter(M=>M.severity==="error"||M.severity==="warning"),D=(s?.findings??[]).find(M=>/clock/i.test(M.code)||/clock/i.test(M.message));return{list:n,doctor:s,tasks:c,loadError:m,loadingBoard:p,advancedOpen:y,setAdvancedOpen:x,morningPreview:k,auxTicker:R,refreshBoard:_,onMorningReport:I,doctorIssues:G,clockHint:D}}function _8(e){const{board:t,runAction:n,isActionSuccess:a,setOpError:s}=e,{tasks:l,refreshBoard:c}=t,[d,m]=S.useState("pick"),[h,p]=S.useState(""),[b,y]=S.useState(xv),[x,k]=S.useState(""),[T,R]=S.useState(null),[C,_]=S.useState(""),[I,G]=S.useState(null),[D,M]=S.useState(!1),B=S.useMemo(()=>{const re=l.filter(ue=>typeof ue.featureId=="string"&&ue.featureId.trim()&&ue.taskId);return re.sort((ue,Te)=>{const P=ue.featureId??"",U=Te.featureId??"";return P!==U?P.localeCompare(U):ue.taskId.localeCompare(Te.taskId)}),re},[l]),X=S.useMemo(()=>h?B.find(re=>`${re.featureId}::${re.taskId}`===h)??null:null,[B,h]),$=X?.featureId?yv(X.featureId):"",j=S.useCallback(async(re,ue,Te)=>{const P=await n("prepareMutationGate",{action:re,actionParams:ue});if(!a(P))return;const U=P?.result??P,q=U.receiptId?U:U.result??U;if(!q.receiptId||!q.humanGateToken){s("prepareMutationGate 未返回可消费的 Human Gate receipt");return}return n(re,{...ue,confirmationId:q.receiptId,humanGateToken:q.humanGateToken},{clientRequestId:E8(Te)})},[a,n,s]),F=S.useCallback(async()=>{if(!X?.featureId){s("请先点选 Feature / Task");return}const re=w8(b);if(!re){s("执行时间格式无效,请使用日期时间选择器");return}const ue={featureDir:yv(X.featureId),taskId:X.taskId,at:re,tz:"Asia/Shanghai",...x.trim()?{taskCard:x.trim()}:{}},Te=await j("workerAdmissionPrepare",ue,"night-prepare");if(!a(Te))return;const P=x8(Te?.result??Te);if(!P){s("准备成功但未解析到 scheduleId / gateToken。请刷新后重试,或查看 Inspect。");return}R(P),m("review")},[a,b,j,X,s,x]),H=S.useCallback(async()=>{if(!T)return;const re=await j("workerSchedulerAdd",{scheduleId:T.scheduleId,approveGate:T.gateToken},"night-add");a(re)&&(R(null),m("pick"),p(""),k(""),y(xv()),await c())},[a,c,T,j]),ne=S.useCallback(()=>{m("pick"),R(null)},[]),V=S.useCallback(async re=>{const ue=await j("workerSchedulerHarvest",{scheduleId:re.scheduleId},"night-harvest");a(ue)&&await c()},[a,c,j]),Y=S.useCallback(async()=>{if(!I)return;const re=C.trim()||"discard from console night workbench",ue=wu(I.status),Te=await j("workerSchedulerDiscard",{scheduleId:I.scheduleId,reason:re,...ue||D?{force:!0}:{}},"night-discard");a(Te)&&(G(null),_(""),M(!1),await c())},[C,I,D,a,c,j]),K=S.useCallback(re=>{G(re),M(wu(re.status)),_("")},[]);return{phase:d,selectedKey:h,setSelectedKey:p,nightAt:b,setNightAt:y,taskCard:x,setTaskCard:k,review:T,discardReason:C,setDiscardReason:_,discardTarget:I,setDiscardTarget:G,forceDiscard:D,setForceDiscard:M,selectableTasks:B,derivedFeatureDir:$,onPrepare:F,onConfirmAdd:H,onCancelWizard:ne,onHarvest:V,onDiscard:Y,openDiscard:K}}function I8({busy:e,runAction:t,isActionSuccess:n,setOpError:a}){const s=A8({setOpError:a}),l=_8({board:s,runAction:t,isActionSuccess:n,setOpError:a});return f.jsxs("section",{className:"panel night-workbench","aria-labelledby":"night-title","data-testid":"night-jobs-panel",children:[f.jsx("h2",{id:"night-title",children:"夜间任务"}),f.jsx("p",{className:"panel-lead",children:"白天点选任务并预约;列表查看状态;早晨在行内收成或丢弃。写操作仍经 Human Gate,列表复用 Inspect 投影。"}),f.jsx(N8,{board:s,busy:e}),f.jsx("div",{className:"cta-row",children:f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e||s.loadingBoard,"data-testid":"night-refresh-btn",onClick:()=>{s.refreshBoard()},children:"刷新看板"})}),s.loadError?f.jsx("p",{className:"error","data-testid":"night-load-error",children:s.loadError}):null,f.jsx(C8,{board:s,busy:e,onHarvest:c=>{l.onHarvest(c)},onOpenDiscard:l.openDiscard}),l.discardTarget?f.jsx(T8,{target:l.discardTarget,reason:l.discardReason,onReasonChange:l.setDiscardReason,force:l.forceDiscard,onForceChange:l.setForceDiscard,busy:e,onConfirm:()=>{l.onDiscard()},onCancel:()=>l.setDiscardTarget(null)}):null,f.jsx(R8,{wizard:l,busy:e}),f.jsx(y8,{board:s,busy:e})]})}const M8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M3 10H2V4.00293C2 3.44903 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.43788 22 4.00293V10H21V20.0015C21 20.553 20.5551 21 20.0066 21H3.9934C3.44476 21 3 20.5525 3 20.0015V10ZM19 10H5V19H19V10ZM4 5V8H20V5H4ZM9 12H15V14H9V12Z"})),O8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})),D8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),j8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"})),P2=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})),wv=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M13 9H21L11 24V15H4L13 0V9ZM11 11V7.22063L7.53238 13H13V17.3944L17.263 11H11Z"})),L8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"})),z8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})),B8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M10 3V5H5V19H19V14H21V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM17.5858 5H13V3H21V11H19V6.41421L12 13.4142L10.5858 12L17.5858 5Z"})),U8=({color:e="currentColor",size:t=24,className:n,...a})=>zn.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},zn.createElement("path",{d:"M18.793 5.79285 12.5859 12 18.793 18.2071 20.2072 16.7928 15.4143 12 20.2072 7.20706 18.793 5.79285ZM5.20694 18.2072 11.414 12.0001 5.20694 5.793 3.79272 7.20721 8.58562 12.0001 3.79272 16.793 5.20694 18.2072Z"}));var Mo=q2();const q8=["command","query","operation","tool","server","symbol","path","file_path","filePath","pattern","glob","url"],H8=120,F8=800;function Su(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function P8(e){if(e!=null){if(typeof e=="string"){const t=e.trim();if(!t)return;try{return Su(JSON.parse(t))}catch{return}}return Su(e)}}function La(e,t){const n=e.replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t)}…`:n:""}function Hn(e,t){const n=e[t];if(typeof n=="string"&&n.trim())return n.trim();if(typeof n=="number"&&Number.isFinite(n))return String(n)}function $8(e,t,n){const a=(e??"").toLowerCase();if(a==="bash"||a==="shell"){const s=Hn(t,"command");return s?La(s,n):void 0}if(a==="mcp"||a.startsWith("mcp_")){const s=Hn(t,"server"),l=Hn(t,"tool")??Hn(t,"name"),c=Hn(t,"query");return s&&l?La(`${s} · ${l}`,n):l?La(l,n):c?La(c,n):s?La(s,n):void 0}if(a==="lsp_navigation"||a.includes("lsp")){const s=[Hn(t,"operation"),Hn(t,"symbol"),Hn(t,"path")??Hn(t,"file_path")??Hn(t,"filePath")].filter(Boolean),l=Hn(t,"line")??Hn(t,"position");if(s.length===0&&!l)return;const c=s.join(" · ");return La(l?`${c}${c?":":""}${l}`:c,n)}if(a==="symbol_search"||a.includes("symbol_search")){const s=Hn(t,"query")??Hn(t,"symbol");return s?La(s,n):void 0}if(a==="read"||a==="read_symbol"||a==="read_enclosing"||a.startsWith("read_")){const s=Hn(t,"path")??Hn(t,"file_path")??Hn(t,"filePath"),l=Hn(t,"symbol"),c=Hn(t,"line");if(!s&&!l)return;const d=[s,l,c].filter(Boolean);return La(d.join(" · "),n)}}function G8(e,t){const n=t?.maxLen??H8,a=P8(e);if(!a){if(typeof e=="string"){const m=e.replace(/\s+/g," ").trim();return!m||m==="{}"?"":m.length>n?`${m.slice(0,n)}…`:m}return""}const s=$8(t?.toolName,a,n);if(s)return s;for(const m of q8){const h=a[m];if(typeof h=="string"&&h.trim())return La(h,n)}const l=Object.keys(a);if(l.length===0)return"";const c=a[l[0]],d=String(c??"").replace(/\s+/g," ").trim();return d?d.length>n?`${d.slice(0,n)}…`:d:""}function K8(e){const t=(e??"").toLowerCase();return t==="bash"||t==="shell"?{argsLabel:"命令",resultLabel:"输出"}:t==="mcp"||t.startsWith("mcp_")?{argsLabel:"参数",resultLabel:"结果"}:{argsLabel:"入参",resultLabel:"结果"}}function $2(e){if(e==null)return"";if(typeof e=="string"){const a=e.trim();if(!a)return"";if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return $2(JSON.parse(a))}catch{return e}return e}if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Su(e);if(!t)try{return JSON.stringify(e,null,2)}catch{return String(e)}const n=t.content;if(Array.isArray(n)){const a=[];for(const s of n){const l=Su(s);l&&(l.type==="text"&&typeof l.text=="string"||typeof l.text=="string")&&a.push(l.text)}if(a.length>0)return a.join(`
|
|
11
|
+
`)}if(typeof t.text=="string")return t.text;if(typeof t.output=="string")return t.output;if(typeof t.message=="string")return t.message;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function V8(e){if(e==null)return"";try{return typeof e=="string"?e:JSON.stringify(e,null,2)}catch{return String(e)}}function Y8(e,t){if(e===void 0)return{text:"",truncated:!1};const n=t?.maxLen??F8;return e.length<=n?{text:e,truncated:!1}:{text:`${e.slice(0,n)}…`,truncated:!0}}function X8(e,t){if(t===void 0||!Number.isFinite(e)||!Number.isFinite(t))return;const n=Math.round((t-e)/1e3);return n>0?n:void 0}function tr(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function rs(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function wf(e,t){return new Promise((n,a)=>{if(t?.aborted){a(new DOMException("Aborted","AbortError"));return}const s=setTimeout(()=>{t?.removeEventListener("abort",l),n()},e),l=()=>{clearTimeout(s),a(new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",l)})}function ko(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Sf(e){const t=new Date(e),n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?"今天":t.toLocaleDateString([],{month:"long",day:"numeric"})}function Z8(e,t){return e?e.taskId===t.taskId&&e.updatedAt===t.updatedAt&&e.lastEventId===t.lastEventId&&e.operations.length===t.operations.length:!1}const G2={status:"idle",snapshot:null,error:null,reloading:!1,reloadError:null,mutationBusy:!1,mutationToken:null};function Uh(e){if(!e||typeof e!="object")return{message:"runtime snapshot request failed"};const t=e,n=t.error;if(n&&typeof n=="object"){const a=n;return{...typeof a.code=="string"&&a.code?{code:a.code}:{},...typeof t.status=="number"?{status:t.status}:{},message:typeof a.message=="string"&&a.message?a.message:"runtime snapshot request failed"}}return{...typeof t.status=="number"?{status:t.status}:{},message:typeof t=="object"&&"message"in t&&typeof t.message=="string"&&t.message?t.message:"runtime snapshot request failed"}}function W8(e,t){switch(t.type){case"load-start":return{...e,sessionId:t.sessionId,status:"loading",error:null};case"load-success":return e.snapshot&&e.sessionId===t.sessionId&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"load-failure":return{...e,sessionId:t.sessionId,status:"error",error:t.error,snapshot:null};case"reload-start":return e.reloading?e:{...e,reloading:!0,reloadError:null,...e.status==="error"?{error:null}:{}};case"reload-success":return{...e,status:"ready",snapshot:t.snapshot,reloading:!1,reloadError:null,error:null,sessionId:t.snapshot.sessionId||e.sessionId};case"reload-failure":return{...e,reloading:!1,reloadError:t.error};case"mutation-start":return{...e,mutationBusy:!0,mutationToken:t.token};case"mutation-adopt":return e.mutationToken!==t.token||e.sessionId!==void 0&&e.sessionId!==t.sessionId||e.snapshot&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"mutation-settle":return e.mutationToken!==t.token?e:{...e,mutationBusy:!1,mutationToken:null};case"mutation-reset":return{...e,mutationBusy:!1,mutationToken:null};case"reset":return{...G2};default:return e}}function K2(e){const t=e.selection;return{...t.model?{model:{provider:t.model.provider,modelId:t.model.id}}:{},...t.thinkingSelection==="auto"?t.effectiveThinkingLevel?{thinkingLevel:t.effectiveThinkingLevel}:{}:{thinkingLevel:t.thinkingSelection}}}function Q8(e,t,n,a){const s=n&&n.sessionId===a?K2(n):{},l=s.model??e?.model,c=s.thinkingLevel??e?.thinkingLevel;return{readOnly:t.readOnly,systemPrompt:t.systemPrompt,resources:t.resources,suffix:t.suffix,...l?{model:l}:{},...c?{thinkingLevel:c}:{}}}function J8(e=G2){let t=e;const n=new Set;return{getState:()=>t,dispatch:a=>{t=W8(t,a);for(const s of n)s();return t},subscribe:a=>(n.add(a),()=>n.delete(a))}}const xn=J8();let Ti;function V2(e){return`/api/operator/v1/chat/sessions/${encodeURIComponent(e)}`}function ew(e){const t=Ti;if(Ti=e,!(t&&t.sessionId===e.sessionId&&t.origin===e.origin)){if((!t||t.sessionId!==e.sessionId)&&xn.dispatch({type:"mutation-reset"}),!e.sessionId){xn.dispatch({type:"reset"});return}xn.dispatch({type:"load-start",sessionId:e.sessionId}),Y2(e.sessionId,e.origin)}}async function Y2(e,t){try{const n=await fetch(`${t}${V2(e)}/runtime-snapshot`,{credentials:"include"}),a=await n.json().catch(()=>({}));if(Ti?.sessionId!==e)return;if(!n.ok){xn.dispatch({type:"load-failure",sessionId:e,error:{...Uh(a),status:n.status}});return}if(!a.snapshot){xn.dispatch({type:"load-failure",sessionId:e,error:{status:n.status,message:"runtime snapshot missing in response"}});return}xn.dispatch({type:"load-success",sessionId:e,snapshot:a.snapshot})}catch(n){if(Ti?.sessionId!==e)return;xn.dispatch({type:"load-failure",sessionId:e,error:{message:n instanceof Error?n.message:String(n)}})}}async function el(){const e=Ti;if(!e?.sessionId||xn.getState().reloading)return!1;const t=e.sessionId;xn.dispatch({type:"reload-start"});try{const n=await fetch(`${e.origin}${V2(t)}/reload`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":tr()},body:"{}"}),a=await n.json().catch(()=>({}));return Ti?.sessionId!==t?!1:n.ok?a.snapshot?(xn.dispatch({type:"reload-success",snapshot:a.snapshot}),!0):(xn.dispatch({type:"reload-failure",error:{status:n.status,message:"reload succeeded but snapshot missing"}}),!1):(xn.dispatch({type:"reload-failure",error:{...Uh(a),status:n.status}}),!1)}catch(n){return Ti?.sessionId!==t||xn.dispatch({type:"reload-failure",error:{message:n instanceof Error?n.message:String(n)}}),!1}}async function tl(){const e=Ti;if(!e?.sessionId)return!1;const t=e.sessionId;return xn.dispatch({type:"load-start",sessionId:t}),Y2(t,e.origin),!0}function tw(e,t,n){return n?(xn.dispatch({type:"mutation-adopt",token:e,sessionId:t,snapshot:n}),xn.getState().snapshot===n):!1}function nw(e,t,n){return n.sessionRef.current?.sessionId!==t||xn.getState().mutationToken!==e?!1:(xn.dispatch({type:"mutation-settle",token:e}),!0)}function sl(){return S.useSyncExternalStore(xn.subscribe,xn.getState)}function X2(e){xn.dispatch(e)}function rw(){return xn.getState()}function aw(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}/auto-invocation`}async function iw(e){const t=e.fetchImpl??fetch;try{const n=await t(aw(e.origin,e.sessionId,e.resourceId),{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":e.confirmationToken},body:JSON.stringify({autoInvocationEnabled:e.autoInvocationEnabled})}),a=await n.json().catch(()=>({}));if(!n.ok||a.ok===!1)return{ok:!1,error:{...Uh(a),status:n.status}};const s=a.preferenceSaved===!0,l=a.reloadApplied===!0;if(!s)return{ok:!1,error:{status:n.status,code:"PI_RESOURCE_PREFERENCES_WRITE_FAILED",message:"preference was not saved"}};if(!l){const c=a.error?.code??"PI_SESSION_BUSY",d=a.error?.message??"preference saved; current session is busy and was not reloaded";return{ok:!0,preferenceSaved:!0,reloadApplied:!1,...a.snapshot?{snapshot:a.snapshot}:{},partialBusy:{code:c,message:d}}}return{ok:!0,preferenceSaved:!0,reloadApplied:!0,...a.snapshot?{snapshot:a.snapshot}:{}}}catch(n){return{ok:!1,error:{message:n instanceof Error?n.message:String(n)}}}}function sw(e){return e.autoInvocationEnabled?{badge:"允许自动使用",help:"模型可自动选择该技能,也可通过 /skill:<name> 手动调用。"}:{badge:"已隐藏自动使用",help:`已从模型自动技能列表隐藏,仍可通过 /skill:${e.name} 手动调用。`}}function lw(e){const{summary:t,onRetry:n}=e,[a,s]=S.useState(!1),l=S.useRef(null),c=S.useId();if(S.useEffect(()=>{if(!a)return;const h=b=>{l.current?.contains(b.target)||s(!1)},p=b=>{b.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",p)}},[a]),t.total===0)return null;const d=t.errorCount>0?"error":"warning",m=t.groups.some(h=>h.items.some(p=>p.retryable));return f.jsxs("div",{className:"oc-diag-chip-wrap",ref:l,children:[f.jsxs("button",{type:"button",className:`oc-diag-chip is-${d}${a?" is-open":""}`,"aria-expanded":a,"aria-controls":c,onClick:()=>s(h=>!h),children:[f.jsx(P2,{size:14,"aria-hidden":"true"}),t.chipLabel]}),a?f.jsxs("div",{id:c,className:"oc-diag-popover",role:"region","aria-label":"加载提示",children:[t.groups.map(h=>f.jsxs("section",{className:"oc-diag-group",children:[f.jsxs("header",{className:"oc-diag-group-head",children:[f.jsx("strong",{children:h.heading}),f.jsx("span",{children:h.items.length})]}),f.jsx("p",{className:"oc-diag-group-hint",children:h.hint}),f.jsx("ul",{className:"oc-diag-list",children:h.items.map((p,b)=>f.jsxs("li",{className:`oc-diag-item is-${p.tone}`,children:[f.jsx("span",{className:"oc-diag-item-title",children:p.title}),p.detail?f.jsx("span",{className:"oc-diag-item-detail",children:p.detail}):null,p.shortPath?f.jsx("code",{className:"oc-diag-item-path",title:p.path,children:p.shortPath}):null]},`${h.kind}:${b}`))})]},h.kind)),m&&n?f.jsx("div",{className:"oc-diag-popover-actions",children:f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,children:"再读一次"})}):null]}):null]})}const ow=/name\s+"([^"]+)"\s+collision/i,cw=/invalid characters|must be lowercase/i,Z2=/must not start or end with a hyphen/i,W2=/consecutive hyphens/i,uw={"load-failed":{heading:"需要处理",hint:"有些清单没读完整,下面的列表可能不全。"},"invalid-name":{heading:"名称不规范",hint:"技能已经加载,还能用。名称请改成小写字母、数字和连字符,例如 sdd-requirement-analysis。"},collision:{heading:"同名未生效",hint:"同名技能只保留先扫到的那一份,后面的不会进当前会话。"},other:{heading:"其他提示",hint:"不影响你浏览当前列表。"}},dw=["load-failed","invalid-name","collision","other"];function tu(e){if(!e)return;const t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length===0)return e;const n=t.at(-1);if(!n)return e;const a=t.at(-2);return a?`${a}/${n}`:n}function Sv(e){if(!e)return;const t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length===0)return;const n=t.at(-1);if(n)return/^skill\.md$/i.test(n)&&t.length>=2?t.at(-2):n.replace(/\.md$/i,"")}function Q2(e,t){if(e.path){const n=e.path.replace(/\\/g,"/").toLowerCase(),a=t.path.replace(/\\/g,"/").toLowerCase();if(n===a||n.endsWith(a)||a.endsWith(n))return!0}return!!(e.skillName&&e.skillName===t.name)}function kv(e){const t=e.trim();return t.length<=80?t:`${t.slice(0,79)}…`}function fw(e){const t=`${e.code??""} ${e.message}`.toLowerCase();return t.includes("preference")?"自动使用偏好读不出来":t.includes("package")?"软件包清单没读完整":t.includes("skill")?"技能清单没读完整":t.includes("extension")?"扩展没读完整":t.includes("prompt")?"提示词没读完整":t.includes("theme")?"主题没读完整":t.includes("context")?"上下文文件没读完整":"有些内容没读完整"}function mw(e){return W2.test(e)?"名称里不要连用两个连字符。现在这样也能用。":Z2.test(e)?"名称开头和结尾不要用连字符。现在这样也能用。":"名称请只用小写字母、数字和连字符。现在这样也能用。"}function hw(e){const t=(e.type??"warning").toLowerCase(),n=e.message??"",a=n.match(ow)??(t==="collision"?n.match(/"([^"]+)"/):null);if(t==="collision"||a){const l=a?.[1]??Sv(e.path);return{kind:"collision",tone:"warning",title:l?`「${l}」有多份`:"有一份同名技能没生效",detail:"同名只保留先扫到的那一份,这份被盖掉了。",path:e.path,shortPath:tu(e.path),skillName:l,retryable:!1}}if(cw.test(n)||Z2.test(n)||W2.test(n)){const l=Sv(e.path);return{kind:"invalid-name",tone:"warning",title:l??"有个技能名称不合规范",detail:mw(n),path:e.path,shortPath:tu(e.path),skillName:l,retryable:!1}}return t==="error"||e.retryable===!0||e.code==="RESOURCE_LOAD_FAILED"||e.code==="PACKAGE_INVENTORY_FAILED"||e.code==="PI_RESOURCE_PREFERENCES_MALFORMED"?{kind:"load-failed",tone:"error",title:fw(e),detail:kv(n),path:e.path,shortPath:tu(e.path),retryable:e.retryable===!0}:{kind:"other",tone:t==="error"?"error":"warning",title:kv(n)||"一条提示",path:e.path,shortPath:tu(e.path),retryable:!1}}function pw(e){const t=e.map(hw),n=new Map;for(const c of t){const d=n.get(c.kind)??[];d.push(c),n.set(c.kind,d)}const a=dw.flatMap(c=>{const d=n.get(c);return d?.length?[{kind:c,...uw[c],items:d}]:[]}),s=t.filter(c=>c.tone==="error").length,l=t.length-s;return{total:t.length,errorCount:s,warningCount:l,chipLabel:gw(s,l),groups:a}}function gw(e,t){return e>0&&t>0?`${e} 个问题 · ${t} 条提示`:e>0?e===1?"1 个问题":`${e} 个问题`:t===1?"1 条提示":`${t} 条提示`}function bw(e,t){return t.some(n=>n.kind==="invalid-name"&&Q2(n,e))}function vw(e,t){return t.filter(n=>n.kind!=="collision"&&Q2(n,e))}const J2=()=>window.__CONSOLE_CONFIRMATION_TOKEN__??"";function yw(){const[e,t]=S.useState(0);return S.useEffect(()=>{const n=()=>{const l=document.querySelector(".och, .operator-chrome-fallback");t(l?Math.max(0,Math.round(l.getBoundingClientRect().bottom)):0)};n();const a=document.querySelector(".och, .operator-chrome-fallback"),s=a?new ResizeObserver(n):null;return a&&s?.observe(a),window.addEventListener("resize",n),()=>{s?.disconnect(),window.removeEventListener("resize",n)}},[]),e}function xw(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString([],{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):e}function ww({origin:e}){const[t,n]=S.useState(null),[a,s]=S.useState(null),[l,c]=S.useState(null),[d,m]=S.useState(!1),h=sl(),p=h.snapshot,b=h.reloading,y=h.reloadError,x=p?.diagnostics??[],k=S.useMemo(()=>pw(x),[x]),T=async G=>{n(G),c(null);{s(null);try{const D=await fetch(`${e}/api/operator/v1/pi/models-config`,{credentials:"include"}),M=await D.json();if(!D.ok)throw new Error(M.error?.message??"读取失败");s(M.data)}catch(D){c(D instanceof Error?D.message:String(D))}}},R=async G=>{m(!0),c(null);try{const D=await fetch(`${e}/api/operator/v1/pi/models-config`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":J2()},body:JSON.stringify(G)}),M=await D.json();if(!D.ok)throw new Error(M.error?.message??"模型配置保存失败");s(M.data)}catch(D){c(D instanceof Error?D.message:String(D))}finally{m(!1)}},C=t==="models"?"Models":t==="skills"?"Skills":t==="mcp"?"MCP":"Plugins",_=yw(),I=t&&typeof document<"u"?Mo.createPortal(f.jsx("div",{className:"oc-resource-backdrop",style:{"--oc-chrome-offset":`${_}px`},onMouseDown:G=>{G.target===G.currentTarget&&n(null)},children:f.jsxs("section",{className:"oc-resource-panel",role:"dialog","aria-modal":"true","aria-label":C,children:[f.jsxs("header",{className:"oc-resource-panel-head",children:[f.jsxs("div",{className:"oc-resource-panel-head-copy",children:[f.jsx("strong",{children:C}),f.jsx("span",{className:"oc-resource-panel-meta",children:t==="models"?"管理 models.json(改动会走确认门)":t==="skills"?"开关控制自动使用;这里是当前会话真正加载的技能":t==="mcp"?"只读;这里是当前会话真正加载的 MCP 服务和工具":"只读;这里是当前会话真正解析到的插件"})]}),f.jsxs("div",{className:"oc-resource-panel-head-actions",children:[f.jsx(lw,{summary:k,onRetry:()=>{tl()}}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>n(null),children:"关闭"})]})]}),f.jsxs("div",{className:"oc-resource-panel-body",children:[l&&f.jsx("p",{className:"oc-resource-error",children:l}),t==="models"&&f.jsx(e3,{busy:d,data:a,onMutate:R}),t==="skills"&&f.jsx(Sw,{origin:e,sessionId:p?.sessionId,status:h.status,loadError:h.error,skills:p?.skills,hasSession:!!p?.sessionId,hasDiagnostics:k.total>0,diagnosticItems:k.groups.flatMap(G=>G.items)}),t==="packages"&&f.jsx(Tw,{status:h.status,loadError:h.error,packages:p?.packages,hasSession:!!p?.sessionId,hasDiagnostics:x.length>0}),t==="mcp"&&f.jsx(Cw,{status:h.status,loadError:h.error,inventory:p?.mcp,hasSession:!!p?.sessionId,hasDiagnostics:x.length>0})]}),f.jsxs("footer",{className:"oc-resource-panel-foot",children:[f.jsx("span",{className:"oc-resource-panel-meta",children:b?"正在重新加载会话…":y?`${y.code??"ERROR"}:${y.message}`:p?`快照 r${p.revision} · ${xw(p.loadedAt)}`:"等待会话快照…"}),f.jsxs("div",{className:"oc-resource-panel-actions",children:[y&&f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:b,onClick:()=>{el()},children:"重试"}),h.status==="error"&&f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{tl()},children:"重新读取快照"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:b,onClick:()=>{el()},children:"重新加载会话"})]})]})]})}),document.body):null;return f.jsxs("div",{className:"oc-governance",children:[f.jsxs("div",{className:"oc-governance-links",children:[f.jsx("button",{type:"button",onClick:()=>{T("models")},children:"Models"}),f.jsx("button",{type:"button",className:t==="skills"?"is-active":"",onClick:()=>n("skills"),children:"Skills"}),f.jsx("button",{type:"button",className:t==="packages"?"is-active":"",onClick:()=>n("packages"),children:"Plugins"}),f.jsx("button",{type:"button",className:t==="mcp"?"is-active":"",onClick:()=>n("mcp"),children:"MCP"})]}),I]})}function e3({busy:e,data:t,onMutate:n}){const[a,s]=S.useState(!1),[l,c]=S.useState("add"),[d,m]=S.useState(""),[h,p]=S.useState(""),[b,y]=S.useState(""),[x,k]=S.useState(""),[T,R]=S.useState(""),[C,_]=S.useState(""),[I,G]=S.useState(!0),D=()=>{m(t?.providers?.[0]?.name??""),p(""),y(""),k(""),R(""),_(""),G(!0),c("add"),s(!0)},M=($,j)=>{m($),p(j.id),y(j.name??""),k(j.contextWindow!==void 0?String(j.contextWindow):""),R(j.maxTokens!==void 0?String(j.maxTokens):""),_((j.input??[]).join(",")),G(j.reasoning!==void 0?j.reasoning:!0),c("edit"),s(!0)},B=()=>s(!1),X=async $=>{if($.preventDefault(),!t||!d.trim()||!h.trim())return;const j=F=>{if(F.trim()==="")return;const H=Number(F.trim());return Number.isFinite(H)?H:void 0};await n({expectedRevision:t.revision,action:"upsert-model",provider:d.trim(),model:{id:h.trim(),...b.trim()?{name:b.trim()}:{},...j(x)!==void 0?{contextWindow:j(x)}:{},...j(T)!==void 0?{maxTokens:j(T)}:{},...C.trim()?{input:C.split(/[,,\s]+/).filter(Boolean)}:{},reasoning:I}}),s(!1)};return t?f.jsxs("div",{className:"oc-models-config",children:[f.jsx("p",{className:"oc-resource-panel-meta",children:"Console 不读取或写入 API key;credential 请通过 Pi CLI 配置。 编辑只改表单里的字段,模型配置里的其它字段不会被覆盖。"}),f.jsx("div",{className:"oc-model-toolbar",children:f.jsx("button",{type:"button",className:"btn btn-primary",disabled:e,onClick:D,children:"新增模型"})}),t.providers.length===0?f.jsx("p",{className:"oc-resource-empty",children:"models.json 中暂无 Provider(真实空态;用 Pi CLI 配置)。"}):null,t.providers.map($=>f.jsxs("article",{className:"oc-model-provider",children:[f.jsxs("div",{className:"oc-model-provider-head",children:[f.jsx("strong",{children:$.name}),f.jsx("span",{children:$.credential.configured?"credential configured":"credential 未配置"})]}),$.models.map(j=>f.jsxs("div",{className:"oc-model-row",children:[f.jsx("span",{children:j.name?`${j.name} (${j.id})`:j.id}),f.jsxs("div",{className:"oc-model-row-actions",children:[f.jsx("button",{type:"button",disabled:e,onClick:()=>M($.name,j),children:"编辑"}),f.jsx("button",{type:"button",disabled:e,onClick:()=>{window.confirm(`确认删除模型 ${$.name}/${j.id}?`)&&n({expectedRevision:t.revision,action:"remove-model",provider:$.name,model:{id:j.id}})},children:"删除"})]})]},j.id))]},$.name)),a?Mo.createPortal(f.jsx("div",{className:"oc-model-modal-backdrop","data-testid":"oc-model-modal",onMouseDown:$=>{$.target===$.currentTarget&&B()},children:f.jsx("div",{className:"oc-model-modal",role:"dialog","aria-modal":"true",children:f.jsxs("form",{className:"oc-model-form",onSubmit:$=>{X($)},children:[f.jsx("strong",{children:l==="edit"?`编辑模型 ${h}`:"新增模型"}),l==="add"?f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"Provider(下拉选择)"}),f.jsx("select",{required:!0,value:d,onChange:$=>m($.target.value),children:t.providers.map($=>f.jsx("option",{value:$.name,children:$.name},$.name))})]}):f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"Provider(编辑时不可修改)"}),f.jsx("input",{value:d,disabled:!0})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"模型 ID"}),f.jsx("input",{required:!0,placeholder:"如 deepseek-v4-flash3",value:h,onChange:$=>p($.target.value)})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"显示名称(name)"}),f.jsx("input",{placeholder:"如 DeepSeek V4 Flash",value:b,onChange:$=>y($.target.value)})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"contextWindow"}),f.jsx("input",{type:"number",min:0,placeholder:"如 1000000",value:x,onChange:$=>k($.target.value)})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"maxTokens"}),f.jsx("input",{type:"number",min:0,placeholder:"如 384000",value:T,onChange:$=>R($.target.value)})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"input(逗号分隔,如 text,image)"}),f.jsx("input",{placeholder:"text",value:C,onChange:$=>_($.target.value)})]}),f.jsxs("label",{className:"oc-model-field",children:[f.jsx("span",{children:"reasoning"}),f.jsxs("select",{value:String(I),onChange:$=>G($.target.value==="true"),children:[f.jsx("option",{value:"true",children:"true"}),f.jsx("option",{value:"false",children:"false"})]})]}),f.jsxs("div",{className:"oc-model-form-actions",children:[f.jsx("button",{type:"submit",disabled:e,children:e?"保存中…":l==="edit"?"保存修改":"新增模型"}),f.jsx("button",{type:"button",disabled:e,onClick:B,children:"取消"})]})]})})}),document.body):null]}):f.jsx("p",{className:"oc-resource-empty",children:"正在读取模型配置…"})}function qh(e){return e.status==="loading"?f.jsx("p",{className:"oc-resource-empty",children:"会话快照加载中…"}):e.status==="error"?f.jsxs("div",{className:"oc-resource-error",role:"alert",children:[f.jsxs("span",{children:[e.loadError?.code?`${e.loadError.code}:`:"",e.loadError?.message??"会话快照读取失败"]}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{tl()},children:"重试"})]}):e.hasSession?f.jsx("p",{className:"oc-resource-empty",children:e.emptyText}):f.jsx("p",{className:"oc-resource-empty",children:"当前没有活动会话;打开会话后显示真实资源清单(真实空态)。"})}function Sw(e){const t=e.skills??[],n=e.diagnosticItems??[],[a,s]=S.useState(null),[l,c]=S.useState(null),[d,m]=S.useState(null),[h,p]=S.useState(null),[b,y]=S.useState({});if(e.status!=="ready"||!e.hasSession)return f.jsx(qh,{status:e.status,loadError:e.loadError,hasSession:e.hasSession,emptyText:"当前 session 未加载任何 Skills(真实空态)"});if(t.length===0&&!e.hasDiagnostics)return f.jsx("p",{className:"oc-resource-empty",children:"当前 session 未加载任何 Skills(真实空态,未伪造列表)。"});const x=new Map;for(const C of t){const _=C.scope||"unknown",I=x.get(_)??[];I.push(C),x.set(_,I)}const k=C=>Object.hasOwn(b,C.resourceId)?b[C.resourceId]:C.autoInvocationEnabled,T=async(C,_)=>{if(!e.sessionId||!C.resourceId||a)return;k(C),c(null),m(null),s(C.resourceId),y(G=>({...G,[C.resourceId]:_}));const I=await iw({origin:e.origin,sessionId:e.sessionId,resourceId:C.resourceId,autoInvocationEnabled:_,confirmationToken:J2()});if(s(null),!I.ok){y(G=>{const D={...G};return delete D[C.resourceId],D}),c(`${I.error.code?`${I.error.code}:`:""}${I.error.message}`);return}if(I.reloadApplied&&I.snapshot){X2({type:"load-success",sessionId:e.sessionId,snapshot:I.snapshot}),y(G=>{const D={...G};return delete D[C.resourceId],D}),m(null);return}!I.reloadApplied&&I.partialBusy&&m(`设置已保存;当前会话正忙(${I.partialBusy.code}),请在本轮结束后点击「重新加载会话」。${I.partialBusy.message}`)},R=t.find(C=>(C.resourceId||C.path)===h)??t[0];return f.jsxs("div",{className:"oc-resource-lists",children:[l?f.jsx("p",{className:"oc-resource-error",role:"alert",children:l}):null,d?f.jsx("p",{className:"oc-skill-partial-notice",role:"status",children:d}):null,t.length===0?null:f.jsxs("div",{className:"oc-master-detail",children:[f.jsx("nav",{className:"oc-master-list","aria-label":"Skills 列表",children:[...x.entries()].map(([C,_])=>f.jsxs("div",{className:"oc-master-group",children:[f.jsx("div",{className:"oc-master-group-label",children:C}),_.map(I=>{const G=k(I),D=I.resourceId||I.path,M=R?.resourceId===I.resourceId&&R?.path===I.path,B=bw(I,n);return f.jsxs("button",{type:"button",className:`oc-master-item${M?" is-active":""}${G?"":" is-off"}`,onClick:()=>p(D),title:I.path,children:[f.jsx("span",{"aria-hidden":"true",className:"oc-master-dot"}),f.jsx("span",{className:"oc-master-name",children:I.name}),B?f.jsx("span",{className:"oc-master-flag",title:"名称不合规范,技能仍可用",children:"提示"}):null]},`${C}:${D}`)})]},C))}),R?f.jsx(kw,{skill:R,enabled:k(R),pending:a===R.resourceId,notices:vw(R,n),onToggle:T}):f.jsx("div",{className:"oc-detail-empty",children:"选择左侧技能看详情"})]})]})}function kw(e){const{skill:t,enabled:n,pending:a,notices:s}=e,l=sw({name:t.name,autoInvocationEnabled:n});return f.jsxs("article",{className:"oc-detail",children:[f.jsxs("header",{className:"oc-detail-head",children:[t.scope?f.jsx("span",{className:"oc-scope-badge",children:t.scope}):null,f.jsx("code",{className:"oc-detail-path",title:t.path,children:t.path}),f.jsx("button",{type:"button",className:`oc-toggle${n?" is-on":""}`,role:"switch","aria-checked":n,"aria-label":`允许自动使用 ${t.name}`,disabled:a||!t.resourceId,title:a?"保存中…":l.help,onClick:()=>{e.onToggle(t,!n)},children:f.jsx("span",{className:"oc-toggle-knob","aria-hidden":"true"})})]}),f.jsxs("div",{className:"oc-detail-fields",children:[f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"名称"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.name})]}),t.description?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"说明"}),f.jsx("span",{className:"oc-detail-value",children:t.description})]}):null,f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"状态"}),f.jsx("span",{className:"oc-detail-value",children:l.badge})]}),t.source?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"来源"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.source})]}):null]}),s.length>0?f.jsx("div",{className:"oc-skill-notices",children:s.map((c,d)=>f.jsx("p",{className:"oc-skill-notice",children:c.detail??c.title},`${c.kind}:${d}`))}):null]})}const Ew={extension:"Extensions",skill:"Skills",prompt:"Prompts",theme:"Themes"};function t3(e){return Array.isArray(e.diagnostics)&&e.diagnostics.length>0?"error":e.enabled?e.version?"installed":"loaded":"disabled"}function Tw(e){const t=e.packages??[];if(e.status!=="ready"||!e.hasSession)return f.jsx(qh,{status:e.status,loadError:e.loadError,hasSession:e.hasSession,emptyText:"当前会话没有插件(真实空态)"});if(t.length===0&&!e.hasDiagnostics)return f.jsx("p",{className:"oc-resource-empty",children:"当前会话没有插件(真实空态,未伪造列表)。"});const[n,a]=S.useState(null),s=new Map;for(const d of t){const m=s.get(d.scope)??[];m.push(d),s.set(d.scope,m)}const l=d=>`${d.scope}:${d.spec}`,c=t.find(d=>l(d)===n)??t[0];return f.jsx("div",{className:"oc-resource-lists",children:t.length===0?null:f.jsxs("div",{className:"oc-master-detail",children:[f.jsx("nav",{className:"oc-master-list","aria-label":"插件列表",children:[...s.entries()].map(([d,m])=>f.jsxs("div",{className:"oc-master-group",children:[f.jsx("div",{className:"oc-master-group-label",children:d}),m.map(h=>{const p=t3(h);return f.jsxs("button",{type:"button",className:`oc-master-item${l(h)===(c?l(c):"")?" is-active":""}`,onClick:()=>a(l(h)),title:h.spec,children:[f.jsx("span",{"aria-hidden":"true",className:`oc-master-dot is-${p}`}),f.jsx("span",{className:"oc-master-name",children:h.spec})]},l(h))})]},d))}),c?f.jsx(Nw,{pkg:c}):f.jsx("div",{className:"oc-detail-empty",children:"选择左侧 Package 查看详情"})]})})}function Nw(e){const{pkg:t}=e,n=t3(t),a=new Map;for(const s of t.resolved??[]){const l=Ew[s.type]??s.type,c=a.get(l)??[];c.push(s),a.set(l,c)}return f.jsxs("article",{className:"oc-detail",children:[f.jsxs("header",{className:"oc-detail-head",children:[t.scope?f.jsx("span",{className:"oc-scope-badge",children:t.scope}):null,f.jsx("code",{className:"oc-detail-path",title:t.spec,children:t.spec}),f.jsx("span",{className:`oc-package-status is-${n}`,children:n})]}),f.jsxs("div",{className:"oc-detail-fields",children:[t.packageName?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"Package"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.packageName})]}):null,t.version?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"Version"}),f.jsxs("span",{className:"oc-detail-value oc-mono",children:["v",t.version]})]}):null,t.configuredVersion?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"Configured"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.configuredVersion})]}):null,f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"状态"}),f.jsx("span",{className:"oc-detail-value",children:t.enabled?"loaded":"disabled"})]}),t.installedPath?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"Installed path"}),f.jsx("span",{className:"oc-detail-value oc-mono",title:t.installedPath,children:t.installedPath})]}):null,t.cwd?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"Cwd"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.cwd})]}):null]}),a.size>0?f.jsx("div",{className:"oc-package-resources",children:[...a.entries()].map(([s,l])=>f.jsxs("section",{className:"oc-package-group",children:[f.jsxs("header",{className:"oc-resource-group-head",children:[f.jsx("strong",{children:s}),f.jsxs("span",{children:[l.length," 项"]})]}),f.jsx("ul",{className:"oc-resource-sub-list",children:l.map((c,d)=>f.jsxs("li",{children:[f.jsx("span",{children:c.name||c.path}),f.jsxs("span",{className:"oc-resource-panel-meta",children:[c.scope,c.source?` · ${c.source}`:""]}),f.jsx("code",{children:c.path})]},`${s}:${d}`))})]},s))}):f.jsx("p",{className:"oc-resource-panel-meta",children:"未解析出扩展/技能/提示词/主题(真实空态)"}),Array.isArray(t.diagnostics)&&t.diagnostics.length>0?f.jsx("div",{className:"oc-package-diagnostics",children:t.diagnostics.map((s,l)=>f.jsx("span",{children:s},l))}):null]})}function Ev(e){return e==="loaded"?"已加载":e==="disabled"?"已关闭":"已配置"}function Cw(e){const t=e.inventory?.servers??[],n=e.inventory?.unassignedTools??[],[a,s]=S.useState(null);if(e.status!=="ready"||!e.hasSession)return f.jsx(qh,{status:e.status,loadError:e.loadError,hasSession:e.hasSession,emptyText:"当前会话还没加载 MCP"});if(t.length===0&&n.length===0&&!e.hasDiagnostics)return f.jsx("p",{className:"oc-resource-empty",children:"当前会话没有 MCP 服务,也没有扩展注册的 MCP 工具。"});const l=t.find(c=>c.name===a)??t[0];return f.jsx("div",{className:"oc-resource-lists",children:t.length===0&&n.length===0?null:f.jsxs("div",{className:"oc-master-detail",children:[f.jsx("nav",{className:"oc-master-list","aria-label":"MCP 服务列表",children:t.length>0?f.jsxs("div",{className:"oc-master-group",children:[f.jsx("div",{className:"oc-master-group-label",children:"服务"}),t.map(c=>{const d=l?.name===c.name;return f.jsxs("button",{type:"button",className:`oc-master-item${d?" is-active":""}${c.enabled?"":" is-off"}`,onClick:()=>s(c.name),title:c.configPath??c.name,children:[f.jsx("span",{"aria-hidden":"true",className:`oc-master-dot is-${c.status}`}),f.jsx("span",{className:"oc-master-name",children:c.name})]},`${c.scope}:${c.name}`)})]}):null}),l?f.jsx(Rw,{server:l}):n.length>0?f.jsx(Aw,{tools:n}):f.jsx("div",{className:"oc-detail-empty",children:"选择左侧服务看详情"})]})})}function Rw(e){const{server:t}=e;return f.jsxs("article",{className:"oc-detail",children:[f.jsxs("header",{className:"oc-detail-head",children:[f.jsx("span",{className:"oc-scope-badge",children:t.scope}),f.jsx("code",{className:"oc-detail-path",title:t.configPath??t.name,children:t.name}),f.jsx("span",{className:`oc-package-status is-${t.status}`,children:Ev(t.status)})]}),f.jsxs("div",{className:"oc-detail-fields",children:[f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"状态"}),f.jsx("span",{className:"oc-detail-value",children:Ev(t.status)})]}),t.transport?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"传输"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.transport})]}):null,t.command?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"命令"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.command})]}):null,t.url?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"地址"}),f.jsx("span",{className:"oc-detail-value oc-mono",children:t.url})]}):null,t.configPath?f.jsxs("section",{className:"oc-detail-field",children:[f.jsx("span",{className:"oc-detail-label",children:"配置"}),f.jsx("span",{className:"oc-detail-value oc-mono",title:t.configPath,children:t.configPath})]}):null]}),t.tools.length>0?f.jsx("div",{className:"oc-package-resources",children:f.jsxs("section",{className:"oc-package-group",children:[f.jsxs("header",{className:"oc-resource-group-head",children:[f.jsx("strong",{children:"工具"}),f.jsxs("span",{children:[t.tools.length," 项"]})]}),f.jsx("ul",{className:"oc-resource-sub-list",children:t.tools.map(n=>f.jsxs("li",{children:[f.jsx("span",{children:n.name}),f.jsx("span",{className:"oc-resource-panel-meta",children:n.active?"当前可用":"已注册未激活"}),n.description?f.jsx("code",{children:n.description}):null]},n.name))})]})}):f.jsx("p",{className:"oc-resource-panel-meta",children:"配置里有这个服务,当前会话还没注册出工具。"})]})}function Aw(e){return f.jsxs("article",{className:"oc-detail",children:[f.jsxs("header",{className:"oc-detail-head",children:[f.jsx("span",{className:"oc-scope-badge",children:"session"}),f.jsx("code",{className:"oc-detail-path",children:"扩展工具"})]}),f.jsx("p",{className:"oc-resource-panel-meta",children:"这些工具已经进当前会话,但对不上 mcp.json 里的服务名。"}),f.jsx("ul",{className:"oc-resource-sub-list",children:e.tools.map(t=>f.jsxs("li",{children:[f.jsx("span",{children:t.name}),f.jsx("span",{className:"oc-resource-panel-meta",children:t.active?"当前可用":"已注册未激活"}),t.description?f.jsx("code",{children:t.description}):null]},t.name))})]})}const ku=10,n3="loop-console.operator-chat.sidebar-split.v1",ss=45,Hu=28,Fu=70,Tv=5,Nv=10;function Ws(e){return Number.isFinite(e)?Math.min(Fu,Math.max(Hu,Math.round(e))):ss}function _w(e){if(e==null||e==="")return null;const t=Number(e);if(!Number.isFinite(t))return null;const n=Math.round(t);return n<Hu||n>Fu?null:n}function Iw(e=r3()){if(!e)return ss;try{return _w(e.getItem(n3))??ss}catch{return ss}}function Cv(e,t=r3()){const n=Ws(e);if(!t)return n;try{t.setItem(n3,String(n))}catch{}return n}function Mw(e,t,n=!1){const a=Ws(e);switch(t){case"ArrowUp":return Ws(a-(n?Nv:Tv));case"ArrowDown":return Ws(a+(n?Nv:Tv));case"Home":return Hu;case"End":return Fu;case"Enter":return ss;default:return null}}function Rv(e,t,n){if(!Number.isFinite(n)||n<=0)return ss;const a=(e-t)/n;return Ws(a*100)}function r3(){try{return typeof globalThis>"u"?null:globalThis.localStorage??null}catch{return null}}const Av='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Pu(e){const{open:t,containerRef:n,triggerRef:a,onEscape:s}=e,l=S.useRef(null),c=S.useRef(!1);S.useEffect(()=>{if(t){if(!c.current){const d=document.activeElement;l.current=a?.current??(d instanceof HTMLElement?d:null);const m=n.current;m&&(m.querySelector(Av)??m).focus?.(),c.current=!0}return()=>{if(!c.current)return;const d=a?.current??l.current;d&&document.contains(d)&&d.focus(),l.current=null,c.current=!1}}c.current=!1},[t,n,a]),S.useEffect(()=>{if(!t)return;const d=n.current;if(!d)return;const m=h=>{if(h.key==="Escape"){h.preventDefault(),s?.();return}if(h.key!=="Tab")return;const p=Array.from(d.querySelectorAll(Av)).filter(k=>!k.hasAttribute("disabled")&&k.tabIndex!==-1);if(p.length===0){h.preventDefault(),d.focus?.();return}const b=p[0],y=p[p.length-1],x=document.activeElement;h.shiftKey?(x===b||!d.contains(x))&&(h.preventDefault(),y.focus()):(x===y||!d.contains(x))&&(h.preventDefault(),b.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,n,s])}function Ow(e){const{item:t,active:n,streamingNow:a,turnPhaseNow:s,state:l,deleteConfirming:c,deleting:d}=e,m=s??t.turnPhase,h=a||m==="running"||m==="stopping"||!!t.activeTurnId,p=t.deferredTurn?.state==="failed"?"发送失败":t.deferredTurn?.state==="dispatching"||t.deferredTurn?.state==="accepted"?"发送中":t.deferredTurn?.state==="queued"?"待发送":null,b=t.title||t.displayTitle||"未命名对话",y=S.useRef(null),x=S.useRef(null),[k,T]=S.useState(null),R=S.useRef(null),C=()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)},_=()=>{C(),T(null)},I=M=>{if(!(M.scrollWidth>M.clientWidth+1)){_();return}const X=M.getBoundingClientRect(),$=12,j=Math.min(360,window.innerWidth-$*2),F=X.left,H=Math.max($,Math.min(F,window.innerWidth-$-j));T({x:H,y:X.top+X.height/2})},G=M=>{M&&(C(),R.current=window.setTimeout(()=>I(M),350))};S.useEffect(()=>{const M=()=>_(),B=X=>{X.key==="Escape"&&_()};return window.addEventListener("scroll",M,!0),window.addEventListener("keydown",B),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("keydown",B),C()}},[]),S.useEffect(()=>{c&&x.current?.focus()},[c]);const D=`oc-session-tip-${t.sessionId}`;return f.jsxs("div",{className:`oc-session-item${n?" is-active":""}${c?" is-delete-confirming":""}`,"data-session-id":t.sessionId,children:[f.jsxs("button",{type:"button",className:"oc-session-main",disabled:d,onClick:e.onActivate,onMouseEnter:M=>{const B=M.currentTarget.querySelector("strong");B instanceof HTMLElement&&G(B)},onMouseLeave:_,onFocus:M=>{const B=M.currentTarget.querySelector("strong");B instanceof HTMLElement&&G(B)},onBlur:_,"aria-describedby":k?D:void 0,children:[f.jsx("strong",{ref:y,children:b}),f.jsx("span",{children:new Date(t.updatedAt).toLocaleString()})]}),h?f.jsx("span",{className:"oc-session-running","aria-label":"对话进行中",title:"对话进行中",children:f.jsx("span",{className:"oc-spinner","aria-hidden":"true"})}):null,p?f.jsx("span",{className:`oc-session-queue-state is-${t.deferredTurn?.state}`,children:p}):null,f.jsx("div",{className:`oc-session-actions${c?" is-delete-confirm":""}`,children:c?f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",ref:x,className:"oc-session-delete-confirm",disabled:d,"aria-busy":d||void 0,"aria-label":`确认删除会话:${b}`,onClick:M=>{M.stopPropagation(),e.onConfirmDelete()},children:d?"删除中…":"删除"}),f.jsx("button",{type:"button",className:"oc-session-delete-cancel",disabled:d,"aria-label":"取消删除会话",onClick:M=>{M.stopPropagation(),e.onCancelDelete()},children:"取消"})]}):f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"oc-session-menu",title:"重命名会话","aria-label":"重命名会话",onClick:M=>{M.stopPropagation();const B=window.prompt("会话名称",t.title??"");B!==null&&e.onRename(B)},children:f.jsx(j8,{size:16,"aria-hidden":"true"})}),f.jsx("button",{type:"button",className:"oc-session-menu",title:l==="active"?"归档会话":"恢复会话","aria-label":l==="active"?"归档会话":"恢复会话",onClick:M=>{M.stopPropagation(),e.onSetState(l==="active"?"archived":"active")},children:l==="active"?f.jsx(M8,{size:16,"aria-hidden":"true"}):f.jsx(L8,{size:16,"aria-hidden":"true"})}),f.jsx("button",{type:"button",className:"oc-session-menu oc-session-delete","data-session-delete-id":t.sessionId,title:"删除会话","aria-label":"删除会话",onClick:M=>{M.stopPropagation(),e.onRequestDelete()},children:f.jsx(D8,{size:16,"aria-hidden":"true"})})]})}),k?Mo.createPortal(f.jsx("div",{id:D,role:"tooltip",className:"oc-session-title-tooltip",style:{position:"fixed",left:k.x,top:k.y,transform:"translateY(-50%)"},children:b}),document.body):null]})}function Dw(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,void 0,{sensitivity:"base"}))}function jw({open:e}){return f.jsx("svg",{className:`oc-tree-chevron${e?" is-open":""}`,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:f.jsx("path",{d:"M4.2 2.4 7.8 6 4.2 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Lw({open:e}){return e?f.jsxs("svg",{className:"oc-tree-glyph is-folder-open",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[f.jsx("path",{d:"M1.5 4.2h3.1l1.1 1.2H12a.8.8 0 0 1 .8.8v5a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V5a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.88"}),f.jsx("path",{d:"M1.8 5.8h10.4l-.7 5.2H2.5L1.8 5.8Z",fill:"currentColor",opacity:"0.55"})]}):f.jsx("svg",{className:"oc-tree-glyph is-folder",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:f.jsx("path",{d:"M1.5 3.8h3.2l1 1.1H12a.8.8 0 0 1 .8.8v5.5a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V4.6a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.78"})})}function zw(){return f.jsxs("svg",{className:"oc-tree-glyph is-file",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:[f.jsx("path",{d:"M3.2 1.6h5.1L10.8 4v8.4a.8.8 0 0 1-.8.8H3.2a.8.8 0 0 1-.8-.8V2.4a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.55"}),f.jsx("path",{d:"M8.3 1.7v2.5h2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round",opacity:"0.75"})]})}function Bw(){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:f.jsx("path",{d:"M3 3.5h10v2H3v-2Zm0 3.5h10v2H3V7Zm0 3.5h7V13H3v-2Z",fill:"currentColor"})})}function Uw(){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:f.jsx("path",{d:"M8 3v10M3 8h10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function qw(){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:f.jsx("path",{d:"M8 2.2 13 4.5v3.2c0 3.1-2.1 5.5-5 6.3-2.9-.8-5-3.2-5-6.3V4.5L8 2.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function Hw(e){const t=e.sessions.slice(0,ku),[n,a]=S.useState(()=>Iw()),[s,l]=S.useState(!1),[c,d]=S.useState(null),[m,h]=S.useState(null),p=S.useRef(null),b=S.useRef(null),y=S.useRef(!1),x=e.layoutMode==="comfortable"&&e.open,k=e.layoutMode==="compact",T=e.drawerOpen&&(e.layoutMode==="compact"||e.layoutMode==="narrow"),R=S.useCallback((ne=!0)=>{if(m)return;const V=c;d(null),!(!ne||!V)&&window.requestAnimationFrame(()=>{const Y=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(V):V.replace(/["\\]/g,"\\$&");document.querySelector(`[data-session-delete-id="${Y}"]`)?.focus()})},[m,c]),C=S.useCallback(()=>{m||(d(null),e.onCloseDrawer())},[m,e.onCloseDrawer]),_=S.useCallback(()=>{if(c){R();return}C()},[R,C,c]);Pu({open:T,containerRef:b,triggerRef:e.drawerTriggerRef,onEscape:_}),S.useEffect(()=>{y.current&&!T&&!m&&d(null),y.current=T},[m,T]),S.useEffect(()=>{if(T||!c)return;const ne=V=>{V.key==="Escape"&&(V.preventDefault(),R())};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[R,c,T]),S.useEffect(()=>{c&&!t.some(ne=>ne.sessionId===c)&&d(null),m&&!t.some(ne=>ne.sessionId===m)&&h(null)},[m,c,t]);const I=S.useCallback(async ne=>{if(!(m||c!==ne)){h(ne);try{await e.onDelete(ne)}finally{h(null),d(null)}}},[m,c,e.onDelete]),G=S.useCallback(()=>{m||(R(!1),e.onCreate())},[R,m,e.onCreate]),D=S.useCallback(()=>{m||(R(!1),e.onToggleOpen())},[R,m,e.onToggleOpen]),M=S.useCallback((ne,V)=>{const Y=Ws(ne);a(Y),V&&Cv(Y)},[]),B=S.useCallback(ne=>{const V=Mw(n,ne.key,ne.shiftKey);V!=null&&(ne.preventDefault(),M(V,!0))},[M,n]),X=S.useCallback(ne=>{ne.preventDefault(),ne.currentTarget.setPointerCapture(ne.pointerId),l(!0);const Y=p.current;if(!Y)return;const K=Y.getBoundingClientRect();M(Rv(ne.clientY,K.top,K.height),!1)},[M]),$=S.useCallback(ne=>{if(!ne.currentTarget.hasPointerCapture(ne.pointerId))return;const V=p.current;if(!V)return;const Y=V.getBoundingClientRect();M(Rv(ne.clientY,Y.top,Y.height),!1)},[M]),j=S.useCallback(ne=>{ne.currentTarget.hasPointerCapture(ne.pointerId)&&ne.currentTarget.releasePointerCapture(ne.pointerId),l(!1),Cv(n)},[n]),F=S.useCallback(()=>{M(ss,!0)},[M]),H=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"oc-sidebar-split",ref:p,style:{"--oc-session-share":`${n}%`,"--oc-repo-share":`${100-n}%`},"data-dragging":s?"true":"false",children:[f.jsxs("section",{className:"oc-sidebar-section oc-sessions",children:[f.jsxs("header",{children:[f.jsx("strong",{children:"会话"}),f.jsxs("div",{className:"oc-sidebar-header-actions",children:[f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:G,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:e.creatingSession?"创建中…":"新建"}),e.layoutMode==="comfortable"?f.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:D,"aria-expanded":!0,"aria-label":"收起侧栏",title:"收起侧栏",children:f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:f.jsx("path",{d:"M8.8 2.6 5.2 7l3.6 4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}):f.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:C,"aria-label":"关闭侧栏抽屉",title:"关闭",children:f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:f.jsx("path",{d:"M3.5 3.5 10.5 10.5M10.5 3.5 3.5 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})]})]}),f.jsxs("div",{className:"oc-session-scroll",children:[["active","archived"].map(ne=>{const V=t.filter(Y=>Y.state===ne);return V.length?f.jsxs("div",{className:"oc-session-group",children:[f.jsx("small",{children:ne==="active"?"进行中":"已归档"}),V.map(Y=>f.jsx(Ow,{item:Y,active:e.activeSessionId===Y.sessionId,streamingNow:e.activeSessionId===Y.sessionId&&e.activeSessionStreaming===!0,turnPhaseNow:e.activeSessionId===Y.sessionId?e.activeSessionTurnPhase:void 0,state:ne,deleteConfirming:c===Y.sessionId,deleting:m===Y.sessionId,onActivate:()=>{m||(R(!1),e.onActivate(Y.sessionId))},onRename:K=>e.onRename(Y.sessionId,K),onSetState:K=>e.onSetState(Y.sessionId,K),onRequestDelete:()=>{m||d(Y.sessionId)},onConfirmDelete:()=>{I(Y.sessionId)},onCancelDelete:()=>R()},Y.sessionId))]},ne):null}),t.length===0?f.jsx("p",{className:"oc-tree-empty",children:"暂无会话,点击上方新建。"}):null]})]}),f.jsx("div",{className:"oc-sidebar-separator",role:"separator","aria-orientation":"horizontal","aria-valuemin":Hu,"aria-valuemax":Fu,"aria-valuenow":n,"aria-label":"调整会话与仓库高度比例",tabIndex:0,onKeyDown:B,onPointerDown:X,onPointerMove:$,onPointerUp:j,onPointerCancel:j,onDoubleClick:F}),f.jsxs("section",{className:"oc-sidebar-section oc-explorer",children:[f.jsxs("header",{children:[f.jsx("strong",{children:"仓库"}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onRefreshTree,children:"刷新"})]}),f.jsx("p",{className:"oc-explorer-hint",children:"单击插入 @路径 · 双击预览"}),e.treeError&&f.jsx("p",{className:"oc-sidebar-error",children:e.treeError}),f.jsx("div",{className:"oc-tree-scroll",children:f.jsx(a3,{entries:e.tree[""]??[],tree:e.tree,expanded:e.expanded,depth:0,onToggle:e.onToggleDir,onInsert:e.onInsert,onPreview:e.onPreview})})]})]}),f.jsx(ww,{origin:e.origin})]});return f.jsxs(f.Fragment,{children:[k?f.jsxs("nav",{className:"oc-sidebar-rail","aria-label":"紧凑侧栏",children:[f.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"打开会话与仓库",title:"会话与仓库","aria-expanded":T,onClick:()=>T?C():e.onOpenDrawer(),children:f.jsx(Bw,{})}),f.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":e.creatingSession?"创建会话中":"新建会话",title:e.creatingSession?"创建中…":"新建会话",onClick:G,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:f.jsx(Uw,{})}),f.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"治理入口",title:"治理",onClick:()=>T?C():e.onOpenDrawer(),children:f.jsx(qw,{})})]}):null,e.layoutMode==="comfortable"?f.jsx("aside",{className:`oc-sidebar${x?"":" is-collapsed"}`,"aria-label":"会话与仓库",children:x?H:f.jsx("button",{type:"button",className:"oc-sidebar-toggle is-collapsed",onClick:D,"aria-expanded":!1,"aria-label":"展开侧栏",title:"展开侧栏",children:f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:f.jsx("path",{d:"M5.2 2.6 8.8 7 5.2 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})}):null,T?f.jsxs(f.Fragment,{children:[f.jsx("button",{type:"button",className:"oc-overlay-backdrop","aria-label":"关闭侧栏遮罩",onClick:C}),f.jsx("aside",{ref:b,className:"oc-sidebar oc-sidebar-drawer","aria-label":"会话与仓库抽屉",role:"dialog","aria-modal":"true",tabIndex:-1,children:H})]}):null]})}function a3(e){const t=S.useMemo(()=>Dw(e.entries),[e.entries]);return t.length?f.jsx("ul",{className:"oc-tree",role:e.depth===0?"tree":"group",children:t.map(n=>{const a=n.name.startsWith(".");if(n.kind==="directory"){const s=e.expanded.has(n.path);return f.jsxs("li",{className:`oc-tree-node is-dir${s?" is-open":""}${a?" is-dot":""}`,role:"treeitem","aria-expanded":s,children:[f.jsxs("button",{type:"button",className:"oc-tree-row oc-tree-dir",onClick:()=>e.onToggle(n.path),style:{paddingLeft:`${8+e.depth*12}px`},children:[f.jsx(jw,{open:s}),f.jsx(Lw,{open:s}),f.jsx("span",{className:"oc-tree-label",children:n.name}),f.jsx("span",{className:"oc-tree-at",role:"button",tabIndex:0,title:"插入 @目录/ 引用","aria-label":`插入 ${n.name} 引用`,onClick:l=>{l.stopPropagation(),e.onInsert(`${n.path}/`)},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),e.onInsert(`${n.path}/`))},children:"@"})]}),s?f.jsx("div",{className:"oc-tree-children",style:{"--oc-tree-guide":`${14+e.depth*12}px`},children:f.jsx(a3,{entries:e.tree[n.path]??[],tree:e.tree,expanded:e.expanded,depth:e.depth+1,onToggle:e.onToggle,onInsert:e.onInsert,onPreview:e.onPreview})}):null]},n.path)}return f.jsx("li",{className:`oc-tree-node is-file${a?" is-dot":""}`,role:"treeitem",children:f.jsx(Fw,{entry:n,depth:e.depth,onInsert:e.onInsert,onPreview:e.onPreview})},n.path)})}):f.jsx("p",{className:"oc-tree-empty",children:"此目录为空或没有可安全浏览的文件。"})}function Fw(e){const t=S.useRef(null);return S.useEffect(()=>()=>{t.current!==null&&window.clearTimeout(t.current)},[]),f.jsxs("button",{type:"button",className:"oc-tree-row oc-tree-file",style:{paddingLeft:`${8+e.depth*12}px`},title:"单击插入引用;双击预览",onClick:()=>{t.current!==null&&window.clearTimeout(t.current),t.current=window.setTimeout(()=>{e.onInsert(e.entry.path),t.current=null},220)},onDoubleClick:()=>{t.current!==null&&window.clearTimeout(t.current),t.current=null,e.onPreview(e.entry.path)},children:[f.jsx("span",{className:"oc-tree-chevron-spacer","aria-hidden":"true"}),f.jsx(zw,{}),f.jsx("span",{className:"oc-tree-label",children:e.entry.name}),f.jsx("span",{className:"oc-tree-at",role:"button",tabIndex:0,title:"插入 @文件 引用","aria-label":`插入 ${e.entry.name} 引用`,onClick:n=>{n.stopPropagation(),e.onInsert(e.entry.path)},onDoubleClick:n=>n.stopPropagation(),onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),e.onInsert(e.entry.path))},children:"@"})]})}const Pw="modulepreload",$w=function(e){return"/"+e},_v={},Gw=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let m=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=m(n.map(h=>{if(h=$w(h),h in _v)return;_v[h]=!0;const p=h.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":Pw,p||(y.as="script"),y.crossOrigin="",y.href=h,d&&y.setAttribute("nonce",d),document.head.appendChild(y),p)return new Promise((x,k)=>{y.addEventListener("load",x),y.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function Iv(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,l=!1;for(;!l;){a===-1&&(a=n.length,l=!0);const c=n.slice(s,a).trim();(c||!l)&&t.push(c),s=a+1,a=n.indexOf(",",s)}return t}function Kw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Vw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xw={};function Mv(e,t){return(Xw.jsx?Yw:Vw).test(e)}const Zw=/[ \t\n\f\r]/g;function Ww(e){return typeof e=="object"?e.type==="text"?Ov(e.value):!1:Ov(e)}function Ov(e){return e.replace(Zw,"")===""}class Oo{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Oo.prototype.normal={};Oo.prototype.property={};Oo.prototype.space=void 0;function i3(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Oo(n,a,t)}function Eo(e){return e.toLowerCase()}class Sr{constructor(t,n){this.attribute=n,this.property=t}}Sr.prototype.attribute="";Sr.prototype.booleanish=!1;Sr.prototype.boolean=!1;Sr.prototype.commaOrSpaceSeparated=!1;Sr.prototype.commaSeparated=!1;Sr.prototype.defined=!1;Sr.prototype.mustUseProperty=!1;Sr.prototype.number=!1;Sr.prototype.overloadedBoolean=!1;Sr.prototype.property="";Sr.prototype.spaceSeparated=!1;Sr.prototype.space=void 0;let Qw=0;const ft=cs(),Dn=cs(),Jm=cs(),Ie=cs(),rn=cs(),ls=cs(),Mr=cs();function cs(){return 2**++Qw}const eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:Dn,commaOrSpaceSeparated:Mr,commaSeparated:ls,number:Ie,overloadedBoolean:Jm,spaceSeparated:rn},Symbol.toStringTag,{value:"Module"})),kf=Object.keys(eh);class Hh extends Sr{constructor(t,n,a,s){let l=-1;if(super(t,n),Dv(this,"space",s),typeof a=="number")for(;++l<kf.length;){const c=kf[l];Dv(this,kf[l],(a&eh[c])===eh[c])}}}Hh.prototype.defined=!0;function Dv(e,t,n){n&&(e[t]=n)}function ll(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const l=new Hh(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,n[Eo(a)]=a,n[Eo(l.attribute)]=a}return new Oo(t,n,e.space)}const s3=ll({properties:{ariaActiveDescendant:null,ariaAtomic:Dn,ariaAutoComplete:null,ariaBusy:Dn,ariaChecked:Dn,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:rn,ariaCurrent:null,ariaDescribedBy:rn,ariaDetails:null,ariaDisabled:Dn,ariaDropEffect:rn,ariaErrorMessage:null,ariaExpanded:Dn,ariaFlowTo:rn,ariaGrabbed:Dn,ariaHasPopup:null,ariaHidden:Dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rn,ariaLevel:Ie,ariaLive:null,ariaModal:Dn,ariaMultiLine:Dn,ariaMultiSelectable:Dn,ariaOrientation:null,ariaOwns:rn,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Dn,ariaReadOnly:Dn,ariaRelevant:null,ariaRequired:Dn,ariaRoleDescription:rn,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Dn,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function l3(e,t){return t in e?e[t]:t}function o3(e,t){return l3(e,t.toLowerCase())}const Jw=ll({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ls,acceptCharset:rn,accessKey:rn,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alpha:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:rn,autoFocus:ft,autoPlay:ft,blocking:rn,capture:null,charSet:null,checked:ft,cite:null,className:rn,closedBy:null,colorSpace:null,cols:Ie,colSpan:Ie,command:null,commandFor:null,content:null,contentEditable:Dn,controls:ft,controlsList:rn,coords:Ie|ls,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:Jm,draggable:Dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:rn,height:Ie,hidden:Jm,high:Ie,href:null,hrefLang:null,htmlFor:rn,httpEquiv:rn,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:rn,itemRef:rn,itemScope:ft,itemType:rn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ft,optimum:Ie,pattern:null,ping:rn,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:rn,required:ft,reversed:ft,rows:Ie,rowSpan:Ie,sandbox:rn,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootCustomElementRegistry:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shadowRootSerializable:ft,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:Dn,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rn,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Dn,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ft,disablePictureInPicture:ft,disableRemotePlayback:ft,exportParts:ls,part:rn,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:o3}),eS=ll({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Mr,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:rn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ls,g2:ls,glyphName:ls,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:Mr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mr,rev:Mr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mr,requiredFeatures:Mr,requiredFonts:Mr,requiredFormats:Mr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:Mr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mr,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:l3}),c3=ll({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),u3=ll({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:o3}),d3=ll({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),tS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},nS=/[A-Z]/g,jv=/-[a-z]/g,rS=/^data[-\w.:]+$/i;function f3(e,t){const n=Eo(t);let a=t,s=Sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(jv,iS);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!jv.test(l)){let c=l.replace(nS,aS);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=Hh}return new s(a,t)}function aS(e){return"-"+e.toLowerCase()}function iS(e){return e.charAt(1).toUpperCase()}const m3=i3([s3,Jw,c3,u3,d3],"html"),$u=i3([s3,eS,c3,u3,d3],"svg");function Lv(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function sS(e){return e.join(" ").trim()}var Ks={},Ef,zv;function lS(){if(zv)return Ef;zv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
|
|
12
|
+
`,h="/",p="*",b="",y="comment",x="declaration";function k(R,C){if(typeof R!="string")throw new TypeError("First argument must be a string");if(!R)return[];C=C||{};var _=1,I=1;function G(V){var Y=V.match(t);Y&&(_+=Y.length);var K=V.lastIndexOf(m);I=~K?V.length-K:I+V.length}function D(){var V={line:_,column:I};return function(Y){return Y.position=new M(V),$(),Y}}function M(V){this.start=V,this.end={line:_,column:I},this.source=C.source}M.prototype.content=R;function B(V){var Y=new Error(C.source+":"+_+":"+I+": "+V);if(Y.reason=V,Y.filename=C.source,Y.line=_,Y.column=I,Y.source=R,!C.silent)throw Y}function X(V){var Y=V.exec(R);if(Y){var K=Y[0];return G(K),R=R.slice(K.length),Y}}function $(){X(n)}function j(V){var Y;for(V=V||[];Y=F();)Y!==!1&&V.push(Y);return V}function F(){var V=D();if(!(h!=R.charAt(0)||p!=R.charAt(1))){for(var Y=2;b!=R.charAt(Y)&&(p!=R.charAt(Y)||h!=R.charAt(Y+1));)++Y;if(Y+=2,b===R.charAt(Y-1))return B("End of comment missing");var K=R.slice(2,Y-2);return I+=2,G(K),R=R.slice(Y),I+=2,V({type:y,comment:K})}}function H(){var V=D(),Y=X(a);if(Y){if(F(),!X(s))return B("property missing ':'");var K=X(l),re=V({type:x,property:T(Y[0].replace(e,b)),value:K?T(K[0].replace(e,b)):b});return X(c),re}}function ne(){var V=[];j(V);for(var Y;Y=H();)Y!==!1&&(V.push(Y),j(V));return V}return $(),ne()}function T(R){return R?R.replace(d,b):b}return Ef=k,Ef}var Bv;function oS(){if(Bv)return Ks;Bv=1;var e=Ks&&Ks.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.default=n;const t=e(lS());function n(a,s){let l=null;if(!a||typeof a!="string")return l;const c=(0,t.default)(a),d=typeof s=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:p}=m;d?s(h,p,m):p&&(l=l||{},l[h]=p)}),l}return Ks}var co={},Uv;function cS(){if(Uv)return co;Uv=1,Object.defineProperty(co,"__esModule",{value:!0}),co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},c=function(h,p){return p.toUpperCase()},d=function(h,p){return"".concat(p,"-")},m=function(h,p){return p===void 0&&(p={}),l(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,d):h=h.replace(a,d),h.replace(t,c))};return co.camelCase=m,co}var uo,qv;function uS(){if(qv)return uo;qv=1;var e=uo&&uo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(oS()),n=cS();function a(s,l){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(d,m){d&&m&&(c[(0,n.camelCase)(d,l)]=m)}),c}return a.default=a,uo=a,uo}var dS=uS();const fS=qu(dS),h3=p3("end"),Fh=p3("start");function p3(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function mS(e){const t=Fh(e),n=h3(e);if(t&&n)return{start:t,end:n}}function bo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hv(e.position):"start"in e||"end"in e?Hv(e):"line"in e||"column"in e?th(e):""}function th(e){return Fv(e&&e.line)+":"+Fv(e&&e.column)}function Hv(e){return th(e&&e.start)+"-"+th(e&&e.end)}function Fv(e){return e&&typeof e=="number"?e:1}class ar extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(c=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?l.ruleId=a:(l.source=a.slice(0,m),l.ruleId=a.slice(m+1))}if(!l.place&&l.ancestors&&l.ancestors){const m=l.ancestors[l.ancestors.length-1];m&&(l.place=m.position)}const d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=bo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ar.prototype.file="";ar.prototype.name="";ar.prototype.reason="";ar.prototype.message="";ar.prototype.stack="";ar.prototype.column=void 0;ar.prototype.line=void 0;ar.prototype.ancestors=void 0;ar.prototype.cause=void 0;ar.prototype.fatal=void 0;ar.prototype.place=void 0;ar.prototype.ruleId=void 0;ar.prototype.source=void 0;const Ph={}.hasOwnProperty,hS=new Map,pS=/[A-Z]/g,gS=new Set(["table","tbody","thead","tfoot","tr"]),bS=new Set(["td","th"]),g3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=NS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=TS(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?$u:m3,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=b3(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function b3(e,t,n){if(t.type==="element")return yS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return xS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return SS(e,t,n);if(t.type==="mdxjsEsm")return wS(e,t);if(t.type==="root")return kS(e,t,n);if(t.type==="text")return ES(e,t)}function yS(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=$u,e.schema=s),e.ancestors.push(t);const l=y3(e,t.tagName,!1),c=CS(e,t);let d=Gh(e,t);return gS.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!Ww(m):!0})),v3(e,c,l,t),$h(c,d),e.ancestors.pop(),e.schema=a,e.create(t,l,c,n)}function xS(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}To(e,t.position)}function wS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);To(e,t.position)}function SS(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=$u,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:y3(e,t.name,!0),c=RS(e,t),d=Gh(e,t);return v3(e,c,l,t),$h(c,d),e.ancestors.pop(),e.schema=a,e.create(t,l,c,n)}function kS(e,t,n){const a={};return $h(a,Gh(e,t)),e.create(t,e.Fragment,a,n)}function ES(e,t){return t.value}function v3(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function $h(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function TS(e,t,n){return a;function a(s,l,c,d){const h=Array.isArray(c.children)?n:t;return d?h(l,c,d):h(l,c)}}function NS(e,t){return n;function n(a,s,l,c){const d=Array.isArray(l.children),m=Fh(a);return t(s,l,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function CS(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&Ph.call(t.properties,s)){const l=AS(e,s,t.properties[s]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&bS.has(t.tagName)?a=d:n[c]=d}}if(a){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function RS(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const c=l.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else To(e,t.position);else{const s=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else To(e,t.position);else l=a.value===null?!0:a.value;n[s]=l}return n}function Gh(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:hS;for(;++a<t.children.length;){const l=t.children[a];let c;if(e.passKeys){const m=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(m){const h=s.get(m)||0;c=m+"-"+h,s.set(m,h+1)}}const d=b3(e,l,c);d!==void 0&&n.push(d)}return n}function AS(e,t,n){const a=f3(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Kw(n):sS(n)),a.property==="style"){let s=typeof n=="object"?n:_S(e,String(n));return e.stylePropertyNameCase==="css"&&(s=IS(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?tS[a.property]||a.property:a.attribute,n]}}function _S(e,t){try{return fS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=g3+"#cannot-parse-style-attribute",s}}function y3(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,c;for(;++l<s.length;){const d=Mv(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}a=c}else a=Mv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Ph.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);To(e)}function To(e,t){const n=new ar("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=g3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function IS(e){const t={};let n;for(n in e)Ph.call(e,n)&&(t[MS(n)]=e[n]);return t}function MS(e){let t=e.replace(pS,OS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function OS(e){return"-"+e.toLowerCase()}const Tf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},DS={};function Kh(e,t){const n=DS,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return x3(e,a,s)}function x3(e,t,n){if(jS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Pv(e.children,t,n)}return Array.isArray(e)?Pv(e,t,n):""}function Pv(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=x3(e[s],t,n);return a.join("")}function jS(e){return!!(e&&typeof e=="object")}const $v=document.createElement("i");function Vh(e){const t="&"+e+";";$v.innerHTML=t;const n=$v.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dr(e,t,n,a){const s=e.length;let l=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<a.length;)c=a.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function Xr(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const Gv={}.hasOwnProperty;function w3(e){const t={};let n=-1;for(;++n<e.length;)LS(t,e[n]);return t}function LS(e,t){let n;for(n in t){const s=(Gv.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){Gv.call(s,c)||(s[c]=[]);const d=l[c];zS(s[c],Array.isArray(d)?d:d?[d]:[])}}}function zS(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Dr(e,0,0,a)}function S3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function na(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cr=_i(/[A-Za-z]/),nr=_i(/[\dA-Za-z]/),BS=_i(/[#-'*+\--9=?A-Z^-~]/);function Eu(e){return e!==null&&(e<32||e===127)}const nh=_i(/\d/),US=_i(/[\dA-Fa-f]/),qS=_i(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function an(e){return e!==null&&(e<0||e===32)}function At(e){return e===-2||e===-1||e===32}const Gu=_i(new RegExp("\\p{P}|\\p{S}","u")),os=_i(/\s/);function _i(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ol(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&nr(e.charCodeAt(n+1))&&nr(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(c=String.fromCharCode(l,d),s=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Nt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(m){return At(m)?(e.enter(n),d(m)):t(m)}function d(m){return At(m)&&l++<s?(e.consume(m),d):(e.exit(n),t(m))}}const HS={tokenize:FS};function FS(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Nt(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),l(d)}function l(d){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ze(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const PS={tokenize:$S},Kv={tokenize:GS};function $S(e){const t=this,n=[];let a=0,s,l,c;return d;function d(I){if(a<n.length){const G=n[a];return t.containerState=G[1],e.attempt(G[0].continuation,m,h)(I)}return h(I)}function m(I){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&_();const G=t.events.length;let D=G,M;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){M=t.events[D][1].end;break}C(a);let B=G;for(;B<t.events.length;)t.events[B][1].end={...M},B++;return Dr(t.events,D+1,0,t.events.slice(G)),t.events.length=B,h(I)}return d(I)}function h(I){if(a===n.length){if(!s)return y(I);if(s.currentConstruct&&s.currentConstruct.concrete)return k(I);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Kv,p,b)(I)}function p(I){return s&&_(),C(a),y(I)}function b(I){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(I)}function y(I){return t.containerState={},e.attempt(Kv,x,k)(I)}function x(I){return a++,n.push([t.currentConstruct,t.containerState]),y(I)}function k(I){if(I===null){s&&_(),C(0),e.consume(I);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),T(I)}function T(I){if(I===null){R(e.exit("chunkFlow"),!0),C(0),e.consume(I);return}return Ze(I)?(e.consume(I),R(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(I),T)}function R(I,G){const D=t.sliceStream(I);if(G&&D.push(null),I.previous=l,l&&(l.next=I),l=I,s.defineSkip(I.start),s.write(D),t.parser.lazy[I.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<c&&(!s.events[M][1].end||s.events[M][1].end.offset>c))return;const B=t.events.length;let X=B,$,j;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if($){j=t.events[X][1].end;break}$=!0}for(C(a),M=B;M<t.events.length;)t.events[M][1].end={...j},M++;Dr(t.events,X+1,0,t.events.slice(B)),t.events.length=M}}function C(I){let G=n.length;for(;G-- >I;){const D=n[G];t.containerState=D[1],D[0].exit.call(t,e)}n.length=I}function _(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function GS(e,t,n){return Nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nl(e){if(e===null||an(e)||os(e))return 1;if(Gu(e))return 2}function Ku(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!a.includes(l)&&(t=l(t,n),a.push(l))}return t}const rh={name:"attention",resolveAll:KS,tokenize:VS};function KS(e,t){let n=-1,a,s,l,c,d,m,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const b={...e[a][1].end},y={...e[n][1].start};Vv(b,-m),Vv(y,m),c={type:m>1?"strongSequence":"emphasisSequence",start:b,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Xr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Xr(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",l,t]]),h=Xr(h,Ku(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Xr(h,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Xr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Dr(e,a-1,n-a+3,h),n=a+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function VS(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=nl(a);let l;return c;function c(m){return l=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===l)return e.consume(m),d;const h=e.exit("attentionSequence"),p=nl(m),b=!p||p===2&&s||n.includes(m),y=!s||s===2&&p||n.includes(a);return h._open=!!(l===42?b:b&&(s||!y)),h._close=!!(l===42?y:y&&(p||!b)),t(m)}}function Vv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const YS={name:"autolink",tokenize:XS};function XS(e,t,n){let a=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(x){return cr(x)?(e.consume(x),c):x===64?n(x):h(x)}function c(x){return x===43||x===45||x===46||nr(x)?(a=1,d(x)):h(x)}function d(x){return x===58?(e.consume(x),a=0,m):(x===43||x===45||x===46||nr(x))&&a++<32?(e.consume(x),d):(a=0,h(x))}function m(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Eu(x)?n(x):(e.consume(x),m)}function h(x){return x===64?(e.consume(x),p):BS(x)?(e.consume(x),h):n(x)}function p(x){return nr(x)?b(x):n(x)}function b(x){return x===46?(e.consume(x),a=0,p):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):y(x)}function y(x){if((x===45||nr(x))&&a++<63){const k=x===45?y:b;return e.consume(x),k}return n(x)}}const Do={partial:!0,tokenize:ZS};function ZS(e,t,n){return a;function a(l){return At(l)?Nt(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ze(l)?t(l):n(l)}}const k3={continuation:{tokenize:QS},exit:JS,name:"blockQuote",tokenize:WS};function WS(e,t,n){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return At(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function QS(e,t,n){const a=this;return s;function s(c){return At(c)?Nt(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(k3,t,n)(c)}}function JS(e){e.exit("blockQuote")}const E3={name:"characterEscape",tokenize:e9};function e9(e,t,n){return a;function a(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return qS(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const T3={name:"characterReference",tokenize:t9};function t9(e,t,n){const a=this;let s=0,l,c;return d;function d(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),m}function m(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,c=nr,p(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=US,p):(e.enter("characterReferenceValue"),l=7,c=nh,p(b))}function p(b){if(b===59&&s){const y=e.exit("characterReferenceValue");return c===nr&&!Vh(a.sliceSerialize(y))?n(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(b)&&s++<l?(e.consume(b),p):n(b)}}const Yv={partial:!0,tokenize:r9},Xv={concrete:!0,name:"codeFenced",tokenize:n9};function n9(e,t,n){const a=this,s={partial:!0,tokenize:D};let l=0,c=0,d;return m;function m(M){return h(M)}function h(M){const B=a.events[a.events.length-1];return l=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===d?(c++,e.consume(M),p):c<3?n(M):(e.exit("codeFencedFenceSequence"),At(M)?Nt(e,b,"whitespace")(M):b(M))}function b(M){return M===null||Ze(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(Yv,T,G)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Ze(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(M)):At(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Nt(e,x,"whitespace")(M)):M===96&&M===d?n(M):(e.consume(M),y)}function x(M){return M===null||Ze(M)?b(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(M))}function k(M){return M===null||Ze(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(M)):M===96&&M===d?n(M):(e.consume(M),k)}function T(M){return e.attempt(s,G,R)(M)}function R(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return l>0&&At(M)?Nt(e,_,"linePrefix",l+1)(M):_(M)}function _(M){return M===null||Ze(M)?e.check(Yv,T,G)(M):(e.enter("codeFlowValue"),I(M))}function I(M){return M===null||Ze(M)?(e.exit("codeFlowValue"),_(M)):(e.consume(M),I)}function G(M){return e.exit("codeFenced"),t(M)}function D(M,B,X){let $=0;return j;function j(Y){return M.enter("lineEnding"),M.consume(Y),M.exit("lineEnding"),F}function F(Y){return M.enter("codeFencedFence"),At(Y)?Nt(M,H,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):H(Y)}function H(Y){return Y===d?(M.enter("codeFencedFenceSequence"),ne(Y)):X(Y)}function ne(Y){return Y===d?($++,M.consume(Y),ne):$>=c?(M.exit("codeFencedFenceSequence"),At(Y)?Nt(M,V,"whitespace")(Y):V(Y)):X(Y)}function V(Y){return Y===null||Ze(Y)?(M.exit("codeFencedFence"),B(Y)):X(Y)}}}function r9(e,t,n){const a=this;return s;function s(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Nf={name:"codeIndented",tokenize:i9},a9={partial:!0,tokenize:s9};function i9(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),Nt(e,l,"linePrefix",5)(h)}function l(h){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):Ze(h)?e.attempt(a9,c,m)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||Ze(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),d)}function m(h){return e.exit("codeIndented"),t(h)}}function s9(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):Ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):Nt(e,l,"linePrefix",5)(c)}function l(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Ze(c)?s(c):n(c)}}const l9={name:"codeText",previous:c9,resolve:o9,tokenize:u9};function o9(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function c9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u9(e,t,n){let a=0,s,l;return c;function c(b){return e.enter("codeText"),e.enter("codeTextSequence"),d(b)}function d(b){return b===96?(e.consume(b),a++,d):(e.exit("codeTextSequence"),m(b))}function m(b){return b===null?n(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),m):b===96?(l=e.enter("codeTextSequence"),s=0,p(b)):Ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||Ze(b)?(e.exit("codeTextData"),m(b)):(e.consume(b),h)}function p(b){return b===96?(e.consume(b),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(b)):(l.type="codeTextData",h(b))}}class d9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&fo(this.left,a),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);fo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fo(this.left,n.reverse())}}}function fo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function N3(e){const t={};let n=-1,a,s,l,c,d,m,h;const p=new d9(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,l=0,l<m.length&&m[l][1].type==="lineEndingBlank"&&(l+=2),l<m.length&&m[l][1].type==="content"))for(;++l<m.length&&m[l][1].type!=="content";)m[l][1].type==="chunkText"&&(m[l][1]._isInFirstContentOfListItem=!0,l++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,f9(p,n)),n=t[n],h=!0);else if(a[1]._container){for(l=n,s=void 0;l--;)if(c=p.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},d=p.slice(s,n),d.unshift(a),p.splice(s,n-s+1,d))}}return Dr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function f9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const l=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],h={};let p,b,y=-1,x=n,k=0,T=0;const R=[T];for(;x;){for(;e.get(++s)[1]!==x;);l.push(s),x._tokenizer||(p=a.sliceStream(x),x.next||p.push(null),b&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),b=x,x=x.next}for(x=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(T=y+1,R.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):R.pop(),y=R.length;y--;){const C=d.slice(R[y],R[y+1]),_=l.pop();m.push([_,_+C.length-1]),e.splice(_,2,C)}for(m.reverse(),y=-1;++y<m.length;)h[k+m[y][0]]=k+m[y][1],k+=m[y][1]-m[y][0]-1;return h}const m9={resolve:p9,tokenize:g9},h9={partial:!0,tokenize:b9};function p9(e){return N3(e),e}function g9(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?l(d):Ze(d)?e.check(h9,c,l)(d):(e.consume(d),s)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function b9(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Nt(e,l,"linePrefix")}function l(c){if(c===null||Ze(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function C3(e,t,n,a,s,l,c,d,m){const h=m||Number.POSITIVE_INFINITY;let p=0;return b;function b(C){return C===60?(e.enter(a),e.enter(s),e.enter(l),e.consume(C),e.exit(l),y):C===null||C===32||C===41||Eu(C)?n(C):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(C))}function y(C){return C===62?(e.enter(l),e.consume(C),e.exit(l),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(d),y(C)):C===null||C===60||Ze(C)?n(C):(e.consume(C),C===92?k:x)}function k(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function T(C){return!p&&(C===null||C===41||an(C))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(C)):p<h&&C===40?(e.consume(C),p++,T):C===41?(e.consume(C),p--,T):C===null||C===32||C===40||Eu(C)?n(C):(e.consume(C),C===92?R:T)}function R(C){return C===40||C===41||C===92?(e.consume(C),T):T(C)}}function R3(e,t,n,a,s,l){const c=this;let d=0,m;return h;function h(x){return e.enter(a),e.enter(s),e.consume(x),e.exit(s),e.enter(l),p}function p(x){return d>999||x===null||x===91||x===93&&!m||x===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(e.exit(l),e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):Ze(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),b(x))}function b(x){return x===null||x===91||x===93||Ze(x)||d++>999?(e.exit("chunkString"),p(x)):(e.consume(x),m||(m=!At(x)),x===92?y:b)}function y(x){return x===91||x===92||x===93?(e.consume(x),d++,b):b(x)}}function A3(e,t,n,a,s,l){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(a),e.enter(s),e.consume(y),e.exit(s),c=y===40?41:y,m):n(y)}function m(y){return y===c?(e.enter(s),e.consume(y),e.exit(s),e.exit(a),t):(e.enter(l),h(y))}function h(y){return y===c?(e.exit(l),m(c)):y===null?n(y):Ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Nt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===c||y===null||Ze(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?b:p)}function b(y){return y===c||y===92?(e.consume(y),p):p(y)}}function vo(e,t){let n;return a;function a(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):At(s)?Nt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const v9={name:"definition",tokenize:x9},y9={partial:!0,tokenize:w9};function x9(e,t,n){const a=this;let s;return l;function l(x){return e.enter("definition"),c(x)}function c(x){return R3.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return s=na(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),m):n(x)}function m(x){return an(x)?vo(e,h)(x):h(x)}function h(x){return C3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return e.attempt(y9,b,b)(x)}function b(x){return At(x)?Nt(e,y,"whitespace")(x):y(x)}function y(x){return x===null||Ze(x)?(e.exit("definition"),a.parser.defined.push(s),t(x)):n(x)}}function w9(e,t,n){return a;function a(d){return an(d)?vo(e,s)(d):n(d)}function s(d){return A3(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return At(d)?Nt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Ze(d)?t(d):n(d)}}const S9={name:"hardBreakEscape",tokenize:k9};function k9(e,t,n){return a;function a(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Ze(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const E9={name:"headingAtx",resolve:T9,tokenize:N9};function T9(e,t){let n=e.length-2,a=3,s,l;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},l={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Dr(e,a,n-a+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function N9(e,t,n){let a=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||an(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||Ze(p)?(e.exit("atxHeading"),t(p)):At(p)?Nt(e,d,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function h(p){return p===null||p===35||an(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),h)}}const C9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zv=["pre","script","style","textarea"],R9={concrete:!0,name:"htmlFlow",resolveTo:I9,tokenize:M9},A9={partial:!0,tokenize:D9},_9={partial:!0,tokenize:O9};function I9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function M9(e,t,n){const a=this;let s,l,c,d,m;return h;function h(A){return p(A)}function p(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),b}function b(A){return A===33?(e.consume(A),y):A===47?(e.consume(A),l=!0,T):A===63?(e.consume(A),s=3,a.interrupt?t:P):cr(A)?(e.consume(A),c=String.fromCharCode(A),R):n(A)}function y(A){return A===45?(e.consume(A),s=2,x):A===91?(e.consume(A),s=5,d=0,k):cr(A)?(e.consume(A),s=4,a.interrupt?t:P):n(A)}function x(A){return A===45?(e.consume(A),a.interrupt?t:P):n(A)}function k(A){const ae="CDATA[";return A===ae.charCodeAt(d++)?(e.consume(A),d===ae.length?a.interrupt?t:H:k):n(A)}function T(A){return cr(A)?(e.consume(A),c=String.fromCharCode(A),R):n(A)}function R(A){if(A===null||A===47||A===62||an(A)){const ae=A===47,pe=c.toLowerCase();return!ae&&!l&&Zv.includes(pe)?(s=1,a.interrupt?t(A):H(A)):C9.includes(c.toLowerCase())?(s=6,ae?(e.consume(A),C):a.interrupt?t(A):H(A)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(A):l?_(A):I(A))}return A===45||nr(A)?(e.consume(A),c+=String.fromCharCode(A),R):n(A)}function C(A){return A===62?(e.consume(A),a.interrupt?t:H):n(A)}function _(A){return At(A)?(e.consume(A),_):j(A)}function I(A){return A===47?(e.consume(A),j):A===58||A===95||cr(A)?(e.consume(A),G):At(A)?(e.consume(A),I):j(A)}function G(A){return A===45||A===46||A===58||A===95||nr(A)?(e.consume(A),G):D(A)}function D(A){return A===61?(e.consume(A),M):At(A)?(e.consume(A),D):I(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),m=A,B):At(A)?(e.consume(A),M):X(A)}function B(A){return A===m?(e.consume(A),m=null,$):A===null||Ze(A)?n(A):(e.consume(A),B)}function X(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||an(A)?D(A):(e.consume(A),X)}function $(A){return A===47||A===62||At(A)?I(A):n(A)}function j(A){return A===62?(e.consume(A),F):n(A)}function F(A){return A===null||Ze(A)?H(A):At(A)?(e.consume(A),F):n(A)}function H(A){return A===45&&s===2?(e.consume(A),K):A===60&&s===1?(e.consume(A),re):A===62&&s===4?(e.consume(A),U):A===63&&s===3?(e.consume(A),P):A===93&&s===5?(e.consume(A),Te):Ze(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(A9,q,ne)(A)):A===null||Ze(A)?(e.exit("htmlFlowData"),ne(A)):(e.consume(A),H)}function ne(A){return e.check(_9,V,q)(A)}function V(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Y}function Y(A){return A===null||Ze(A)?ne(A):(e.enter("htmlFlowData"),H(A))}function K(A){return A===45?(e.consume(A),P):H(A)}function re(A){return A===47?(e.consume(A),c="",ue):H(A)}function ue(A){if(A===62){const ae=c.toLowerCase();return Zv.includes(ae)?(e.consume(A),U):H(A)}return cr(A)&&c.length<8?(e.consume(A),c+=String.fromCharCode(A),ue):H(A)}function Te(A){return A===93?(e.consume(A),P):H(A)}function P(A){return A===62?(e.consume(A),U):A===45&&s===2?(e.consume(A),P):H(A)}function U(A){return A===null||Ze(A)?(e.exit("htmlFlowData"),q(A)):(e.consume(A),U)}function q(A){return e.exit("htmlFlow"),t(A)}}function O9(e,t,n){const a=this;return s;function s(c){return Ze(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):n(c)}function l(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function D9(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Do,t,n)}}const j9={name:"htmlText",tokenize:L9};function L9(e,t,n){const a=this;let s,l,c;return d;function d(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),D):P===63?(e.consume(P),I):cr(P)?(e.consume(P),X):n(P)}function h(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),l=0,k):cr(P)?(e.consume(P),_):n(P)}function p(P){return P===45?(e.consume(P),x):n(P)}function b(P){return P===null?n(P):P===45?(e.consume(P),y):Ze(P)?(c=b,re(P)):(e.consume(P),b)}function y(P){return P===45?(e.consume(P),x):b(P)}function x(P){return P===62?K(P):P===45?y(P):b(P)}function k(P){const U="CDATA[";return P===U.charCodeAt(l++)?(e.consume(P),l===U.length?T:k):n(P)}function T(P){return P===null?n(P):P===93?(e.consume(P),R):Ze(P)?(c=T,re(P)):(e.consume(P),T)}function R(P){return P===93?(e.consume(P),C):T(P)}function C(P){return P===62?K(P):P===93?(e.consume(P),C):T(P)}function _(P){return P===null||P===62?K(P):Ze(P)?(c=_,re(P)):(e.consume(P),_)}function I(P){return P===null?n(P):P===63?(e.consume(P),G):Ze(P)?(c=I,re(P)):(e.consume(P),I)}function G(P){return P===62?K(P):I(P)}function D(P){return cr(P)?(e.consume(P),M):n(P)}function M(P){return P===45||nr(P)?(e.consume(P),M):B(P)}function B(P){return Ze(P)?(c=B,re(P)):At(P)?(e.consume(P),B):K(P)}function X(P){return P===45||nr(P)?(e.consume(P),X):P===47||P===62||an(P)?$(P):n(P)}function $(P){return P===47?(e.consume(P),K):P===58||P===95||cr(P)?(e.consume(P),j):Ze(P)?(c=$,re(P)):At(P)?(e.consume(P),$):K(P)}function j(P){return P===45||P===46||P===58||P===95||nr(P)?(e.consume(P),j):F(P)}function F(P){return P===61?(e.consume(P),H):Ze(P)?(c=F,re(P)):At(P)?(e.consume(P),F):$(P)}function H(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),s=P,ne):Ze(P)?(c=H,re(P)):At(P)?(e.consume(P),H):(e.consume(P),V)}function ne(P){return P===s?(e.consume(P),s=void 0,Y):P===null?n(P):Ze(P)?(c=ne,re(P)):(e.consume(P),ne)}function V(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||an(P)?$(P):(e.consume(P),V)}function Y(P){return P===47||P===62||an(P)?$(P):n(P)}function K(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function re(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),ue}function ue(P){return At(P)?Nt(e,Te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):Te(P)}function Te(P){return e.enter("htmlTextData"),c(P)}}const Yh={name:"labelEnd",resolveAll:q9,resolveTo:H9,tokenize:F9},z9={tokenize:P9},B9={tokenize:$9},U9={tokenize:G9};function q9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Dr(e,0,e.length,n),e}function H9(e,t){let n=e.length,a=0,s,l,c,d;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const m={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[l+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,t],["enter",h,t]],d=Xr(d,e.slice(l+1,l+a+3)),d=Xr(d,[["enter",p,t]]),d=Xr(d,Ku(t.parser.constructs.insideSpan.null,e.slice(l+a+4,c-3),t)),d=Xr(d,[["exit",p,t],e[c-2],e[c-1],["exit",h,t]]),d=Xr(d,e.slice(c+1)),d=Xr(d,[["exit",m,t]]),Dr(e,l,e.length,d),e}function F9(e,t,n){const a=this;let s=a.events.length,l,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){l=a.events[s][1];break}return d;function d(y){return l?l._inactive?b(y):(c=a.parser.defined.includes(na(a.sliceSerialize({start:l.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):n(y)}function m(y){return y===40?e.attempt(z9,p,c?p:b)(y):y===91?e.attempt(B9,p,c?h:b)(y):c?p(y):b(y)}function h(y){return e.attempt(U9,p,b)(y)}function p(y){return t(y)}function b(y){return l._balanced=!0,n(y)}}function P9(e,t,n){return a;function a(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),s}function s(b){return an(b)?vo(e,l)(b):l(b)}function l(b){return b===41?p(b):C3(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function c(b){return an(b)?vo(e,m)(b):p(b)}function d(b){return n(b)}function m(b){return b===34||b===39||b===40?A3(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):p(b)}function h(b){return an(b)?vo(e,p)(b):p(b)}function p(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),t):n(b)}}function $9(e,t,n){const a=this;return s;function s(d){return R3.call(a,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return a.parser.defined.includes(na(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function G9(e,t,n){return a;function a(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const K9={name:"labelStartImage",resolveAll:Yh.resolveAll,tokenize:V9};function V9(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const Y9={name:"labelStartLink",resolveAll:Yh.resolveAll,tokenize:X9};function X9(e,t,n){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Cf={name:"lineEnding",tokenize:Z9};function Z9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Nt(e,t,"linePrefix")}}const bu={name:"thematicBreak",tokenize:W9};function W9(e,t,n){let a=0,s;return l;function l(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,d(h)}function d(h){return h===s?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||Ze(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===s?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),At(h)?Nt(e,d,"whitespace")(h):d(h))}}const xr={continuation:{tokenize:tk},exit:rk,name:"list",tokenize:ek},Q9={partial:!0,tokenize:ak},J9={partial:!0,tokenize:nk};function ek(e,t,n){const a=this,s=a.events[a.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(x){const k=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:nh(x)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(bu,n,h)(x):h(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(x)}return n(x)}function m(x){return nh(x)&&++c<10?(e.consume(x),m):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(Do,a.interrupt?n:p,e.attempt(Q9,y,b))}function p(x){return a.containerState.initialBlankLine=!0,l++,y(x)}function b(x){return At(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):n(x)}function y(x){return a.containerState.size=l+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function tk(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Do,s,l);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Nt(e,t,"listItemIndent",a.containerState.size+1)(d)}function l(d){return a.containerState.furtherBlankLines||!At(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(J9,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Nt(e,e.attempt(xr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function nk(e,t,n){const a=this;return Nt(e,s,"listItemIndent",a.containerState.size+1);function s(l){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(l):n(l)}}function rk(e){e.exit(this.containerState.type)}function ak(e,t,n){const a=this;return Nt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const c=a.events[a.events.length-1];return!At(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Wv={name:"setextUnderline",resolveTo:ik,tokenize:sk};function ik(e,t){let n=e.length,a,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",c,t]),e.splice(l+1,0,["exit",e[a][1],t]),e[a][1].end={...e[l][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function sk(e,t,n){const a=this;let s;return l;function l(h){let p=a.events.length,b;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){b=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||b)?(e.enter("setextHeadingLine"),s=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===s?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),At(h)?Nt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Ze(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const lk={tokenize:ok};function ok(e){const t=this,n=e.attempt(Do,a,e.attempt(this.parser.constructs.flowInitial,s,Nt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(m9,s)),"linePrefix")));return n;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ck={resolveAll:I3()},uk=_3("string"),dk=_3("text");function _3(e){return{resolveAll:I3(e==="text"?fk:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],l=n.attempt(s,c,d);return c;function c(p){return h(p)?l(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return h(p)?(n.exit("data"),l(p)):(n.consume(p),m)}function h(p){if(p===null)return!0;const b=s[p];let y=-1;if(b)for(;++y<b.length;){const x=b[y];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function I3(e){return t;function t(n,a){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,a):n}}function fk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let l=s.length,c=-1,d=0,m;for(;l--;){const h=s[l];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(h===-2)m=!0,d++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:a.start._bufferIndex+c,_index:a.start._index+l,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const mk={42:xr,43:xr,45:xr,48:xr,49:xr,50:xr,51:xr,52:xr,53:xr,54:xr,55:xr,56:xr,57:xr,62:k3},hk={91:v9},pk={[-2]:Nf,[-1]:Nf,32:Nf},gk={35:E9,42:bu,45:[Wv,bu],60:R9,61:Wv,95:bu,96:Xv,126:Xv},bk={38:T3,92:E3},vk={[-5]:Cf,[-4]:Cf,[-3]:Cf,33:K9,38:T3,42:rh,60:[YS,j9],91:Y9,92:[S9,E3],93:Yh,95:rh,96:l9},yk={null:[rh,ck]},xk={null:[42,95]},wk={null:[]},Sk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xk,contentInitial:hk,disable:wk,document:mk,flow:gk,flowInitial:pk,insideSpan:yk,string:bk,text:vk},Symbol.toStringTag,{value:"Module"}));function kk(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let c=[],d=[];const m={attempt:B(D),check:B(M),consume:_,enter:I,exit:G,interrupt:B(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:T,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:x,write:b};let p=t.tokenize.call(h,m);return t.resolveAll&&l.push(t),h;function b(F){return c=Xr(c,F),R(),c[c.length-1]!==null?[]:(X(t,0),h.events=Ku(l,h.events,h),h.events)}function y(F,H){return Tk(x(F),H)}function x(F){return Ek(c,F)}function k(){const{_bufferIndex:F,_index:H,line:ne,column:V,offset:Y}=a;return{_bufferIndex:F,_index:H,line:ne,column:V,offset:Y}}function T(F){s[F.line]=F.column,j()}function R(){let F;for(;a._index<c.length;){const H=c[a._index];if(typeof H=="string")for(F=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===F&&a._bufferIndex<H.length;)C(H.charCodeAt(a._bufferIndex));else C(H)}}function C(F){p=p(F)}function _(F){Ze(F)?(a.line++,a.column=1,a.offset+=F===-3?2:1,j()):F!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=F}function I(F,H){const ne=H||{};return ne.type=F,ne.start=k(),h.events.push(["enter",ne,h]),d.push(ne),ne}function G(F){const H=d.pop();return H.end=k(),h.events.push(["exit",H,h]),H}function D(F,H){X(F,H.from)}function M(F,H){H.restore()}function B(F,H){return ne;function ne(V,Y,K){let re,ue,Te,P;return Array.isArray(V)?q(V):"tokenize"in V?q([V]):U(V);function U(te){return ee;function ee(ce){const ge=ce!==null&&te[ce],Ae=ce!==null&&te.null,Oe=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return q(Oe)(ce)}}function q(te){return re=te,ue=0,te.length===0?K:A(te[ue])}function A(te){return ee;function ee(ce){return P=$(),Te=te,te.partial||(h.currentConstruct=te),te.name&&h.parser.constructs.disable.null.includes(te.name)?pe():te.tokenize.call(H?Object.assign(Object.create(h),H):h,m,ae,pe)(ce)}}function ae(te){return F(Te,P),Y}function pe(te){return P.restore(),++ue<re.length?A(re[ue]):K}}}function X(F,H){F.resolveAll&&!l.includes(F)&&l.push(F),F.resolve&&Dr(h.events,H,h.events.length-H,F.resolve(h.events.slice(H),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function $(){const F=k(),H=h.previous,ne=h.currentConstruct,V=h.events.length,Y=Array.from(d);return{from:V,restore:K};function K(){a=F,h.previous=H,h.currentConstruct=ne,h.events.length=V,d=Y,j()}}function j(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function Ek(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,l)];else{if(c=e.slice(n,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}l>0&&c.push(e[s].slice(0,l))}return c}function Tk(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const l=e[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
|
|
13
|
+
`;break}case-3:{c=`\r
|
|
14
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(l)}s=l===-2,a.push(c)}return a.join("")}function Nk(e){const a={constructs:w3([Sk,...(e||{}).extensions||[]]),content:s(HS),defined:[],document:s(PS),flow:s(lk),lazy:{},string:s(uk),text:s(dk)};return a;function s(l){return c;function c(d){return kk(a,l,d)}}}function Ck(e){for(;!N3(e););return e}const Qv=/[\0\t\n\r]/g;function Rk(){let e=1,t="",n=!0,a;return s;function s(l,c,d){const m=[];let h,p,b,y,x;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),b=0,t="",n&&(l.charCodeAt(0)===65279&&b++,n=void 0);b<l.length;){if(Qv.lastIndex=b,h=Qv.exec(l),y=h&&h.index!==void 0?h.index:l.length,x=l.charCodeAt(y),!h){t=l.slice(b);break}if(x===10&&b===y&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),b<y&&(m.push(l.slice(b,y)),e+=y-b),x){case 0:{m.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,m.push(-2);e++<p;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}b=y+1}return d&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const Ak=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _k(e){return e.replace(Ak,Ik)}function Ik(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return S3(n.slice(l?2:1),l?16:10)}return Vh(n)||e}const M3={}.hasOwnProperty;function Mk(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ok(n)(Ck(Nk(n).document().write(Rk()(e,t,!0))))}function Ok(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ut),autolinkProtocol:$,autolinkEmail:$,atxHeading:l(nt),blockQuote:l(Ae),characterEscape:$,characterReference:$,codeFenced:l(Oe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(Oe,c),codeText:l(ve,c),codeTextData:$,data:$,codeFlowValue:$,definition:l(Ue),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Ve),hardBreakEscape:l(lt),hardBreakTrailing:l(lt),htmlFlow:l(Lt,c),htmlFlowData:$,htmlText:l(Lt,c),htmlTextData:$,image:l(_t),label:c,link:l(ut),listItem:l(Fe),listItemValue:y,listOrdered:l(Ye,b),listUnordered:l(Ye),paragraph:l(ct),reference:A,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(nt),strong:l(zt),thematicBreak:l(Wt)},exit:{atxHeading:m(),atxHeadingSequence:D,autolink:m(),autolinkEmail:ge,autolinkProtocol:ce,blockQuote:m(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:te,characterReference:ee,codeFenced:m(R),codeFencedFence:T,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:j,codeIndented:m(C),codeText:m(Y),codeTextData:j,data:j,definition:m(),definitionDestinationString:G,definitionLabelString:_,definitionTitleString:I,emphasis:m(),hardBreakEscape:m(H),hardBreakTrailing:m(H),htmlFlow:m(ne),htmlFlowData:j,htmlText:m(V),htmlTextData:j,image:m(re),label:Te,labelText:ue,lineEnding:F,link:m(K),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:ae,resourceDestinationString:P,resourceTitleString:U,resource:q,setextHeading:m(X),setextHeadingLineSequence:B,setextHeadingText:M,strong:m(),thematicBreak:m()}};O3(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(me){let ye={type:"root",children:[]};const qe={stack:[ye],tokenStack:[],config:t,enter:d,exit:h,buffer:c,resume:p,data:n},Qe=[];let rt=-1;for(;++rt<me.length;)if(me[rt][1].type==="listOrdered"||me[rt][1].type==="listUnordered")if(me[rt][0]==="enter")Qe.push(rt);else{const tn=Qe.pop();rt=s(me,tn,rt)}for(rt=-1;++rt<me.length;){const tn=t[me[rt][0]];M3.call(tn,me[rt][1].type)&&tn[me[rt][1].type].call(Object.assign({sliceSerialize:me[rt][2].sliceSerialize},qe),me[rt][1])}if(qe.tokenStack.length>0){const tn=qe.tokenStack[qe.tokenStack.length-1];(tn[1]||Jv).call(qe,void 0,tn[0])}for(ye.position={start:xi(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:xi(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)ye=t.transforms[rt](ye)||ye;return ye}function s(me,ye,qe){let Qe=ye-1,rt=-1,tn=!1,un,Bt,dt,Ht;for(;++Qe<=qe;){const bt=me[Qe];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?rt++:rt--,Ht=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(un&&!Ht&&!rt&&!dt&&(dt=Qe),Ht=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ht=void 0}if(!rt&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||rt===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(un){let Wn=Qe;for(Bt=void 0;Wn--;){const wn=me[Wn];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Bt&&(me[Bt][1].type="lineEndingBlank",tn=!0),wn[1].type="lineEnding",Bt=Wn}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}dt&&(!Bt||dt<Bt)&&(un._spread=!0),un.end=Object.assign({},Bt?me[Bt][1].start:bt[1].end),me.splice(Bt||Qe,0,["exit",un,bt[2]]),Qe++,qe++}if(bt[1].type==="listItemPrefix"){const Wn={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};un=Wn,me.splice(Qe,0,["enter",Wn,bt[2]]),Qe++,qe++,dt=void 0,Ht=!0}}}return me[ye][1]._spread=tn,qe}function l(me,ye){return qe;function qe(Qe){d.call(this,me(Qe),Qe),ye&&ye.call(this,Qe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(me,ye,qe){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([ye,qe||void 0]),me.position={start:xi(ye.start),end:void 0}}function m(me){return ye;function ye(qe){me&&me.call(this,qe),h.call(this,qe)}}function h(me,ye){const qe=this.stack.pop(),Qe=this.tokenStack.pop();if(Qe)Qe[0].type!==me.type&&(ye?ye.call(this,me,Qe[0]):(Qe[1]||Jv).call(this,me,Qe[0]));else throw new Error("Cannot close `"+me.type+"` ("+bo({start:me.start,end:me.end})+"): it’s not open");qe.position.end=xi(me.end)}function p(){return Kh(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function y(me){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function x(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=me}function k(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=me}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function R(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.value=me.replace(/(\r?\n|\r)$/g,"")}function _(me){const ye=this.resume(),qe=this.stack[this.stack.length-1];qe.label=ye,qe.identifier=na(this.sliceSerialize(me)).toLowerCase()}function I(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.title=me}function G(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.url=me}function D(me){const ye=this.stack[this.stack.length-1];if(!ye.depth){const qe=this.sliceSerialize(me).length;ye.depth=qe}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function B(me){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function $(me){const qe=this.stack[this.stack.length-1].children;let Qe=qe[qe.length-1];(!Qe||Qe.type!=="text")&&(Qe=Pe(),Qe.position={start:xi(me.start),end:void 0},qe.push(Qe)),this.stack.push(Qe)}function j(me){const ye=this.stack.pop();ye.value+=this.sliceSerialize(me),ye.position.end=xi(me.end)}function F(me){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const qe=ye.children[ye.children.length-1];qe.position.end=xi(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&($.call(this,me),j.call(this,me))}function H(){this.data.atHardBreak=!0}function ne(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.value=me}function V(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.value=me}function Y(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.value=me}function K(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=ye,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function re(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=ye,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ue(me){const ye=this.sliceSerialize(me),qe=this.stack[this.stack.length-2];qe.label=_k(ye),qe.identifier=na(ye).toLowerCase()}function Te(){const me=this.stack[this.stack.length-1],ye=this.resume(),qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,qe.type==="link"){const Qe=me.children;qe.children=Qe}else qe.alt=ye}function P(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.url=me}function U(){const me=this.resume(),ye=this.stack[this.stack.length-1];ye.title=me}function q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ae(me){const ye=this.resume(),qe=this.stack[this.stack.length-1];qe.label=ye,qe.identifier=na(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function pe(me){this.data.characterReferenceType=me.type}function te(me){const ye=this.sliceSerialize(me),qe=this.data.characterReferenceType;let Qe;qe?(Qe=S3(ye,qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Qe=Vh(ye);const rt=this.stack[this.stack.length-1];rt.value+=Qe}function ee(me){const ye=this.stack.pop();ye.position.end=xi(me.end)}function ce(me){j.call(this,me);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(me)}function ge(me){j.call(this,me);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(me)}function Ae(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function nt(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function Lt(){return{type:"html",value:""}}function _t(){return{type:"image",title:null,url:"",alt:null}}function ut(){return{type:"link",title:null,url:"",children:[]}}function Ye(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function Fe(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function ct(){return{type:"paragraph",children:[]}}function zt(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function Wt(){return{type:"thematicBreak"}}}function xi(e){return{line:e.line,column:e.column,offset:e.offset}}function O3(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?O3(e,a):Dk(e,a)}}function Dk(e,t){let n;for(n in t)if(M3.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Jv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bo({start:t.start,end:t.end})+") is still open")}function jk(e){const t=this;t.parser=n;function n(a){return Mk(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Lk(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function zk(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
15
|
+
`}]}function Bk(e,t){const n=t.value?t.value+`
|
|
16
|
+
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function Uk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=ol(a.toLowerCase()),l=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(a,d);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function Fk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function D3(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function $k(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D3(e,t);const s={src:ol(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function Gk(e,t){const n={src:ol(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function Kk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function Vk(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return D3(e,t);const s={href:ol(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function Yk(e,t){const n={href:ol(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Xk(e,t,n){const a=e.all(t),s=n?Zk(n):j3(t),l={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let b;p&&p.type==="element"&&p.tagName==="p"?b=p:(b={type:"element",tagName:"p",properties:{},children:[]},a.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(s||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
17
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?c.push(...p.children):c.push(p)}const m=a[a.length-1];m&&(s||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
18
|
+
`});const h={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,h),e.applyData(t,h)}function Zk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=j3(n[a])}return t}function j3(e){const t=e.spread;return t??e.children.length>1}function Wk(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const c=a[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function Qk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tE(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),s.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Fh(t.children[1]),m=h3(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),s.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function nE(e,t,n){const a=n?n.children:void 0,l=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<d;){const b=t.children[m],y={},x=c?c[m]:void 0;x&&(y.align=x);let k={type:"element",tagName:l,properties:y,children:[]};b&&(k.children=e.all(b),e.patch(b,k),k=e.applyData(b,k)),h.push(k)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function rE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const e4=9,t4=32;function aE(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const l=[];for(;a;)l.push(n4(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return l.push(n4(t.slice(s),s>0,!1)),l.join("")}function n4(e,t,n){let a=0,s=e.length;if(t){let l=e.codePointAt(a);for(;l===e4||l===t4;)a++,l=e.codePointAt(a)}if(n){let l=e.codePointAt(s-1);for(;l===e4||l===t4;)s--,l=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function iE(e,t){const n={type:"text",value:aE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const lE={blockquote:Lk,break:zk,code:Bk,delete:Uk,emphasis:qk,footnoteReference:Hk,heading:Fk,html:Pk,imageReference:$k,image:Gk,inlineCode:Kk,linkReference:Vk,link:Yk,listItem:Xk,list:Wk,paragraph:Qk,root:Jk,strong:eE,table:tE,tableCell:rE,tableRow:nE,text:iE,thematicBreak:sE,toml:nu,yaml:nu,definition:nu,footnoteDefinition:nu};function nu(){}const L3=-1,Vu=0,yo=1,Tu=2,Xh=3,Zh=4,Wh=5,Qh=6,z3=7,B3=8,U3=typeof self=="object"?self:globalThis,r4=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new U3[e](t)},oE=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),a=s=>{if(e.has(s))return e.get(s);const[l,c]=t[s];switch(l){case Vu:case L3:return n(c,s);case yo:{const d=n([],s);for(const m of c)d.push(a(m));return d}case Tu:{const d=n({},s);for(const[m,h]of c)d[a(m)]=a(h);return d}case Xh:return n(new Date(c),s);case Zh:{const{source:d,flags:m}=c;return n(new RegExp(d,m),s)}case Wh:{const d=n(new Map,s);for(const[m,h]of c)d.set(a(m),a(h));return d}case Qh:{const d=n(new Set,s);for(const m of c)d.add(a(m));return d}case z3:{const{name:d,message:m}=c;return n(typeof U3[d]=="function"?r4(d,m):new Error(m),s)}case B3:return n(BigInt(c),s);case"BigInt":return n(Object(BigInt(c)),s);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(r4(l,c),s)};return a},a4=e=>oE(new Map,e)(0),ts="",{toString:cE}={},{keys:uE}=Object,mo=e=>{const t=typeof e;if(t!=="object"||!e)return[Vu,t];const n=cE.call(e).slice(8,-1);switch(n){case"Array":return[yo,ts];case"Object":return[Tu,ts];case"Date":return[Xh,ts];case"RegExp":return[Zh,ts];case"Map":return[Wh,ts];case"Set":return[Qh,ts];case"DataView":return[yo,n]}return n.includes("Array")?[yo,n]:e instanceof Error?[z3,e.name||"Error"]:[Tu,n]},ru=([e,t])=>e===Vu&&(t==="function"||t==="symbol"),dE=(e,t,n,a)=>{const s=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},l=c=>{if(n.has(c))return n.get(c);let[d,m]=mo(c);switch(d){case Vu:{let p=c;switch(m){case"bigint":d=B3,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return s([L3],c)}return s([d,p],c)}case yo:{if(m){let y=c;return m==="DataView"?y=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(c)),s([m,[...y]],c)}const p=[],b=s([d,p],c);for(const y of c)p.push(l(y));return b}case Tu:{if(m)switch(m){case"BigInt":return s([m,c.toString()],c);case"Boolean":case"Number":case"String":return s([m,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const p=[],b=s([d,p],c);for(const y of uE(c))(e||!ru(mo(c[y])))&&p.push([l(y),l(c[y])]);return b}case Xh:return s([d,isNaN(c.getTime())?ts:c.toISOString()],c);case Zh:{const{source:p,flags:b}=c;return s([d,{source:p,flags:b}],c)}case Wh:{const p=[],b=s([d,p],c);for(const[y,x]of c)(e||!(ru(mo(y))||ru(mo(x))))&&p.push([l(y),l(x)]);return b}case Qh:{const p=[],b=s([d,p],c);for(const y of c)(e||!ru(mo(y)))&&p.push(l(y));return b}}const{message:h}=c;return s([d,{name:m,message:h}],c)};return l},i4=(e,{json:t,lossy:n}={})=>{const a=[];return dE(!(t||n),!!t,new Map,a)(e),a},Nu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?a4(i4(e,t)):structuredClone(e):(e,t)=>a4(i4(e,t));function fE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function mE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function hE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||fE,a=e.options.footnoteBackLabel||mE,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const p=e.all(h),b=String(h.identifier).toUpperCase(),y=ol(b.toLowerCase());let x=0;const k=[],T=e.footnoteCounts.get(b);for(;T!==void 0&&++x<=T;){k.length>0&&k.push({type:"text",value:" "});let _=typeof n=="string"?n:n(m,x);typeof _=="string"&&(_={type:"text",value:_}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,x),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const R=p[p.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const _=R.children[R.children.length-1];_&&_.type==="text"?_.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(...k)}else p.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(h,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Nu(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
19
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
20
|
+
`}]}}const jo=(function(e){if(e==null)return vE;if(typeof e=="function")return Yu(e);if(typeof e=="object")return Array.isArray(e)?pE(e):gE(e);if(typeof e=="string")return bE(e);throw new Error("Expected function, string, or object as test")});function pE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=jo(e[n]);return Yu(a);function a(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function gE(e){const t=e;return Yu(n);function n(a){const s=a;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function bE(e){return Yu(t);function t(n){return n&&n.type===e}}function Yu(e){return t;function t(n,a,s){return!!(yE(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function vE(){return!0}function yE(e){return e!==null&&typeof e=="object"&&"type"in e}const q3=[],xE=!0,ah=!1,H3="skip";function Jh(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const l=jo(s),c=a?-1:1;d(e,void 0,[])();function d(m,h,p){const b=m&&typeof m=="object"?m:{};if(typeof b.type=="string"){const x=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=q3,k,T,R;if((!t||l(m,h,p[p.length-1]||void 0))&&(x=wE(n(m,p)),x[0]===ah))return x;if("children"in m&&m.children){const C=m;if(C.children&&x[0]!==H3)for(T=(a?C.children.length:-1)+c,R=p.concat(C);T>-1&&T<C.children.length;){const _=C.children[T];if(k=d(_,T,R)(),k[0]===ah)return k;T=typeof k[1]=="number"?k[1]:T+c}}return x}}}function wE(e){return Array.isArray(e)?e:typeof e=="number"?[xE,e]:e==null?q3:[e]}function ep(e,t,n,a){let s,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,s=n):(l=t,c=n,s=a),Jh(e,l,d,s);function d(m,h){const p=h[h.length-1],b=p?p.children.indexOf(m):void 0;return c(m,b,p)}}const ih={}.hasOwnProperty,SE={};function kE(e,t){const n=t||SE,a=new Map,s=new Map,l=new Map,c={...lE,...n.handlers},d={all:h,applyData:TE,definitionById:a,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:c,one:m,options:n,patch:EE,wrap:CE};return ep(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const b=p.type==="definition"?a:s,y=String(p.identifier).toUpperCase();b.has(y)||b.set(y,p)}}),d;function m(p,b){const y=p.type,x=d.handlers[y];if(ih.call(d.handlers,y)&&x)return x(d,p,b);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in p){const{children:T,...R}=p,C=Nu(R);return C.children=d.all(p),C}return Nu(p)}return(d.options.unknownHandler||NE)(d,p,b)}function h(p){const b=[];if("children"in p){const y=p.children;let x=-1;for(;++x<y.length;){const k=d.one(y[x],p);if(k){if(x&&y[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=s4(k.value)),!Array.isArray(k)&&k.type==="element")){const T=k.children[0];T&&T.type==="text"&&(T.value=s4(T.value))}Array.isArray(k)?b.push(...k):b.push(k)}}}return b}}function EE(e,t){e.position&&(t.position=mS(e))}function TE(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,Nu(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NE(e,t){const n=t.data||{},a="value"in t&&!(ih.call(n,"hProperties")||ih.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function CE(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
21
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
22
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
23
|
+
`}),n}function s4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function l4(e,t){const n=kE(e,t),a=n.one(e,void 0),s=hE(n),l=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
24
|
+
`},s),l}function RE(e,t){return e&&"run"in e?async function(n,a){const s=l4(n,{file:a,...t});await e.run(s,a)}:function(n,a){return l4(n,{file:a,...e||t})}}function o4(e){if(e)throw e}var Rf,c4;function AE(){if(c4)return Rf;c4=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!b)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},c=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},d=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(a)return a(h,p).value}else return;return h[p]};return Rf=function m(){var h,p,b,y,x,k,T=arguments[0],R=1,C=arguments.length,_=!1;for(typeof T=="boolean"&&(_=T,T=arguments[1]||{},R=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});R<C;++R)if(h=arguments[R],h!=null)for(p in h)b=d(T,p),y=d(h,p),T!==y&&(_&&y&&(l(y)||(x=s(y)))?(x?(x=!1,k=b&&s(b)?b:[]):k=b&&l(b)?b:{},c(T,{name:p,newValue:m(_,k,y)})):typeof y<"u"&&c(T,{name:p,newValue:y}));return T},Rf}var _E=AE();const Af=qu(_E);function sh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function IE(){const e=[],t={run:n,use:a};return t;function n(...s){let l=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(m,...h){const p=e[++l];let b=-1;if(m){c(m);return}for(;++b<s.length;)(h[b]===null||h[b]===void 0)&&(h[b]=s[b]);s=h,p?ME(p,d)(...h):c(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function ME(e,t){let n;return a;function a(...c){const d=e.length>c.length;let m;d&&c.push(s);try{m=e.apply(this,c)}catch(h){const p=h;if(d&&n)throw p;return s(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(l,s):m instanceof Error?s(m):l(m))}function s(c,...d){n||(n=!0,t(c,...d))}function l(c){s(null,c)}}const ca={basename:OE,dirname:DE,extname:jE,join:LE,sep:"/"};function OE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lo(e);let n=0,a=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else c<0&&(l=!0,c=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function DE(e){if(Lo(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jE(e){Lo(e);let t=e.length,n=-1,a=0,s=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function LE(...e){let t=-1,n;for(;++t<e.length;)Lo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zE(n)}function zE(e){Lo(e);const t=e.codePointAt(0)===47;let n=BE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function BE(e,t){let n="",a=0,s=-1,l=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||l===1))if(s!==c-1&&l===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),s=c,l=0;continue}}else if(n.length>0){n="",a=0,s=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,c):n=e.slice(s+1,c),a=c-s-1;s=c,l=0}else d===46&&l>-1?l++:l=-1}return n}function Lo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const UE={cwd:qE};function qE(){return"/"}function lh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function HE(e){if(typeof e=="string")e=new URL(e);else if(!lh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return FE(e)}function FE(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const _f=["history","path","basename","stem","extname","dirname"];class F3{constructor(t){let n;t?lh(t)?n={path:t}:typeof t=="string"||PE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":UE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<_f.length;){const l=_f[a];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)_f.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?ca.basename(this.path):void 0}set basename(t){Mf(t,"basename"),If(t,"basename"),this.path=ca.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ca.dirname(this.path):void 0}set dirname(t){u4(this.basename,"dirname"),this.path=ca.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ca.extname(this.path):void 0}set extname(t){if(If(t,"extname"),u4(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ca.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){lh(t)&&(t=HE(t)),Mf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ca.basename(this.path,this.extname):void 0}set stem(t){Mf(t,"stem"),If(t,"stem"),this.path=ca.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new ar(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function If(e,t){if(e&&e.includes(ca.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ca.sep+"`")}function Mf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function u4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function PE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $E=(function(e){const a=this.constructor.prototype,s=a[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,a),l}),GE={}.hasOwnProperty;class tp extends $E{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IE()}copy(){const t=new tp;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Af(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(jf("data",this.frozen),this.namespace[t]=n,this):GE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=au(t),a=this.parser||this.Parser;return Of("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Of("process",this.parser||this.Parser),Df("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,c){const d=au(t),m=a.parse(d);a.run(m,d,function(p,b,y){if(p||!b||!y)return h(p);const x=b,k=a.stringify(x,y);YE(k)?y.value=k:y.result=k,h(p,y)});function h(p,b){p||!b?c(p):l?l(b):n(void 0,b)}}}processSync(t){let n=!1,a;return this.freeze(),Of("processSync",this.parser||this.Parser),Df("processSync",this.compiler||this.Compiler),this.process(t,s),f4("processSync","process",n),a;function s(l,c){n=!0,o4(l),a=c}}run(t,n,a){d4(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?l(void 0,a):new Promise(l);function l(c,d){const m=au(n);s.run(t,m,h);function h(p,b,y){const x=b||t;p?d(p):c?c(x):a(void 0,x,y)}}}runSync(t,n){let a=!1,s;return this.run(t,n,l),f4("runSync","run",a),s;function l(c,d){o4(c),s=d,a=!0}}stringify(t,n){this.freeze();const a=au(n),s=this.compiler||this.Compiler;return Df("stringify",s),d4(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(jf("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...b]=h;m(p,b)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(h.plugins),h.settings&&(s.settings=Af(!0,s.settings,h.settings))}function d(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const b=h[p];l(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,p){let b=-1,y=-1;for(;++b<a.length;)if(a[b][0]===h){y=b;break}if(y===-1)a.push([h,...p]);else if(p.length>0){let[x,...k]=p;const T=a[y][1];sh(T)&&sh(x)&&(x=Af(!0,T,x)),a[y]=[h,x,...k]}}}}const KE=new tp().freeze();function Of(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Df(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jf(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function d4(e){if(!sh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function f4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function au(e){return VE(e)?e:new F3(e)}function VE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YE(e){return typeof e=="string"||XE(e)}function XE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",m4=[],h4={allowDangerousHtml:!0},WE=/^(https?|ircs?|mailto|xmpp)$/i,QE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function JE(e){const t=eT(e),n=tT(e);return nT(t.runSync(t.parse(n),n),e)}function eT(e){const t=e.rehypePlugins||m4,n=e.remarkPlugins||m4,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...h4}:h4;return KE().use(jk).use(n).use(RE,a).use(t)}function tT(e){const t=e.children||"",n=new F3;return typeof t=="string"&&(n.value=t),n}function nT(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||rT;for(const p of QE)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+ZE+p.id,void 0);return ep(e,h),vS(e,{Fragment:f.Fragment,components:s,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function h(p,b,y){if(p.type==="raw"&&y&&typeof b=="number")return c?y.children.splice(b,1):y.children[b]={type:"text",value:p.value},b;if(p.type==="element"){let x;for(x in Tf)if(Object.hasOwn(Tf,x)&&Object.hasOwn(p.properties,x)){const k=p.properties[x],T=Tf[x];(T===null||T.includes(p.tagName))&&(p.properties[x]=m(String(k||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!x&&a&&typeof b=="number"&&(x=!a(p,b,y)),x&&y&&typeof b=="number")return d&&p.children?y.children.splice(b,1,...p.children):y.children.splice(b,1),b}}}function rT(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||WE.test(e.slice(0,t))?e:""}function p4(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function aT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iT(e,t,n){const s=jo((n||{}).ignore||[]),l=sT(t);let c=-1;for(;++c<l.length;)Jh(e,"text",d);function d(h,p){let b=-1,y;for(;++b<p.length;){const x=p[b],k=y?y.children:void 0;if(s(x,k?k.indexOf(x):void 0,y))return;y=x}if(y)return m(h,p)}function m(h,p){const b=p[p.length-1],y=l[c][0],x=l[c][1];let k=0;const R=b.children.indexOf(h);let C=!1,_=[];y.lastIndex=0;let I=y.exec(h.value);for(;I;){const G=I.index,D={index:I.index,input:I.input,stack:[...p,h]};let M=x(...I,D);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=G+1:(k!==G&&_.push({type:"text",value:h.value.slice(k,G)}),Array.isArray(M)?_.push(...M):M&&_.push(M),k=G+I[0].length,C=!0),!y.global)break;I=y.exec(h.value)}return C?(k<h.value.length&&_.push({type:"text",value:h.value.slice(k)}),b.children.splice(R,1,..._)):_=[h],R+_.length}}function sT(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([lT(s[0]),oT(s[1])])}return t}function lT(e){return typeof e=="string"?new RegExp(aT(e),"g"):e}function oT(e){return typeof e=="function"?e:function(){return e}}const Lf="phrasing",zf=["autolink","link","image","label"];function cT(){return{transforms:[gT],enter:{literalAutolink:dT,literalAutolinkEmail:Bf,literalAutolinkHttp:Bf,literalAutolinkWww:Bf},exit:{literalAutolink:pT,literalAutolinkEmail:hT,literalAutolinkHttp:fT,literalAutolinkWww:mT}}}function uT(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Lf,notInConstruct:zf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Lf,notInConstruct:zf},{character:":",before:"[ps]",after:"\\/",inConstruct:Lf,notInConstruct:zf}]}}function dT(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Bf(e){this.config.enter.autolinkProtocol.call(this,e)}function fT(e){this.config.exit.autolinkProtocol.call(this,e)}function mT(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function hT(e){this.config.exit.autolinkEmail.call(this,e)}function pT(e){this.exit(e)}function gT(e){iT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,bT],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),vT]],{ignore:["link","linkReference"]})}function bT(e,t,n,a,s){let l="";if(!P3(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!yT(n)))return!1;const c=xT(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:l+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function vT(e,t,n,a){return!P3(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function yT(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function xT(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=p4(e,"(");let l=p4(e,")");for(;a!==-1&&s>l;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),l++;return[e,n]}function P3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||os(n)||Gu(n))&&(!t||n!==47)}$3.peek=AT;function wT(){this.buffer()}function ST(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kT(){this.buffer()}function ET(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TT(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NT(e){this.exit(e)}function CT(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=na(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RT(e){this.exit(e)}function AT(){return"["}function $3(e,t,n,a){const s=n.createTracker(a);let l=s.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),d(),c(),l+=s.move("]"),l}function _T(){return{enter:{gfmFootnoteCallString:wT,gfmFootnoteCall:ST,gfmFootnoteDefinitionLabelString:kT,gfmFootnoteDefinition:ET},exit:{gfmFootnoteCallString:TT,gfmFootnoteCall:NT,gfmFootnoteDefinitionLabelString:CT,gfmFootnoteDefinition:RT}}}function IT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,l,c){const d=l.createTracker(c);let m=d.move("[^");const h=l.enter("footnoteDefinition"),p=l.enter("label");return m+=d.move(l.safe(l.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?`
|
|
25
|
+
`:" ")+l.indentLines(l.containerFlow(a,d.current()),t?G3:MT))),h(),m}}function MT(e,t,n){return t===0?e:G3(e,t,n)}function G3(e,t,n){return(n?"":" ")+e}const OT=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];K3.peek=BT;function DT(){return{canContainEols:["delete"],enter:{strikethrough:LT},exit:{strikethrough:zT}}}function jT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OT}],handlers:{delete:K3}}}function LT(e){this.enter({type:"delete",children:[]},e)}function zT(e){this.exit(e)}function K3(e,t,n,a){const s=n.createTracker(a),l=n.enter("strikethrough");let c=s.move("~~");return c+=n.containerPhrasing(e,{...s.current(),before:c,after:"~"}),c+=s.move("~~"),l(),c}function BT(){return"~"}function UT(e){return e.length}function qT(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||UT,l=[],c=[],d=[],m=[];let h=0,p=-1;for(;++p<e.length;){const T=[],R=[];let C=-1;for(e[p].length>h&&(h=e[p].length);++C<e[p].length;){const _=HT(e[p][C]);if(n.alignDelimiters!==!1){const I=s(_);R[C]=I,(m[C]===void 0||I>m[C])&&(m[C]=I)}T.push(_)}c[p]=T,d[p]=R}let b=-1;if(typeof a=="object"&&"length"in a)for(;++b<h;)l[b]=g4(a[b]);else{const T=g4(a);for(;++b<h;)l[b]=T}b=-1;const y=[],x=[];for(;++b<h;){const T=l[b];let R="",C="";T===99?(R=":",C=":"):T===108?R=":":T===114&&(C=":");let _=n.alignDelimiters===!1?1:Math.max(1,m[b]-R.length-C.length);const I=R+"-".repeat(_)+C;n.alignDelimiters!==!1&&(_=R.length+_+C.length,_>m[b]&&(m[b]=_),x[b]=_),y[b]=I}c.splice(1,0,y),d.splice(1,0,x),p=-1;const k=[];for(;++p<c.length;){const T=c[p],R=d[p];b=-1;const C=[];for(;++b<h;){const _=T[b]||"";let I="",G="";if(n.alignDelimiters!==!1){const D=m[b]-(R[b]||0),M=l[b];M===114?I=" ".repeat(D):M===99?D%2?(I=" ".repeat(D/2+.5),G=" ".repeat(D/2-.5)):(I=" ".repeat(D/2),G=I):G=" ".repeat(D)}n.delimiterStart!==!1&&!b&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||b)&&C.push(" "),n.alignDelimiters!==!1&&C.push(I),C.push(_),n.alignDelimiters!==!1&&C.push(G),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||b!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
26
|
+
`)}function HT(e){return e==null?"":String(e)}function g4(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function FT(e,t,n,a){const s=n.enter("blockquote"),l=n.createTracker(a);l.move("> "),l.shift(2);const c=n.indentLines(n.containerFlow(e,l.current()),PT);return s(),c}function PT(e,t,n){return">"+(n?"":" ")+e}function $T(e,t){return b4(e,t.inConstruct,!0)&&!b4(e,t.notInConstruct,!1)}function b4(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function v4(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
27
|
+
`&&$T(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
28
|
+
`}function V3(e,t){const n=String(e);let a=n.indexOf(t),s=a,l=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++l>c&&(c=l):l=1,s=a+t.length,a=n.indexOf(t,s);return c}function GT(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function KT(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function VT(e,t,n,a){const s=KT(n),l=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(GT(e,n)){const b=n.enter("codeIndented"),y=n.indentLines(l,YT);return b(),y}const d=n.createTracker(a),m=s.repeat(Math.max(V3(l,s)+1,3)),h=n.enter("codeFenced");let p=d.move(m);if(e.lang){const b=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),b()}if(e.lang&&e.meta){const b=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
|
|
29
|
+
`,encode:["`"],...d.current()})),b()}return p+=d.move(`
|
|
30
|
+
`),l&&(p+=d.move(l+`
|
|
31
|
+
`)),p+=d.move(m),h(),p}function YT(e,t,n){return(n?"":" ")+e}function np(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XT(e,t,n,a){const s=np(n),l=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
32
|
+
`,...m.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),c(),h}function ZT(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function No(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Cu(e,t,n){const a=nl(e),s=nl(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Y3.peek=WT;function Y3(e,t,n,a){const s=ZT(n),l=n.enter("emphasis"),c=n.createTracker(a),d=c.move(s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=Cu(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=No(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Cu(a.after.charCodeAt(0),b,s);y.inside&&(m=m.slice(0,-1)+No(b));const x=c.move(s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+x}function WT(e,t,n){return n.options.emphasis||"*"}function QT(e,t){let n=!1;return ep(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,ah}),!!((!e.depth||e.depth<3)&&Kh(e)&&(t.options.setext||n))}function JT(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(a);if(QT(e,n)){const p=n.enter("headingSetext"),b=n.enter("phrasing"),y=n.containerPhrasing(e,{...l.current(),before:`
|
|
33
|
+
`,after:`
|
|
34
|
+
`});return b(),p(),y+`
|
|
35
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
36
|
+
`))+1))}const c="#".repeat(s),d=n.enter("headingAtx"),m=n.enter("phrasing");l.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
37
|
+
`,...l.current()});return/^[\t ]/.test(h)&&(h=No(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),d(),h}X3.peek=eN;function X3(e){return e.value||""}function eN(){return"<"}Z3.peek=tN;function Z3(e,t,n,a){const s=np(n),l=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),h+=m.move(")"),c(),h}function tN(){return"!"}W3.peek=nN;function W3(e,t,n,a){const s=e.referenceType,l=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const h=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const b=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,l(),s==="full"||!h||h!==b?m+=d.move(b+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function nN(){return"!"}Q3.peek=rN;function Q3(e,t,n){let a=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++l<n.unsafe.length;){const c=n.unsafe[l],d=n.compilePattern(c);let m;if(c.atBreak)for(;m=d.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return s+a+s}function rN(){return"`"}function J3(e,t){const n=Kh(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}e5.peek=aN;function e5(e,t,n,a){const s=np(n),l=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(J3(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let b=c.move("<");return b+=c.move(n.containerPhrasing(e,{before:b,after:">",...c.current()})),b+=c.move(">"),d(),n.stack=p,b}d=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${l}`),h+=c.move(" "+s),h+=c.move(n.safe(e.title,{before:h,after:s,...c.current()})),h+=c.move(s),m()),h+=c.move(")"),d(),h}function aN(e,t,n){return J3(e,n)?"<":"["}t5.peek=iN;function t5(e,t,n,a){const s=e.referenceType,l=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const b=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,l(),s==="full"||!h||h!==b?m+=d.move(b+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function iN(){return"["}function rp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sN(e){const t=rp(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function lN(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function n5(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function oN(e,t,n,a){const s=n.enter("list"),l=n.bulletCurrent;let c=e.ordered?lN(n):rp(n);const d=e.ordered?c==="."?")":".":sN(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),n5(n)===c&&p){let b=-1;for(;++b<e.children.length;){const y=e.children[b];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=l,s(),h}function cN(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function uN(e,t,n,a){const s=cN(n);let l=n.bulletCurrent||rp(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let c=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(l+" ".repeat(c-l.length)),d.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),p);return m(),h;function p(b,y,x){return y?(x?"":" ".repeat(c))+b:(x?l:l+" ".repeat(c-l.length))+b}}function dN(e,t,n,a){const s=n.enter("paragraph"),l=n.enter("phrasing"),c=n.containerPhrasing(e,a);return l(),s(),c}const fN=jo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mN(e,t,n,a){return(e.children.some(function(c){return fN(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function hN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}r5.peek=pN;function r5(e,t,n,a){const s=hN(n),l=n.enter("strong"),c=n.createTracker(a),d=c.move(s+s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=Cu(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=No(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Cu(a.after.charCodeAt(0),b,s);y.inside&&(m=m.slice(0,-1)+No(b));const x=c.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},d+m+x}function pN(e,t,n){return n.options.strong||"*"}function gN(e,t,n,a){return n.safe(e.value,a)}function bN(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function vN(e,t,n){const a=(n5(n)+(n.options.ruleSpaces?" ":"")).repeat(bN(n));return n.options.ruleSpaces?a.slice(0,-1):a}const a5={blockquote:FT,break:v4,code:VT,definition:XT,emphasis:Y3,hardBreak:v4,heading:JT,html:X3,image:Z3,imageReference:W3,inlineCode:Q3,link:e5,linkReference:t5,list:oN,listItem:uN,paragraph:dN,root:mN,strong:r5,text:gN,thematicBreak:vN};function yN(){return{enter:{table:xN,tableData:y4,tableHeader:y4,tableRow:SN},exit:{codeText:kN,table:wN,tableData:Uf,tableHeader:Uf,tableRow:Uf}}}function xN(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function wN(e){this.exit(e),this.data.inTable=void 0}function SN(e){this.enter({type:"tableRow",children:[]},e)}function Uf(e){this.exit(e)}function y4(e){this.enter({type:"tableCell",children:[]},e)}function kN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,EN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function EN(e,t){return t==="|"?t:e}function TN(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
38
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:c,tableCell:m,tableRow:d}};function c(x,k,T,R){return h(p(x,T,R),x.align)}function d(x,k,T,R){const C=b(x,T,R),_=h([C]);return _.slice(0,_.indexOf(`
|
|
39
|
+
`))}function m(x,k,T,R){const C=T.enter("tableCell"),_=T.enter("phrasing"),I=T.containerPhrasing(x,{...R,before:l,after:l});return _(),C(),I}function h(x,k){return qT(x,{align:k,alignDelimiters:a,padding:n,stringLength:s})}function p(x,k,T){const R=x.children;let C=-1;const _=[],I=k.enter("table");for(;++C<R.length;)_[C]=b(R[C],k,T);return I(),_}function b(x,k,T){const R=x.children;let C=-1;const _=[],I=k.enter("tableRow");for(;++C<R.length;)_[C]=m(R[C],x,k,T);return I(),_}function y(x,k,T){let R=a5.inlineCode(x,k,T);return T.stack.includes("tableCell")&&(R=R.replace(/\|/g,"\\$&")),R}}function NN(){return{exit:{taskListCheckValueChecked:x4,taskListCheckValueUnchecked:x4,paragraph:RN}}}function CN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AN}}}function x4(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function RN(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let l=-1,c;for(;++l<s.length;){const d=s[l];if(d.type==="paragraph"){c=d;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function AN(e,t,n,a){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);l&&d.move(c);let m=a5.listItem(e,t,n,{...a,...d.current()});return l&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(p){return p+c}}function _N(){return[cT(),_T(),DT(),yN(),NN()]}function IN(e){return{extensions:[uT(),IT(e),jT(),TN(e),CN()]}}const MN={tokenize:BN,partial:!0},i5={tokenize:UN,partial:!0},s5={tokenize:qN,partial:!0},l5={tokenize:HN,partial:!0},ON={tokenize:FN,partial:!0},o5={name:"wwwAutolink",tokenize:LN,previous:u5},c5={name:"protocolAutolink",tokenize:zN,previous:d5},Fa={name:"emailAutolink",tokenize:jN,previous:f5},fa={};function DN(){return{text:fa}}let Qi=48;for(;Qi<123;)fa[Qi]=Fa,Qi++,Qi===58?Qi=65:Qi===91&&(Qi=97);fa[43]=Fa;fa[45]=Fa;fa[46]=Fa;fa[95]=Fa;fa[72]=[Fa,c5];fa[104]=[Fa,c5];fa[87]=[Fa,o5];fa[119]=[Fa,o5];function jN(e,t,n){const a=this;let s,l;return c;function c(b){return!oh(b)||!f5.call(a,a.previous)||ap(a.events)?n(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(b))}function d(b){return oh(b)?(e.consume(b),d):b===64?(e.consume(b),m):n(b)}function m(b){return b===46?e.check(ON,p,h)(b):b===45||b===95||nr(b)?(l=!0,e.consume(b),m):p(b)}function h(b){return e.consume(b),s=!0,m}function p(b){return l&&s&&cr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(b)):n(b)}}function LN(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!u5.call(a,a.previous)||ap(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(MN,e.attempt(i5,e.attempt(s5,l),n),n)(c))}function l(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function zN(e,t,n){const a=this;let s="",l=!1;return c;function c(b){return(b===72||b===104)&&d5.call(a,a.previous)&&!ap(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(b),e.consume(b),d):n(b)}function d(b){if(cr(b)&&s.length<5)return s+=String.fromCodePoint(b),e.consume(b),d;if(b===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(b),m}return n(b)}function m(b){return b===47?(e.consume(b),l?h:(l=!0,m)):n(b)}function h(b){return b===null||Eu(b)||an(b)||os(b)||Gu(b)?n(b):e.attempt(i5,e.attempt(s5,p),n)(b)}function p(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(b)}}function BN(e,t,n){let a=0;return s;function s(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),s):c===46&&a===3?(e.consume(c),l):n(c)}function l(c){return c===null?n(c):t(c)}}function UN(e,t,n){let a,s,l;return c;function c(h){return h===46||h===95?e.check(l5,m,d)(h):h===null||an(h)||os(h)||h!==45&&Gu(h)?m(h):(l=!0,e.consume(h),c)}function d(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),c}function m(h){return s||a||!l?n(h):t(h)}}function qN(e,t){let n=0,a=0;return s;function s(c){return c===40?(n++,e.consume(c),s):c===41&&a<n?l(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(l5,t,l)(c):c===null||an(c)||os(c)?t(c):(e.consume(c),s)}function l(c){return c===41&&a++,e.consume(c),s}}function HN(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),l):d===93?(e.consume(d),s):d===60||d===null||an(d)||os(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||an(d)||os(d)?t(d):a(d)}function l(d){return cr(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):cr(d)?(e.consume(d),c):n(d)}}function FN(e,t,n){return a;function a(l){return e.consume(l),s}function s(l){return nr(l)?n(l):t(l)}}function u5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||an(e)}function d5(e){return!cr(e)}function f5(e){return!(e===47||oh(e))}function oh(e){return e===43||e===45||e===46||e===95||nr(e)}function ap(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const PN={tokenize:WN,partial:!0};function $N(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YN,continuation:{tokenize:XN},exit:ZN}},text:{91:{name:"gfmFootnoteCall",tokenize:VN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:GN,resolveTo:KN}}}}function GN(e,t,n){const a=this;let s=a.events.length;const l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;s--;){const m=a.events[s][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return n(m);const h=na(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function KN(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",c,t],["exit",c,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function VN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l=0,c;return d;function d(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),m}function m(b){return b!==94?n(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(l>999||b===93&&!c||b===null||b===91||an(b))return n(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(na(a.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(b)}return an(b)||(c=!0),l++,e.consume(b),b===92?p:h}function p(b){return b===91||b===92||b===93?(e.consume(b),l++,h):h(b)}}function YN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l,c=0,d;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(k)}function p(k){if(c>999||k===93&&!d||k===null||k===91||an(k))return n(k);if(k===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return l=na(a.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return an(k)||(d=!0),c++,e.consume(k),k===92?b:p}function b(k){return k===91||k===92||k===93?(e.consume(k),c++,p):p(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(l)||s.push(l),Nt(e,x,"gfmFootnoteDefinitionWhitespace")):n(k)}function x(k){return t(k)}}function XN(e,t,n){return e.check(Do,t,e.attempt(PN,t,n))}function ZN(e){e.exit("gfmFootnoteDefinition")}function WN(e,t,n){const a=this;return Nt(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(l):n(l)}}function QN(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,d){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},b={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},y=[["enter",p,d],["enter",c[h][1],d],["exit",c[h][1],d],["enter",b,d]],x=d.parser.constructs.insideSpan.null;x&&Dr(y,y.length,0,Ku(x,c.slice(h+1,m),d)),Dr(y,y.length,0,[["exit",b,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",p,d]]),Dr(c,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function l(c,d,m){const h=this.previous,p=this.events;let b=0;return y;function y(k){return h===126&&p[p.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const T=nl(h);if(k===126)return b>1?m(k):(c.consume(k),b++,x);if(b<2&&!n)return m(k);const R=c.exit("strikethroughSequenceTemporary"),C=nl(k);return R._open=!C||C===2&&!!T,R._close=!T||T===2&&!!C,d(k)}}}class JN{constructor(){this.map=[]}add(t,n,a){eC(this,t,n,a)}consume(t){if(this.map.sort(function(l,c){return l[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const l of s)t.push(l);s=a.pop()}this.map.length=0}}function eC(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function tC(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=a.length-1;a[l]=a[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function nC(){return{flow:{null:{name:"table",tokenize:rC,resolveAll:aC}}}}function rC(e,t,n){const a=this;let s=0,l=0,c;return d;function d(j){let F=a.events.length-1;for(;F>-1;){const V=a.events[F][1].type;if(V==="lineEnding"||V==="linePrefix")F--;else break}const H=F>-1?a.events[F][1].type:null,ne=H==="tableHead"||H==="tableRow"?M:m;return ne===M&&a.parser.lazy[a.now().line]?n(j):ne(j)}function m(j){return e.enter("tableHead"),e.enter("tableRow"),h(j)}function h(j){return j===124||(c=!0,l+=1),p(j)}function p(j){return j===null?n(j):Ze(j)?l>1?(l=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),x):n(j):At(j)?Nt(e,p,"whitespace")(j):(l+=1,c&&(c=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),b(j)))}function b(j){return j===null||j===124||an(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?y:b)}function y(j){return j===92||j===124?(e.consume(j),b):b(j)}function x(j){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(j):(e.enter("tableDelimiterRow"),c=!1,At(j)?Nt(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):k(j))}function k(j){return j===45||j===58?R(j):j===124?(c=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),T):D(j)}function T(j){return At(j)?Nt(e,R,"whitespace")(j):R(j)}function R(j){return j===58?(l+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(l+=1,C(j)):j===null||Ze(j)?G(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(j))}function I(j){return At(j)?Nt(e,G,"whitespace")(j):G(j)}function G(j){return j===124?k(j):j===null||Ze(j)?!c||s!==l?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function M(j){return e.enter("tableRow"),B(j)}function B(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),B):j===null||Ze(j)?(e.exit("tableRow"),t(j)):At(j)?Nt(e,B,"whitespace")(j):(e.enter("data"),X(j))}function X(j){return j===null||j===124||an(j)?(e.exit("data"),B(j)):(e.consume(j),j===92?$:X)}function $(j){return j===92||j===124?(e.consume(j),X):X(j)}}function aC(e,t){let n=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,h,p,b;const y=new JN;for(;++n<e.length;){const x=e[n],k=x[1];x[0]==="enter"?k.type==="tableHead"?(d=!1,m!==0&&(w4(y,t,m,h,p),p=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,b=void 0,l=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",p,t]])),s=k.type==="tableDelimiterRow"?2:p?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(l[1]!==0&&(c[0]=c[1],b=iu(y,t,l,s,void 0,b),l=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(l[1]!==0&&(c[0]=c[1],b=iu(y,t,l,s,void 0,b)),l=c,c=[l[1],n,0,0])):k.type==="tableHead"?(d=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,l[1]!==0?(c[0]=c[1],b=iu(y,t,l,s,n,b)):c[1]!==0&&(b=iu(y,t,c,s,n,b)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&w4(y,t,m,h,p),y.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=tC(t.events,n))}return e}function iu(e,t,n,a,s,l){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(l.end=Object.assign({},Zs(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const m=Zs(t.events,n[1]);if(l={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=Zs(t.events,n[2]),p=Zs(t.events,n[3]),b={type:d,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",b,t]]),a!==2){const y=t.events[n[2]],x=t.events[n[3]];if(y[1].end=Object.assign({},x[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,T=n[3]-n[2]-1;e.add(k,T,[])}}e.add(n[3]+1,0,[["exit",b,t]])}return s!==void 0&&(l.end=Object.assign({},Zs(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function w4(e,t,n,a,s){const l=[],c=Zs(t.events,n);s&&(s.end=Object.assign({},c),l.push(["exit",s,t])),a.end=Object.assign({},c),l.push(["exit",a,t]),e.add(n+1,0,l)}function Zs(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const iC={name:"tasklistCheck",tokenize:lC};function sC(){return{text:{91:iC}}}function lC(e,t,n){const a=this;return s;function s(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),l)}function l(m){return an(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(m)}function d(m){return Ze(m)?t(m):At(m)?e.check({tokenize:oC},t,n)(m):n(m)}}function oC(e,t,n){return Nt(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function cC(e){return w3([DN(),$N(),QN(e),nC(),sC()])}const uC={};function dC(e){const t=this,n=e||uC,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),l=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(cC(n)),l.push(_N()),c.push(IN(n))}function fC(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:l},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(m){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},m)}function t(){this.buffer()}function n(){const m=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=m}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(m){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=h;const b=p.data.hChildren[0];b.type,b.tagName,b.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function l(m){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},m),this.buffer()}function c(m){const h=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=h,p.data.hChildren.push({type:"text",value:h})}function d(m){this.config.enter.data.call(this,m),this.config.exit.data.call(this,m)}}function mC(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
40
|
+
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(l,c,d,m){const h=l.value||"",p=d.createTracker(m),b="$".repeat(Math.max(V3(h,"$")+1,2)),y=d.enter("mathFlow");let x=p.move(b);if(l.meta){const k=d.enter("mathFlowMeta");x+=p.move(d.safe(l.meta,{after:`
|
|
41
|
+
`,before:x,encode:["$"],...p.current()})),k()}return x+=p.move(`
|
|
42
|
+
`),h&&(x+=p.move(h+`
|
|
43
|
+
`)),x+=p.move(b),y(),x}function a(l,c,d){let m=l.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(m);)h++;const p="$".repeat(h);/[^ \r\n]/.test(m)&&(/^[ \r\n]/.test(m)&&/[ \r\n]$/.test(m)||/^\$|\$$/.test(m))&&(m=" "+m+" ");let b=-1;for(;++b<d.unsafe.length;){const y=d.unsafe[b];if(!y.atBreak)continue;const x=d.compilePattern(y);let k;for(;k=x.exec(m);){let T=k.index;m.codePointAt(T)===10&&m.codePointAt(T-1)===13&&T--,m=m.slice(0,T)+" "+m.slice(k.index+1)}}return p+m+p}function s(){return"$"}}const hC={tokenize:pC,concrete:!0,name:"mathFlow"},S4={tokenize:gC,partial:!0};function pC(e,t,n){const a=this,s=a.events[a.events.length-1],l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let c=0;return d;function d(_){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),m(_)}function m(_){return _===36?(e.consume(_),c++,m):c<2?n(_):(e.exit("mathFlowFenceSequence"),Nt(e,h,"whitespace")(_))}function h(_){return _===null||Ze(_)?b(_):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||Ze(_)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),b(_)):_===36?n(_):(e.consume(_),p)}function b(_){return e.exit("mathFlowFence"),a.interrupt?t(_):e.attempt(S4,y,R)(_)}function y(_){return e.attempt({tokenize:C,partial:!0},R,x)(_)}function x(_){return(l?Nt(e,k,"linePrefix",l+1):k)(_)}function k(_){return _===null?R(_):Ze(_)?e.attempt(S4,y,R)(_):(e.enter("mathFlowValue"),T(_))}function T(_){return _===null||Ze(_)?(e.exit("mathFlowValue"),k(_)):(e.consume(_),T)}function R(_){return e.exit("mathFlow"),t(_)}function C(_,I,G){let D=0;return Nt(_,M,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function M($){return _.enter("mathFlowFence"),_.enter("mathFlowFenceSequence"),B($)}function B($){return $===36?(D++,_.consume($),B):D<c?G($):(_.exit("mathFlowFenceSequence"),Nt(_,X,"whitespace")($))}function X($){return $===null||Ze($)?(_.exit("mathFlowFence"),I($)):G($)}}}function gC(e,t,n){const a=this;return s;function s(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function bC(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:vC,previous:yC,name:"mathText"};function a(s,l,c){let d=0,m,h;return p;function p(T){return s.enter("mathText"),s.enter("mathTextSequence"),b(T)}function b(T){return T===36?(s.consume(T),d++,b):d<2&&!n?c(T):(s.exit("mathTextSequence"),y(T))}function y(T){return T===null?c(T):T===36?(h=s.enter("mathTextSequence"),m=0,k(T)):T===32?(s.enter("space"),s.consume(T),s.exit("space"),y):Ze(T)?(s.enter("lineEnding"),s.consume(T),s.exit("lineEnding"),y):(s.enter("mathTextData"),x(T))}function x(T){return T===null||T===32||T===36||Ze(T)?(s.exit("mathTextData"),y(T)):(s.consume(T),x)}function k(T){return T===36?(s.consume(T),m++,k):m===d?(s.exit("mathTextSequence"),s.exit("mathText"),l(T)):(h.type="mathTextData",x(T))}}}function vC(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function yC(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function xC(e){return{flow:{36:hC},text:{36:bC(e)}}}class _e extends Error{constructor(t,n){var a="KaTeX parse error: "+t,s,l,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;s=c.start,l=c.end,s===d.length?a+=" at end of input: ":a+=" at position "+(s+1)+": ";var m=d.slice(s,l).replace(/[^]/g,"$&̲"),h;s>15?h="…"+d.slice(s-15,s):h=d.slice(0,s);var p;l+15<d.length?p=d.slice(l,l+15)+"…":p=d.slice(l),a+=h+m+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,_e.prototype),this.position=s,s!=null&&l!=null&&(this.length=l-s),this.rawMessage=t}}var wC=/([A-Z])/g,SC=e=>e.replace(wC,"-$1").toLowerCase(),kC={"&":"&",">":">","<":"<",'"':""","'":"'"},EC=/[&><"']/g,rr=e=>String(e).replace(EC,t=>kC[t]),vu=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?vu(e.body[0]):e:e.type==="font"?vu(e.body):e,TC=new Set(["mathord","textord","atom"]),Pa=e=>TC.has(vu(e).type),NC=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Ru={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function CC(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function RC(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return CC(t)}function AC(e,t,n,a){var s=n[t];e[t]=s!==void 0?a.processor?a.processor(s):s:RC(a)}class ip{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Ru)){var a=Ru[n];a&&AC(this,n,t,a)}}reportNonstrict(t,n,a){var s=this.strict;if(typeof s=="function"&&(s=s(t,n,a)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new _e("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var s=this.strict;if(typeof s=="function")try{s=s(t,n,a)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=NC(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class wi{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return ua[_C[this.id]]}sub(){return ua[IC[this.id]]}fracNum(){return ua[MC[this.id]]}fracDen(){return ua[OC[this.id]]}cramp(){return ua[DC[this.id]]}text(){return ua[jC[this.id]]}isTight(){return this.size>=2}}var sp=0,Au=1,Qs=2,qa=3,Co=4,Zr=5,rl=6,ur=7,ua=[new wi(sp,0,!1),new wi(Au,0,!0),new wi(Qs,1,!1),new wi(qa,1,!0),new wi(Co,2,!1),new wi(Zr,2,!0),new wi(rl,3,!1),new wi(ur,3,!0)],_C=[Co,Zr,Co,Zr,rl,ur,rl,ur],IC=[Zr,Zr,Zr,Zr,ur,ur,ur,ur],MC=[Qs,qa,Co,Zr,rl,ur,rl,ur],OC=[qa,qa,Zr,Zr,ur,ur,ur,ur],DC=[Au,Au,qa,qa,Zr,Zr,ur,ur],jC=[sp,Au,Qs,qa,Qs,qa,Qs,qa],mt={DISPLAY:ua[sp],TEXT:ua[Qs],SCRIPT:ua[Co],SCRIPTSCRIPT:ua[rl]},ch=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function LC(e){for(var t=0;t<ch.length;t++)for(var n=ch[t],a=0;a<n.blocks.length;a++){var s=n.blocks[a];if(e>=s[0]&&e<=s[1])return n.name}return null}var yu=[];ch.forEach(e=>e.blocks.forEach(t=>yu.push(...t)));function m5(e){for(var t=0;t<yu.length;t+=2)if(e>=yu[t]&&e<=yu[t+1])return!0;return!1}var Fn=e=>e+" "+e,Vs=80,zC=function(t,n){return"M95,"+(622+t+n)+`
|
|
44
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
45
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
46
|
+
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
47
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
48
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
49
|
+
l`+t/2.075+" -"+t+`
|
|
50
|
+
c5.3,-9.3,12,-14,20,-14
|
|
51
|
+
H400000v`+(40+t)+`H845.2724
|
|
52
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
53
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
54
|
+
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},BC=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
|
55
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
56
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
57
|
+
l`+t/2.084+" -"+t+`
|
|
58
|
+
c4.7,-7.3,11,-11,19,-11
|
|
59
|
+
H40000v`+(40+t)+`H1012.3
|
|
60
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
61
|
+
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
62
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
63
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
64
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},UC=function(t,n){return"M983 "+(10+t+n)+`
|
|
65
|
+
l`+t/3.13+" -"+t+`
|
|
66
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
67
|
+
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
68
|
+
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
69
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
70
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
71
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
72
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
73
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},qC=function(t,n){return"M424,"+(2398+t+n)+`
|
|
74
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
75
|
+
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
76
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
77
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
78
|
+
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|
79
|
+
v`+(40+t)+`H1014.6
|
|
80
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
81
|
+
c-2,6,-10,9,-24,9
|
|
82
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
|
83
|
+
h400000v`+(40+t)+"h-400000z"},HC=function(t,n){return"M473,"+(2713+t+n)+`
|
|
84
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
85
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
86
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
87
|
+
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
88
|
+
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
89
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
90
|
+
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},FC=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},PC=function(t,n,a){var s=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
|
91
|
+
H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
92
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
93
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
94
|
+
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},$C=function(t,n,a){n=1e3*n;var s="";switch(t){case"sqrtMain":s=zC(n,Vs);break;case"sqrtSize1":s=BC(n,Vs);break;case"sqrtSize2":s=UC(n,Vs);break;case"sqrtSize3":s=qC(n,Vs);break;case"sqrtSize4":s=HC(n,Vs);break;case"sqrtTall":s=PC(n,Vs,a)}return s},GC=function(t,n){switch(t){case"⎜":return Fn("M291 0 H417 V"+n+" H291z");case"∣":return Fn("M145 0 H188 V"+n+" H145z");case"∥":return Fn("M145 0 H188 V"+n+" H145z")+Fn("M367 0 H410 V"+n+" H367z");case"⎟":return Fn("M457 0 H583 V"+n+" H457z");case"⎢":return Fn("M319 0 H403 V"+n+" H319z");case"⎥":return Fn("M263 0 H347 V"+n+" H263z");case"⎪":return Fn("M384 0 H504 V"+n+" H384z");case"⏐":return Fn("M312 0 H355 V"+n+" H312z");case"‖":return Fn("M257 0 H300 V"+n+" H257z")+Fn("M478 0 H521 V"+n+" H478z");default:return""}},k4={doubleleftarrow:`M262 157
|
|
95
|
+
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
96
|
+
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
97
|
+
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
98
|
+
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
99
|
+
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
100
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
101
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
102
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
103
|
+
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
104
|
+
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
105
|
+
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
106
|
+
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
107
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
108
|
+
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
109
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
110
|
+
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
111
|
+
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
112
|
+
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
113
|
+
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
114
|
+
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
115
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
116
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
117
|
+
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
118
|
+
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
119
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
120
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
121
|
+
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
122
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
123
|
+
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
124
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
125
|
+
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
126
|
+
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
127
|
+
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
128
|
+
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
129
|
+
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
130
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
131
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
132
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
133
|
+
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
134
|
+
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
135
|
+
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
136
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
137
|
+
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
138
|
+
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
139
|
+
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
140
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Fn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Fn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Fn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Fn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
141
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
142
|
+
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
143
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Fn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
144
|
+
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
145
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
146
|
+
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
147
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
148
|
+
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
149
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
150
|
+
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
151
|
+
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
152
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
153
|
+
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
154
|
+
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
155
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
156
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
157
|
+
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
158
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
159
|
+
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
160
|
+
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
161
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
162
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
163
|
+
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
164
|
+
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
165
|
+
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
166
|
+
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
167
|
+
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
168
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
169
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
170
|
+
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
171
|
+
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
172
|
+
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
173
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
174
|
+
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
175
|
+
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
176
|
+
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
177
|
+
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
178
|
+
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
179
|
+
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
180
|
+
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
181
|
+
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
182
|
+
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
183
|
+
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
184
|
+
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
185
|
+
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
186
|
+
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
187
|
+
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
188
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
189
|
+
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
190
|
+
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
191
|
+
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
192
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Fn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Fn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Fn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
193
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
194
|
+
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
195
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
196
|
+
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
197
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
198
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
199
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
200
|
+
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
201
|
+
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
202
|
+
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
203
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
204
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
205
|
+
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
206
|
+
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
207
|
+
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
208
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
209
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
210
|
+
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
211
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
212
|
+
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
213
|
+
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
214
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
215
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
216
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
217
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
218
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
219
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
220
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
221
|
+
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
222
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
223
|
+
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
224
|
+
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
225
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
226
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
227
|
+
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
228
|
+
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
229
|
+
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
230
|
+
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
231
|
+
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
232
|
+
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
233
|
+
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
234
|
+
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
235
|
+
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
236
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
237
|
+
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
238
|
+
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
239
|
+
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
240
|
+
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
241
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
242
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
243
|
+
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
244
|
+
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
245
|
+
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
246
|
+
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
247
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
248
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
249
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
250
|
+
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
251
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
252
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
253
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
254
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
255
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
256
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
257
|
+
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
258
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
259
|
+
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
260
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
261
|
+
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
262
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
263
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
264
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
265
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},KC=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
266
|
+
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
267
|
+
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
268
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
269
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
270
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
271
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
272
|
+
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
273
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
274
|
+
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|
275
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
276
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
277
|
+
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
278
|
+
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
279
|
+
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
280
|
+
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
281
|
+
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
282
|
+
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
283
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
284
|
+
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
285
|
+
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
286
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
287
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
288
|
+
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
289
|
+
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
290
|
+
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
291
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
292
|
+
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
293
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function VC(e){return"toText"in e}class cl{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(VC(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var uh={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},YC={ex:!0,em:!0,mu:!0},h5=function(t){return typeof t!="string"&&(t=t.unit),t in uh||t in YC||t==="ex"},gn=function(t,n){var a;if(t.unit in uh)a=uh[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")a=s.fontMetrics().xHeight;else if(t.unit==="em")a=s.fontMetrics().quad;else throw new _e("Invalid unit: '"+t.unit+"'");s!==n&&(a*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},De=function(t){return+t.toFixed(4)+"em"},Ni=function(t){return t.filter(n=>n).join(" ")},lp=function(t){var n="";for(var a of Object.keys(t)){var s=t[a];s!==void 0&&(n+=SC(a)+":"+s+";")}return n},p5=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},g5=function(t){var n=document.createElement(t);n.className=Ni(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},XC=/[\s"'>/=\x00-\x1f]/,b5=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+rr(Ni(this.classes))+'"');var a=lp(this.style);a&&(n+=' style="'+rr(a)+'"');for(var s of Object.keys(this.attributes)){if(XC.test(s))throw new _e("Invalid attribute name '"+s+"'");n+=" "+s+'="'+rr(this.attributes[s])+'"'}n+=">";for(var l=0;l<this.children.length;l++)n+=this.children[l].toMarkup();return n+="</"+t+">",n};class ul{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,p5.call(this,t,a,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return g5.call(this,"span")}toMarkup(){return b5.call(this,"span")}}class Xu{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,p5.call(this,n,s),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return g5.call(this,"a")}toMarkup(){return b5.call(this,"a")}}class ZC{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+rr(this.src)+'"'+(' alt="'+rr(this.alt)+'"'),n=lp(this.style);return n&&(t+=' style="'+rr(n)+'"'),t+="'/>",t}}var WC={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Lr{constructor(t,n,a,s,l,c,d,m){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=s||0,this.skew=l||0,this.width=c||0,this.classes=d||[],this.style=m||{},this.maxFontSize=0;var h=LC(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=WC[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=De(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ni(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=rr(Ni(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+De(this.italic)+";"),a+=lp(this.style),a&&(t=!0,n+=' style="'+rr(a)+'"');var s=rr(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class Ha{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+rr(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Ci{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",k4[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+rr(this.alternate)+'"/>':'<path d="'+rr(k4[this.pathName])+'"/>'}}class dh{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+rr(this.attributes[n])+'"';return t+="/>",t}}function QC(e){if(e instanceof Lr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function JC(e){if(e instanceof ul)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var eR=e=>e instanceof ul||e instanceof Xu||e instanceof cl,da={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},su={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},E4={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function v5(e,t){da[e]=t}function op(e,t,n){if(!da[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),s=da[t][a];if(!s&&e[0]in E4&&(a=E4[e[0]].charCodeAt(0),s=da[t][a]),!s&&n==="text"&&m5(a)&&(s=da[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var qf={};function tR(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!qf[t]){var n=qf[t]={cssEmPerMu:su.quad[t]/18};for(var a in su)su.hasOwnProperty(a)&&(n[a]=su[a][t])}return qf[t]}var fn={math:{},text:{}};function w(e,t,n,a,s,l){fn[e][s]={font:t,group:n,replace:a},l&&a&&(fn[e][a]=fn[e][s])}var E="math",Ne="text",O="main",Z="ams",mn="accent-token",He="bin",dr="close",dl="inner",tt="mathord",Bn="op-token",zr="open",zo="punct",W="rel",$a="spacing",le="textord";w(E,O,W,"≡","\\equiv",!0);w(E,O,W,"≺","\\prec",!0);w(E,O,W,"≻","\\succ",!0);w(E,O,W,"∼","\\sim",!0);w(E,O,W,"⊥","\\perp");w(E,O,W,"⪯","\\preceq",!0);w(E,O,W,"⪰","\\succeq",!0);w(E,O,W,"≃","\\simeq",!0);w(E,O,W,"∣","\\mid",!0);w(E,O,W,"≪","\\ll",!0);w(E,O,W,"≫","\\gg",!0);w(E,O,W,"≍","\\asymp",!0);w(E,O,W,"∥","\\parallel");w(E,O,W,"⋈","\\bowtie",!0);w(E,O,W,"⌣","\\smile",!0);w(E,O,W,"⊑","\\sqsubseteq",!0);w(E,O,W,"⊒","\\sqsupseteq",!0);w(E,O,W,"≐","\\doteq",!0);w(E,O,W,"⌢","\\frown",!0);w(E,O,W,"∋","\\ni",!0);w(E,O,W,"∝","\\propto",!0);w(E,O,W,"⊢","\\vdash",!0);w(E,O,W,"⊣","\\dashv",!0);w(E,O,W,"∋","\\owns");w(E,O,zo,".","\\ldotp");w(E,O,zo,"⋅","\\cdotp");w(E,O,zo,"⋅","·");w(Ne,O,le,"⋅","·");w(E,O,le,"#","\\#");w(Ne,O,le,"#","\\#");w(E,O,le,"&","\\&");w(Ne,O,le,"&","\\&");w(E,O,le,"ℵ","\\aleph",!0);w(E,O,le,"∀","\\forall",!0);w(E,O,le,"ℏ","\\hbar",!0);w(E,O,le,"∃","\\exists",!0);w(E,O,le,"∇","\\nabla",!0);w(E,O,le,"♭","\\flat",!0);w(E,O,le,"ℓ","\\ell",!0);w(E,O,le,"♮","\\natural",!0);w(E,O,le,"♣","\\clubsuit",!0);w(E,O,le,"℘","\\wp",!0);w(E,O,le,"♯","\\sharp",!0);w(E,O,le,"♢","\\diamondsuit",!0);w(E,O,le,"ℜ","\\Re",!0);w(E,O,le,"♡","\\heartsuit",!0);w(E,O,le,"ℑ","\\Im",!0);w(E,O,le,"♠","\\spadesuit",!0);w(E,O,le,"§","\\S",!0);w(Ne,O,le,"§","\\S");w(E,O,le,"¶","\\P",!0);w(Ne,O,le,"¶","\\P");w(E,O,le,"†","\\dag");w(Ne,O,le,"†","\\dag");w(Ne,O,le,"†","\\textdagger");w(E,O,le,"‡","\\ddag");w(Ne,O,le,"‡","\\ddag");w(Ne,O,le,"‡","\\textdaggerdbl");w(E,O,dr,"⎱","\\rmoustache",!0);w(E,O,zr,"⎰","\\lmoustache",!0);w(E,O,dr,"⟯","\\rgroup",!0);w(E,O,zr,"⟮","\\lgroup",!0);w(E,O,He,"∓","\\mp",!0);w(E,O,He,"⊖","\\ominus",!0);w(E,O,He,"⊎","\\uplus",!0);w(E,O,He,"⊓","\\sqcap",!0);w(E,O,He,"∗","\\ast");w(E,O,He,"⊔","\\sqcup",!0);w(E,O,He,"◯","\\bigcirc",!0);w(E,O,He,"∙","\\bullet",!0);w(E,O,He,"‡","\\ddagger");w(E,O,He,"≀","\\wr",!0);w(E,O,He,"⨿","\\amalg");w(E,O,He,"&","\\And");w(E,O,W,"⟵","\\longleftarrow",!0);w(E,O,W,"⇐","\\Leftarrow",!0);w(E,O,W,"⟸","\\Longleftarrow",!0);w(E,O,W,"⟶","\\longrightarrow",!0);w(E,O,W,"⇒","\\Rightarrow",!0);w(E,O,W,"⟹","\\Longrightarrow",!0);w(E,O,W,"↔","\\leftrightarrow",!0);w(E,O,W,"⟷","\\longleftrightarrow",!0);w(E,O,W,"⇔","\\Leftrightarrow",!0);w(E,O,W,"⟺","\\Longleftrightarrow",!0);w(E,O,W,"↦","\\mapsto",!0);w(E,O,W,"⟼","\\longmapsto",!0);w(E,O,W,"↗","\\nearrow",!0);w(E,O,W,"↩","\\hookleftarrow",!0);w(E,O,W,"↪","\\hookrightarrow",!0);w(E,O,W,"↘","\\searrow",!0);w(E,O,W,"↼","\\leftharpoonup",!0);w(E,O,W,"⇀","\\rightharpoonup",!0);w(E,O,W,"↙","\\swarrow",!0);w(E,O,W,"↽","\\leftharpoondown",!0);w(E,O,W,"⇁","\\rightharpoondown",!0);w(E,O,W,"↖","\\nwarrow",!0);w(E,O,W,"⇌","\\rightleftharpoons",!0);w(E,Z,W,"≮","\\nless",!0);w(E,Z,W,"","\\@nleqslant");w(E,Z,W,"","\\@nleqq");w(E,Z,W,"⪇","\\lneq",!0);w(E,Z,W,"≨","\\lneqq",!0);w(E,Z,W,"","\\@lvertneqq");w(E,Z,W,"⋦","\\lnsim",!0);w(E,Z,W,"⪉","\\lnapprox",!0);w(E,Z,W,"⊀","\\nprec",!0);w(E,Z,W,"⋠","\\npreceq",!0);w(E,Z,W,"⋨","\\precnsim",!0);w(E,Z,W,"⪹","\\precnapprox",!0);w(E,Z,W,"≁","\\nsim",!0);w(E,Z,W,"","\\@nshortmid");w(E,Z,W,"∤","\\nmid",!0);w(E,Z,W,"⊬","\\nvdash",!0);w(E,Z,W,"⊭","\\nvDash",!0);w(E,Z,W,"⋪","\\ntriangleleft");w(E,Z,W,"⋬","\\ntrianglelefteq",!0);w(E,Z,W,"⊊","\\subsetneq",!0);w(E,Z,W,"","\\@varsubsetneq");w(E,Z,W,"⫋","\\subsetneqq",!0);w(E,Z,W,"","\\@varsubsetneqq");w(E,Z,W,"≯","\\ngtr",!0);w(E,Z,W,"","\\@ngeqslant");w(E,Z,W,"","\\@ngeqq");w(E,Z,W,"⪈","\\gneq",!0);w(E,Z,W,"≩","\\gneqq",!0);w(E,Z,W,"","\\@gvertneqq");w(E,Z,W,"⋧","\\gnsim",!0);w(E,Z,W,"⪊","\\gnapprox",!0);w(E,Z,W,"⊁","\\nsucc",!0);w(E,Z,W,"⋡","\\nsucceq",!0);w(E,Z,W,"⋩","\\succnsim",!0);w(E,Z,W,"⪺","\\succnapprox",!0);w(E,Z,W,"≆","\\ncong",!0);w(E,Z,W,"","\\@nshortparallel");w(E,Z,W,"∦","\\nparallel",!0);w(E,Z,W,"⊯","\\nVDash",!0);w(E,Z,W,"⋫","\\ntriangleright");w(E,Z,W,"⋭","\\ntrianglerighteq",!0);w(E,Z,W,"","\\@nsupseteqq");w(E,Z,W,"⊋","\\supsetneq",!0);w(E,Z,W,"","\\@varsupsetneq");w(E,Z,W,"⫌","\\supsetneqq",!0);w(E,Z,W,"","\\@varsupsetneqq");w(E,Z,W,"⊮","\\nVdash",!0);w(E,Z,W,"⪵","\\precneqq",!0);w(E,Z,W,"⪶","\\succneqq",!0);w(E,Z,W,"","\\@nsubseteqq");w(E,Z,He,"⊴","\\unlhd");w(E,Z,He,"⊵","\\unrhd");w(E,Z,W,"↚","\\nleftarrow",!0);w(E,Z,W,"↛","\\nrightarrow",!0);w(E,Z,W,"⇍","\\nLeftarrow",!0);w(E,Z,W,"⇏","\\nRightarrow",!0);w(E,Z,W,"↮","\\nleftrightarrow",!0);w(E,Z,W,"⇎","\\nLeftrightarrow",!0);w(E,Z,W,"△","\\vartriangle");w(E,Z,le,"ℏ","\\hslash");w(E,Z,le,"▽","\\triangledown");w(E,Z,le,"◊","\\lozenge");w(E,Z,le,"Ⓢ","\\circledS");w(E,Z,le,"®","\\circledR");w(Ne,Z,le,"®","\\circledR");w(E,Z,le,"∡","\\measuredangle",!0);w(E,Z,le,"∄","\\nexists");w(E,Z,le,"℧","\\mho");w(E,Z,le,"Ⅎ","\\Finv",!0);w(E,Z,le,"⅁","\\Game",!0);w(E,Z,le,"‵","\\backprime");w(E,Z,le,"▲","\\blacktriangle");w(E,Z,le,"▼","\\blacktriangledown");w(E,Z,le,"■","\\blacksquare");w(E,Z,le,"⧫","\\blacklozenge");w(E,Z,le,"★","\\bigstar");w(E,Z,le,"∢","\\sphericalangle",!0);w(E,Z,le,"∁","\\complement",!0);w(E,Z,le,"ð","\\eth",!0);w(Ne,O,le,"ð","ð");w(E,Z,le,"╱","\\diagup");w(E,Z,le,"╲","\\diagdown");w(E,Z,le,"□","\\square");w(E,Z,le,"□","\\Box");w(E,Z,le,"◊","\\Diamond");w(E,Z,le,"¥","\\yen",!0);w(Ne,Z,le,"¥","\\yen",!0);w(E,Z,le,"✓","\\checkmark",!0);w(Ne,Z,le,"✓","\\checkmark");w(E,Z,le,"ℶ","\\beth",!0);w(E,Z,le,"ℸ","\\daleth",!0);w(E,Z,le,"ℷ","\\gimel",!0);w(E,Z,le,"ϝ","\\digamma",!0);w(E,Z,le,"ϰ","\\varkappa");w(E,Z,zr,"┌","\\@ulcorner",!0);w(E,Z,dr,"┐","\\@urcorner",!0);w(E,Z,zr,"└","\\@llcorner",!0);w(E,Z,dr,"┘","\\@lrcorner",!0);w(E,Z,W,"≦","\\leqq",!0);w(E,Z,W,"⩽","\\leqslant",!0);w(E,Z,W,"⪕","\\eqslantless",!0);w(E,Z,W,"≲","\\lesssim",!0);w(E,Z,W,"⪅","\\lessapprox",!0);w(E,Z,W,"≊","\\approxeq",!0);w(E,Z,He,"⋖","\\lessdot");w(E,Z,W,"⋘","\\lll",!0);w(E,Z,W,"≶","\\lessgtr",!0);w(E,Z,W,"⋚","\\lesseqgtr",!0);w(E,Z,W,"⪋","\\lesseqqgtr",!0);w(E,Z,W,"≑","\\doteqdot");w(E,Z,W,"≓","\\risingdotseq",!0);w(E,Z,W,"≒","\\fallingdotseq",!0);w(E,Z,W,"∽","\\backsim",!0);w(E,Z,W,"⋍","\\backsimeq",!0);w(E,Z,W,"⫅","\\subseteqq",!0);w(E,Z,W,"⋐","\\Subset",!0);w(E,Z,W,"⊏","\\sqsubset",!0);w(E,Z,W,"≼","\\preccurlyeq",!0);w(E,Z,W,"⋞","\\curlyeqprec",!0);w(E,Z,W,"≾","\\precsim",!0);w(E,Z,W,"⪷","\\precapprox",!0);w(E,Z,W,"⊲","\\vartriangleleft");w(E,Z,W,"⊴","\\trianglelefteq");w(E,Z,W,"⊨","\\vDash",!0);w(E,Z,W,"⊪","\\Vvdash",!0);w(E,Z,W,"⌣","\\smallsmile");w(E,Z,W,"⌢","\\smallfrown");w(E,Z,W,"≏","\\bumpeq",!0);w(E,Z,W,"≎","\\Bumpeq",!0);w(E,Z,W,"≧","\\geqq",!0);w(E,Z,W,"⩾","\\geqslant",!0);w(E,Z,W,"⪖","\\eqslantgtr",!0);w(E,Z,W,"≳","\\gtrsim",!0);w(E,Z,W,"⪆","\\gtrapprox",!0);w(E,Z,He,"⋗","\\gtrdot");w(E,Z,W,"⋙","\\ggg",!0);w(E,Z,W,"≷","\\gtrless",!0);w(E,Z,W,"⋛","\\gtreqless",!0);w(E,Z,W,"⪌","\\gtreqqless",!0);w(E,Z,W,"≖","\\eqcirc",!0);w(E,Z,W,"≗","\\circeq",!0);w(E,Z,W,"≜","\\triangleq",!0);w(E,Z,W,"∼","\\thicksim");w(E,Z,W,"≈","\\thickapprox");w(E,Z,W,"⫆","\\supseteqq",!0);w(E,Z,W,"⋑","\\Supset",!0);w(E,Z,W,"⊐","\\sqsupset",!0);w(E,Z,W,"≽","\\succcurlyeq",!0);w(E,Z,W,"⋟","\\curlyeqsucc",!0);w(E,Z,W,"≿","\\succsim",!0);w(E,Z,W,"⪸","\\succapprox",!0);w(E,Z,W,"⊳","\\vartriangleright");w(E,Z,W,"⊵","\\trianglerighteq");w(E,Z,W,"⊩","\\Vdash",!0);w(E,Z,W,"∣","\\shortmid");w(E,Z,W,"∥","\\shortparallel");w(E,Z,W,"≬","\\between",!0);w(E,Z,W,"⋔","\\pitchfork",!0);w(E,Z,W,"∝","\\varpropto");w(E,Z,W,"◀","\\blacktriangleleft");w(E,Z,W,"∴","\\therefore",!0);w(E,Z,W,"∍","\\backepsilon");w(E,Z,W,"▶","\\blacktriangleright");w(E,Z,W,"∵","\\because",!0);w(E,Z,W,"⋘","\\llless");w(E,Z,W,"⋙","\\gggtr");w(E,Z,He,"⊲","\\lhd");w(E,Z,He,"⊳","\\rhd");w(E,Z,W,"≂","\\eqsim",!0);w(E,O,W,"⋈","\\Join");w(E,Z,W,"≑","\\Doteq",!0);w(E,Z,He,"∔","\\dotplus",!0);w(E,Z,He,"∖","\\smallsetminus");w(E,Z,He,"⋒","\\Cap",!0);w(E,Z,He,"⋓","\\Cup",!0);w(E,Z,He,"⩞","\\doublebarwedge",!0);w(E,Z,He,"⊟","\\boxminus",!0);w(E,Z,He,"⊞","\\boxplus",!0);w(E,Z,He,"⋇","\\divideontimes",!0);w(E,Z,He,"⋉","\\ltimes",!0);w(E,Z,He,"⋊","\\rtimes",!0);w(E,Z,He,"⋋","\\leftthreetimes",!0);w(E,Z,He,"⋌","\\rightthreetimes",!0);w(E,Z,He,"⋏","\\curlywedge",!0);w(E,Z,He,"⋎","\\curlyvee",!0);w(E,Z,He,"⊝","\\circleddash",!0);w(E,Z,He,"⊛","\\circledast",!0);w(E,Z,He,"⋅","\\centerdot");w(E,Z,He,"⊺","\\intercal",!0);w(E,Z,He,"⋒","\\doublecap");w(E,Z,He,"⋓","\\doublecup");w(E,Z,He,"⊠","\\boxtimes",!0);w(E,Z,W,"⇢","\\dashrightarrow",!0);w(E,Z,W,"⇠","\\dashleftarrow",!0);w(E,Z,W,"⇇","\\leftleftarrows",!0);w(E,Z,W,"⇆","\\leftrightarrows",!0);w(E,Z,W,"⇚","\\Lleftarrow",!0);w(E,Z,W,"↞","\\twoheadleftarrow",!0);w(E,Z,W,"↢","\\leftarrowtail",!0);w(E,Z,W,"↫","\\looparrowleft",!0);w(E,Z,W,"⇋","\\leftrightharpoons",!0);w(E,Z,W,"↶","\\curvearrowleft",!0);w(E,Z,W,"↺","\\circlearrowleft",!0);w(E,Z,W,"↰","\\Lsh",!0);w(E,Z,W,"⇈","\\upuparrows",!0);w(E,Z,W,"↿","\\upharpoonleft",!0);w(E,Z,W,"⇃","\\downharpoonleft",!0);w(E,O,W,"⊶","\\origof",!0);w(E,O,W,"⊷","\\imageof",!0);w(E,Z,W,"⊸","\\multimap",!0);w(E,Z,W,"↭","\\leftrightsquigarrow",!0);w(E,Z,W,"⇉","\\rightrightarrows",!0);w(E,Z,W,"⇄","\\rightleftarrows",!0);w(E,Z,W,"↠","\\twoheadrightarrow",!0);w(E,Z,W,"↣","\\rightarrowtail",!0);w(E,Z,W,"↬","\\looparrowright",!0);w(E,Z,W,"↷","\\curvearrowright",!0);w(E,Z,W,"↻","\\circlearrowright",!0);w(E,Z,W,"↱","\\Rsh",!0);w(E,Z,W,"⇊","\\downdownarrows",!0);w(E,Z,W,"↾","\\upharpoonright",!0);w(E,Z,W,"⇂","\\downharpoonright",!0);w(E,Z,W,"⇝","\\rightsquigarrow",!0);w(E,Z,W,"⇝","\\leadsto");w(E,Z,W,"⇛","\\Rrightarrow",!0);w(E,Z,W,"↾","\\restriction");w(E,O,le,"‘","`");w(E,O,le,"$","\\$");w(Ne,O,le,"$","\\$");w(Ne,O,le,"$","\\textdollar");w(E,O,le,"%","\\%");w(Ne,O,le,"%","\\%");w(E,O,le,"_","\\_");w(Ne,O,le,"_","\\_");w(Ne,O,le,"_","\\textunderscore");w(E,O,le,"∠","\\angle",!0);w(E,O,le,"∞","\\infty",!0);w(E,O,le,"′","\\prime");w(E,O,le,"△","\\triangle");w(E,O,le,"Γ","\\Gamma",!0);w(E,O,le,"Δ","\\Delta",!0);w(E,O,le,"Θ","\\Theta",!0);w(E,O,le,"Λ","\\Lambda",!0);w(E,O,le,"Ξ","\\Xi",!0);w(E,O,le,"Π","\\Pi",!0);w(E,O,le,"Σ","\\Sigma",!0);w(E,O,le,"Υ","\\Upsilon",!0);w(E,O,le,"Φ","\\Phi",!0);w(E,O,le,"Ψ","\\Psi",!0);w(E,O,le,"Ω","\\Omega",!0);w(E,O,le,"A","Α");w(E,O,le,"B","Β");w(E,O,le,"E","Ε");w(E,O,le,"Z","Ζ");w(E,O,le,"H","Η");w(E,O,le,"I","Ι");w(E,O,le,"K","Κ");w(E,O,le,"M","Μ");w(E,O,le,"N","Ν");w(E,O,le,"O","Ο");w(E,O,le,"P","Ρ");w(E,O,le,"T","Τ");w(E,O,le,"X","Χ");w(E,O,le,"¬","\\neg",!0);w(E,O,le,"¬","\\lnot");w(E,O,le,"⊤","\\top");w(E,O,le,"⊥","\\bot");w(E,O,le,"∅","\\emptyset");w(E,Z,le,"∅","\\varnothing");w(E,O,tt,"α","\\alpha",!0);w(E,O,tt,"β","\\beta",!0);w(E,O,tt,"γ","\\gamma",!0);w(E,O,tt,"δ","\\delta",!0);w(E,O,tt,"ϵ","\\epsilon",!0);w(E,O,tt,"ζ","\\zeta",!0);w(E,O,tt,"η","\\eta",!0);w(E,O,tt,"θ","\\theta",!0);w(E,O,tt,"ι","\\iota",!0);w(E,O,tt,"κ","\\kappa",!0);w(E,O,tt,"λ","\\lambda",!0);w(E,O,tt,"μ","\\mu",!0);w(E,O,tt,"ν","\\nu",!0);w(E,O,tt,"ξ","\\xi",!0);w(E,O,tt,"ο","\\omicron",!0);w(E,O,tt,"π","\\pi",!0);w(E,O,tt,"ρ","\\rho",!0);w(E,O,tt,"σ","\\sigma",!0);w(E,O,tt,"τ","\\tau",!0);w(E,O,tt,"υ","\\upsilon",!0);w(E,O,tt,"ϕ","\\phi",!0);w(E,O,tt,"χ","\\chi",!0);w(E,O,tt,"ψ","\\psi",!0);w(E,O,tt,"ω","\\omega",!0);w(E,O,tt,"ε","\\varepsilon",!0);w(E,O,tt,"ϑ","\\vartheta",!0);w(E,O,tt,"ϖ","\\varpi",!0);w(E,O,tt,"ϱ","\\varrho",!0);w(E,O,tt,"ς","\\varsigma",!0);w(E,O,tt,"φ","\\varphi",!0);w(E,O,He,"∗","*",!0);w(E,O,He,"+","+");w(E,O,He,"−","-",!0);w(E,O,He,"⋅","\\cdot",!0);w(E,O,He,"∘","\\circ",!0);w(E,O,He,"÷","\\div",!0);w(E,O,He,"±","\\pm",!0);w(E,O,He,"×","\\times",!0);w(E,O,He,"∩","\\cap",!0);w(E,O,He,"∪","\\cup",!0);w(E,O,He,"∖","\\setminus",!0);w(E,O,He,"∧","\\land");w(E,O,He,"∨","\\lor");w(E,O,He,"∧","\\wedge",!0);w(E,O,He,"∨","\\vee",!0);w(E,O,le,"√","\\surd");w(E,O,zr,"⟨","\\langle",!0);w(E,O,zr,"∣","\\lvert");w(E,O,zr,"∥","\\lVert");w(E,O,dr,"?","?");w(E,O,dr,"!","!");w(E,O,dr,"⟩","\\rangle",!0);w(E,O,dr,"∣","\\rvert");w(E,O,dr,"∥","\\rVert");w(E,O,W,"=","=");w(E,O,W,":",":");w(E,O,W,"≈","\\approx",!0);w(E,O,W,"≅","\\cong",!0);w(E,O,W,"≥","\\ge");w(E,O,W,"≥","\\geq",!0);w(E,O,W,"←","\\gets");w(E,O,W,">","\\gt",!0);w(E,O,W,"∈","\\in",!0);w(E,O,W,"","\\@not");w(E,O,W,"⊂","\\subset",!0);w(E,O,W,"⊃","\\supset",!0);w(E,O,W,"⊆","\\subseteq",!0);w(E,O,W,"⊇","\\supseteq",!0);w(E,Z,W,"⊈","\\nsubseteq",!0);w(E,Z,W,"⊉","\\nsupseteq",!0);w(E,O,W,"⊨","\\models");w(E,O,W,"←","\\leftarrow",!0);w(E,O,W,"≤","\\le");w(E,O,W,"≤","\\leq",!0);w(E,O,W,"<","\\lt",!0);w(E,O,W,"→","\\rightarrow",!0);w(E,O,W,"→","\\to");w(E,Z,W,"≱","\\ngeq",!0);w(E,Z,W,"≰","\\nleq",!0);w(E,O,$a," ","\\ ");w(E,O,$a," ","\\space");w(E,O,$a," ","\\nobreakspace");w(Ne,O,$a," ","\\ ");w(Ne,O,$a," "," ");w(Ne,O,$a," ","\\space");w(Ne,O,$a," ","\\nobreakspace");w(E,O,$a,"","\\nobreak");w(E,O,$a,"","\\allowbreak");w(E,O,zo,",",",");w(E,O,zo,";",";");w(E,Z,He,"⊼","\\barwedge",!0);w(E,Z,He,"⊻","\\veebar",!0);w(E,O,He,"⊙","\\odot",!0);w(E,O,He,"⊕","\\oplus",!0);w(E,O,He,"⊗","\\otimes",!0);w(E,O,le,"∂","\\partial",!0);w(E,O,He,"⊘","\\oslash",!0);w(E,Z,He,"⊚","\\circledcirc",!0);w(E,Z,He,"⊡","\\boxdot",!0);w(E,O,He,"△","\\bigtriangleup");w(E,O,He,"▽","\\bigtriangledown");w(E,O,He,"†","\\dagger");w(E,O,He,"⋄","\\diamond");w(E,O,He,"⋆","\\star");w(E,O,He,"◃","\\triangleleft");w(E,O,He,"▹","\\triangleright");w(E,O,zr,"{","\\{");w(Ne,O,le,"{","\\{");w(Ne,O,le,"{","\\textbraceleft");w(E,O,dr,"}","\\}");w(Ne,O,le,"}","\\}");w(Ne,O,le,"}","\\textbraceright");w(E,O,zr,"{","\\lbrace");w(E,O,dr,"}","\\rbrace");w(E,O,zr,"[","\\lbrack",!0);w(Ne,O,le,"[","\\lbrack",!0);w(E,O,dr,"]","\\rbrack",!0);w(Ne,O,le,"]","\\rbrack",!0);w(E,O,zr,"(","\\lparen",!0);w(E,O,dr,")","\\rparen",!0);w(Ne,O,le,"<","\\textless",!0);w(Ne,O,le,">","\\textgreater",!0);w(E,O,zr,"⌊","\\lfloor",!0);w(E,O,dr,"⌋","\\rfloor",!0);w(E,O,zr,"⌈","\\lceil",!0);w(E,O,dr,"⌉","\\rceil",!0);w(E,O,le,"\\","\\backslash");w(E,O,le,"∣","|");w(E,O,le,"∣","\\vert");w(Ne,O,le,"|","\\textbar",!0);w(E,O,le,"∥","\\|");w(E,O,le,"∥","\\Vert");w(Ne,O,le,"∥","\\textbardbl");w(Ne,O,le,"~","\\textasciitilde");w(Ne,O,le,"\\","\\textbackslash");w(Ne,O,le,"^","\\textasciicircum");w(E,O,W,"↑","\\uparrow",!0);w(E,O,W,"⇑","\\Uparrow",!0);w(E,O,W,"↓","\\downarrow",!0);w(E,O,W,"⇓","\\Downarrow",!0);w(E,O,W,"↕","\\updownarrow",!0);w(E,O,W,"⇕","\\Updownarrow",!0);w(E,O,Bn,"∐","\\coprod");w(E,O,Bn,"⋁","\\bigvee");w(E,O,Bn,"⋀","\\bigwedge");w(E,O,Bn,"⨄","\\biguplus");w(E,O,Bn,"⋂","\\bigcap");w(E,O,Bn,"⋃","\\bigcup");w(E,O,Bn,"∫","\\int");w(E,O,Bn,"∫","\\intop");w(E,O,Bn,"∬","\\iint");w(E,O,Bn,"∭","\\iiint");w(E,O,Bn,"∏","\\prod");w(E,O,Bn,"∑","\\sum");w(E,O,Bn,"⨂","\\bigotimes");w(E,O,Bn,"⨁","\\bigoplus");w(E,O,Bn,"⨀","\\bigodot");w(E,O,Bn,"∮","\\oint");w(E,O,Bn,"∯","\\oiint");w(E,O,Bn,"∰","\\oiiint");w(E,O,Bn,"⨆","\\bigsqcup");w(E,O,Bn,"∫","\\smallint");w(Ne,O,dl,"…","\\textellipsis");w(E,O,dl,"…","\\mathellipsis");w(Ne,O,dl,"…","\\ldots",!0);w(E,O,dl,"…","\\ldots",!0);w(E,O,dl,"⋯","\\@cdots",!0);w(E,O,dl,"⋱","\\ddots",!0);w(E,O,le,"⋮","\\varvdots");w(Ne,O,le,"⋮","\\varvdots");w(E,O,mn,"ˊ","\\acute");w(E,O,mn,"ˋ","\\grave");w(E,O,mn,"¨","\\ddot");w(E,O,mn,"~","\\tilde");w(E,O,mn,"ˉ","\\bar");w(E,O,mn,"˘","\\breve");w(E,O,mn,"ˇ","\\check");w(E,O,mn,"^","\\hat");w(E,O,mn,"⃗","\\vec");w(E,O,mn,"˙","\\dot");w(E,O,mn,"˚","\\mathring");w(E,O,tt,"","\\@imath");w(E,O,tt,"","\\@jmath");w(E,O,le,"ı","ı");w(E,O,le,"ȷ","ȷ");w(Ne,O,le,"ı","\\i",!0);w(Ne,O,le,"ȷ","\\j",!0);w(Ne,O,le,"ß","\\ss",!0);w(Ne,O,le,"æ","\\ae",!0);w(Ne,O,le,"œ","\\oe",!0);w(Ne,O,le,"ø","\\o",!0);w(Ne,O,le,"Æ","\\AE",!0);w(Ne,O,le,"Œ","\\OE",!0);w(Ne,O,le,"Ø","\\O",!0);w(Ne,O,mn,"ˊ","\\'");w(Ne,O,mn,"ˋ","\\`");w(Ne,O,mn,"ˆ","\\^");w(Ne,O,mn,"˜","\\~");w(Ne,O,mn,"ˉ","\\=");w(Ne,O,mn,"˘","\\u");w(Ne,O,mn,"˙","\\.");w(Ne,O,mn,"¸","\\c");w(Ne,O,mn,"˚","\\r");w(Ne,O,mn,"ˇ","\\v");w(Ne,O,mn,"¨",'\\"');w(Ne,O,mn,"˝","\\H");w(Ne,O,mn,"◯","\\textcircled");var y5={"--":!0,"---":!0,"``":!0,"''":!0};w(Ne,O,le,"–","--",!0);w(Ne,O,le,"–","\\textendash");w(Ne,O,le,"—","---",!0);w(Ne,O,le,"—","\\textemdash");w(Ne,O,le,"‘","`",!0);w(Ne,O,le,"‘","\\textquoteleft");w(Ne,O,le,"’","'",!0);w(Ne,O,le,"’","\\textquoteright");w(Ne,O,le,"“","``",!0);w(Ne,O,le,"“","\\textquotedblleft");w(Ne,O,le,"”","''",!0);w(Ne,O,le,"”","\\textquotedblright");w(E,O,le,"°","\\degree",!0);w(Ne,O,le,"°","\\degree");w(Ne,O,le,"°","\\textdegree",!0);w(E,O,le,"£","\\pounds");w(E,O,le,"£","\\mathsterling",!0);w(Ne,O,le,"£","\\pounds");w(Ne,O,le,"£","\\textsterling",!0);w(E,Z,le,"✠","\\maltese");w(Ne,Z,le,"✠","\\maltese");var T4='0123456789/@."';for(var Hf=0;Hf<T4.length;Hf++){var N4=T4.charAt(Hf);w(E,O,le,N4,N4)}var C4='0123456789!@*()-=+";:?/.,';for(var Ff=0;Ff<C4.length;Ff++){var R4=C4.charAt(Ff);w(Ne,O,le,R4,R4)}var _u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Pf=0;Pf<_u.length;Pf++){var lu=_u.charAt(Pf);w(E,O,tt,lu,lu),w(Ne,O,le,lu,lu)}w(E,Z,le,"C","ℂ");w(Ne,Z,le,"C","ℂ");w(E,Z,le,"H","ℍ");w(Ne,Z,le,"H","ℍ");w(E,Z,le,"N","ℕ");w(Ne,Z,le,"N","ℕ");w(E,Z,le,"P","ℙ");w(Ne,Z,le,"P","ℙ");w(E,Z,le,"Q","ℚ");w(Ne,Z,le,"Q","ℚ");w(E,Z,le,"R","ℝ");w(Ne,Z,le,"R","ℝ");w(E,Z,le,"Z","ℤ");w(Ne,Z,le,"Z","ℤ");w(E,O,tt,"h","ℎ");w(Ne,O,tt,"h","ℎ");var ot;for(var lr=0;lr<_u.length;lr++){var yn=_u.charAt(lr);ot=String.fromCharCode(55349,56320+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56372+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56424+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56580+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56684+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56736+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56788+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56840+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56944+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),lr<26&&(ot=String.fromCharCode(55349,56632+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot),ot=String.fromCharCode(55349,56476+lr),w(E,O,tt,yn,ot),w(Ne,O,le,yn,ot))}ot="𝕜";w(E,O,tt,"k",ot);w(Ne,O,le,"k",ot);for(var Ji=0;Ji<10;Ji++){var Si=Ji.toString();ot=String.fromCharCode(55349,57294+Ji),w(E,O,tt,Si,ot),w(Ne,O,le,Si,ot),ot=String.fromCharCode(55349,57314+Ji),w(E,O,tt,Si,ot),w(Ne,O,le,Si,ot),ot=String.fromCharCode(55349,57324+Ji),w(E,O,tt,Si,ot),w(Ne,O,le,Si,ot),ot=String.fromCharCode(55349,57334+Ji),w(E,O,tt,Si,ot),w(Ne,O,le,Si,ot)}var fh="ÐÞþ";for(var $f=0;$f<fh.length;$f++){var ou=fh.charAt($f);w(E,O,tt,ou,ou),w(Ne,O,le,ou,ou)}var mh={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},A4={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},_4={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},nR={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ns={mathClass:"",textClass:"",font:""},I4={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},M4={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},O4={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},hh={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},ph={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},D4={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},gh={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},j4=[mh,mh,A4,A4,_4,_4,nR,ns,ns,ns,I4,I4,M4,M4,O4,O4,hh,hh,ph,ph,D4,D4,ns,ns,gh,gh],rR=[mh,ns,hh,ph,gh],aR=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var s=Math.floor((a-119808)/26);return j4[s]}else if(120782<=a&&a<=120831){var l=Math.floor((a-120782)/10);return rR[l]}else{if(a===120485||a===120486)return j4[0];if(120486<a&&a<120782)return ns;throw new _e("Unsupported character: "+e)}},Zu=function(t,n,a){if(fn[a][t]){var s=fn[a][t].replace;s&&(t=s)}return{value:t,metrics:op(t,n,a)}},or=function(t,n,a,s,l){var c=Zu(t,n,a),d=c.metrics;t=c.value;var m;if(d){var h=d.italic;(a==="text"||s&&s.font==="mathit")&&(h=0),m=new Lr(t,d.height,d.depth,h,d.skew,d.width,l)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),m=new Lr(t,0,0,0,0,0,l);if(s){m.maxFontSize=s.sizeMultiplier,s.style.isTight()&&m.classes.push("mtight");var p=s.getColor();p&&(m.style.color=p)}return m},cp=function(t,n,a,s){return s===void 0&&(s=[]),a.font==="boldsymbol"&&Zu(t,"Main-Bold",n).metrics?or(t,"Main-Bold",n,a,s.concat(["mathbf"])):t==="\\"||fn[n][t].font==="main"?or(t,"Main-Regular",n,a,s):or(t,"AMS-Regular",n,a,s.concat(["amsrm"]))},iR=function(t,n,a){return a!=="textord"&&Zu(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Wu=function(t,n,a){var s=t.mode,l=t.text,c=["mord"],{font:d,fontFamily:m,fontWeight:h,fontShape:p}=n,b=s==="math"||s==="text"&&!!d,y=b?d:m,x="",k="";if(l.charCodeAt(0)===55349){var T=aR(l);x=T.font,k=T[s+"Class"]}if(x)return or(l,x,s,n,c.concat(k));if(y){var R,C;if(y==="boldsymbol"){var _=iR(l,s,a);R=_.fontName,C=[_.fontClass]}else b?(R=bh[d].fontName,C=[d]):(R=cu(m,h,p),C=[m,h,p]);if(Zu(l,R,s).metrics)return or(l,R,s,n,c.concat(C));if(y5.hasOwnProperty(l)&&R.slice(0,10)==="Typewriter"){for(var I=[],G=0;G<l.length;G++)I.push(or(l[G],R,s,n,c.concat(C)));return Ga(I)}}if(a==="mathord")return or(l,"Math-Italic",s,n,c.concat(["mathnormal"]));if(a==="textord"){var D=fn[s][l]&&fn[s][l].font;if(D==="ams"){var M=cu("amsrm",h,p);return or(l,M,s,n,c.concat("amsrm",h,p))}else if(D==="main"||!D){var B=cu("textrm",h,p);return or(l,B,s,n,c.concat(h,p))}else{var X=cu(D,h,p);return or(l,X,s,n,c.concat(X,h,p))}}else throw new Error("unexpected type: "+a+" in makeOrd")},sR=(e,t)=>{if(Ni(e.classes)!==Ni(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},x5=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Lr&&a instanceof Lr&&sR(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},up=function(t){for(var n=0,a=0,s=0,l=0;l<t.children.length;l++){var c=t.children[l];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>s&&(s=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=s},Ce=function(t,n,a,s){var l=new ul(t,n,a,s);return up(l),l},Ri=(e,t,n,a)=>new ul(e,t,n,a),al=function(t,n,a){var s=Ce([t],[],n);return s.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=De(s.height),s.maxFontSize=1,s},lR=function(t,n,a,s){var l=new Xu(t,n,a,s);return up(l),l},Ga=function(t){var n=new cl(t);return up(n),n},il=function(t,n){return t instanceof cl?Ce([],[t],n):t},oR=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],s=-n[0].shift-n[0].elem.depth,l=s,c=1;c<n.length;c++){var d=-n[c].shift-l-n[c].elem.depth,m=d-(n[c-1].elem.height+n[c-1].elem.depth);l=l+d,a.push({type:"kern",size:m}),a.push(n[c])}return{children:a,depth:s}}var h;if(t.positionType==="top"){for(var p=t.positionData,b=0;b<t.children.length;b++){var y=t.children[b];p-=y.type==="kern"?y.size:y.elem.height+y.elem.depth}h=p}else if(t.positionType==="bottom")h=-t.positionData;else{var x=t.children[0];if(x.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")h=-x.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")h=-x.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:h}},Gt=function(t,n){for(var{children:a,depth:s}=oR(t),l=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var m=d.elem;l=Math.max(l,m.maxFontSize,m.height)}}l+=2;var h=Ce(["pstrut"],[]);h.style.height=De(l);for(var p=[],b=s,y=s,x=s,k=0;k<a.length;k++){var T=a[k];if(T.type==="kern")x+=T.size;else{var R=T.elem,C=T.wrapperClasses||[],_=T.wrapperStyle||{},I=Ce(C,[h,R],void 0,_);I.style.top=De(-l-x-R.depth),T.marginLeft&&(I.style.marginLeft=T.marginLeft),T.marginRight&&(I.style.marginRight=T.marginRight),p.push(I),x+=R.height+R.depth}b=Math.min(b,x),y=Math.max(y,x)}var G=Ce(["vlist"],p);G.style.height=De(y);var D;if(b<0){var M=Ce([],[]),B=Ce(["vlist"],[M]);B.style.height=De(-b);var X=Ce(["vlist-s"],[new Lr("")]);D=[Ce(["vlist-r"],[G,X]),Ce(["vlist-r"],[B])]}else D=[Ce(["vlist-r"],[G])];var $=Ce(["vlist-t"],D);return D.length===2&&$.classes.push("vlist-t2"),$.height=y,$.depth=-b,$},w5=(e,t)=>{var n=Ce(["mspace"],[],t),a=gn(e,t);return n.style.marginRight=De(a),n},cu=(e,t,n)=>{var a,s;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",a+"-"+s},bh={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},S5={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},k5=function(t,n){var[a,s,l]=S5[t],c=new Ci(a),d=new Ha([c],{width:De(s),height:De(l),style:"width:"+De(s),viewBox:"0 0 "+1e3*s+" "+1e3*l,preserveAspectRatio:"xMinYMin"}),m=Ri(["overlay"],[d],n);return m.height=l,m.style.height=De(l),m.style.width=De(s),m},pn={number:3,unit:"mu"},es={number:4,unit:"mu"},ja={number:5,unit:"mu"},cR={mord:{mop:pn,mbin:es,mrel:ja,minner:pn},mop:{mord:pn,mop:pn,mrel:ja,minner:pn},mbin:{mord:es,mop:es,mopen:es,minner:es},mrel:{mord:ja,mop:ja,mopen:ja,minner:ja},mopen:{},mclose:{mop:pn,mbin:es,mrel:ja,minner:pn},mpunct:{mord:pn,mop:pn,mrel:ja,mopen:pn,mclose:pn,mpunct:pn,minner:pn},minner:{mord:pn,mop:pn,mbin:es,mrel:ja,mopen:pn,mpunct:pn,minner:pn}},uR={mord:{mop:pn},mop:{mord:pn,mop:pn},mbin:{},mrel:{},mopen:{},mclose:{mop:pn},mpunct:{},minner:{mop:pn}},E5={},Iu={},Mu={};function ze(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:l,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:s},m=0;m<n.length;++m)E5[n[m]]=d;t&&(l&&(Iu[t]=l),c&&(Mu[t]=c))}function us(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;ze({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var Ou=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},jn=function(t){return t.type==="ordgroup"?t.body:[t]},dR=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),fR=new Set(["rightmost","mrel","mclose","mpunct"]),mR={display:mt.DISPLAY,text:mt.TEXT,script:mt.SCRIPT,scriptscript:mt.SCRIPTSCRIPT},hR={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Pn=function(t,n,a,s){s===void 0&&(s=[null,null]);for(var l=[],c=0;c<t.length;c++){var d=Kt(t[c],n);if(d instanceof cl){var m=d.children;l.push(...m)}else l.push(d)}if(x5(l),!a)return l;var h=n;if(t.length===1){var p=t[0];p.type==="sizing"?h=n.havingSize(p.size):p.type==="styling"&&(h=n.havingStyle(mR[p.style]))}var b=Ce([s[0]||"leftmost"],[],n),y=Ce([s[1]||"rightmost"],[],n),x=a==="root";return vh(l,(k,T)=>{var R=T.classes[0],C=k.classes[0];R==="mbin"&&fR.has(C)?T.classes[0]="mord":C==="mbin"&&dR.has(R)&&(k.classes[0]="mord")},{node:b},y,x),vh(l,(k,T)=>{var R,C,_=xh(T),I=xh(k),G=_&&I?k.hasClass("mtight")?(R=uR[_])==null?void 0:R[I]:(C=cR[_])==null?void 0:C[I]:null;if(G)return w5(G,h)},{node:b},y,x),l},vh=function(t,n,a,s,l){s&&t.push(s);for(var c=0;c<t.length;c++){var d=t[c],m=T5(d);if(m){vh(m.children,n,a,null,l);continue}var h=!d.hasClass("mspace");if(h){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}h?a.node=d:l&&d.hasClass("newline")&&(a.node=Ce(["leftmost"])),a.insertAfter=(b=>y=>{t.splice(b+1,0,y),c++})(c)}s&&t.pop()},T5=function(t){return t instanceof cl||t instanceof Xu||t instanceof ul&&t.hasClass("enclosing")?t:null},yh=function(t,n){var a=T5(t);if(a){var s=a.children;if(s.length){if(n==="right")return yh(s[s.length-1],"right");if(n==="left")return yh(s[0],"left")}}return t},xh=function(t,n){if(!t)return null;n&&(t=yh(t,n));var a=t.classes[0];return hR[a]||null},Ro=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Ce(n.concat(a))},Kt=function(t,n,a){if(!t)return Ce();if(Iu[t.type]){var s=Iu[t.type](t,n);if(a&&n.size!==a.size){s=Ce(n.sizingClasses(a),[s],n);var l=n.sizeMultiplier/a.sizeMultiplier;s.height*=l,s.depth*=l}return s}else throw new _e("Got group of unknown type: '"+t.type+"'")};function uu(e,t){var n=Ce(["base"],e,t),a=Ce(["strut"]);return a.style.height=De(n.height+n.depth),n.depth&&(a.style.verticalAlign=De(-n.depth)),n.children.unshift(a),n}function wh(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Pn(e,t,"root"),s;a.length===2&&a[1].hasClass("tag")&&(s=a.pop());for(var l=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var m=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(m=!0);m||(l.push(uu(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(l.push(uu(c,t)),c=[]),l.push(a[d]));c.length>0&&l.push(uu(c,t));var h;n?(h=uu(Pn(n,t,!0),t),h.classes=["tag"],l.push(h)):s&&l.push(s);var p=Ce(["katex-html"],l);if(p.setAttribute("aria-hidden","true"),h){var b=h.children[0];b.style.height=De(p.height+p.depth),p.depth&&(b.style.verticalAlign=De(-p.depth))}return p}function N5(e){return new cl(e)}class Me{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Ni(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Ln&&this.children[a+1]instanceof Ln){for(var s=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Ln;)s+=this.children[++a].toText();t.appendChild(new Ln(s).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=rr(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+rr(Ni(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Ln{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return rr(this.toText())}toText(){return this.text}}class C5{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",De(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+De(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var pR=new Set(["\\imath","\\jmath"]),gR=new Set(["mrow","mtable"]),Wr=function(t,n,a){return fn[n][t]&&fn[n][t].replace&&t.charCodeAt(0)!==55349&&!(y5.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=fn[n][t].replace),new Ln(t)},dp=function(t){return t.length===1?t[0]:new Me("mrow",t)},bR={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},fp=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,s=bR[n];if(s)return typeof s=="function"?s(e):s;var l=e.text;if(pR.has(l))return null;if(fn[a][l]){var c=fn[a][l].replace;c&&(l=c)}var d=bh[n].fontName;return op(l,d,a)?bh[n].variant:null};function Gf(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Ln&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Ln&&n.text===","}else return!1}var Br=function(t,n,a){if(t.length===1){var s=sn(t[0],n);return a&&s instanceof Me&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var l=[],c,d=0;d<t.length;d++){var m=sn(t[d],n);if(m instanceof Me&&c instanceof Me){if(m.type==="mtext"&&c.type==="mtext"&&m.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...m.children);continue}else if(m.type==="mn"&&c.type==="mn"){c.children.push(...m.children);continue}else if(Gf(m)&&c.type==="mn"){c.children.push(...m.children);continue}else if(m.type==="mn"&&Gf(c))m.children=[...c.children,...m.children],l.pop();else if((m.type==="msup"||m.type==="msub")&&m.children.length>=1&&(c.type==="mn"||Gf(c))){var h=m.children[0];h instanceof Me&&h.type==="mn"&&(h.children=[...c.children,...h.children],l.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof Ln&&p.text==="̸"&&(m.type==="mo"||m.type==="mi"||m.type==="mn")){var b=m.children[0];b instanceof Ln&&b.text.length>0&&(b.text=b.text.slice(0,1)+"̸"+b.text.slice(1),l.pop())}}}l.push(m),c=m}return l},Ai=function(t,n,a){return dp(Br(t,n,a))},sn=function(t,n){if(!t)return new Me("mrow");if(Mu[t.type])return Mu[t.type](t,n);throw new _e("Got group of unknown type: '"+t.type+"'")};function L4(e,t,n,a,s){var l=Br(e,n),c;l.length===1&&l[0]instanceof Me&&gR.has(l[0].type)?c=l[0]:c=new Me("mrow",l);var d=new Me("annotation",[new Ln(t)]);d.setAttribute("encoding","application/x-tex");var m=new Me("semantics",[c,d]),h=new Me("math",[m]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&h.setAttribute("display","block");var p=s?"katex":"katex-mathml";return Ce([p],[h])}var vR=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],z4=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],B4=function(t,n){return n.size<2?t:vR[t-1][n.size-1]};class za{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||za.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=z4[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new za(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:B4(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:z4[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=B4(za.BASESIZE,t);return this.size===n&&this.textSize===za.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==za.BASESIZE?["sizing","reset-size"+this.size,"size"+za.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=tR(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}za.BASESIZE=6;var R5=function(t){return new za({style:t.displayMode?mt.DISPLAY:mt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},A5=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=Ce(a,[t])}return t},yR=function(t,n,a){var s=R5(a),l;if(a.output==="mathml")return L4(t,n,s,a.displayMode,!0);if(a.output==="html"){var c=wh(t,s);l=Ce(["katex"],[c])}else{var d=L4(t,n,s,a.displayMode,!1),m=wh(t,s);l=Ce(["katex"],[d,m])}return A5(l,a)},xR=function(t,n,a){var s=R5(a),l=wh(t,s),c=Ce(["katex"],[l]);return A5(c,a)},wR={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Qu=function(t){var n=new Me("mo",[new Ln(wR[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},SR={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},kR=new Set(["widehat","widecheck","widetilde","utilde"]),Ju=function(t,n){function a(){var d=4e5,m=t.label.slice(1);if(kR.has(m)&&"base"in t){var h=t.base.type==="ordgroup"?t.base.body.length:1,p,b,y;if(h>5)m==="widehat"||m==="widecheck"?(p=420,d=2364,y=.42,b=m+"4"):(p=312,d=2340,y=.34,b="tilde4");else{var x=[1,1,2,2,3,3][h];m==="widehat"||m==="widecheck"?(d=[0,1062,2364,2364,2364][x],p=[0,239,300,360,420][x],y=[0,.24,.3,.3,.36,.42][x],b=m+x):(d=[0,600,1033,2339,2340][x],p=[0,260,286,306,312][x],y=[0,.26,.286,.3,.306,.34][x],b="tilde"+x)}var k=new Ci(b),T=new Ha([k],{width:"100%",height:De(y),viewBox:"0 0 "+d+" "+p,preserveAspectRatio:"none"});return{span:Ri([],[T],n),minWidth:0,height:y}}else{var R=[],C=SR[m];if(!C)throw new Error('No SVG data for "'+m+'".');var[_,I,G]=C,D=G/1e3,M=_.length,B,X;if(M===1){if(C.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+m+'".');B=["hide-tail"],X=[C[3]]}else if(M===2)B=["halfarrow-left","halfarrow-right"],X=["xMinYMin","xMaxYMin"];else if(M===3)B=["brace-left","brace-center","brace-right"],X=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
294
|
+
`+M+" children.");for(var $=0;$<M;$++){var j=new Ci(_[$]),F=new Ha([j],{width:"400em",height:De(D),viewBox:"0 0 "+d+" "+G,preserveAspectRatio:X[$]+" slice"}),H=Ri([B[$]],[F],n);if(M===1)return{span:H,minWidth:I,height:D};H.style.height=De(D),R.push(H)}return{span:Ce(["stretchy"],R,n),minWidth:I,height:D}}}var{span:s,minWidth:l,height:c}=a();return s.height=c,s.style.height=De(c),l>0&&(s.style.minWidth=De(l)),s},ER=function(t,n,a,s,l){var c,d=t.height+t.depth+a+s;if(/fbox|color|angl/.test(n)){if(c=Ce(["stretchy",n],[],l),n==="fbox"){var m=l.color&&l.getColor();m&&(c.style.borderColor=m)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new dh({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new dh({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new Ha(h,{width:"100%",height:De(d)});c=Ri([],[p],l)}return c.height=d,c.style.height=De(d),c},TR={bin:1,close:1,inner:1,open:1,punct:1,rel:1},NR={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function CR(e){return e in TR}function wt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function e0(e){var t=t0(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function t0(e){return e&&(e.type==="atom"||NR.hasOwnProperty(e.type))?e:null}var _5=e=>{if(e instanceof Lr)return e;if(eR(e)&&e.children.length===1)return _5(e.children[0])},mp=(e,t)=>{var n,a,s;e&&e.type==="supsub"?(a=wt(e.base,"accent"),n=a.base,e.base=n,s=JC(Kt(e,t)),e.base=a):(a=wt(e,"accent"),n=a.base);var l=Kt(n,t.havingCrampedStyle()),c=a.isShifty&&Pa(n),d=0;if(c){var m,h;d=(m=(h=_5(l))==null?void 0:h.skew)!=null?m:0}var p=a.label==="\\c",b=p?l.height+l.depth:Math.min(l.height,t.fontMetrics().xHeight),y;if(a.isStretchy)y=Ju(a,t),y=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:y,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+De(2*d)+")",marginLeft:De(2*d)}:void 0}]});else{var x,k;a.label==="\\vec"?(x=k5("vec",t),k=S5.vec[1]):(x=Wu({mode:a.mode,text:a.label},t,"textord"),x=QC(x),x.italic=0,k=x.width,p&&(b+=x.depth)),y=Ce(["accent-body"],[x]);var T=a.label==="\\textcircled";T&&(y.classes.push("accent-full"),b=l.height);var R=d;T||(R-=k/2),y.style.left=De(R),a.label==="\\textcircled"&&(y.style.top=".2em"),y=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-b},{type:"elem",elem:y}]})}var C=Ce(["mord","accent"],[y],t);return s?(s.children[0]=C,s.height=Math.max(C.height,s.height),s.classes[0]="mord",s):C},I5=(e,t)=>{var n=e.isStretchy?Qu(e.label):new Me("mo",[Wr(e.label,e.mode)]),a=new Me("mover",[sn(e.base,t),n]);return a.setAttribute("accent","true"),a},RR=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));ze({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Ou(t[0]),a=!RR.test(e.funcName),s=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:s,base:n}},htmlBuilder:mp,mathmlBuilder:I5});ze({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:mp,mathmlBuilder:I5});ze({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:s}},htmlBuilder:(e,t)=>{var n=Kt(e.base,t),a=Ju(e,t),s=e.label==="\\utilde"?.12:0,l=Gt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return Ce(["mord","accentunder"],[l],t)},mathmlBuilder:(e,t)=>{var n=Qu(e.label),a=new Me("munder",[sn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var du=e=>{var t=new Me("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ze({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:s}=e;return{type:"xArrow",mode:a.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),s=il(Kt(e.body,a,t),t),l=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(l+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=il(Kt(e.below,a,t),t),c.classes.push(l+"-arrow-pad"));var d=Ju(e,t),m=-t.fontMetrics().axisHeight+.5*d.height,h=-t.fontMetrics().axisHeight-.5*d.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(h-=s.depth);var p;if(c){var b=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=Gt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:d,shift:m,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:b}]})}else p=Gt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:d,shift:m,wrapperClasses:["svg-align"]}]});return Ce(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=Qu(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var s=du(sn(e.body,t));if(e.below){var l=du(sn(e.below,t));a=new Me("munderover",[n,l,s])}else a=new Me("mover",[n,s])}else if(e.below){var c=du(sn(e.below,t));a=new Me("munder",[n,c])}else a=du(),a=new Me("mover",[n,a]);return a}});function M5(e,t){var n=Pn(e.body,t,!0);return Ce([e.mclass],n,t)}function O5(e,t){var n,a=Br(e.body,t);return e.mclass==="minner"?n=new Me("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Me("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Me("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}ze({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:jn(s),isCharacterBox:Pa(s)}},htmlBuilder:M5,mathmlBuilder:O5});var n0=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};ze({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:n0(t[0]),body:jn(t[1]),isCharacterBox:Pa(t[1])}}});ze({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,s=t[1],l=t[0],c;a!=="\\stackrel"?c=n0(s):c="mrel";var d={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:jn(s)},m={type:"supsub",mode:l.mode,base:d,sup:a==="\\underset"?null:l,sub:a==="\\underset"?l:null};return{type:"mclass",mode:n.mode,mclass:c,body:[m],isCharacterBox:Pa(m)}},htmlBuilder:M5,mathmlBuilder:O5});ze({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:n0(t[0]),body:jn(t[0])}},htmlBuilder(e,t){var n=Pn(e.body,t,!0),a=Ce([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Br(e.body,t),a=new Me("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var AR={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},U4=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),q4=e=>e.type==="textord"&&e.text==="@",_R=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function IR(e,t,n){var a=AR[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),l={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[l],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),m={type:"ordgroup",mode:"math",body:[s,c,d]};return n.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function MR(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new _e("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],s=[a],l=0;l<t.length;l++){for(var c=t[l],d=U4(),m=0;m<c.length;m++)if(!q4(c[m]))d.body.push(c[m]);else{a.push(d),m+=1;var h=e0(c[m]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(h))if("<>AV".includes(h))for(var b=0;b<2;b++){for(var y=!0,x=m+1;x<c.length;x++){if(_R(c[x],h)){y=!1,m=x;break}if(q4(c[x]))throw new _e("Missing a "+h+" character to complete a CD arrow.",c[x]);p[b].body.push(c[x])}if(y)throw new _e("Missing a "+h+" character to complete a CD arrow.",c[m])}else throw new _e('Expected one of "<>AV=|." after @',c[m]);var k=IR(h,p,e),T={type:"styling",body:[k],mode:"math",style:"display",resetFont:!0};a.push(T),d=U4()}l%2===0?a.push(d):a.shift(),a=[],s.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var R=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:R,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}ze({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=il(Kt(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=De(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Me("mrow",[sn(e.label,t)]);return n=new Me("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});ze({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=il(Kt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Me("mrow",[sn(e.fragment,t)])}});ze({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=wt(t[0],"ordgroup"),s=a.body,l="",c=0;c<s.length;c++){var d=wt(s[c],"textord");l+=d.text}var m=parseInt(l),h;if(isNaN(m))throw new _e("\\@char has non-numeric argument "+l);if(m<0||m>=1114111)throw new _e("\\@char with invalid code point "+l);return m<=65535?h=String.fromCharCode(m):(m-=65536,h=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var D5=(e,t)=>{var n=Pn(e.body,t.withColor(e.color),!1);return Ga(n)},j5=(e,t)=>{var n=Br(e.body,t.withColor(e.color)),a=new Me("mstyle",n);return a.setAttribute("mathcolor",e.color),a};ze({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=wt(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:a,body:jn(s)}},htmlBuilder:D5,mathmlBuilder:j5});ze({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,s=wt(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var l=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:s,body:l}},htmlBuilder:D5,mathmlBuilder:j5});ze({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,s=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,l=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:l,size:s&&wt(s,"size").value}},htmlBuilder(e,t){var n=Ce(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=De(gn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Me("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",De(gn(e.size,t)))),n}});var Sh={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},L5=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new _e("Expected a control sequence",e);return t},OR=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},z5=(e,t,n,a)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,a)};ze({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Sh[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Sh[a.text]),wt(t.parseFunction(),"internal");throw new _e("Invalid token after macro prefix",a)}});ze({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),s=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new _e("Expected a control sequence",a);for(var l=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[l].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new _e('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==l+1)throw new _e('Argument number "'+a.text+'" out of order');l++,d.push([])}else{if(a.text==="EOF")throw new _e("Expected a macro definition");d[l].push(a.text)}var{tokens:m}=t.gullet.consumeArg();return c&&m.unshift(c),(n==="\\edef"||n==="\\xdef")&&(m=t.gullet.expandTokens(m),m.reverse()),t.gullet.macros.set(s,{tokens:m,numArgs:l,delimiters:d},n===Sh[n]),{type:"internal",mode:t.mode}}});ze({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=L5(t.gullet.popToken());t.gullet.consumeSpaces();var s=OR(t);return z5(t,a,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});ze({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=L5(t.gullet.popToken()),s=t.gullet.popToken(),l=t.gullet.popToken();return z5(t,a,l,n==="\\\\globalfuture"),t.gullet.pushToken(l),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var ho=function(t,n,a){var s=fn.math[t]&&fn.math[t].replace,l=op(s||t,n,a);if(!l)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return l},hp=function(t,n,a,s){var l=a.havingBaseStyle(n),c=Ce(s.concat(l.sizingClasses(a)),[t],a),d=l.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=l.sizeMultiplier,c},B5=function(t,n,a){var s=n.havingBaseStyle(a),l=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=De(l),t.height-=l,t.depth+=l},DR=function(t,n,a,s,l,c){var d=or(t,"Main-Regular",l,s),m=hp(d,n,s,c);return B5(m,s,n),m},jR=function(t,n,a,s){return or(t,"Size"+n+"-Regular",a,s)},U5=function(t,n,a,s,l,c){var d=jR(t,n,l,s),m=hp(Ce(["delimsizing","size"+n],[d],s),mt.TEXT,s,c);return a&&B5(m,s,mt.TEXT),m},Kf=function(t,n,a){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var l=Ce(["delimsizinginner",s],[Ce([],[or(t,n,a)])]);return{type:"elem",elem:l}},Vf=function(t,n,a){var s=da["Size4-Regular"][t.charCodeAt(0)]?da["Size4-Regular"][t.charCodeAt(0)][4]:da["Size1-Regular"][t.charCodeAt(0)][4],l=new Ci("inner",GC(t,Math.round(1e3*n))),c=new Ha([l],{width:De(s),height:De(n),style:"width:"+De(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=Ri([],[c],a);return d.height=n,d.style.height=De(n),d.style.width=De(s),{type:"elem",elem:d}},kh=.008,fu={type:"kern",size:-1*kh},LR=new Set(["|","\\lvert","\\rvert","\\vert"]),zR=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),q5=function(t,n,a,s,l,c){var d,m,h,p,b="",y=0;d=h=p=t,m=null;var x="Size1-Regular";t==="\\uparrow"?h=p="⏐":t==="\\Uparrow"?h=p="‖":t==="\\downarrow"?d=h="⏐":t==="\\Downarrow"?d=h="‖":t==="\\updownarrow"?(d="\\uparrow",h="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",h="‖",p="\\Downarrow"):LR.has(t)?(h="∣",b="vert",y=333):zR.has(t)?(h="∥",b="doublevert",y=556):t==="["||t==="\\lbrack"?(d="⎡",h="⎢",p="⎣",x="Size4-Regular",b="lbrack",y=667):t==="]"||t==="\\rbrack"?(d="⎤",h="⎥",p="⎦",x="Size4-Regular",b="rbrack",y=667):t==="\\lfloor"||t==="⌊"?(h=d="⎢",p="⎣",x="Size4-Regular",b="lfloor",y=667):t==="\\lceil"||t==="⌈"?(d="⎡",h=p="⎢",x="Size4-Regular",b="lceil",y=667):t==="\\rfloor"||t==="⌋"?(h=d="⎥",p="⎦",x="Size4-Regular",b="rfloor",y=667):t==="\\rceil"||t==="⌉"?(d="⎤",h=p="⎥",x="Size4-Regular",b="rceil",y=667):t==="("||t==="\\lparen"?(d="⎛",h="⎜",p="⎝",x="Size4-Regular",b="lparen",y=875):t===")"||t==="\\rparen"?(d="⎞",h="⎟",p="⎠",x="Size4-Regular",b="rparen",y=875):t==="\\{"||t==="\\lbrace"?(d="⎧",m="⎨",p="⎩",h="⎪",x="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",m="⎬",p="⎭",h="⎪",x="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",h="⎪",x="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",h="⎪",x="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",h="⎪",x="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",h="⎪",x="Size4-Regular");var k=ho(d,x,l),T=k.height+k.depth,R=ho(h,x,l),C=R.height+R.depth,_=ho(p,x,l),I=_.height+_.depth,G=0,D=1;if(m!==null){var M=ho(m,x,l);G=M.height+M.depth,D=2}var B=T+I+G,X=Math.max(0,Math.ceil((n-B)/(D*C))),$=B+X*D*C,j=s.fontMetrics().axisHeight;a&&(j*=s.sizeMultiplier);var F=$/2-j,H=[];if(b.length>0){var ne=$-T-I,V=Math.round($*1e3),Y=KC(b,Math.round(ne*1e3)),K=new Ci(b,Y),re=De(y/1e3),ue=De(V/1e3),Te=new Ha([K],{width:re,height:ue,viewBox:"0 0 "+y+" "+V}),P=Ri([],[Te],s);P.height=V/1e3,P.style.width=re,P.style.height=ue,H.push({type:"elem",elem:P})}else{if(H.push(Kf(p,x,l)),H.push(fu),m===null){var U=$-T-I+2*kh;H.push(Vf(h,U,s))}else{var q=($-T-I-G)/2+2*kh;H.push(Vf(h,q,s)),H.push(fu),H.push(Kf(m,x,l)),H.push(fu),H.push(Vf(h,q,s))}H.push(fu),H.push(Kf(d,x,l))}var A=s.havingBaseStyle(mt.TEXT),ae=Gt({positionType:"bottom",positionData:F,children:H});return hp(Ce(["delimsizing","mult"],[ae],A),mt.TEXT,s,c)},Yf=80,Xf=.08,Zf=function(t,n,a,s,l){var c=$C(t,s,a),d=new Ci(t,c),m=new Ha([d],{width:"400em",height:De(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return Ri(["hide-tail"],[m],l)},BR=function(t,n){var a=n.havingBaseSizing(),s=G5("\\surd",t*a.sizeMultiplier,$5,a),l=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,m,h,p,b;return s.type==="small"?(p=1e3+1e3*c+Yf,t<1?l=1:t<1.4&&(l=.7),m=(1+c+Xf)/l,h=(1+c)/l,d=Zf("sqrtMain",m,p,c,n),d.style.minWidth="0.853em",b=.833/l):s.type==="large"?(p=(1e3+Yf)*xo[s.size],h=(xo[s.size]+c)/l,m=(xo[s.size]+c+Xf)/l,d=Zf("sqrtSize"+s.size,m,p,c,n),d.style.minWidth="1.02em",b=1/l):(m=t+c+Xf,h=t+c,p=Math.floor(1e3*t+c)+Yf,d=Zf("sqrtTall",m,p,c,n),d.style.minWidth="0.742em",b=1.056),d.height=h,d.style.height=De(m),{span:d,advanceWidth:b,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*l}},H5=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),UR=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),F5=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),xo=[0,1.2,1.8,2.4,3],P5=function(t,n,a,s,l){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),H5.has(t)||F5.has(t))return U5(t,n,!1,a,s,l);if(UR.has(t))return q5(t,xo[n],!1,a,s,l);throw new _e("Illegal delimiter: '"+t+"'")},qR=[{type:"small",style:mt.SCRIPTSCRIPT},{type:"small",style:mt.SCRIPT},{type:"small",style:mt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],HR=[{type:"small",style:mt.SCRIPTSCRIPT},{type:"small",style:mt.SCRIPT},{type:"small",style:mt.TEXT},{type:"stack"}],$5=[{type:"small",style:mt.SCRIPTSCRIPT},{type:"small",style:mt.SCRIPT},{type:"small",style:mt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],FR=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},G5=function(t,n,a,s){for(var l=Math.min(2,3-s.style.size),c=l;c<a.length;c++){var d=a[c];if(d.type==="stack")break;var m=ho(t,FR(d),"math"),h=m.height+m.depth;if(d.type==="small"){var p=s.havingBaseStyle(d.style);h*=p.sizeMultiplier}if(h>n)return d}return a[a.length-1]},Eh=function(t,n,a,s,l,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;F5.has(t)?d=qR:H5.has(t)?d=$5:d=HR;var m=G5(t,n,d,s);return m.type==="small"?DR(t,m.style,a,s,l,c):m.type==="large"?U5(t,m.size,a,s,l,c):q5(t,n,a,s,l,c)},Wf=function(t,n,a,s,l,c){var d=s.fontMetrics().axisHeight*s.sizeMultiplier,m=901,h=5/s.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),b=Math.max(p/500*m,2*p-h);return Eh(t,b,!0,s,l,c)},H4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},PR=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function F4(e){return"isMiddle"in e}function r0(e,t){var n=t0(e);if(n&&PR.has(n.text))return n;throw n?new _e("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new _e("Invalid delimiter type '"+e.type+"'",e)}ze({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=r0(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:H4[e.funcName].size,mclass:H4[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ce([e.mclass]):P5(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Wr(e.delim,e.mode));var n=new Me("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=De(xo[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function P4(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ze({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new _e("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:r0(t[0],e).text,color:n}}});ze({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=r0(t[0],e),a=e.parser;++a.leftrightDepth;var s=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var l=wt(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:s,left:n.text,right:l.delim,rightColor:l.color}},htmlBuilder:(e,t)=>{P4(e);for(var n=Pn(e.body,t,!0,["mopen","mclose"]),a=0,s=0,l=!1,c=0;c<n.length;c++){var d=n[c];F4(d)?l=!0:(a=Math.max(n[c].height,a),s=Math.max(n[c].depth,s))}a*=t.sizeMultiplier,s*=t.sizeMultiplier;var m;if(e.left==="."?m=Ro(t,["mopen"]):m=Wf(e.left,a,s,t,e.mode,["mopen"]),n.unshift(m),l)for(var h=1;h<n.length;h++){var p=n[h];if(F4(p)){var b=p.isMiddle;n[h]=Wf(b.delim,a,s,b.options,e.mode,[])}}var y;if(e.right===".")y=Ro(t,["mclose"]);else{var x=e.rightColor?t.withColor(e.rightColor):t;y=Wf(e.right,a,s,x,e.mode,["mclose"])}return n.push(y),Ce(["minner"],n,t)},mathmlBuilder:(e,t)=>{P4(e);var n=Br(e.body,t);if(e.left!=="."){var a=new Me("mo",[Wr(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var s=new Me("mo",[Wr(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return dp(n)}});ze({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=r0(t[0],e);if(!e.parser.leftrightDepth)throw new _e("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Ro(t,[]):(n=P5(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Wr("|","text"):Wr(e.delim,e.mode),a=new Me("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var a0=(e,t)=>{var n=il(Kt(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,l,c,d=Pa(e.body);if(a==="sout")l=Ce(["stretchy","sout"]),l.height=t.fontMetrics().defaultRuleThickness/s,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var m=gn({number:.6,unit:"pt"},t),h=gn({number:.35,unit:"ex"},t),p=t.havingBaseSizing();s=s/p.sizeMultiplier;var b=n.height+n.depth+m+h;n.style.paddingLeft=De(b/2+m);var y=Math.floor(1e3*b*s),x=FC(y),k=new Ha([new Ci("phase",x)],{width:"400em",height:De(y/1e3),viewBox:"0 0 400000 "+y,preserveAspectRatio:"xMinYMin slice"});l=Ri(["hide-tail"],[k],t),l.style.height=De(b),c=n.depth+m+h}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var T,R,C=0;/box/.test(a)?(C=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),T=t.fontMetrics().fboxsep+(a==="colorbox"?0:C),R=T):a==="angl"?(C=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),T=4*C,R=Math.max(0,.25-n.depth)):(T=d?.2:0,R=T),l=ER(n,a,T,R,t),/fbox|boxed|fcolorbox/.test(a)?(l.style.borderStyle="solid",l.style.borderWidth=De(C)):a==="angl"&&C!==.049&&(l.style.borderTopWidth=De(C),l.style.borderRightWidth=De(C)),c=n.depth+R,e.backgroundColor&&(l.style.backgroundColor=e.backgroundColor,e.borderColor&&(l.style.borderColor=e.borderColor))}var _;if(e.backgroundColor)_=Gt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:0}]});else{var I=/cancel|phase/.test(a)?["svg-align"]:[];_=Gt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:l,shift:c,wrapperClasses:I}]})}return/cancel/.test(a)&&(_.height=n.height,_.depth=n.depth),/cancel/.test(a)&&!d?Ce(["mord","cancel-lap"],[_],t):Ce(["mord"],[_],t)},i0=(e,t)=>{var n,a=new Me(e.label.includes("colorbox")?"mpadded":"menclose",[sn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+De(s)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};ze({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,l=wt(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:s,backgroundColor:l,body:c}},htmlBuilder:a0,mathmlBuilder:i0});ze({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,l=wt(t[0],"color-token").color,c=wt(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:s,backgroundColor:c,borderColor:l,body:d}},htmlBuilder:a0,mathmlBuilder:i0});ze({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});ze({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:a0,mathmlBuilder:i0});ze({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:a0,mathmlBuilder:i0});ze({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var K5={};function ma(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:l,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},m=0;m<n.length;++m)K5[n[m]]=d;l&&(Iu[t]=l),c&&(Mu[t]=c)}var V5={};function z(e,t){V5[e]=t}class wr{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new wr(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class jr{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new jr(n,wr.range(this,t))}}function $4(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var s0=e=>{var t=e.parser.settings;if(!t.displayMode)throw new _e("{"+e.envName+"} can be used only in display mode.")},$R=new Set(["gather","gather*"]);function pp(e){if(!e.includes("ed"))return!e.includes("*")}function Ii(e,t,n){var{hskipBeforeAndAfter:a,addJot:s,cols:l,arraystretch:c,colSeparationType:d,autoTag:m,singleRow:h,emptySingleRow:p,maxNumCols:b,leqno:y}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var x=e.gullet.expandMacroAsText("\\arraystretch");if(x==null)c=1;else if(c=parseFloat(x),!c||c<0)throw new _e("Invalid \\arraystretch: "+x)}e.gullet.beginGroup();var k=[],T=[k],R=[],C=[],_=m!=null?[]:void 0;function I(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function G(){_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new jr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):_.push(!!m&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(I(),C.push($4(e));;){var D=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var M={type:"ordgroup",mode:e.mode,body:D};n&&(M={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[M]}),k.push(M);var B=e.fetch().text;if(B==="&"){if(b&&k.length===b){if(h||d)throw new _e("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(B==="\\end"){G(),k.length===1&&M.type==="styling"&&M.body.length===1&&M.body[0].type==="ordgroup"&&M.body[0].body.length===0&&(T.length>1||!p)&&T.pop(),C.length<T.length+1&&C.push([]);break}else if(B==="\\\\"){e.consume();var X=void 0;e.gullet.future().text!==" "&&(X=e.parseSizeGroup(!0)),R.push(X?X.value:null),G(),C.push($4(e)),k=[],T.push(k),I()}else throw new _e("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:c,body:T,cols:l,rowGaps:R,hskipBeforeAndAfter:a,hLinesBeforeRow:C,colSeparationType:d,tags:_,leqno:y}}function gp(e){return e.slice(0,1)==="d"?"display":"text"}var ha=function(t,n){var a,s,l=t.body.length,c=t.hLinesBeforeRow,d=0,m=new Array(l),h=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),b=1/n.fontMetrics().ptPerEm,y=5*b;if(t.colSeparationType&&t.colSeparationType==="small"){var x=n.havingStyle(mt.SCRIPT).sizeMultiplier;y=.2778*(x/n.sizeMultiplier)}var k=t.colSeparationType==="CD"?gn({number:3,unit:"ex"},n):12*b,T=3*b,R=t.arraystretch*k,C=.7*R,_=.3*R,I=0;function G(qe){for(var Qe=0;Qe<qe.length;++Qe)Qe>0&&(I+=.25),h.push({pos:I,isDashed:qe[Qe]})}for(G(c[0]),a=0;a<t.body.length;++a){var D=t.body[a],M=C,B=_;d<D.length&&(d=D.length);var X={cells:new Array(D.length),height:0,depth:0,pos:0};for(s=0;s<D.length;++s){var $=Kt(D[s],n);B<$.depth&&(B=$.depth),M<$.height&&(M=$.height),X.cells[s]=$}var j=t.rowGaps[a],F=0;j&&(F=gn(j,n),F>0&&(F+=_,B<F&&(B=F),F=0)),t.addJot&&a<t.body.length-1&&(B+=T),X.height=M,X.depth=B,I+=M,X.pos=I,I+=B+F,m[a]=X,G(c[a+1])}var H=I/2+n.fontMetrics().axisHeight,ne=t.cols||[],V=[],Y,K,re=[];if(t.tags&&t.tags.some(qe=>qe))for(a=0;a<l;++a){var ue=m[a],Te=ue.pos-H,P=t.tags[a],U=void 0;P===!0?U=Ce(["eqn-num"],[],n):P===!1?U=Ce([],[],n):U=Ce([],Pn(P,n,!0),n),U.depth=ue.depth,U.height=ue.height,re.push({type:"elem",elem:U,shift:Te})}for(s=0,K=0;s<d||K<ne.length;++s,++K){for(var q,A=ne[K],ae=!0;((pe=A)==null?void 0:pe.type)==="separator";){var pe;if(ae||(Y=Ce(["arraycolsep"],[]),Y.style.width=De(n.fontMetrics().doubleRuleSep),V.push(Y)),A.separator==="|"||A.separator===":"){var te=A.separator==="|"?"solid":"dashed",ee=Ce(["vertical-separator"],[],n);ee.style.height=De(I),ee.style.borderRightWidth=De(p),ee.style.borderRightStyle=te,ee.style.margin="0 "+De(-p/2);var ce=I-H;ce&&(ee.style.verticalAlign=De(-ce)),V.push(ee)}else throw new _e("Invalid separator type: "+A.separator);K++,A=ne[K],ae=!1}if(!(s>=d)){var ge=void 0;if(s>0||t.hskipBeforeAndAfter){var Ae,Oe;ge=(Ae=(Oe=A)==null?void 0:Oe.pregap)!=null?Ae:y,ge!==0&&(Y=Ce(["arraycolsep"],[]),Y.style.width=De(ge),V.push(Y))}var ve=[];for(a=0;a<l;++a){var Ue=m[a],Ve=Ue.cells[s];if(Ve){var nt=Ue.pos-H;Ve.depth=Ue.depth,Ve.height=Ue.height,ve.push({type:"elem",elem:Ve,shift:nt})}}var lt=Gt({positionType:"individualShift",children:ve}),Lt=Ce(["col-align-"+(((q=A)==null?void 0:q.align)||"c")],[lt]);if(V.push(Lt),s<d-1||t.hskipBeforeAndAfter){var _t,ut;ge=(_t=(ut=A)==null?void 0:ut.postgap)!=null?_t:y,ge!==0&&(Y=Ce(["arraycolsep"],[]),Y.style.width=De(ge),V.push(Y))}}}var Ye=Ce(["mtable"],V);if(h.length>0){for(var Fe=al("hline",n,p),ct=al("hdashline",n,p),zt=[{type:"elem",elem:Ye,shift:0}];h.length>0;){var Pe=h.pop(),Wt=Pe.pos-H;Pe.isDashed?zt.push({type:"elem",elem:ct,shift:Wt}):zt.push({type:"elem",elem:Fe,shift:Wt})}Ye=Gt({positionType:"individualShift",children:zt})}if(re.length===0)return Ce(["mord"],[Ye],n);var me=Gt({positionType:"individualShift",children:re}),ye=Ce(["tag"],[me],n);return Ga([Ye,ye])},GR={c:"center ",l:"left ",r:"right "},pa=function(t,n){for(var a=[],s=new Me("mtd",[],["mtr-glue"]),l=new Me("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],m=[],h=0;h<d.length;h++)m.push(new Me("mtd",[sn(d[h],n)]));t.tags&&t.tags[c]&&(m.unshift(s),m.push(s),t.leqno?m.unshift(l):m.push(l)),a.push(new Me("mtr",m))}var p=new Me("mtable",a),b=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",De(b));var y="",x="";if(t.cols&&t.cols.length>0){var k=t.cols,T="",R=!1,C=0,_=k.length;k[0].type==="separator"&&(y+="top ",C=1),k[k.length-1].type==="separator"&&(y+="bottom ",_-=1);for(var I=C;I<_;I++){var G=k[I];G.type==="align"?(x+=GR[G.align],R&&(T+="none "),R=!0):G.type==="separator"&&R&&(T+=G.separator==="|"?"solid ":"dashed ",R=!1)}p.setAttribute("columnalign",x.trim()),/[sd]/.test(T)&&p.setAttribute("columnlines",T.trim())}if(t.colSeparationType==="align"){for(var D=t.cols||[],M="",B=1;B<D.length;B++)M+=B%2?"0em ":"1em ";p.setAttribute("columnspacing",M.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var X="",$=t.hLinesBeforeRow;y+=$[0].length>0?"left ":"",y+=$[$.length-1].length>0?"right ":"";for(var j=1;j<$.length-1;j++)X+=$[j].length===0?"none ":$[j][0]?"dashed ":"solid ";return/[sd]/.test(X)&&p.setAttribute("rowlines",X.trim()),y!==""&&(p=new Me("menclose",[p]),p.setAttribute("notation",y.trim())),t.arraystretch&&t.arraystretch<1&&(p=new Me("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},Y5=function(t,n){t.envName.includes("ed")||s0(t);var a=[],s=t.envName.includes("at")?"alignat":"align",l=t.envName==="split",c=Ii(t.parser,{cols:a,addJot:!0,autoTag:l?void 0:pp(t.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:l?2:void 0,leqno:t.parser.settings.leqno},"display"),d=0,m=0,h={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",b=0;b<n[0].body.length;b++){var y=wt(n[0].body[b],"textord");p+=y.text}d=Number(p),m=d*2}var x=!m;c.body.forEach(function(C){for(var _=1;_<C.length;_+=2){var I=wt(C[_],"styling"),G=wt(I.body[0],"ordgroup");G.body.unshift(h)}if(x)m<C.length&&(m=C.length);else{var D=C.length/2;if(d<D)throw new _e("Too many math in a row: "+("expected "+d+", but got "+D),C[0])}});for(var k=0;k<m;++k){var T="r",R=0;k%2===1?T="l":k>0&&x&&(R=1),a[k]={type:"align",align:T,pregap:R,postgap:0}}return c.colSeparationType=x?"align":"alignat",c};ma({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=t0(t[0]),a=n?[t[0]]:wt(t[0],"ordgroup").body,s=a.map(function(c){var d=e0(c),m=d.text;if("lcr".includes(m))return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new _e("Unknown column alignment: "+m,c)}),l={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Ii(e.parser,l,gp(e.envName))},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new _e("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),a.cols=[{type:"align",align:n}]}}var l=Ii(e.parser,a,gp(e.envName)),c=Math.max(0,...l.body.map(d=>d.length));return l.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[l],left:t[0],right:t[1],rightColor:void 0}:l},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Ii(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=t0(t[0]),a=n?[t[0]]:wt(t[0],"ordgroup").body,s=a.map(function(d){var m=e0(d),h=m.text;if("lc".includes(h))return{type:"align",align:h};throw new _e("Unknown column alignment: "+h,d)});if(s.length>1)throw new _e("{subarray} can contain only one column");var l={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},c=Ii(e.parser,l,"script");if(c.body.length>0&&c.body[0].length>1)throw new _e("{subarray} can contain only one column");return c},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Ii(e.parser,t,gp(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y5,htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){$R.has(e.envName)&&s0(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:pp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Ii(e.parser,t,"display")},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y5,htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){s0(e);var t={autoTag:pp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Ii(e.parser,t,"display")},htmlBuilder:ha,mathmlBuilder:pa});ma({type:"array",names:["CD"],props:{numArgs:0},handler(e){return s0(e),MR(e.parser)},htmlBuilder:ha,mathmlBuilder:pa});z("\\nonumber","\\gdef\\@eqnsw{0}");z("\\notag","\\nonumber");ze({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new _e(e.funcName+" valid only within array environment")}});var G4=K5;ze({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];if(s.type!=="ordgroup")throw new _e("Invalid environment name",s);for(var l="",c=0;c<s.body.length;++c)l+=wt(s.body[c],"textord").text;if(a==="\\begin"){if(!G4.hasOwnProperty(l))throw new _e("No such environment: "+l,s);var d=G4[l],{args:m,optArgs:h}=n.parseArguments("\\begin{"+l+"}",d),p={mode:n.mode,envName:l,parser:n},b=d.handler(p,m,h);n.expect("\\end",!1);var y=n.nextToken,x=wt(n.parseFunction(),"environment");if(x.name!==l)throw new _e("Mismatch: \\begin{"+l+"} matched by \\end{"+x.name+"}",y);return b}return{type:"environment",mode:n.mode,name:l,nameGroup:s}}});var X5=(e,t)=>{var n=e.font,a=t.withFont(n);return Kt(e.body,a)},Z5=(e,t)=>{var n=e.font,a=t.withFont(n);return sn(e.body,a)},K4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ze({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=Ou(t[0]),l=a;return l in K4&&(l=K4[l]),{type:"font",mode:n.mode,font:l.slice(1),body:s}},htmlBuilder:X5,mathmlBuilder:Z5});ze({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:n0(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:Pa(a)}}});ze({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:s}=e,{mode:l}=n,c=n.parseExpression(!0,s);return{type:"font",mode:l,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:X5,mathmlBuilder:Z5});var KR=(e,t)=>{var n=t.style,a=n.fracNum(),s=n.fracDen(),l;l=t.havingStyle(a);var c=Kt(e.numer,l,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,m=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<m?m:c.depth}l=t.havingStyle(s);var h=Kt(e.denom,l,t),p,b,y;e.hasBarLine?(e.barSize?(b=gn(e.barSize,t),p=al("frac-line",t,b)):p=al("frac-line",t),b=p.height,y=p.height):(p=null,b=0,y=t.fontMetrics().defaultRuleThickness);var x,k,T;n.size===mt.DISPLAY.size?(x=t.fontMetrics().num1,b>0?k=3*y:k=7*y,T=t.fontMetrics().denom1):(b>0?(x=t.fontMetrics().num2,k=y):(x=t.fontMetrics().num3,k=3*y),T=t.fontMetrics().denom2);var R;if(p){var _=t.fontMetrics().axisHeight;x-c.depth-(_+.5*b)<k&&(x+=k-(x-c.depth-(_+.5*b))),_-.5*b-(h.height-T)<k&&(T+=k-(_-.5*b-(h.height-T)));var I=-(_-.5*b);R=Gt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:T},{type:"elem",elem:p,shift:I},{type:"elem",elem:c,shift:-x}]})}else{var C=x-c.depth-(h.height-T);C<k&&(x+=.5*(k-C),T+=.5*(k-C)),R=Gt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:T},{type:"elem",elem:c,shift:-x}]})}l=t.havingStyle(n),R.height*=l.sizeMultiplier/t.sizeMultiplier,R.depth*=l.sizeMultiplier/t.sizeMultiplier;var G;n.size===mt.DISPLAY.size?G=t.fontMetrics().delim1:n.size===mt.SCRIPTSCRIPT.size?G=t.havingStyle(mt.SCRIPT).fontMetrics().delim2:G=t.fontMetrics().delim2;var D,M;return e.leftDelim==null?D=Ro(t,["mopen"]):D=Eh(e.leftDelim,G,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?M=Ce([]):e.rightDelim==null?M=Ro(t,["mclose"]):M=Eh(e.rightDelim,G,!0,t.havingStyle(n),e.mode,["mclose"]),Ce(["mord"].concat(l.sizingClasses(t)),[D,Ce(["mfrac"],[R]),M],t)},VR=(e,t)=>{var n=new Me("mfrac",[sn(e.numer,t),sn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=gn(e.barSize,t);n.setAttribute("linethickness",De(a))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var l=new Me("mo",[new Ln(e.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}if(s.push(n),e.rightDelim!=null){var c=new Me("mo",[new Ln(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),s.push(c)}return dp(s)}return n},W5=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};ze({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],l=t[1],c,d=null,m=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",m=")";break;case"\\\\bracefrac":c=!1,d="\\{",m="\\}";break;case"\\\\brackfrac":c=!1,d="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}var h=a==="\\cfrac",p=null;return h||a.startsWith("\\d")?p="display":a.startsWith("\\t")&&(p="text"),W5({type:"genfrac",mode:n.mode,numer:s,denom:l,continued:h,hasBarLine:c,leftDelim:d,rightDelim:m,barSize:null},p)},htmlBuilder:KR,mathmlBuilder:VR});ze({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:a}}});var V4=["display","text","script","scriptscript"],Y4=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};ze({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],s=t[5],l=Ou(t[0]),c=l.type==="atom"&&l.family==="open"?Y4(l.text):null,d=Ou(t[1]),m=d.type==="atom"&&d.family==="close"?Y4(d.text):null,h=wt(t[2],"size"),p,b=null;h.isBlank?p=!0:(b=h.value,p=b.number>0);var y=null,x=t[3];if(x.type==="ordgroup"){if(x.body.length>0){var k=wt(x.body[0],"textord");y=V4[Number(k.text)]}}else x=wt(x,"textord"),y=V4[Number(x.text)];return W5({type:"genfrac",mode:n.mode,numer:a,denom:s,continued:!1,hasBarLine:p,barSize:b,leftDelim:c,rightDelim:m},y)}});ze({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:wt(t[0],"size").value,token:s}}});ze({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],l=wt(t[1],"infix").size;if(!l)throw new Error("\\\\abovefrac expected size, but got "+String(l));var c=t[2],d=l.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:c,continued:!1,hasBarLine:d,barSize:l,leftDelim:null,rightDelim:null}}});var Q5=(e,t)=>{var n=t.style,a,s;e.type==="supsub"?(a=e.sup?Kt(e.sup,t.havingStyle(n.sup()),t):Kt(e.sub,t.havingStyle(n.sub()),t),s=wt(e.base,"horizBrace")):s=wt(e,"horizBrace");var l=Kt(s.base,t.havingBaseStyle(mt.DISPLAY)),c=Ju(s,t),d;if(s.isOver?d=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):d=Gt({positionType:"bottom",positionData:l.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:l}]}),a){var m=Ce(["minner",s.isOver?"mover":"munder"],[d],t);s.isOver?d=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]}):d=Gt({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]})}return Ce(["minner",s.isOver?"mover":"munder"],[d],t)},YR=(e,t)=>{var n=Qu(e.label);return new Me(e.isOver?"mover":"munder",[sn(e.base,t),n])};ze({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:Q5,mathmlBuilder:YR});ze({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],s=wt(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:jn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Pn(e.body,t,!1);return lR(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ai(e.body,t);return n instanceof Me||(n=new Me("mrow",[n])),n.setAttribute("href",e.href),n}});ze({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=wt(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var s=[],l=0;l<a.length;l++){var c=a[l];c==="~"&&(c="\\textasciitilde"),s.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:a,body:jn(d)}}});ze({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:jn(t[0])}},htmlBuilder(e,t){var n=Pn(e.body,t.withFont(""),!1);return Ga(n)},mathmlBuilder(e,t){return new Me("mrow",Br(e.body,t.withFont("")))}});ze({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:s}=e,l=wt(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,m={};switch(a){case"\\htmlClass":m.class=l,d={command:"\\htmlClass",class:l};break;case"\\htmlId":m.id=l,d={command:"\\htmlId",id:l};break;case"\\htmlStyle":m.style=l,d={command:"\\htmlStyle",style:l};break;case"\\htmlData":{for(var h=l.split(","),p=0;p<h.length;p++){var b=h[p],y=b.indexOf("=");if(y<0)throw new _e("\\htmlData key/value '"+b+"' missing equals sign");var x=b.slice(0,y),k=b.slice(y+1);m["data-"+x.trim()]=k}d={command:"\\htmlData",attributes:m};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:m,body:jn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Pn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var s=Ce(a,n,t);for(var l in e.attributes)l!=="class"&&e.attributes.hasOwnProperty(l)&&s.setAttribute(l,e.attributes[l]);return s},mathmlBuilder:(e,t)=>Ai(e.body,t)});ze({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:jn(t[0]),mathml:jn(t[1])}},htmlBuilder:(e,t)=>{var n=Pn(e.html,t,!1);return Ga(n)},mathmlBuilder:(e,t)=>Ai(e.mathml,t)});var Qf=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new _e("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!h5(a))throw new _e("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};ze({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,s={number:0,unit:"em"},l={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var m=wt(n[0],"raw").string,h=m.split(","),p=0;p<h.length;p++){var b=h[p].split("=");if(b.length===2){var y=b[1].trim();switch(b[0].trim()){case"alt":d=y;break;case"width":s=Qf(y);break;case"height":l=Qf(y);break;case"totalheight":c=Qf(y);break;default:throw new _e("Invalid key: '"+b[0]+"' in \\includegraphics.")}}}var x=wt(t[0],"url").url;return d===""&&(d=x,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:a.mode,alt:d,width:s,height:l,totalheight:c,src:x}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=gn(e.height,t),a=0;e.totalheight.number>0&&(a=gn(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=gn(e.width,t));var l={height:De(n+a)};s>0&&(l.width=De(s)),a>0&&(l.verticalAlign=De(-a));var c=new ZC(e.src,e.alt,l);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Me("mglyph",[]);n.setAttribute("alt",e.alt);var a=gn(e.height,t),s=0;if(e.totalheight.number>0&&(s=gn(e.totalheight,t)-a,n.setAttribute("valign",De(-s))),n.setAttribute("height",De(a+s)),e.width.number>0){var l=gn(e.width,t);n.setAttribute("width",De(l))}return n.setAttribute("src",e.src),n}});ze({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=wt(t[0],"size");if(n.settings.strict){var l=a[1]==="m",c=s.value.unit==="mu";l?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return w5(e.dimension,t)},mathmlBuilder(e,t){var n=gn(e.dimension,t);return new C5(n)}});ze({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ce([],[Kt(e.body,t)]),n=Ce(["inner"],[n],t)):n=Ce(["inner"],[Kt(e.body,t)]);var a=Ce(["fix"],[]),s=Ce([e.alignment],[n,a],t),l=Ce(["strut"]);return l.style.height=De(s.height+s.depth),s.depth&&(l.style.verticalAlign=De(-s.depth)),s.children.unshift(l),s=Ce(["thinbox"],[s],t),Ce(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[sn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});ze({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,s=a.mode;a.switchMode("math");var l=n==="\\("?"\\)":"$",c=a.parseExpression(!1,l);return a.expect(l),a.switchMode(s),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});ze({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new _e("Mismatched "+e.funcName)}});var X4=(e,t)=>{switch(t.style.size){case mt.DISPLAY.size:return e.display;case mt.TEXT.size:return e.text;case mt.SCRIPT.size:return e.script;case mt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ze({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:jn(t[0]),text:jn(t[1]),script:jn(t[2]),scriptscript:jn(t[3])}},htmlBuilder:(e,t)=>{var n=X4(e,t),a=Pn(n,t,!1);return Ga(a)},mathmlBuilder:(e,t)=>{var n=X4(e,t);return Ai(n,t)}});var J5=(e,t,n,a,s,l,c)=>{e=Ce([],[e]);var d=n&&Pa(n),m,h;if(t){var p=Kt(t,a.havingStyle(s.sup()),a);h={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var b=Kt(n,a.havingStyle(s.sub()),a);m={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var y;if(h&&m){var x=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+e.depth+c;y=Gt({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:De(-l)},{type:"kern",size:m.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:De(l)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(m){var k=e.height-c;y=Gt({positionType:"top",positionData:k,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:De(-l)},{type:"kern",size:m.kern},{type:"elem",elem:e}]})}else if(h){var T=e.depth+c;y=Gt({positionType:"bottom",positionData:T,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:De(l)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var R=[y];if(m&&l!==0&&!d){var C=Ce(["mspace"],[],a);C.style.marginRight=De(l),R.unshift(C)}return Ce(["mop","op-limits"],R,a)},e6=new Set(["\\smallint"]),fl=(e,t)=>{var n,a,s=!1,l;e.type==="supsub"?(n=e.sup,a=e.sub,l=wt(e.base,"op"),s=!0):l=wt(e,"op");var c=t.style,d=!1;c.size===mt.DISPLAY.size&&l.symbol&&!e6.has(l.name)&&(d=!0);var m,h;if(l.symbol){var p=d?"Size2-Regular":"Size1-Regular",b="";if((l.name==="\\oiint"||l.name==="\\oiiint")&&(b=l.name.slice(1),l.name=b==="oiint"?"\\iint":"\\iiint"),m=or(l.name,p,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),h=m.italic,b.length>0){var y=k5(b+"Size"+(d?"2":"1"),t);m=Gt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:y,shift:d?.08:0}]}),l.name="\\"+b,m.classes.unshift("mop"),m.italic=h}}else if(l.body){var x=Pn(l.body,t,!0);x.length===1&&x[0]instanceof Lr?(m=x[0],m.classes[0]="mop"):m=Ce(["mop"],x,t)}else{for(var k=[],T=1;T<l.name.length;T++)k.push(cp(l.name[T],l.mode,t));m=Ce(["mop"],k,t)}var R=0,C=0;if((m instanceof Lr||l.name==="\\oiint"||l.name==="\\oiiint")&&!l.suppressBaseShift){var _;R=(m.height-m.depth)/2-t.fontMetrics().axisHeight,C=(_=m.italic)!=null?_:0}return s?J5(m,n,a,t,c,C,R):(R&&(m.style.position="relative",m.style.top=De(R)),m)},Bo=(e,t)=>{var n;if(e.symbol)n=new Me("mo",[Wr(e.name,e.mode)]),e6.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Me("mo",Br(e.body,t));else{n=new Me("mi",[new Ln(e.name.slice(1))]);var a=new Me("mo",[Wr("","text")]);e.parentIsSupSub?n=new Me("mrow",[n,a]):n=N5([n,a])}return n},XR={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ze({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=a;return s.length===1&&(s=XR[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:fl,mathmlBuilder:Bo});ze({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:jn(a)}},htmlBuilder:fl,mathmlBuilder:Bo});var ZR={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ze({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:fl,mathmlBuilder:Bo});ze({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:fl,mathmlBuilder:Bo});ze({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=ZR[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:fl,mathmlBuilder:Bo});var t6=(e,t)=>{var n,a,s=!1,l;e.type==="supsub"?(n=e.sup,a=e.sub,l=wt(e.base,"operatorname"),s=!0):l=wt(e,"operatorname");var c;if(l.body.length>0){for(var d=l.body.map(b=>{var y="text"in b?b.text:void 0;return typeof y=="string"?{type:"textord",mode:b.mode,text:y}:b}),m=Pn(d,t.withFont("mathrm"),!0),h=0;h<m.length;h++){var p=m[h];p instanceof Lr&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=Ce(["mop"],m,t)}else c=Ce(["mop"],[],t);return s?J5(c,n,a,t,t.style,0,0):c},WR=(e,t)=>{for(var n=Br(e.body,t.withFont("mathrm")),a=!0,s=0;s<n.length;s++){var l=n[s];if(!(l instanceof C5))if(l instanceof Me)switch(l.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=l.children[0];l.children.length===1&&c instanceof Ln?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Ln(d)]}var m=new Me("mi",n);m.setAttribute("mathvariant","normal");var h=new Me("mo",[Wr("","text")]);return e.parentIsSupSub?new Me("mrow",[m,h]):N5([m,h])};ze({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:jn(s),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:t6,mathmlBuilder:WR});z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");us({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Ga(Pn(e.body,t,!1)):Ce(["mord"],Pn(e.body,t,!0),t)},mathmlBuilder(e,t){return Ai(e.body,t,!0)}});ze({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle()),a=al("overline-line",t),s=t.fontMetrics().defaultRuleThickness,l=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:a},{type:"kern",size:s}]});return Ce(["mord","overline"],[l],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Ln("‾")]);n.setAttribute("stretchy","true");var a=new Me("mover",[sn(e.body,t),n]);return a.setAttribute("accent","true"),a}});ze({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:jn(a)}},htmlBuilder:(e,t)=>{var n=Pn(e.body,t.withPhantom(),!1);return Ga(n)},mathmlBuilder:(e,t)=>{var n=Br(e.body,t);return new Me("mphantom",n)}});z("\\hphantom","\\smash{\\phantom{#1}}");ze({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=Ce(["inner"],[Kt(e.body,t.withPhantom())]),a=Ce(["fix"],[]);return Ce(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Br(jn(e.body),t),a=new Me("mphantom",n),s=new Me("mpadded",[a]);return s.setAttribute("width","0px"),s}});ze({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=wt(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:s}},htmlBuilder(e,t){var n=Kt(e.body,t),a=gn(e.dy,t);return Gt({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[sn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});ze({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});ze({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,s=n[0],l=wt(t[0],"size"),c=wt(t[1],"size");return{type:"rule",mode:a.mode,shift:s&&wt(s,"size").value,width:l.value,height:c.value}},htmlBuilder(e,t){var n=Ce(["mord","rule"],[],t),a=gn(e.width,t),s=gn(e.height,t),l=e.shift?gn(e.shift,t):0;return n.style.borderRightWidth=De(a),n.style.borderTopWidth=De(s),n.style.bottom=De(l),n.width=a,n.height=s+l,n.depth=-l,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=gn(e.width,t),a=gn(e.height,t),s=e.shift?gn(e.shift,t):0,l=t.color&&t.getColor()||"black",c=new Me("mspace");c.setAttribute("mathbackground",l),c.setAttribute("width",De(n)),c.setAttribute("height",De(a));var d=new Me("mpadded",[c]);return s>=0?d.setAttribute("height",De(s)):(d.setAttribute("height",De(s)),d.setAttribute("depth",De(-s))),d.setAttribute("voffset",De(s)),d}});function n6(e,t,n){for(var a=Pn(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier,l=0;l<a.length;l++){var c=a[l].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[l].classes,t.sizingClasses(n)):a[l].classes[c+1]==="reset-size"+t.size&&(a[l].classes[c+1]="reset-size"+n.size),a[l].height*=s,a[l].depth*=s}return Ga(a)}var Z4=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],QR=(e,t)=>{var n=t.havingSize(e.size);return n6(e.body,n,t)};ze({type:"sizing",names:Z4,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:s}=e,l=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Z4.indexOf(a)+1,body:l}},htmlBuilder:QR,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Br(e.body,n),s=new Me("mstyle",a);return s.setAttribute("mathsize",De(n.sizeMultiplier)),s}});ze({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,s=!1,l=!1,c=n[0]&&wt(n[0],"ordgroup");if(c)for(var d,m=0;m<c.body.length;++m){var h=c.body[m];if(d=e0(h).text,d==="t")s=!0;else if(d==="b")l=!0;else{s=!1,l=!1;break}}else s=!0,l=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:s,smashDepth:l}},htmlBuilder:(e,t)=>{var n=Ce([],[Kt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Ce(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var s=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return Ce(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[sn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});ze({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,s=n[0],l=t[0];return{type:"sqrt",mode:a.mode,body:l,index:s}},htmlBuilder(e,t){var n=Kt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=il(n,t);var a=t.fontMetrics(),s=a.defaultRuleThickness,l=s;t.style.id<mt.TEXT.id&&(l=t.fontMetrics().xHeight);var c=s+l/4,d=n.height+n.depth+c+s,{span:m,ruleWidth:h,advanceWidth:p}=BR(d,t),b=m.height-h;b>n.height+n.depth+c&&(c=(c+b-n.height-n.depth)/2);var y=m.height-n.height-c-h;n.style.paddingLeft=De(p);var x=Gt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+y)},{type:"elem",elem:m},{type:"kern",size:h}]});if(e.index){var k=t.havingStyle(mt.SCRIPTSCRIPT),T=Kt(e.index,k,t),R=.6*(x.height-x.depth),C=Gt({positionType:"shift",positionData:-R,children:[{type:"elem",elem:T}]}),_=Ce(["root"],[C]);return Ce(["mord","sqrt"],[_,x],t)}else return Ce(["mord","sqrt"],[x],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Me("mroot",[sn(n,t),sn(a,t)]):new Me("msqrt",[sn(n,t)])}});var Th={display:mt.DISPLAY,text:mt.TEXT,script:mt.SCRIPT,scriptscript:mt.SCRIPTSCRIPT};function JR(e){return e in Th}ze({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:s}=e,l=s.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!JR(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:s.mode,style:c,body:l}},htmlBuilder(e,t){var n=Th[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),n6(e.body,a,t)},mathmlBuilder(e,t){var n=Th[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var s=Br(e.body,a),l=new Me("mstyle",s),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return l.setAttribute("scriptlevel",d[0]),l.setAttribute("displaystyle",d[1]),l}});var eA=function(t,n){var a=t.base;if(a)if(a.type==="op"){var s=a.limits&&(n.style.size===mt.DISPLAY.size||a.alwaysHandleSupSub);return s?fl:null}else if(a.type==="operatorname"){var l=a.alwaysHandleSupSub&&(n.style.size===mt.DISPLAY.size||a.limits);return l?t6:null}else{if(a.type==="accent")return Pa(a.base)?mp:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?Q5:null}else return null}else return null};us({type:"supsub",htmlBuilder(e,t){var n=eA(e,t);if(n)return n(e,t);var{base:a,sup:s,sub:l}=e,c=Kt(a,t),d,m,h=t.fontMetrics(),p=0,b=0,y=a&&Pa(a);if(s){var x=t.havingStyle(t.style.sup());d=Kt(s,x,t),y||(p=c.height-x.fontMetrics().supDrop*x.sizeMultiplier/t.sizeMultiplier)}if(l){var k=t.havingStyle(t.style.sub());m=Kt(l,k,t),y||(b=c.depth+k.fontMetrics().subDrop*k.sizeMultiplier/t.sizeMultiplier)}var T;t.style===mt.DISPLAY?T=h.sup1:t.style.cramped?T=h.sup3:T=h.sup2;var R=t.sizeMultiplier,C=De(.5/h.ptPerEm/R),_=null;if(m){var I=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Lr||I){var G;_=De(-((G=c.italic)!=null?G:0))}}var D;if(d&&m){p=Math.max(p,T,d.depth+.25*h.xHeight),b=Math.max(b,h.sub2);var M=h.defaultRuleThickness,B=4*M;if(p-d.depth-(m.height-b)<B){b=B-(p-d.depth)+m.height;var X=.8*h.xHeight-(p-d.depth);X>0&&(p+=X,b-=X)}var $=[{type:"elem",elem:m,shift:b,marginRight:C,marginLeft:_},{type:"elem",elem:d,shift:-p,marginRight:C}];D=Gt({positionType:"individualShift",children:$})}else if(m){b=Math.max(b,h.sub1,m.height-.8*h.xHeight);var j=[{type:"elem",elem:m,marginLeft:_,marginRight:C}];D=Gt({positionType:"shift",positionData:b,children:j})}else if(d)p=Math.max(p,T,d.depth+.25*h.xHeight),D=Gt({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:C}]});else throw new Error("supsub must have either sup or sub.");var F=xh(c,"right")||"mord";return Ce([F],[c,Ce(["msupsub"],[D])],t)},mathmlBuilder(e,t){var n=!1,a,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var l=[sn(e.base,t)];e.sub&&l.push(sn(e.sub,t)),e.sup&&l.push(sn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var h=e.base;h&&h.type==="op"&&h.limits&&t.style===mt.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(t.style===mt.DISPLAY||h.limits)?c="munderover":c="msubsup"}else{var m=e.base;m&&m.type==="op"&&m.limits&&(t.style===mt.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||t.style===mt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===mt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===mt.DISPLAY)?c="mover":c="msup"}return new Me(c,l)}});us({type:"atom",htmlBuilder(e,t){return cp(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Me("mo",[Wr(e.text,e.mode)]);if(e.family==="bin"){var a=fp(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var r6={mi:"italic",mn:"normal",mtext:"normal"};us({type:"mathord",htmlBuilder(e,t){return Wu(e,t,"mathord")},mathmlBuilder(e,t){var n=new Me("mi",[Wr(e.text,e.mode,t)]),a=fp(e,t)||"italic";return a!==r6[n.type]&&n.setAttribute("mathvariant",a),n}});us({type:"textord",htmlBuilder(e,t){return Wu(e,t,"textord")},mathmlBuilder(e,t){var n=Wr(e.text,e.mode,t),a=fp(e,t)||"normal",s;return e.mode==="text"?s=new Me("mtext",[n]):/[0-9]/.test(e.text)?s=new Me("mn",[n]):e.text==="\\prime"?s=new Me("mo",[n]):s=new Me("mi",[n]),a!==r6[s.type]&&s.setAttribute("mathvariant",a),s}});var Jf={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},em={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};us({type:"spacing",htmlBuilder(e,t){if(em.hasOwnProperty(e.text)){var n=em[e.text].className||"";if(e.mode==="text"){var a=Wu(e,t,"textord");return a.classes.push(n),a}else return Ce(["mspace",n],[cp(e.text,e.mode,t)],t)}else{if(Jf.hasOwnProperty(e.text))return Ce(["mspace",Jf[e.text]],[],t);throw new _e('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(em.hasOwnProperty(e.text))n=new Me("mtext",[new Ln(" ")]);else{if(Jf.hasOwnProperty(e.text))return new Me("mspace");throw new _e('Unknown type of space "'+e.text+'"')}return n}});var W4=()=>{var e=new Me("mtd",[]);return e.setAttribute("width","50%"),e};us({type:"tag",mathmlBuilder(e,t){var n=new Me("mtable",[new Me("mtr",[W4(),new Me("mtd",[Ai(e.body,t)]),W4(),new Me("mtd",[Ai(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Q4={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},J4={"\\textbf":"textbf","\\textmd":"textmd"},tA={"\\textit":"textit","\\textup":"textup"},ey=(e,t)=>{var n=e.font;if(n){if(Q4[n])return t.withTextFontFamily(Q4[n]);if(J4[n])return t.withTextFontWeight(J4[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(tA[n])};ze({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"text",mode:n.mode,body:jn(s),font:a}},htmlBuilder(e,t){var n=ey(e,t),a=Pn(e.body,n,!0);return Ce(["mord","text"],a,n)},mathmlBuilder(e,t){var n=ey(e,t);return Ai(e.body,n)}});ze({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),a=al("underline-line",t),s=t.fontMetrics().defaultRuleThickness,l=Gt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:a},{type:"kern",size:3*s},{type:"elem",elem:n}]});return Ce(["mord","underline"],[l],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Ln("‾")]);n.setAttribute("stretchy","true");var a=new Me("munder",[sn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});ze({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Kt(e.body,t),a=t.fontMetrics().axisHeight,s=.5*(n.height-a-(n.depth+a));return Gt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[sn(e.body,t)],["vcenter"]);return new Me("mrow",[n])}});ze({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new _e("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ty(e),a=[],s=t.havingStyle(t.style.text()),l=0;l<n.length;l++){var c=n[l];c==="~"&&(c="\\textasciitilde"),a.push(or(c,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return Ce(["mord","text"].concat(s.sizingClasses(t)),x5(a),s)},mathmlBuilder(e,t){var n=new Ln(ty(e)),a=new Me("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var ty=e=>e.body.replace(/ /g,e.star?"␣":" "),Ei=E5,a6=`[ \r
|
|
295
|
+
]`,nA="\\\\[a-zA-Z@]+",rA="\\\\[^\uD800-\uDFFF]",aA="("+nA+")"+a6+"*",iA=`\\\\(
|
|
296
|
+
|[ \r ]+
|
|
297
|
+
?)[ \r ]*`,Nh="[̀-ͯ]",sA=new RegExp(Nh+"+$"),lA="("+a6+"+)|"+(iA+"|")+"([!-\\[\\]-‧-豈-]"+(Nh+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Nh+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+aA)+("|"+rA+")");class ny{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(lA,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new jr("EOF",new wr(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new _e("Unexpected character: '"+t[n]+"'",new jr(t[n],new wr(this,n,n+1)));var s=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[s]===14){var l=t.indexOf(`
|
|
298
|
+
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new jr(s,new wr(this,n,this.tokenRegex.lastIndex))}}class oA{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _e("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(t)&&(l[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var cA=V5;z("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});z("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});z("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});z("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});z("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});z("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");z("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ry={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};z("\\char",function(e){var t=e.popToken(),n,a=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new _e("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=ry[t.text],a==null||a>=n)throw new _e("Invalid base-"+n+" digit "+t.text);for(var s;(s=ry[e.future().text])!=null&&s<n;)a*=n,a+=s,e.popToken()}return"\\@char{"+a+"}"});var bp=(e,t,n,a)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new _e("\\newcommand's first argument must be a macro name");var l=s[0].text,c=e.isDefined(l);if(c&&!t)throw new _e("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!c&&!n)throw new _e("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var d=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var m="",h=e.expandNextToken();h.text!=="]"&&h.text!=="EOF";)m+=h.text,h=e.expandNextToken();if(!m.match(/^\s*[0-9]+\s*$/))throw new _e("Invalid number of arguments: "+m);d=parseInt(m),s=e.consumeArg().tokens}return c&&a||e.macros.set(l,{tokens:s,numArgs:d}),""};z("\\newcommand",e=>bp(e,!1,!0,!1));z("\\renewcommand",e=>bp(e,!0,!1,!1));z("\\providecommand",e=>bp(e,!0,!0,!0));z("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});z("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});z("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Ei[n],fn.math[n],fn.text[n]),""});z("\\bgroup","{");z("\\egroup","}");z("~","\\nobreakspace");z("\\lq","`");z("\\rq","'");z("\\aa","\\r a");z("\\AA","\\r A");z("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");z("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");z("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");z("ℬ","\\mathscr{B}");z("ℰ","\\mathscr{E}");z("ℱ","\\mathscr{F}");z("ℋ","\\mathscr{H}");z("ℐ","\\mathscr{I}");z("ℒ","\\mathscr{L}");z("ℳ","\\mathscr{M}");z("ℛ","\\mathscr{R}");z("ℭ","\\mathfrak{C}");z("ℌ","\\mathfrak{H}");z("ℨ","\\mathfrak{Z}");z("\\Bbbk","\\Bbb{k}");z("\\llap","\\mathllap{\\textrm{#1}}");z("\\rlap","\\mathrlap{\\textrm{#1}}");z("\\clap","\\mathclap{\\textrm{#1}}");z("\\mathstrut","\\vphantom{(}");z("\\underbar","\\underline{\\text{#1}}");z("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');z("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");z("\\ne","\\neq");z("≠","\\neq");z("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");z("∉","\\notin");z("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");z("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");z("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");z("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");z("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");z("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");z("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");z("⟂","\\perp");z("‼","\\mathclose{!\\mkern-0.8mu!}");z("∌","\\notni");z("⌜","\\ulcorner");z("⌝","\\urcorner");z("⌞","\\llcorner");z("⌟","\\lrcorner");z("©","\\copyright");z("®","\\textregistered");z("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');z("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');z("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');z("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');z("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");z("⋮","\\vdots");z("\\varGamma","\\mathit{\\Gamma}");z("\\varDelta","\\mathit{\\Delta}");z("\\varTheta","\\mathit{\\Theta}");z("\\varLambda","\\mathit{\\Lambda}");z("\\varXi","\\mathit{\\Xi}");z("\\varPi","\\mathit{\\Pi}");z("\\varSigma","\\mathit{\\Sigma}");z("\\varUpsilon","\\mathit{\\Upsilon}");z("\\varPhi","\\mathit{\\Phi}");z("\\varPsi","\\mathit{\\Psi}");z("\\varOmega","\\mathit{\\Omega}");z("\\substack","\\begin{subarray}{c}#1\\end{subarray}");z("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");z("\\boxed","\\fbox{$\\displaystyle{#1}$}");z("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");z("\\implies","\\DOTSB\\;\\Longrightarrow\\;");z("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");z("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");z("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var ay={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},uA=new Set(["bin","rel"]);z("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in ay?t=ay[n]:(n.slice(0,4)==="\\not"||n in fn.math&&uA.has(fn.math[n].group))&&(t="\\dotsb"),t});var vp={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};z("\\dotso",function(e){var t=e.future().text;return t in vp?"\\ldots\\,":"\\ldots"});z("\\dotsc",function(e){var t=e.future().text;return t in vp&&t!==","?"\\ldots\\,":"\\ldots"});z("\\cdots",function(e){var t=e.future().text;return t in vp?"\\@cdots\\,":"\\@cdots"});z("\\dotsb","\\cdots");z("\\dotsm","\\cdots");z("\\dotsi","\\!\\cdots");z("\\dotsx","\\ldots\\,");z("\\DOTSI","\\relax");z("\\DOTSB","\\relax");z("\\DOTSX","\\relax");z("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");z("\\,","\\tmspace+{3mu}{.1667em}");z("\\thinspace","\\,");z("\\>","\\mskip{4mu}");z("\\:","\\tmspace+{4mu}{.2222em}");z("\\medspace","\\:");z("\\;","\\tmspace+{5mu}{.2777em}");z("\\thickspace","\\;");z("\\!","\\tmspace-{3mu}{.1667em}");z("\\negthinspace","\\!");z("\\negmedspace","\\tmspace-{4mu}{.2222em}");z("\\negthickspace","\\tmspace-{5mu}{.277em}");z("\\enspace","\\kern.5em ");z("\\enskip","\\hskip.5em\\relax");z("\\quad","\\hskip1em\\relax");z("\\qquad","\\hskip2em\\relax");z("\\tag","\\@ifstar\\tag@literal\\tag@paren");z("\\tag@paren","\\tag@literal{({#1})}");z("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new _e("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});z("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");z("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");z("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");z("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");z("\\newline","\\\\\\relax");z("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var i6=De(da["Main-Regular"][84][1]-.7*da["Main-Regular"][65][1]);z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+i6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+i6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");z("\\hspace","\\@ifstar\\@hspacer\\@hspace");z("\\@hspace","\\hskip #1\\relax");z("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");z("\\ordinarycolon",":");z("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");z("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');z("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');z("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');z("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');z("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');z("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');z("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');z("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');z("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');z("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');z("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');z("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');z("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');z("∷","\\dblcolon");z("∹","\\eqcolon");z("≔","\\coloneqq");z("≕","\\eqqcolon");z("⩴","\\Coloneqq");z("\\ratio","\\vcentcolon");z("\\coloncolon","\\dblcolon");z("\\colonequals","\\coloneqq");z("\\coloncolonequals","\\Coloneqq");z("\\equalscolon","\\eqqcolon");z("\\equalscoloncolon","\\Eqqcolon");z("\\colonminus","\\coloneq");z("\\coloncolonminus","\\Coloneq");z("\\minuscolon","\\eqcolon");z("\\minuscoloncolon","\\Eqcolon");z("\\coloncolonapprox","\\Colonapprox");z("\\coloncolonsim","\\Colonsim");z("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");z("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");z("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");z("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");z("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");z("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");z("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");z("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");z("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");z("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");z("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");z("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");z("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");z("\\nleqq","\\html@mathml{\\@nleqq}{≰}");z("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");z("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");z("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");z("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");z("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");z("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");z("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");z("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");z("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");z("\\imath","\\html@mathml{\\@imath}{ı}");z("\\jmath","\\html@mathml{\\@jmath}{ȷ}");z("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");z("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");z("⟦","\\llbracket");z("⟧","\\rrbracket");z("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");z("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");z("⦃","\\lBrace");z("⦄","\\rBrace");z("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");z("⦵","\\minuso");z("\\darr","\\downarrow");z("\\dArr","\\Downarrow");z("\\Darr","\\Downarrow");z("\\lang","\\langle");z("\\rang","\\rangle");z("\\uarr","\\uparrow");z("\\uArr","\\Uparrow");z("\\Uarr","\\Uparrow");z("\\N","\\mathbb{N}");z("\\R","\\mathbb{R}");z("\\Z","\\mathbb{Z}");z("\\alef","\\aleph");z("\\alefsym","\\aleph");z("\\Alpha","\\mathrm{A}");z("\\Beta","\\mathrm{B}");z("\\bull","\\bullet");z("\\Chi","\\mathrm{X}");z("\\clubs","\\clubsuit");z("\\cnums","\\mathbb{C}");z("\\Complex","\\mathbb{C}");z("\\Dagger","\\ddagger");z("\\diamonds","\\diamondsuit");z("\\empty","\\emptyset");z("\\Epsilon","\\mathrm{E}");z("\\Eta","\\mathrm{H}");z("\\exist","\\exists");z("\\harr","\\leftrightarrow");z("\\hArr","\\Leftrightarrow");z("\\Harr","\\Leftrightarrow");z("\\hearts","\\heartsuit");z("\\image","\\Im");z("\\infin","\\infty");z("\\Iota","\\mathrm{I}");z("\\isin","\\in");z("\\Kappa","\\mathrm{K}");z("\\larr","\\leftarrow");z("\\lArr","\\Leftarrow");z("\\Larr","\\Leftarrow");z("\\lrarr","\\leftrightarrow");z("\\lrArr","\\Leftrightarrow");z("\\Lrarr","\\Leftrightarrow");z("\\Mu","\\mathrm{M}");z("\\natnums","\\mathbb{N}");z("\\Nu","\\mathrm{N}");z("\\Omicron","\\mathrm{O}");z("\\plusmn","\\pm");z("\\rarr","\\rightarrow");z("\\rArr","\\Rightarrow");z("\\Rarr","\\Rightarrow");z("\\real","\\Re");z("\\reals","\\mathbb{R}");z("\\Reals","\\mathbb{R}");z("\\Rho","\\mathrm{P}");z("\\sdot","\\cdot");z("\\sect","\\S");z("\\spades","\\spadesuit");z("\\sub","\\subset");z("\\sube","\\subseteq");z("\\supe","\\supseteq");z("\\Tau","\\mathrm{T}");z("\\thetasym","\\vartheta");z("\\weierp","\\wp");z("\\Zeta","\\mathrm{Z}");z("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");z("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");z("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");z("\\bra","\\mathinner{\\langle{#1}|}");z("\\ket","\\mathinner{|{#1}\\rangle}");z("\\braket","\\mathinner{\\langle{#1}\\rangle}");z("\\Bra","\\left\\langle#1\\right|");z("\\Ket","\\left|#1\\right\\rangle");var s6=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.consumeArg().tokens,l=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var m=b=>y=>{e&&(y.macros.set("|",c),s.length&&y.macros.set("\\|",d));var x=b;if(!b&&s.length){var k=y.future();k.text==="|"&&(y.popToken(),x=!0)}return{tokens:x?s:a,numArgs:0}};t.macros.set("|",m(!1)),s.length&&t.macros.set("\\|",m(!0));var h=t.consumeArg().tokens,p=t.expandTokens([...l,...h,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};z("\\bra@ket",s6(!1));z("\\bra@set",s6(!0));z("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");z("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");z("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");z("\\angln","{\\angl n}");z("\\blue","\\textcolor{##6495ed}{#1}");z("\\orange","\\textcolor{##ffa500}{#1}");z("\\pink","\\textcolor{##ff00af}{#1}");z("\\red","\\textcolor{##df0030}{#1}");z("\\green","\\textcolor{##28ae7b}{#1}");z("\\gray","\\textcolor{gray}{#1}");z("\\purple","\\textcolor{##9d38bd}{#1}");z("\\blueA","\\textcolor{##ccfaff}{#1}");z("\\blueB","\\textcolor{##80f6ff}{#1}");z("\\blueC","\\textcolor{##63d9ea}{#1}");z("\\blueD","\\textcolor{##11accd}{#1}");z("\\blueE","\\textcolor{##0c7f99}{#1}");z("\\tealA","\\textcolor{##94fff5}{#1}");z("\\tealB","\\textcolor{##26edd5}{#1}");z("\\tealC","\\textcolor{##01d1c1}{#1}");z("\\tealD","\\textcolor{##01a995}{#1}");z("\\tealE","\\textcolor{##208170}{#1}");z("\\greenA","\\textcolor{##b6ffb0}{#1}");z("\\greenB","\\textcolor{##8af281}{#1}");z("\\greenC","\\textcolor{##74cf70}{#1}");z("\\greenD","\\textcolor{##1fab54}{#1}");z("\\greenE","\\textcolor{##0d923f}{#1}");z("\\goldA","\\textcolor{##ffd0a9}{#1}");z("\\goldB","\\textcolor{##ffbb71}{#1}");z("\\goldC","\\textcolor{##ff9c39}{#1}");z("\\goldD","\\textcolor{##e07d10}{#1}");z("\\goldE","\\textcolor{##a75a05}{#1}");z("\\redA","\\textcolor{##fca9a9}{#1}");z("\\redB","\\textcolor{##ff8482}{#1}");z("\\redC","\\textcolor{##f9685d}{#1}");z("\\redD","\\textcolor{##e84d39}{#1}");z("\\redE","\\textcolor{##bc2612}{#1}");z("\\maroonA","\\textcolor{##ffbde0}{#1}");z("\\maroonB","\\textcolor{##ff92c6}{#1}");z("\\maroonC","\\textcolor{##ed5fa6}{#1}");z("\\maroonD","\\textcolor{##ca337c}{#1}");z("\\maroonE","\\textcolor{##9e034e}{#1}");z("\\purpleA","\\textcolor{##ddd7ff}{#1}");z("\\purpleB","\\textcolor{##c6b9fc}{#1}");z("\\purpleC","\\textcolor{##aa87ff}{#1}");z("\\purpleD","\\textcolor{##7854ab}{#1}");z("\\purpleE","\\textcolor{##543b78}{#1}");z("\\mintA","\\textcolor{##f5f9e8}{#1}");z("\\mintB","\\textcolor{##edf2df}{#1}");z("\\mintC","\\textcolor{##e0e5cc}{#1}");z("\\grayA","\\textcolor{##f6f7f7}{#1}");z("\\grayB","\\textcolor{##f0f1f2}{#1}");z("\\grayC","\\textcolor{##e3e5e6}{#1}");z("\\grayD","\\textcolor{##d6d8da}{#1}");z("\\grayE","\\textcolor{##babec2}{#1}");z("\\grayF","\\textcolor{##888d93}{#1}");z("\\grayG","\\textcolor{##626569}{#1}");z("\\grayH","\\textcolor{##3b3e40}{#1}");z("\\grayI","\\textcolor{##21242c}{#1}");z("\\kaBlue","\\textcolor{##314453}{#1}");z("\\kaGreen","\\textcolor{##71B307}{#1}");var l6={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class dA{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new oA(cA,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new ny(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:a}=this.consumeArg(["]"])}else({tokens:s,start:n,end:a}=this.consumeArg());return this.pushToken(new jr("EOF",a.loc)),this.pushTokens(s),new jr("",wr.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var s=this.future(),l,c=0,d=0;do{if(l=this.popToken(),n.push(l),l.text==="{")++c;else if(l.text==="}"){if(--c,c===-1)throw new _e("Extra }",l)}else if(l.text==="EOF")throw new _e("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",l);if(t&&a)if((c===0||c===1&&t[d]==="{")&&l.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:l}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new _e("The length of delimiters doesn't match the number of args!");for(var a=n[0],s=0;s<a.length;s++){var l=this.popToken();if(a[s]!==l.text)throw new _e("Use of the macro doesn't match its definition",l)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new _e("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,s=n.noexpand?null:this._getExpansion(a);if(s==null||t&&s.unexpandable){if(t&&s==null&&a[0]==="\\"&&!this.isDefined(a))throw new _e("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var l=s.tokens,c=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){l=l.slice();for(var d=l.length-1;d>=0;--d){var m=l[d];if(m.text==="#"){if(d===0)throw new _e("Incomplete placeholder at end of macro body",m);if(m=l[--d],m.text==="#")l.splice(d+1,1);else if(/^[1-9]$/.test(m.text))l.splice(d,2,...c[+m.text-1]);else throw new _e("Not a valid argument number",m)}}}return this.pushTokens(l),l.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new jr(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var l=0;if(s.includes("#"))for(var c=s.replace(/##/g,"");c.includes("#"+(l+1));)++l;for(var d=new ny(s,this.settings),m=[],h=d.lex();h.text!=="EOF";)m.push(h),h=d.lex();m.reverse();var p={tokens:m,numArgs:l};return p}return s}isDefined(t){return this.macros.has(t)||Ei.hasOwnProperty(t)||fn.math.hasOwnProperty(t)||fn.text.hasOwnProperty(t)||l6.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Ei.hasOwnProperty(t)&&!Ei[t].primitive}}var iy=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,mu=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),tm={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},sy={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class l0{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new dA(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new _e("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new jr("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(l0.endOfExpression.has(s.text)||n&&s.text===n||t&&Ei[s.text]&&Ei[s.text].infix)break;var l=this.parseAtom(n);if(l){if(l.type==="internal")continue}else break;a.push(l)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,s=0;s<t.length;s++){var l=t[s];if(l.type==="infix"){if(n!==-1)throw new _e("only one infix operator per group",l.token);n=s,a=l.replaceWith}}if(n!==-1&&a){var c,d,m=t.slice(0,n),h=t.slice(n+1);m.length===1&&m[0].type==="ordgroup"?c=m[0]:c={type:"ordgroup",mode:this.mode,body:m},h.length===1&&h[0].type==="ordgroup"?d=h[0]:d={type:"ordgroup",mode:this.mode,body:h};var p;return a==="\\\\abovefrac"?p=this.callFunction(a,[c,t[n],d],[]):p=this.callFunction(a,[c,d],[]),[p]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var s;do{var l;s=this.parseGroup(t)}while(((l=s)==null?void 0:l.type)==="internal");if(!s)throw new _e("Expected group after '"+a+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var s={type:"text",mode:this.mode,body:n},l={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return l}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,s;;){this.consumeSpaces();var l=this.fetch();if(l.text==="\\limits"||l.text==="\\nolimits"){if(n&&n.type==="op"){var c=l.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=l.text==="\\limits");else throw new _e("Limit controls must follow a math operator",l);this.consume()}else if(l.text==="^"){if(a)throw new _e("Double superscript",l);a=this.handleSupSubscript("superscript")}else if(l.text==="_"){if(s)throw new _e("Double subscript",l);s=this.handleSupSubscript("subscript")}else if(l.text==="'"){if(a)throw new _e("Double superscript",l);var d={type:"textord",mode:this.mode,text:"\\prime"},m=[d];for(this.consume();this.fetch().text==="'";)m.push(d),this.consume();this.fetch().text==="^"&&m.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:m}}else if(mu[l.text]){var h=iy.test(l.text),p=[];for(p.push(new jr(mu[l.text])),this.consume();;){var b=this.fetch().text;if(!mu[b]||iy.test(b)!==h)break;p.unshift(new jr(mu[b])),this.consume()}var y=this.subparse(p);h?s={type:"ordgroup",mode:"math",body:y}:a={type:"ordgroup",mode:"math",body:y}}else break}return a||s?{type:"supsub",mode:this.mode,base:n,sup:a,sub:s}:n}parseFunction(t,n){var a=this.fetch(),s=a.text,l=Ei[s];if(!l)return null;if(this.consume(),n&&n!=="atom"&&!l.allowedInArgument)throw new _e("Got function '"+s+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!l.allowedInText)throw new _e("Can't use function '"+s+"' in text mode",a);if(this.mode==="math"&&l.allowedInMath===!1)throw new _e("Can't use function '"+s+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(s,l);return this.callFunction(s,c,d,a,t)}callFunction(t,n,a,s,l){var c={funcName:t,parser:this,token:s,breakOnTokenText:l},d=Ei[t];if(d&&d.handler)return d.handler(c,n,a);throw new _e("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var s=[],l=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],m=c<n.numOptionalArgs;("primitive"in n&&n.primitive&&d==null||n.type==="sqrt"&&c===1&&l[0]==null)&&(d="primitive");var h=this.parseGroupOfType("argument to '"+t+"'",d,m);if(m)l.push(h);else if(h!=null)s.push(h);else throw new _e("Null argument, please report this as a bug")}return{args:s,optArgs:l}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var s=this.parseArgumentGroup(a,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var l=this.parseStringGroup("raw",a);return l!=null?{type:"raw",mode:"text",string:l.text}:null}case"primitive":{if(a)throw new _e("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new _e("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new _e("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var s="",l;(l=this.fetch()).text!=="EOF";)s+=l.text,this.consume();return this.consume(),a.text=s,a}parseRegexGroup(t,n){for(var a=this.fetch(),s=a,l="",c;(c=this.fetch()).text!=="EOF"&&t.test(l+c.text);)s=c,l+=s.text,this.consume();if(l==="")throw new _e("Invalid "+n+": '"+a.text+"'",a);return a.range(s,l)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new _e("Invalid color: '"+n.text+"'",n);var s=a[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new _e("Invalid size: '"+n.text+"'",n);var l={number:+(s[1]+s[2]),unit:s[3]};if(!h5(l))throw new _e("Invalid unit: '"+l.unit+"'",n);return{type:"size",mode:this.mode,value:l,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var l=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:l};return n&&this.switchMode(s),c}parseGroup(t,n){var a=this.fetch(),s=a.text,l;if(s==="{"||s==="\\begingroup"){this.consume();var c=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),m=this.fetch();this.expect(c),this.gullet.endGroup(),l={type:"ordgroup",mode:this.mode,loc:wr.range(a,m),body:d,semisimple:s==="\\begingroup"||void 0}}else if(l=this.parseFunction(n,t)||this.parseSymbol(),l==null&&s[0]==="\\"&&!l6.hasOwnProperty(s)){if(this.settings.throwOnError)throw new _e("Undefined control sequence: "+s,a);l=this.formatUnsupportedCmd(s),this.consume()}return l}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var s=t[a];if(s.type==="textord"){var l=s.text,c=t[a+1];if(!(!c||c.type!=="textord")){if(l==="-"&&c.text==="-"){var d=t[a+2];a+1<n&&d&&d.type==="textord"&&d.text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:wr.range(s,d),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:wr.range(s,c),text:"--"}),n-=1)}(l==="'"||l==="`")&&c.text===l&&(t.splice(a,2,{type:"textord",mode:"text",loc:wr.range(s,c),text:l+l}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),s=a.charAt(0)==="*";if(s&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new _e(`\\verb assertion failed --
|
|
299
|
+
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:s}}sy.hasOwnProperty(n[0])&&!fn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=sy[n[0]]+n.slice(1));var l=sA.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(fn[this.mode][n]){this.settings.strict&&this.mode==="math"&&fh.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=fn[this.mode][n].group,m=wr.range(t),h;CR(d)?h={type:"atom",mode:this.mode,family:d,loc:m,text:n}:h={type:d,mode:this.mode,loc:m,text:n},c=h}else if(n.charCodeAt(0)>=128)this.settings.strict&&(m5(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:wr.range(t),text:n};else return null;if(this.consume(),l)for(var p=0;p<l[0].length;p++){var b=l[0][p];if(!tm[b])throw new _e("Unknown accent ' "+b+"'",t);var y=tm[b][this.mode]||tm[b].text;if(!y)throw new _e("Accent "+b+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:wr.range(t),label:y,isStretchy:!1,isShifty:!0,base:c}}return c}}l0.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var yp=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new l0(t,n);delete a.gullet.macros.current["\\df@tag"];var s=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new _e("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:a.subparse([new jr("\\df@tag")])}]}return s},xp=function(t,n,a){n.textContent="";var s=o0(t,a).toNode();n.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),xp=function(){throw new _e("KaTeX doesn't work in quirks mode.")});var o6=function(t,n){var a=o0(t,n).toMarkup();return a},c6=function(t,n){var a=new ip(n);return yp(t,a)},u6=function(t,n,a){if(a.throwOnError||!(t instanceof _e))throw t;var s=Ce(["katex-error"],[new Lr(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+a.errorColor),s},o0=function(t,n){var a=new ip(n);try{var s=yp(t,a);return yR(s,t,a)}catch(l){return u6(l,t,a)}},d6=function(t,n){var a=new ip(n);try{var s=yp(t,a);return xR(s,t,a)}catch(l){return u6(l,t,a)}},f6="0.16.47",m6={Span:ul,Anchor:Xu,SymbolNode:Lr,SvgNode:Ha,PathNode:Ci,LineNode:dh},Ch={version:f6,render:xp,renderToString:o6,ParseError:_e,SETTINGS_SCHEMA:Ru,__parse:c6,__renderToDomTree:o0,__renderToHTMLTree:d6,__setFontMetrics:v5,__defineSymbol:w,__defineFunction:ze,__defineMacro:z,__domTree:m6};const Rj=Object.freeze(Object.defineProperty({__proto__:null,ParseError:_e,SETTINGS_SCHEMA:Ru,__defineFunction:ze,__defineMacro:z,__defineSymbol:w,__domTree:m6,__parse:c6,__renderToDomTree:o0,__renderToHTMLTree:d6,__setFontMetrics:v5,default:Ch,get render(){return xp},renderToString:o6,version:f6},Symbol.toStringTag,{value:"Module"})),fA={};function mA(e){const t=this,n=e||fA,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),l=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(xC(n)),l.push(fC()),c.push(mC(n))}const ly=/[#.]/g;function hA(e,t){const n=e||"",a={};let s=0,l,c;for(;s<n.length;){ly.lastIndex=s;const d=ly.exec(n),m=n.slice(s,d?d.index:n.length);m&&(l?l==="#"?a.id=m:Array.isArray(a.className)?a.className.push(m):a.className=[m]:c=m,s+=m.length),d&&(l=d[0],s++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function h6(e,t,n){const a=n?vA(n):void 0;function s(l,c,...d){let m;if(l==null){m={type:"root",children:[]};const h=c;d.unshift(h)}else{m=hA(l,t);const h=m.tagName.toLowerCase(),p=a?a.get(h):void 0;if(m.tagName=p||h,pA(c))d.unshift(c);else for(const[b,y]of Object.entries(c))gA(e,m.properties,b,y)}for(const h of d)Rh(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return s}function pA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const l=s;for(const c of l)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function gA(e,t,n,a){const s=f3(e,n);let l;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;l=a}else typeof a=="boolean"?l=a:typeof a=="string"?s.spaceSeparated?l=Lv(a):s.commaSeparated?l=Iv(a):s.commaOrSpaceSeparated?l=Lv(Iv(a).join(" ")):l=oy(s,s.property,a):Array.isArray(a)?l=[...a]:l=s.property==="style"?bA(a):String(a);if(Array.isArray(l)){const c=[];for(const d of l)c.push(oy(s,s.property,d));l=c}s.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[s.property]=l}}function Rh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Rh(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Rh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function oy(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Eo(n)===Eo(t)))return!0}return n}function bA(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function vA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const yA=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],xA=h6(m3,"div"),wA=h6($u,"g",yA),nm={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function SA(e,t){return p6(e,{})||{type:"root",children:[]}}function p6(e,t){const n=kA(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function kA(e,t){switch(e.nodeType){case 1:return CA(e,t);case 3:return TA(e);case 8:return NA(e);case 9:return cy(e,t);case 10:return EA();case 11:return cy(e,t);default:return}}function cy(e,t){return{type:"root",children:g6(e,t)}}function EA(){return{type:"doctype"}}function TA(e){return{type:"text",value:e.nodeValue||""}}function NA(e){return{type:"comment",value:e.nodeValue||""}}function CA(e,t){const n=e.namespaceURI,a=n===nm.svg?wA:xA,s=n===nm.html?e.tagName.toLowerCase():e.tagName,l=n===nm.html&&s==="template"?e.content:e,c=e.getAttributeNames(),d={};let m=-1;for(;++m<c.length;)d[c[m]]=e.getAttribute(c[m])||"";return a(s,d,g6(l,t))}function g6(e,t){const n=e.childNodes,a=[];let s=-1;for(;++s<n.length;){const l=p6(n[s],t);l!==void 0&&a.push(l)}return a}new DOMParser;function RA(e,t){const n=AA(e);return SA(n)}function AA(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const uy=(function(e,t,n){const a=jo(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),ds=(function(e){if(e==null)return MA;if(typeof e=="string")return IA(e);if(typeof e=="object")return _A(e);if(typeof e=="function")return wp(e);throw new Error("Expected function, string, or array as `test`")});function _A(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ds(e[n]);return wp(a);function a(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function IA(e){return wp(t);function t(n){return n.tagName===e}}function wp(e){return t;function t(n,a,s){return!!(OA(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function MA(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function OA(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const dy=/\n/g,fy=/[\t ]+/g,Ah=ds("br"),my=ds(HA),DA=ds("p"),hy=ds("tr"),jA=ds(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",qA,FA]),b6=ds(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function LA(e,t){const n=t||{},a="children"in e?e.children:[],s=b6(e),l=x6(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...y6(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...v6(a[d],e,{whitespace:l,breakBefore:d?void 0:s,breakAfter:d<a.length-1?Ah(a[d+1]):s}));const m=[];let h;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?h!==void 0&&p>h&&(h=p):p&&(h!==void 0&&h>-1&&m.push(`
|
|
300
|
+
`.repeat(h)||" "),h=-1,m.push(p))}return m.join("")}function v6(e,t,n){return e.type==="element"?zA(e,t,n):e.type==="text"?n.whitespace==="normal"?y6(e,n):BA(e):[]}function zA(e,t,n){const a=x6(e,n),s=e.children||[];let l=-1,c=[];if(jA(e))return c;let d,m;for(Ah(e)||hy(e)&&uy(t,e,hy)?m=`
|
|
301
|
+
`:DA(e)?(d=2,m=2):b6(e)&&(d=1,m=1);++l<s.length;)c=c.concat(v6(s[l],e,{whitespace:a,breakBefore:l?void 0:d,breakAfter:l<s.length-1?Ah(s[l+1]):m}));return my(e)&&uy(t,e,my)&&c.push(" "),d&&c.unshift(d),m&&c.push(m),c}function y6(e,t){const n=String(e.value),a=[],s=[];let l=0;for(;l<=n.length;){dy.lastIndex=l;const m=dy.exec(n),h=m&&"index"in m?m.index:n.length;a.push(UA(n.slice(l,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),l=h+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(s.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&s.push(d),s.push(a[c]),d=0):(c===0||c===a.length-1)&&s.push(0);return s}function BA(e){return[String(e.value)]}function UA(e,t,n){const a=[];let s=0,l;for(;s<e.length;){fy.lastIndex=s;const c=fy.exec(e);l=c?c.index:e.length,!s&&!l&&c&&!t&&a.push(""),s!==l&&a.push(e.slice(s,l)),s=c?l+c[0].length:l}return s!==l&&!n&&a.push(""),a.join(" ")}function x6(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function qA(e){return!!(e.properties||{}).hidden}function HA(e){return e.tagName==="td"||e.tagName==="th"}function FA(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const PA={},$A=[];function GA(e){const t=e||PA;return function(n,a){Jh(n,"element",function(s,l){const c=Array.isArray(s.properties.className)?s.properties.className:$A,d=c.includes("language-math"),m=c.includes("math-display"),h=c.includes("math-inline");let p=m;if(!d&&!m&&!h)return;let b=l[l.length-1],y=s;if(s.tagName==="code"&&d&&b&&b.type==="element"&&b.tagName==="pre"&&(y=b,b=l[l.length-2],p=!0),!b)return;const x=LA(y,{whitespace:"pre"});let k;try{k=Ch.renderToString(x,{...t,displayMode:p,throwOnError:!0})}catch(R){const C=R,_=C.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...l,s],cause:C,place:s.position,ruleId:_,source:"rehype-katex"});try{k=Ch.renderToString(x,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{k=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(R)},children:[{type:"text",value:x}]}]}}typeof k=="string"&&(k=RA(k).children);const T=b.children.indexOf(y);return b.children.splice(T,1,...k),H3})}}var rm,py;function KA(){if(py)return rm;py=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(xe=>{const je=Q[xe],Xe=typeof je;(Xe==="object"||Xe==="function")&&!Object.isFrozen(je)&&e(je)}),Q}class t{constructor(xe){xe.data===void 0&&(xe.data={}),this.data=xe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(Q,...xe){const je=Object.create(null);for(const Xe in Q)je[Xe]=Q[Xe];return xe.forEach(function(Xe){for(const ht in Xe)je[ht]=Xe[ht]}),je}const s="</span>",l=Q=>!!Q.scope,c=(Q,{prefix:xe})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const je=Q.split(".");return[`${xe}${je.shift()}`,...je.map((Xe,ht)=>`${Xe}${"_".repeat(ht+1)}`)].join(" ")}return`${xe}${Q}`};class d{constructor(xe,je){this.buffer="",this.classPrefix=je.classPrefix,xe.walk(this)}addText(xe){this.buffer+=n(xe)}openNode(xe){if(!l(xe))return;const je=c(xe.scope,{prefix:this.classPrefix});this.span(je)}closeNode(xe){l(xe)&&(this.buffer+=s)}value(){return this.buffer}span(xe){this.buffer+=`<span class="${xe}">`}}const m=(Q={})=>{const xe={children:[]};return Object.assign(xe,Q),xe};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(xe){this.top.children.push(xe)}openNode(xe){const je=m({scope:xe});this.add(je),this.stack.push(je)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(xe){return this.constructor._walk(xe,this.rootNode)}static _walk(xe,je){return typeof je=="string"?xe.addText(je):je.children&&(xe.openNode(je),je.children.forEach(Xe=>this._walk(xe,Xe)),xe.closeNode(je)),xe}static _collapse(xe){typeof xe!="string"&&xe.children&&(xe.children.every(je=>typeof je=="string")?xe.children=[xe.children.join("")]:xe.children.forEach(je=>{h._collapse(je)}))}}class p extends h{constructor(xe){super(),this.options=xe}addText(xe){xe!==""&&this.add(xe)}startScope(xe){this.openNode(xe)}endScope(){this.closeNode()}__addSublanguage(xe,je){const Xe=xe.root;je&&(Xe.scope=`language:${je}`),this.add(Xe)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(Q){return Q?typeof Q=="string"?Q:Q.source:null}function y(Q){return T("(?=",Q,")")}function x(Q){return T("(?:",Q,")*")}function k(Q){return T("(?:",Q,")?")}function T(...Q){return Q.map(je=>b(je)).join("")}function R(Q){const xe=Q[Q.length-1];return typeof xe=="object"&&xe.constructor===Object?(Q.splice(Q.length-1,1),xe):{}}function C(...Q){return"("+(R(Q).capture?"":"?:")+Q.map(Xe=>b(Xe)).join("|")+")"}function _(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function I(Q,xe){const je=Q&&Q.exec(xe);return je&&je.index===0}const G=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function D(Q,{joinWith:xe}){let je=0;return Q.map(Xe=>{je+=1;const ht=je;let kt=b(Xe),ie="";for(;kt.length>0;){const Se=G.exec(kt);if(!Se){ie+=kt;break}ie+=kt.substring(0,Se.index),kt=kt.substring(Se.index+Se[0].length),Se[0][0]==="\\"&&Se[1]?ie+="\\"+String(Number(Se[1])+ht):(ie+=Se[0],Se[0]==="("&&je++)}return ie}).map(Xe=>`(${Xe})`).join(xe)}const M=/\b\B/,B="[a-zA-Z]\\w*",X="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",H="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ne=(Q={})=>{const xe=/^#![ ]*\//;return Q.binary&&(Q.begin=T(xe,/.*\b/,Q.binary,/\b.*/)),a({scope:"meta",begin:xe,end:/$/,relevance:0,"on:begin":(je,Xe)=>{je.index!==0&&Xe.ignoreMatch()}},Q)},V={begin:"\\\\[\\s\\S]",relevance:0},Y={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[V]},K={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[V]},re={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ue=function(Q,xe,je={}){const Xe=a({scope:"comment",begin:Q,end:xe,contains:[]},je);Xe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=C("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Xe.contains.push({begin:T(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Xe},Te=ue("//","$"),P=ue("/\\*","\\*/"),U=ue("#","$"),q={scope:"number",begin:$,relevance:0},A={scope:"number",begin:j,relevance:0},ae={scope:"number",begin:F,relevance:0},pe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[V,{begin:/\[/,end:/\]/,relevance:0,contains:[V]}]},te={scope:"title",begin:B,relevance:0},ee={scope:"title",begin:X,relevance:0},ce={begin:"\\.\\s*"+X,relevance:0};var Ae=Object.freeze({__proto__:null,APOS_STRING_MODE:Y,BACKSLASH_ESCAPE:V,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:F,COMMENT:ue,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:Te,C_NUMBER_MODE:A,C_NUMBER_RE:j,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(xe,je)=>{je.data._beginMatch=xe[1]},"on:end":(xe,je)=>{je.data._beginMatch!==xe[1]&&je.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:B,MATCH_NOTHING_RE:M,METHOD_GUARD:ce,NUMBER_MODE:q,NUMBER_RE:$,PHRASAL_WORDS_MODE:re,QUOTE_STRING_MODE:K,REGEXP_MODE:pe,RE_STARTERS_RE:H,SHEBANG:ne,TITLE_MODE:te,UNDERSCORE_IDENT_RE:X,UNDERSCORE_TITLE_MODE:ee});function Oe(Q,xe){Q.input[Q.index-1]==="."&&xe.ignoreMatch()}function ve(Q,xe){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function Ue(Q,xe){xe&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=Oe,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function Ve(Q,xe){Array.isArray(Q.illegal)&&(Q.illegal=C(...Q.illegal))}function nt(Q,xe){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function lt(Q,xe){Q.relevance===void 0&&(Q.relevance=1)}const Lt=(Q,xe)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const je=Object.assign({},Q);Object.keys(Q).forEach(Xe=>{delete Q[Xe]}),Q.keywords=je.keywords,Q.begin=T(je.beforeMatch,y(je.begin)),Q.starts={relevance:0,contains:[Object.assign(je,{endsParent:!0})]},Q.relevance=0,delete je.beforeMatch},_t=["of","and","for","in","not","or","if","then","parent","list","value"],ut="keyword";function Ye(Q,xe,je=ut){const Xe=Object.create(null);return typeof Q=="string"?ht(je,Q.split(" ")):Array.isArray(Q)?ht(je,Q):Object.keys(Q).forEach(function(kt){Object.assign(Xe,Ye(Q[kt],xe,kt))}),Xe;function ht(kt,ie){xe&&(ie=ie.map(Se=>Se.toLowerCase())),ie.forEach(function(Se){const Be=Se.split("|");Xe[Be[0]]=[kt,Fe(Be[0],Be[1])]})}}function Fe(Q,xe){return xe?Number(xe):ct(Q)?0:1}function ct(Q){return _t.includes(Q.toLowerCase())}const zt={},Pe=Q=>{console.error(Q)},Wt=(Q,...xe)=>{console.log(`WARN: ${Q}`,...xe)},me=(Q,xe)=>{zt[`${Q}/${xe}`]||(console.log(`Deprecated as of ${Q}. ${xe}`),zt[`${Q}/${xe}`]=!0)},ye=new Error;function qe(Q,xe,{key:je}){let Xe=0;const ht=Q[je],kt={},ie={};for(let Se=1;Se<=xe.length;Se++)ie[Se+Xe]=ht[Se],kt[Se+Xe]=!0,Xe+=_(xe[Se-1]);Q[je]=ie,Q[je]._emit=kt,Q[je]._multi=!0}function Qe(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw Pe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ye;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw Pe("beginScope must be object"),ye;qe(Q,Q.begin,{key:"beginScope"}),Q.begin=D(Q.begin,{joinWith:""})}}function rt(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw Pe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ye;if(typeof Q.endScope!="object"||Q.endScope===null)throw Pe("endScope must be object"),ye;qe(Q,Q.end,{key:"endScope"}),Q.end=D(Q.end,{joinWith:""})}}function tn(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function un(Q){tn(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Qe(Q),rt(Q)}function Bt(Q){function xe(ie,Se){return new RegExp(b(ie),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Se?"g":""))}class je{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Se,Be){Be.position=this.position++,this.matchIndexes[this.matchAt]=Be,this.regexes.push([Be,Se]),this.matchAt+=_(Se)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Se=this.regexes.map(Be=>Be[1]);this.matcherRe=xe(D(Se,{joinWith:"|"}),!0),this.lastIndex=0}exec(Se){this.matcherRe.lastIndex=this.lastIndex;const Be=this.matcherRe.exec(Se);if(!Be)return null;const yt=Be.findIndex((Sn,Un)=>Un>0&&Sn!==void 0),Et=this.matchIndexes[yt];return Be.splice(0,yt),Object.assign(Be,Et)}}class Xe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Se){if(this.multiRegexes[Se])return this.multiRegexes[Se];const Be=new je;return this.rules.slice(Se).forEach(([yt,Et])=>Be.addRule(yt,Et)),Be.compile(),this.multiRegexes[Se]=Be,Be}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Se,Be){this.rules.push([Se,Be]),Be.type==="begin"&&this.count++}exec(Se){const Be=this.getMatcher(this.regexIndex);Be.lastIndex=this.lastIndex;let yt=Be.exec(Se);if(this.resumingScanAtSamePosition()&&!(yt&&yt.index===this.lastIndex)){const Et=this.getMatcher(0);Et.lastIndex=this.lastIndex+1,yt=Et.exec(Se)}return yt&&(this.regexIndex+=yt.position+1,this.regexIndex===this.count&&this.considerAll()),yt}}function ht(ie){const Se=new Xe;return ie.contains.forEach(Be=>Se.addRule(Be.begin,{rule:Be,type:"begin"})),ie.terminatorEnd&&Se.addRule(ie.terminatorEnd,{type:"end"}),ie.illegal&&Se.addRule(ie.illegal,{type:"illegal"}),Se}function kt(ie,Se){const Be=ie;if(ie.isCompiled)return Be;[ve,nt,un,Lt].forEach(Et=>Et(ie,Se)),Q.compilerExtensions.forEach(Et=>Et(ie,Se)),ie.__beforeBegin=null,[Ue,Ve,lt].forEach(Et=>Et(ie,Se)),ie.isCompiled=!0;let yt=null;return typeof ie.keywords=="object"&&ie.keywords.$pattern&&(ie.keywords=Object.assign({},ie.keywords),yt=ie.keywords.$pattern,delete ie.keywords.$pattern),yt=yt||/\w+/,ie.keywords&&(ie.keywords=Ye(ie.keywords,Q.case_insensitive)),Be.keywordPatternRe=xe(yt,!0),Se&&(ie.begin||(ie.begin=/\B|\b/),Be.beginRe=xe(Be.begin),!ie.end&&!ie.endsWithParent&&(ie.end=/\B|\b/),ie.end&&(Be.endRe=xe(Be.end)),Be.terminatorEnd=b(Be.end)||"",ie.endsWithParent&&Se.terminatorEnd&&(Be.terminatorEnd+=(ie.end?"|":"")+Se.terminatorEnd)),ie.illegal&&(Be.illegalRe=xe(ie.illegal)),ie.contains||(ie.contains=[]),ie.contains=[].concat(...ie.contains.map(function(Et){return Ht(Et==="self"?ie:Et)})),ie.contains.forEach(function(Et){kt(Et,Be)}),ie.starts&&kt(ie.starts,Se),Be.matcher=ht(Be),Be}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=a(Q.classNameAliases||{}),kt(Q)}function dt(Q){return Q?Q.endsWithParent||dt(Q.starts):!1}function Ht(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(xe){return a(Q,{variants:null},xe)})),Q.cachedVariants?Q.cachedVariants:dt(Q)?a(Q,{starts:Q.starts?a(Q.starts):null}):Object.isFrozen(Q)?a(Q):Q}var bt="11.11.2";class Wn extends Error{constructor(xe,je){super(xe),this.name="HTMLInjectionError",this.html=je}}const wn=n,it=a,We=Symbol("nomatch"),St=7,Dt=function(Q){const xe=Object.create(null),je=Object.create(null),Xe=[];let ht=!0;const kt="Could not find the language '{}', did you forget to load/include a language module?",ie={disableAutodetect:!0,name:"Plain text",contains:[]};let Se={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Be(Re){return Se.noHighlightRe.test(Re)}function yt(Re){let Je=Re.className+" ";Je+=Re.parentNode?Re.parentNode.className:"";const Tt=Se.languageDetectRe.exec(Je);if(Tt){const Vt=ir(Tt[1]);return Vt||(Wt(kt.replace("{}",Tt[1])),Wt("Falling back to no-highlight mode for this block.",Re)),Vt?Tt[1]:"no-highlight"}return Je.split(/\s+/).find(Vt=>Be(Vt)||ir(Vt))}function Et(Re,Je,Tt){let Vt="",En="";typeof Je=="object"?(Vt=Re,Tt=Je.ignoreIllegals,En=Je.language):(me("10.7.0","highlight(lang, code, ...args) has been deprecated."),me("10.7.0",`Please use highlight(code, options) instead.
|
|
302
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),En=Re,Vt=Je),Tt===void 0&&(Tt=!0);const Jn={code:Vt,language:En};Oi("before:highlight",Jn);const kr=Jn.result?Jn.result:Sn(Jn.language,Jn.code,Tt);return kr.code=Jn.code,Oi("after:highlight",kr),kr}function Sn(Re,Je,Tt,Vt){const En=Object.create(null);function Jn(Le,Ge){return Le.keywords[Ge]}function kr(){if(!st.keywords){An.addText(Yt);return}let Le=0;st.keywordPatternRe.lastIndex=0;let Ge=st.keywordPatternRe.exec(Yt),gt="";for(;Ge;){gt+=Yt.substring(Le,Ge.index);const It=Kn.case_insensitive?Ge[0].toLowerCase():Ge[0],hn=Jn(st,It);if(hn){const[Ur,yl]=hn;if(An.addText(gt),gt="",En[It]=(En[It]||0)+1,En[It]<=St&&(Xa+=yl),Ur.startsWith("_"))gt+=Ge[0];else{const Go=Kn.classNameAliases[Ur]||Ur;Er(Ge[0],Go)}}else gt+=Ge[0];Le=st.keywordPatternRe.lastIndex,Ge=st.keywordPatternRe.exec(Yt)}gt+=Yt.substring(Le),An.addText(gt)}function fr(){if(Yt==="")return;let Le=null;if(typeof st.subLanguage=="string"){if(!xe[st.subLanguage]){An.addText(Yt);return}Le=Sn(st.subLanguage,Yt,!0,$o[st.subLanguage]),$o[st.subLanguage]=Le._top}else Le=Qn(Yt,st.subLanguage.length?st.subLanguage:null);st.relevance>0&&(Xa+=Le.relevance),An.__addSublanguage(Le._emitter,Le.language)}function ln(){st.subLanguage!=null?fr():kr(),Yt=""}function Er(Le,Ge){Le!==""&&(An.startScope(Ge),An.addText(Le),An.endScope())}function Fo(Le,Ge){let gt=1;const It=Ge.length-1;for(;gt<=It;){if(!Le._emit[gt]){gt++;continue}const hn=Kn.classNameAliases[Le[gt]]||Le[gt],Ur=Ge[gt];hn?Er(Ur,hn):(Yt=Ur,kr(),Yt=""),gt++}}function ms(Le,Ge){return Le.scope&&typeof Le.scope=="string"&&An.openNode(Kn.classNameAliases[Le.scope]||Le.scope),Le.beginScope&&(Le.beginScope._wrap?(Er(Yt,Kn.classNameAliases[Le.beginScope._wrap]||Le.beginScope._wrap),Yt=""):Le.beginScope._multi&&(Fo(Le.beginScope,Ge),Yt="")),st=Object.create(Le,{parent:{value:st}}),st}function gl(Le,Ge,gt){let It=I(Le.endRe,gt);if(It){if(Le["on:end"]){const hn=new t(Le);Le["on:end"](Ge,hn),hn.isMatchIgnored&&(It=!1)}if(It){for(;Le.endsParent&&Le.parent;)Le=Le.parent;return Le}}if(Le.endsWithParent)return gl(Le.parent,Ge,gt)}function hs(Le){return st.matcher.regexIndex===0?(Yt+=Le[0],1):(Za=!0,0)}function f0(Le){const Ge=Le[0],gt=Le.rule,It=new t(gt),hn=[gt.__beforeBegin,gt["on:begin"]];for(const Ur of hn)if(Ur&&(Ur(Le,It),It.isMatchIgnored))return hs(Ge);return gt.skip?Yt+=Ge:(gt.excludeBegin&&(Yt+=Ge),ln(),!gt.returnBegin&&!gt.excludeBegin&&(Yt=Ge)),ms(gt,Le),gt.returnBegin?0:Ge.length}function mr(Le){const Ge=Le[0],gt=Je.substring(Le.index),It=gl(st,Le,gt);if(!It)return We;const hn=st;st.endScope&&st.endScope._wrap?(ln(),Er(Ge,st.endScope._wrap)):st.endScope&&st.endScope._multi?(ln(),Fo(st.endScope,Le)):hn.skip?Yt+=Ge:(hn.returnEnd||hn.excludeEnd||(Yt+=Ge),ln(),hn.excludeEnd&&(Yt=Ge));do st.scope&&An.closeNode(),!st.skip&&!st.subLanguage&&(Xa+=st.relevance),st=st.parent;while(st!==It.parent);return It.starts&&ms(It.starts,Le),hn.returnEnd?0:Ge.length}function bl(){const Le=[];for(let Ge=st;Ge!==Kn;Ge=Ge.parent)Ge.scope&&Le.unshift(Ge.scope);Le.forEach(Ge=>An.openNode(Ge))}let Di={};function ps(Le,Ge){const gt=Ge&&Ge[0];if(Yt+=Le,gt==null)return ln(),0;if(Di.type==="begin"&&Ge.type==="end"&&Di.index===Ge.index&>===""){if(Yt+=Je.slice(Ge.index,Ge.index+1),!ht){const It=new Error(`0 width match regex (${Re})`);throw It.languageName=Re,It.badRule=Di.rule,It}return 1}if(Di=Ge,Ge.type==="begin")return f0(Ge);if(Ge.type==="illegal"&&!Tt){const It=new Error('Illegal lexeme "'+gt+'" for mode "'+(st.scope||"<unnamed>")+'"');throw It.mode=st,It}else if(Ge.type==="end"){const It=mr(Ge);if(It!==We)return It}if(Ge.type==="illegal"&>==="")return Ge.index===Je.length||(Yt+=`
|
|
303
|
+
`),1;if(vl>1e5&&vl>Ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Yt+=gt,gt.length}const Kn=ir(Re);if(!Kn)throw Pe(kt.replace("{}",Re)),new Error('Unknown language: "'+Re+'"');const Po=Bt(Kn);let gs="",st=Vt||Po;const $o={},An=new Se.__emitter(Se);bl();let Yt="",Xa=0,va=0,vl=0,Za=!1;try{if(Kn.__emitTokens)Kn.__emitTokens(Je,An);else{for(st.matcher.considerAll();;){vl++,Za?Za=!1:st.matcher.considerAll(),st.matcher.lastIndex=va;const Le=st.matcher.exec(Je);if(!Le)break;const Ge=Je.substring(va,Le.index),gt=ps(Ge,Le);va=Le.index+gt}ps(Je.substring(va))}return An.finalize(),gs=An.toHTML(),{language:Re,value:gs,relevance:Xa,illegal:!1,_emitter:An,_top:st}}catch(Le){if(Le.message&&Le.message.includes("Illegal"))return{language:Re,value:wn(Je),illegal:!0,relevance:0,_illegalBy:{message:Le.message,index:va,context:Je.slice(va-100,va+100),mode:Le.mode,resultSoFar:gs},_emitter:An};if(ht)return{language:Re,value:wn(Je),illegal:!1,relevance:0,errorRaised:Le,_emitter:An,_top:st};throw Le}}function Un(Re){const Je={value:wn(Re),illegal:!1,relevance:0,_top:ie,_emitter:new Se.__emitter(Se)};return Je._emitter.addText(Re),Je}function Qn(Re,Je){Je=Je||Se.languages||Object.keys(xe);const Tt=Un(Re),Vt=Je.filter(ir).filter(Va).map(ln=>Sn(ln,Re,!1));Vt.unshift(Tt);const En=Vt.sort((ln,Er)=>{if(ln.relevance!==Er.relevance)return Er.relevance-ln.relevance;if(ln.language&&Er.language){if(ir(ln.language).supersetOf===Er.language)return 1;if(ir(Er.language).supersetOf===ln.language)return-1}return 0}),[Jn,kr]=En,fr=Jn;return fr.secondBest=kr,fr}function $n(Re,Je,Tt){const Vt=Je&&je[Je]||Tt;Re.classList.add("hljs"),Re.classList.add(`language-${Vt}`)}function Pt(Re){let Je=null;const Tt=yt(Re);if(Be(Tt))return;if(Oi("before:highlightElement",{el:Re,language:Tt}),Re.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Re);return}if(Re.children.length>0&&(Se.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Re)),Se.throwUnescapedHTML))throw new Wn("One of your code blocks includes unescaped HTML.",Re.innerHTML);Je=Re;const Vt=Je.textContent,En=Tt?Et(Vt,{language:Tt,ignoreIllegals:!0}):Qn(Vt);Re.innerHTML=En.value,Re.dataset.highlighted="yes",$n(Re,Tt,En.language),Re.result={language:En.language,re:En.relevance,relevance:En.relevance},En.secondBest&&(Re.secondBest={language:En.secondBest.language,relevance:En.secondBest.relevance}),Oi("after:highlightElement",{el:Re,result:En,text:Vt})}function kn(Re){Se=it(Se,Re)}const Ka=()=>{fs(),me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function hl(){fs(),me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Uo=!1;function fs(){function Re(){fs()}if(document.readyState==="loading"){Uo||window.addEventListener("DOMContentLoaded",Re,!1),Uo=!0;return}document.querySelectorAll(Se.cssSelector).forEach(Pt)}function qo(Re,Je){let Tt=null;try{Tt=Je(Q)}catch(Vt){if(Pe("Language definition for '{}' could not be registered.".replace("{}",Re)),ht)Pe(Vt);else throw Vt;Tt=ie}Tt.name||(Tt.name=Re),xe[Re]=Tt,Tt.rawDefinition=Je.bind(null,Q),Tt.aliases&&ga(Tt.aliases,{languageName:Re})}function Mi(Re){delete xe[Re];for(const Je of Object.keys(je))je[Je]===Re&&delete je[Je]}function pl(){return Object.keys(xe)}function ir(Re){return Re=(Re||"").toLowerCase(),xe[Re]||xe[je[Re]]}function ga(Re,{languageName:Je}){typeof Re=="string"&&(Re=[Re]),Re.forEach(Tt=>{je[Tt.toLowerCase()]=Je})}function Va(Re){const Je=ir(Re);return Je&&!Je.disableAutodetect}function Ya(Re){Re["before:highlightBlock"]&&!Re["before:highlightElement"]&&(Re["before:highlightElement"]=Je=>{Re["before:highlightBlock"](Object.assign({block:Je.el},Je))}),Re["after:highlightBlock"]&&!Re["after:highlightElement"]&&(Re["after:highlightElement"]=Je=>{Re["after:highlightBlock"](Object.assign({block:Je.el},Je))})}function Rn(Re){Ya(Re),Xe.push(Re)}function Ho(Re){const Je=Xe.indexOf(Re);Je!==-1&&Xe.splice(Je,1)}function Oi(Re,Je){const Tt=Re;Xe.forEach(function(Vt){Vt[Tt]&&Vt[Tt](Je)})}function ba(Re){return me("10.7.0","highlightBlock will be removed entirely in v12.0"),me("10.7.0","Please use highlightElement now."),Pt(Re)}Object.assign(Q,{highlight:Et,highlightAuto:Qn,highlightAll:fs,highlightElement:Pt,highlightBlock:ba,configure:kn,initHighlighting:Ka,initHighlightingOnLoad:hl,registerLanguage:qo,unregisterLanguage:Mi,listLanguages:pl,getLanguage:ir,registerAliases:ga,autoDetection:Va,inherit:it,addPlugin:Rn,removePlugin:Ho}),Q.debugMode=function(){ht=!1},Q.safeMode=function(){ht=!0},Q.versionString=bt,Q.regex={concat:T,lookahead:y,either:C,optional:k,anyNumberOfTimes:x};for(const Re in Ae)typeof Ae[Re]=="object"&&e(Ae[Re]);return Object.assign(Q,Ae),Q},Ft=Dt({});return Ft.newInstance=()=>Dt({}),rm=Ft,Ft.HighlightJS=Ft,Ft.default=Ft,rm}var am,gy;function VA(){if(gy)return am;gy=1;function e(t){const n=t.regex,a=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=t.inherit(c,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),h=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,h,m,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,h,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(a,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return am=e,am}var im,by;function YA(){if(by)return im;by=1;function e(t){const n=t.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,l]};l.contains.push(m);const h={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,a]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],k=t.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},R=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],_={match:/(\/[a-z._-]+)+/},I=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],G=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:R,literal:C,built_in:[...I,...G,"set","shopt",...D,...M]},contains:[k,t.SHEBANG(),T,y,c,d,_,m,h,p,b,a]}}return im=e,im}var sm,vy;function XA(){if(vy)return sm;vy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="("+s+"|"+n.optional(l)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:n.optional(l)+t.IDENT_RE,relevance:0},k=n.optional(l)+t.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[y,m,a,t.C_BLOCK_COMMENT_MODE,b,p],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:_.concat([{begin:/\(/,end:/\)/,keywords:C,contains:_.concat(["self"]),relevance:0}]),relevance:0},G={begin:"("+d+"[\\*&\\s]+)+"+k,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:C,relevance:0},{begin:k,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,a,t.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(I,G,_,[y,{begin:t.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:y,strings:p,keywords:C}}}return sm=e,sm}var lm,yy;function ZA(){if(yy)return lm;yy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+n.optional(l)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:n.optional(l)+t.IDENT_RE,relevance:0},k=n.optional(l)+t.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],R=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:R,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},M={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:n.concat(/\b/,`(?!${T.join("|")})`,t.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},B=[M,y,m,a,t.C_BLOCK_COMMENT_MODE,b,p],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:B.concat([{begin:/\(/,end:/\)/,keywords:D,contains:B.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+d+"[\\*&\\s]+)+"+k,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:D,relevance:0},{begin:k,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,a,t.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,$,M,B,[y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return lm=e,lm}var om,xy;function WA(){if(xy)return om;xy=1;function e(t){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:l.concat(c),built_in:n,literal:s},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},y=t.inherit(b,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:d},k=t.inherit(x,{illegal:/\n/}),T={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,k]},R={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},C=t.inherit(R,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},k]});x.contains=[R,T,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.C_BLOCK_COMMENT_MODE],k.contains=[C,T,y,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[p,R,T,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},I={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},G=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,I,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,I,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+G+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,I],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[_,h,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}return om=e,om}var cm,wy;function QA(){if(wy)return cm;wy=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const p=h.regex,b=e(h),y={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},x="and or not only",k=/@-?\w[\w]*(-\w+)*/,T="[a-zA-Z-][a-zA-Z0-9_-]*",R=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,y,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+T,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,b.UNICODE_RANGE,...R,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...R,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:k},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:s.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...R,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b"}]}}return cm=m,cm}var um,Sy;function JA(){if(Sy)return um;Sy=1;function e(t){const n=t.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=t.inherit(p,{contains:[]}),x=t.inherit(b,{contains:[]});p.contains.push(x),b.contains.push(y);let k=[a,h];return[p,b,y,x].forEach(_=>{_.contains=_.contains.concat(k)}),k=k.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:k},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:k}]}]},a,c,p,b,{className:"quote",begin:"^>\\s+",contains:k,end:"$"},l,s,h,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return um=e,um}var dm,ky;function e_(){if(ky)return dm;ky=1;function e(t){const n=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return dm=e,dm}var fm,Ey;function t_(){if(Ey)return fm;Ey=1;function e(t){const n=t.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=n.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},m={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:d},y={className:"string",contains:[t.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},x="[1-9](_?[0-9])*|0",k="[0-9](_?[0-9])*",T={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${k}))?([eE][+-]?(${k})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},R={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},B=[y,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:d},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[R]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:a}],relevance:0},T,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,p),relevance:0}].concat(h,p);b.contains=B,R.contains=B;const F=[{begin:/^\s*=>/,starts:{end:"$",contains:B}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:B}}];return p.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(F).concat(p).concat(B)}}return fm=e,fm}var mm,Ty;function n_(){if(Ty)return mm;Ty=1;function e(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}return mm=e,mm}var hm,Ny;function r_(){if(Ny)return hm;Ny=1;function e(t){const n=t.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(a,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return hm=e,hm}var pm,Cy;function a_(){if(Cy)return pm;Cy=1;function e(t){const n=t.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},s=t.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[s,c,l,d,a,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,y=n.either(h,p,b),x=n.concat(y,"(\\s*\\.\\s*",y,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[s,m,c,l,d,a]}}]}}return pm=e,pm}var gm,Ry;function i_(){if(Ry)return gm;Ry=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(c,d,m){return m===-1?"":c.replace(d,h=>s(c,d,m-1))}function l(c){const d=c.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",h=m+s("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),k={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},T={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},R={className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:k,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[d.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[R,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+h+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:k,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[T,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,a,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},a,T]}}return gm=l,gm}var bm,Ay;function s_(){if(Ay)return bm;Ay=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(l,a,s);function m(h){const p=h.regex,b=(ee,{after:ce})=>{const ge="</"+ee[0].slice(1);return ee.input.indexOf(ge,ce)!==-1},y=e,x={begin:"<>",end:"</>"},k=/<[A-Za-z0-9\\._:-]+\s*\/>/,T={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ee,ce)=>{const ge=ee[0].length+ee.index,Ae=ee.input[ge];if(Ae==="<"||Ae===","){ce.ignoreMatch();return}Ae===">"&&(b(ee,{after:ge})||ce.ignoreMatch());let Oe;const ve=ee.input.substring(ge);if(Oe=ve.match(/^\s*=/)){ce.ignoreMatch();return}if((Oe=ve.match(/^\s+extends\s+/))&&Oe.index===0){ce.ignoreMatch();return}}},R={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},C="[0-9](_?[0-9])*",_=`\\.(${C})`,I="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",G={className:"number",variants:[{begin:`(\\b(${I})((${_})|\\.)?|(${_}))[eE][+-]?(${C})\\b`},{begin:`\\b(${I})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},D={className:"subst",begin:"\\$\\{",end:"\\}",keywords:R,contains:[]},M={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,D],subLanguage:"xml"}},B={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,D],subLanguage:"css"}},X={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,D],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[h.BACKSLASH_ESCAPE,D]},F={className:"comment",variants:[h.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:y+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),h.C_BLOCK_COMMENT_MODE,h.C_LINE_COMMENT_MODE]},H=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,M,B,X,$,{match:/\$\d+/},G];D.contains=H.concat({begin:/\{/,end:/\}/,keywords:R,contains:["self"].concat(H)});const ne=[].concat(F,D.contains),V=ne.concat([{begin:/(\s*)\(/,end:/\)/,keywords:R,contains:["self"].concat(ne)}]),Y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:V},K={variants:[{match:[/class/,/\s+/,y,/\s+/,/extends/,/\s+/,p.concat(y,"(",p.concat(/\./,y),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,y],scope:{1:"keyword",3:"title.class"}}]},re={relevance:0,match:p.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},ue={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Te={variants:[{match:[/function/,/\s+/,y,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Y],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(ee){return p.concat("(?!",ee.join("|"),")")}const q={match:p.concat(/\b/,U([...l,"super","import","await"].map(ee=>`${ee}\\s*\\(`)),y,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},A={begin:p.concat(/\./,p.lookahead(p.concat(y,/(?![0-9A-Za-z$_(])/))),end:y,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,y,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},Y]},pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+h.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,y,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:R,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:re},illegal:/#(?![$_A-Za-z])/,contains:[h.SHEBANG({label:"shebang",binary:"node",relevance:5}),ue,h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,M,B,X,$,F,{match:/\$\d+/},G,re,{scope:"attr",match:y+p.lookahead(":"),relevance:0},te,{begin:"("+h.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,h.REGEXP_MODE,{className:"function",begin:pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:h.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:k},{begin:T.begin,"on:begin":T.isTrulyOpeningTag,end:T.end}],subLanguage:"xml",contains:[{begin:T.begin,end:T.end,skip:!0,contains:["self"]}]}]},Te,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+h.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Y,h.inherit(h.TITLE_MODE,{begin:y,className:"title.function"})]},{match:/\.\.\./,relevance:0},A,{match:"\\$"+y,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Y]},q,P,K,ae,{match:/\$[(.]/}]}}return bm=m,bm}var vm,_y;function l_(){if(_y)return vm;_y=1;const t={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function n(a){const s={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},l={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:c},contains:[s,l,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,d,t,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return vm=n,vm}var ym,Iy;function o_(){if(Iy)return ym;Iy=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(l){const c={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},d={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:l.UNDERSCORE_IDENT_RE+"@"},h={className:"subst",begin:/\$\{/,end:/\}/,contains:[l.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+l.UNDERSCORE_IDENT_RE},b={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,h]},{begin:"'",end:"'",illegal:/\n/,contains:[l.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[l.BACKSLASH_ESCAPE,p,h]}]};h.contains.push(b);const y={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},x={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(b,{className:"string"}),"self"]}]},k=a,T=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),R={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},C=R;return C.variants[1].contains=[R],R.variants[1].contains=[C],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[l.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),l.C_LINE_COMMENT_MODE,T,d,m,y,x,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:l.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[l.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[R,l.C_LINE_COMMENT_MODE,T],relevance:0},l.C_LINE_COMMENT_MODE,T,y,x,b,l.C_NUMBER_MODE]},T]},{begin:[/class|interface|trait/,/\s+/,l.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},l.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},y,x]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
304
|
+
`},k]}}return ym=s,ym}var xm,My;function c_(){if(My)return xm;My=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),m=l.concat(c).sort().reverse();function h(p){const b=e(p),y=m,x="and or not only",k="[\\w-]+",T="("+k+"|@\\{"+k+"\\})",R=[],C=[],_=function(ne){return{className:"string",begin:"~?"+ne+".*?"+ne}},I=function(ne,V,Y){return{className:ne,begin:V,relevance:Y}},G={$pattern:/[a-z-]+/,keyword:x,attribute:s.join(" ")},D={begin:"\\(",end:"\\)",contains:C,keywords:G,relevance:0};C.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,_("'"),_('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.UNICODE_RANGE,b.HEXCOLOR,D,I("variable","@@?"+k,10),I("variable","@\\{"+k+"\\}"),I("built_in","~?`[^`]*?`"),{className:"attribute",begin:k+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const M=C.concat({begin:/\{/,end:/\}/,contains:R}),B={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(C)},X={begin:T+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:C}}]},$={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:G,returnEnd:!0,contains:C,relevance:0}},j={className:"variable",variants:[{begin:"@"+k+"\\s*:",relevance:15},{begin:"@"+k}],starts:{end:"[;}]",returnEnd:!0,contains:M}},F={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:T,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,B,I("keyword","all\\b"),I("variable","@\\{"+k+"\\}"),{begin:"\\b("+a.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,I("selector-tag",T,0),I("selector-id","#"+T),I("selector-class","\\."+T,0),I("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:M},{begin:"!important"},b.FUNCTION_DISPATCH]},H={begin:k+`:(:)?(${y.join("|")})`,returnBegin:!0,contains:[F]};return R.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,$,j,H,X,F,B,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:R}}return xm=h,xm}var wm,Oy;function u_(){if(Oy)return wm;Oy=1;function e(t){const n="\\[=*\\[",a="\\]=*\\]",s={begin:n,end:a,contains:["self"]},l=[t.COMMENT("--(?!"+n+")","$"),t.COMMENT("--"+n,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:n,end:a,contains:[s],relevance:5}])}}return wm=e,wm}var Sm,Dy;function d_(){if(Dy)return Sm;Dy=1;function e(t){const n={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,a]},l={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,n,a,s,l,c,d]}}return Sm=e,Sm}var km,jy;function f_(){if(jy)return km;jy=1;function e(t){const n=t.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:a.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},d={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[t.BACKSLASH_ESCAPE,c,h],y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(R,C,_="\\1")=>{const I=_==="\\1"?_:n.concat(_,C);return n.concat(n.concat("(?:",R,")"),C,/(?:\\.|[^\\\/])*?/,I,/(?:\\.|[^\\\/])*?/,_,s)},k=(R,C,_)=>n.concat(n.concat("(?:",R,")"),C,/(?:\\.|[^\\\/])*?/,_,s),T=[h,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",n.either(...y,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:k("(?:m|qr)?",/\//,/\//)},{begin:k("m|qr",n.either(...y,{capture:!0}),/\1/)},{begin:k("m|qr",/\(/,/\)/)},{begin:k("m|qr",/\[/,/\]/)},{begin:k("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=T,d.contains=T,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:T}}return km=e,km}var Em,Ly;function m_(){if(Ly)return Em;Ly=1;function e(t){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return Em=e,Em}var Tm,zy;function h_(){if(zy)return Tm;zy=1;function e(t){const n=t.regex,a=/(?![A-Za-z0-9])(?![$])/,s=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),l=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),c=n.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(h)}),y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(Y,K)=>{K.data._beginMatch=Y[1]||Y[2]},"on:end":(Y,K)=>{K.data._beginMatch!==Y[1]&&K.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),k=`[
|
|
305
|
+
]`,T={scope:"string",variants:[b,p,y,x]},R={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],I=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:_,literal:(Y=>{const K=[];return Y.forEach(re=>{K.push(re),re.toLowerCase()===re?K.push(re.toUpperCase()):K.push(re.toLowerCase())}),K})(C),built_in:I},M=Y=>Y.map(K=>K.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,n.concat(k,"+"),n.concat("(?!",M(I).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},X=n.concat(s,"\\b(?!\\()"),$={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{1:"title.class",3:"variable.constant"}},{match:[l,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[j,d,$,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,R,B]},H={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",M(_).join("\\b|"),"|",M(I).join("\\b|"),"\\b)"),s,n.concat(k,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(H);const ne=[j,$,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,R,B],V={begin:n.concat(/#\[\s*\\?/,n.either(l,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...ne]},...ne,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:D,contains:[V,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},d,H,$,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},B,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",V,d,$,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,R]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},T,R]}}return Tm=e,Tm}var Nm,By;function p_(){if(By)return Nm;By=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return Nm=e,Nm}var Cm,Uy;function g_(){if(Uy)return Cm;Uy=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Cm=e,Cm}var Rm,qy;function b_(){if(qy)return Rm;qy=1;function e(t){const n=t.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],m={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},y={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h,b,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",k=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,T=`\\b|${s.join("|")}`,R={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${k}))[eE][+-]?(${x})[jJ]?(?=${T})`},{begin:`(${k})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${x})[jJ](?=${T})`}]},C={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",h,R,y,t.HASH_COMMENT_MODE]}]};return p.contains=[y,R,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[h,R,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[R,_,y]}]}}return Rm=e,Rm}var Am,Hy;function v_(){if(Hy)return Am;Hy=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return Am=e,Am}var _m,Fy;function y_(){if(Fy)return _m;Fy=1;function e(t){const n=t.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[c,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return _m=e,_m}var Im,Py;function x_(){if(Py)return Im;Py=1;function e(t){const n=t.regex,a=/(r#)?/,s=n.concat(a,t.UNDERSCORE_IDENT_RE),l=n.concat(a,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,n.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",m=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:m,literal:h,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},c]}}return Im=e,Im}var Mm,$y;function w_(){if($y)return Mm;$y=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const p=e(h),b=c,y=l,x="@[a-z-]+",k="and or not only",R={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+y.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},R,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[p.BLOCK_COMMENT,R,p.HEXCOLOR,p.CSS_NUMBER_MODE,p.UNICODE_RANGE,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:x,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:k,attribute:s.join(" ")},contains:[{begin:x,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},R,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return Mm=m,Mm}var Om,Gy;function S_(){if(Gy)return Om;Gy=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return Om=e,Om}var Dm,Ky;function k_(){if(Ky)return Dm;Ky=1;function e(t){const n=t.regex,a=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],m=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],x=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],k=b,T=[...p,...h].filter(M=>!b.includes(M)),R={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:n.concat(/\b/,n.either(...k),/\s*\(/),relevance:0,keywords:{built_in:k}};function I(M){return n.concat(/\b/,n.either(...M.map(B=>B.replace(/\s+/,"\\s+"))),/\b/)}const G={scope:"keyword",match:I(x),relevance:0};function D(M,{exceptions:B,when:X}={}){const $=X;return B=B||[],M.map(j=>j.match(/\|\d+$/)||B.includes(j)?j:$(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(T,{when:M=>M.length<3}),literal:c,type:m,built_in:y},contains:[{scope:"type",match:I(d)},G,_,R,s,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,a,C]}}return Dm=e,Dm}var jm,Vy;function E_(){if(Vy)return jm;Vy=1;function e(X){return X?typeof X=="string"?X:X.source:null}function t(X){return n("(?=",X,")")}function n(...X){return X.map(j=>e(j)).join("")}function a(X){const $=X[X.length-1];return typeof $=="object"&&$.constructor===Object?(X.splice(X.length-1,1),$):{}}function s(...X){return"("+(a(X).capture?"":"?:")+X.map(F=>e(F)).join("|")+")"}const l=X=>n(/\b/,X,/\w$/.test(X)?/\b/:/\B/),c=["Protocol","Type"].map(l),d=["init","self"].map(l),m=["Any","Self"],h=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],y=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],x=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],k=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),T=s(k,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),R=n(k,T,"*"),C=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_=s(C,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),I=n(C,_,"*"),G=n(/[A-Z]/,_,"*"),D=["attached","autoclosure",n(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,I,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],M=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function B(X){const $={match:/\s+/,relevance:0},j=X.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[X.C_LINE_COMMENT_MODE,j],H={match:[/\./,s(...c,...d)],className:{2:"keyword"}},ne={match:n(/\./,s(...h)),relevance:0},V=h.filter(We=>typeof We=="string").concat(["_|0"]),Y=h.filter(We=>typeof We!="string").concat(m).map(l),K={variants:[{className:"keyword",match:s(...Y,...d)}]},re={$pattern:s(/\b\w+/,/#\w+/),keyword:V.concat(y),literal:p},ue=[H,ne,K],Te={match:n(/\./,s(...x)),relevance:0},P={className:"built_in",match:n(/\b/,s(...x),/(?=\()/)},U=[Te,P],q={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:R},{match:`\\.(\\.|${T})+`}]},ae=[q,A],pe="([0-9]_*)+",te="([0-9a-fA-F]_*)+",ee={className:"number",relevance:0,variants:[{match:`\\b(${pe})(\\.(${pe}))?([eE][+-]?(${pe}))?\\b`},{match:`\\b0x(${te})(\\.(${te}))?([pP][+-]?(${pe}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ce=(We="")=>({className:"subst",variants:[{match:n(/\\/,We,/[0\\tnr"']/)},{match:n(/\\/,We,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ge=(We="")=>({className:"subst",match:n(/\\/,We,/[\t ]*(?:[\r\n]|\r\n)/)}),Ae=(We="")=>({className:"subst",label:"interpol",begin:n(/\\/,We,/\(/),end:/\)/}),Oe=(We="")=>({begin:n(We,/"""/),end:n(/"""/,We),contains:[ce(We),ge(We),Ae(We)]}),ve=(We="")=>({begin:n(We,/"/),end:n(/"/,We),contains:[ce(We),Ae(We)]}),Ue={className:"string",variants:[Oe(),Oe("#"),Oe("##"),Oe("###"),ve(),ve("#"),ve("##"),ve("###")]},Ve=[X.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[X.BACKSLASH_ESCAPE]}],nt={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ve},lt=We=>{const St=n(We,/\//),Dt=n(/\//,We);return{begin:St,end:Dt,contains:[...Ve,{scope:"comment",begin:`#(?!.*${Dt})`,end:/$/}]}},Lt={scope:"regexp",variants:[lt("###"),lt("##"),lt("#"),nt]},_t={match:n(/`/,I,/`/)},ut={className:"variable",match:/\$\d+/},Ye={className:"variable",match:`\\$${_}+`},Fe=[_t,ut,Ye],ct={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:M,contains:[...ae,ee,Ue]}]}},zt={scope:"keyword",match:n(/@/,s(...D),t(s(/\(/,/\s+/)))},Pe={scope:"meta",match:n(/@/,I)},Wt=[ct,zt,Pe],me={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:n(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_,"+")},{className:"type",match:G,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:n(/\s+&\s+/,t(G)),relevance:0}]},ye={begin:/</,end:/>/,keywords:re,contains:[...F,...ue,...Wt,q,me]};me.contains.push(ye);const qe={match:n(I,/\s*:/),keywords:"_|0",relevance:0},Qe={begin:/\(/,end:/\)/,relevance:0,keywords:re,contains:["self",qe,...F,Lt,...ue,...U,...ae,ee,Ue,...Fe,...Wt,me]},rt={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,me]},tn={begin:s(t(n(I,/\s*:/)),t(n(I,/\s+/,I,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:I}]},un={begin:/\(/,end:/\)/,keywords:re,contains:[tn,...F,...ue,...ae,ee,Ue,...Wt,me,Qe],endsParent:!0,illegal:/["']/},Bt={match:[/(func|macro)/,/\s+/,s(_t.match,I,R)],className:{1:"keyword",3:"title.function"},contains:[rt,un,$],illegal:[/\[/,/%/]},dt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[rt,un,$],illegal:/\[|%/},Ht={match:[/operator/,/\s+/,R],className:{1:"keyword",3:"title"}},bt={begin:[/precedencegroup/,/\s+/,G],className:{1:"keyword",3:"title"},contains:[me],keywords:[...b,...p],end:/}/},Wn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},wn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},it={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,I,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:re,contains:[rt,...ue,{begin:/:/,end:/\{/,keywords:re,contains:[{scope:"title.class.inherited",match:G},...ue],relevance:0}]};for(const We of Ue.variants){const St=We.contains.find(Ft=>Ft.label==="interpol");St.keywords=re;const Dt=[...ue,...U,...ae,ee,Ue,...Fe];St.contains=[...Dt,{begin:/\(/,end:/\)/,contains:["self",...Dt]}]}return{name:"Swift",keywords:re,contains:[...F,Bt,dt,Wn,wn,it,Ht,bt,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},Lt,...ue,...U,...ae,ee,Ue,...Fe,...Wt,me,Qe]}}return jm=B,jm}var Lm,Yy;function T_(){if(Yy)return Lm;Yy=1;function e(t){const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},m=t.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},k={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},T={begin:/\{/,end:/\}/,contains:[k],illegal:"\\n",relevance:0},R={begin:"\\[",end:"\\]",contains:[k],illegal:"\\n",relevance:0},C=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},x,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},T,R,c,d],_=[...C];return _.pop(),_.push(m),k.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}return Lm=e,Lm}var zm,Xy;function N_(){if(Xy)return zm;Xy=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(l,a,s);function m(p){const b=p.regex,y=(ce,{after:ge})=>{const Ae="</"+ce[0].slice(1);return ce.input.indexOf(Ae,ge)!==-1},x=e,k={begin:"<>",end:"</>"},T=/<[A-Za-z0-9\\._:-]+\s*\/>/,R={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ce,ge)=>{const Ae=ce[0].length+ce.index,Oe=ce.input[Ae];if(Oe==="<"||Oe===","){ge.ignoreMatch();return}Oe===">"&&(y(ce,{after:Ae})||ge.ignoreMatch());let ve;const Ue=ce.input.substring(Ae);if(ve=Ue.match(/^\s*=/)){ge.ignoreMatch();return}if((ve=Ue.match(/^\s+extends\s+/))&&ve.index===0){ge.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},_="[0-9](_?[0-9])*",I=`\\.(${_})`,G="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",D={className:"number",variants:[{begin:`(\\b(${G})((${I})|\\.)?|(${I}))[eE][+-]?(${_})\\b`},{begin:`\\b(${G})\\b((${I})\\b|\\.)?|(${I})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},M={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},B={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,M],subLanguage:"xml"}},X={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,M],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,M],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,M]},H={className:"comment",variants:[p.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},ne=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,B,X,$,j,{match:/\$\d+/},D];M.contains=ne.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(ne)});const V=[].concat(H,M.contains),Y=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(V)}]),K={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:Y},re={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,b.concat(x,"(",b.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},ue={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},Te={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[K],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(ce){return b.concat("(?!",ce.join("|"),")")}const A={match:b.concat(/\b/,q([...l,"super","import","await"].map(ce=>`${ce}\\s*\\(`)),x,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:b.concat(/\./,b.lookahead(b.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},pe={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},K]},te="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(te)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[K]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:Y,CLASS_REFERENCE:ue},illegal:/#(?![$_A-Za-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),Te,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,B,X,$,j,H,{match:/\$\d+/},D,ue,{scope:"attr",match:x+b.lookahead(":"),relevance:0},ee,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,p.REGEXP_MODE,{className:"function",begin:te,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:Y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:k.begin,end:k.end},{match:T},{begin:R.begin,"on:begin":R.isTrulyOpeningTag,end:R.end}],subLanguage:"xml",contains:[{begin:R.begin,end:R.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[K,p.inherit(p.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[K]},A,U,re,pe,{match:/\$[(.]/}]}}function h(p){const b=p.regex,y=m(p),x=e,k=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],T={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},R={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:k},contains:[y.exports.CLASS_REFERENCE]},C={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},_=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],I={$pattern:e,keyword:t.concat(_),literal:n,built_in:d.concat(k),"variable.language":c},G={className:"meta",begin:"@"+x},D=($,j,F)=>{const H=$.contains.findIndex(ne=>ne.label===j);if(H===-1)throw new Error("can not find mode to replace");$.contains.splice(H,1,F)};Object.assign(y.keywords,I),y.exports.PARAMS_CONTAINS.push(G);const M=y.contains.find($=>$.scope==="attr"),B=Object.assign({},M,{match:b.concat(x,b.lookahead(/\s*\?:/))});y.exports.PARAMS_CONTAINS.push([y.exports.CLASS_REFERENCE,M,B]),y.contains=y.contains.concat([G,T,R,B]),D(y,"shebang",p.SHEBANG()),D(y,"use_strict",C);const X=y.contains.find($=>$.label==="func.def");return X.relevance=0,Object.assign(y,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),y}return zm=h,zm}var Bm,Zy;function C_(){if(Zy)return Bm;Zy=1;function e(t){const n=t.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,l),/ *#/)},{begin:n.concat(/# */,m,/ *#/)},{begin:n.concat(/# */,d,/ *#/)},{begin:n.concat(/# */,n.either(c,l),/ +/,n.either(d,m),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},y=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,h,p,b,y,x,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[x]}]}}return Bm=e,Bm}var Um,Wy;function R_(){if(Wy)return Um;Wy=1;function e(t){t.regex;const n=t.COMMENT(/\(;/,/;\)/);n.contains.push("self");const a=t.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},m={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,d,l,t.QUOTE_STRING_MODE,h,p,m]}}return Um=e,Um}var qm,Qy;function A_(){if(Qy)return qm;Qy=1;var e=KA();return e.registerLanguage("xml",VA()),e.registerLanguage("bash",YA()),e.registerLanguage("c",XA()),e.registerLanguage("cpp",ZA()),e.registerLanguage("csharp",WA()),e.registerLanguage("css",QA()),e.registerLanguage("markdown",JA()),e.registerLanguage("diff",e_()),e.registerLanguage("ruby",t_()),e.registerLanguage("go",n_()),e.registerLanguage("graphql",r_()),e.registerLanguage("ini",a_()),e.registerLanguage("java",i_()),e.registerLanguage("javascript",s_()),e.registerLanguage("json",l_()),e.registerLanguage("kotlin",o_()),e.registerLanguage("less",c_()),e.registerLanguage("lua",u_()),e.registerLanguage("makefile",d_()),e.registerLanguage("perl",f_()),e.registerLanguage("objectivec",m_()),e.registerLanguage("php",h_()),e.registerLanguage("php-template",p_()),e.registerLanguage("plaintext",g_()),e.registerLanguage("python",b_()),e.registerLanguage("python-repl",v_()),e.registerLanguage("r",y_()),e.registerLanguage("rust",x_()),e.registerLanguage("scss",w_()),e.registerLanguage("shell",S_()),e.registerLanguage("sql",k_()),e.registerLanguage("swift",E_()),e.registerLanguage("yaml",T_()),e.registerLanguage("typescript",N_()),e.registerLanguage("vbnet",C_()),e.registerLanguage("wasm",R_()),e.HighlightJS=e,e.default=e,qm=e,qm}var __=A_();const Jy=qu(__),w6=/^(javascript|vbscript|data):/i;function I_(e){if(!e)return!1;const t=e.trim();return!(!t||w6.test(t))}function M_(e){if(!e)return!1;const t=e.trim();return!t||w6.test(t)||t.startsWith("blob:")||t.startsWith("data:image/")||/^https?:\/\//i.test(t)?!1:!!(t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))}const O_=[[dC,{singleTilde:!1}],[mA,{singleDollarTextMath:!0}]],D_=[GA];let Hm=null,e2=null;async function j_(){return Hm||(e2??=Gw(()=>import("./mermaid.core-t3EZtIGh.js").then(e=>e.bp),[]).then(e=>{e.default.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"});const t=async(n,a)=>{const{svg:s}=await e.default.render(`oc-mermaid-${Math.random().toString(36).slice(2,10)}`,a);n.innerHTML=s};return Hm=t,t}).catch(()=>null),e2)}function L_({code:e}){const t=S.useRef(null),[n,a]=S.useState(!1);return S.useEffect(()=>{let s=!1;return j_().then(l=>{if(s||!l||!t.current){l||a(!0);return}l(t.current,e).catch(()=>{s||a(!0)})}),()=>{s=!0}},[e]),n?f.jsx(_h,{lang:"mermaid",text:e}):f.jsx("div",{className:"oc-mermaid",ref:t,role:"img","aria-label":"Mermaid 图表"})}function _h({lang:e,text:t,children:n}){const[a,s]=S.useState(!1),l=S.useMemo(()=>{const d=Jy.getLanguage(e)?e:"";return d?Jy.highlight(t,{language:d,ignoreIllegals:!0}).value:void 0},[e,t]),c=()=>{navigator.clipboard?.writeText(t).then(()=>{s(!0),window.setTimeout(()=>s(!1),1600)},()=>{})};return f.jsxs("div",{className:"oc-codeblock",children:[f.jsxs("div",{className:"oc-codeblock-head",children:[f.jsx("span",{className:"oc-codeblock-lang",children:e||"text"}),f.jsx("button",{type:"button",className:"oc-codeblock-copy",onClick:c,children:a?"已复制":"复制"})]}),f.jsx("pre",{children:l!==void 0?f.jsx("code",{className:`hljs language-${e}`,dangerouslySetInnerHTML:{__html:l}}):f.jsx("code",{className:e?`hljs language-${e}`:"hljs",children:n??t})})]})}function Ih(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Ih).join("");if(typeof e=="object"&&"props"in e){const t=e.props;return Ih(t?.children)}return""}const z_={pre({children:e}){return f.jsx(f.Fragment,{children:e})},code({className:e,children:t,...n}){const a=Ih(t).replace(/\n$/,""),s=/language-([\w-]+)/.exec(e??"");return s?.[1]==="mermaid"?f.jsx(L_,{code:a}):s||e&&a.includes(`
|
|
306
|
+
`)?f.jsx(_h,{lang:s?.[1]??"",text:a}):a.includes(`
|
|
307
|
+
`)?f.jsx(_h,{lang:"",text:a}):f.jsx("code",{className:e,...n,children:t})},a({href:e,children:t,...n}){if(!I_(e))return f.jsx("span",{...n,children:t});const a=/^https?:\/\//i.test(e??"");return f.jsx("a",{href:e,...a?{target:"_blank",rel:"noopener noreferrer"}:{},...n,children:t})},img({src:e,alt:t}){return M_(e)?f.jsxs(f.Fragment,{children:[f.jsx("img",{src:e,alt:t??"",loading:"lazy",onError:n=>{const a=n.currentTarget;a.hidden=!0,a.nextElementSibling?.removeAttribute("hidden")}}),f.jsx("span",{className:"oc-md-img-fallback",hidden:!0,title:e??void 0,children:t?`[图片加载失败: ${t}]`:"[图片加载失败]"})]}):f.jsx("span",{className:"oc-md-img-fallback",title:e??void 0,children:t?`[图片: ${t}]`:"[图片已屏蔽]"})},table({children:e}){return f.jsx("div",{className:"oc-md-table-wrap",children:f.jsx("table",{children:e})})},input(e){return e.type==="checkbox"?f.jsx("input",{type:"checkbox",checked:!!e.checked,disabled:!0,readOnly:!0}):f.jsx("input",{...e,disabled:!0,readOnly:!0})}};class B_ extends S.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}componentDidUpdate(t){t.text!==this.props.text&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?f.jsx("div",{className:"oc-md",children:f.jsx("pre",{className:"oc-md-fallback",children:this.props.text})}):this.props.children}}function Mh({text:e}){try{return f.jsx(B_,{text:e,children:f.jsx("div",{className:"oc-md",children:f.jsx(JE,{remarkPlugins:O_,rehypePlugins:D_,components:z_,children:e})})})}catch{return f.jsx("div",{className:"oc-md",children:f.jsx("pre",{className:"oc-md-fallback",children:e})})}}const t2="无法在浏览器中打开:弹窗被拦截",U_="内容已截断,以下为已加载片段。";function q_(e){const t=e?.availWidth??1440,n=e?.availHeight??900,a=Math.min(1280,Math.max(880,Math.floor(t*.82))),s=Math.min(960,Math.max(640,Math.floor(n*.88)));return["popup=yes",`width=${a}`,`height=${s}`,"left=72","top=36","menubar=yes","toolbar=yes","location=yes","status=yes","resizable=yes","scrollbars=yes"].join(",")}function Js(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function c0(e){return e.trim().toLowerCase()}function H_(e){const t=c0(e);return t==="html"||t==="htm"}function F_(e){const t=c0(e);return t==="md"||t==="markdown"}function P_(e){if(c0(e.language)!=="json")return e.content;try{return JSON.stringify(JSON.parse(e.content),null,2)}catch{return e.content}}function $_(e){return/^https?:\/\//i.test(e.trim())}function po(e){const t=[];return e.replace(/`([^`]+)`/g,(l,c)=>(t.push(`<code>${c}</code>`),`\0${t.length-1}\0`)).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(l,c,d)=>$_(d)?`<a href="${d}" rel="noopener noreferrer" target="_blank">${c}</a>`:c).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\u0000(\d+)\u0000/g,(l,c)=>t[Number(c)]??"")}function G_(e){return e.length?`<p>${po(e.join(" "))}</p>`:""}function n2(e){const t=e.replaceAll(`\r
|
|
308
|
+
`,`
|
|
309
|
+
`).split(`
|
|
310
|
+
`),n=[];let a=[],s=null;const l=()=>{s&&(n.push(s==="ul"?"</ul>":"</ol>"),s=null)},c=()=>{a.length&&(n.push(G_(a)),a=[])};for(const d of t){const m=/^(#{1,6})\s+(.+)$/.exec(d);if(m){c(),l();const y=m[1].length;n.push(`<h${y}>${po(m[2])}</h${y}>`);continue}if(/^---+$/.test(d.trim())||/^\*\*\*+$/.test(d.trim())){c(),l(),n.push("<hr>");continue}const h=/^>\s?(.*)$/.exec(d);if(h){c(),l(),n.push(`<blockquote><p>${po(h[1]??"")}</p></blockquote>`);continue}const p=/^[-*]\s+(.+)$/.exec(d);if(p){c(),s!=="ul"&&(l(),n.push("<ul>"),s="ul"),n.push(`<li>${po(p[1])}</li>`);continue}const b=/^\d+\.\s+(.+)$/.exec(d);if(b){c(),s!=="ol"&&(l(),n.push("<ol>"),s="ol"),n.push(`<li>${po(b[1])}</li>`);continue}if(d.trim()===""){c(),l();continue}l(),a.push(d)}return c(),l(),n.join(`
|
|
311
|
+
`)}function K_(e){const t=Js(e),n=[],a=/```([^\n`]*)\n([\s\S]*?)```/g;let s=0,l;for(;l=a.exec(t);)l.index>s&&n.push(n2(t.slice(s,l.index))),n.push(`<pre class="md-code"><code>${l[2]??""}</code></pre>`),s=l.index+l[0].length;return s<t.length&&n.push(n2(t.slice(s))),n.filter(Boolean).join(`
|
|
312
|
+
`)}function V_(){return`
|
|
313
|
+
:root { color-scheme: light dark; }
|
|
314
|
+
html, body { margin: 0; min-height: 100%; background: #f7f5f0; color: #1f1b16; }
|
|
315
|
+
body { font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
316
|
+
.bar { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 20px; border-bottom: 1px solid #e4ddd2; background: #fffdf8; }
|
|
317
|
+
.bar .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
|
|
318
|
+
.bar strong { font-size: 13px; font-weight: 650; word-break: break-all; }
|
|
319
|
+
.bar .kind { color: #6b6258; font-size: 12px; }
|
|
320
|
+
.modes { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #e4ddd2; border-radius: 8px; background: #f3eee6; }
|
|
321
|
+
.modes button { appearance: none; border: 0; background: transparent; color: #6b6258; font: 12px/1.2 inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
|
|
322
|
+
.modes button:hover { color: #1f1b16; }
|
|
323
|
+
.modes button.is-active { background: #fff; color: #1f1b16; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
|
|
324
|
+
.notice { margin: 0; padding: 8px 20px; background: #fff6d8; color: #5c4b00; font-size: 13px; }
|
|
325
|
+
.pane { display: none; }
|
|
326
|
+
.pane.is-active { display: block; }
|
|
327
|
+
.doc { max-width: 52rem; margin: 0 auto; padding: 32px 24px 96px; }
|
|
328
|
+
.doc.md h1, .doc.md h2, .doc.md h3, .doc.md h4 { line-height: 1.25; margin: 1.4em 0 0.5em; }
|
|
329
|
+
.doc.md h1 { font-size: 2rem; }
|
|
330
|
+
.doc.md h2 { font-size: 1.45rem; }
|
|
331
|
+
.doc.md p { margin: 0.8em 0; }
|
|
332
|
+
.doc.md ul, .doc.md ol { margin: 0.6em 0; padding-left: 1.4em; }
|
|
333
|
+
.doc.md blockquote { margin: 0.8em 0; padding: 0.2em 0.9em; border-left: 3px solid #d9cfc0; color: #4a433c; }
|
|
334
|
+
.doc.md hr { border: 0; border-top: 1px solid #e4ddd2; margin: 1.6em 0; }
|
|
335
|
+
.doc.md a { color: #0b57d0; }
|
|
336
|
+
.doc.md code, .md-code, .source { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
|
|
337
|
+
.doc.md :not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: #efe8dc; }
|
|
338
|
+
.md-code, .source { margin: 1em 0; padding: 14px 16px; overflow: auto; white-space: pre-wrap; background: #fff; border: 1px solid #e4ddd2; border-radius: 8px; }
|
|
339
|
+
.frame { margin: 0; padding: 0; }
|
|
340
|
+
iframe.page { display: block; width: 100%; height: calc(100vh - 53px); border: 0; background: #fff; }
|
|
341
|
+
`.trim()}function S6(e){return Js(P_(e))}function Y_(e){return H_(e.language)?`<div class="frame"><iframe class="page" sandbox="" srcdoc="${Js(e.content)}"></iframe></div>`:F_(e.language)?`<article class="doc md">${K_(e.content)}</article>`:`<article class="doc"><pre class="source">${S6(e)}</pre></article>`}function X_(e){return`<article class="doc"><pre class="source">${S6(e)}</pre></article>`}function Z_(){return`<script>
|
|
342
|
+
(function () {
|
|
343
|
+
var previewBtn = document.getElementById("view-preview");
|
|
344
|
+
var sourceBtn = document.getElementById("view-source");
|
|
345
|
+
var previewPane = document.getElementById("pane-preview");
|
|
346
|
+
var sourcePane = document.getElementById("pane-source");
|
|
347
|
+
if (!previewBtn || !sourceBtn || !previewPane || !sourcePane) return;
|
|
348
|
+
function show(mode) {
|
|
349
|
+
var source = mode === "source";
|
|
350
|
+
previewBtn.classList.toggle("is-active", !source);
|
|
351
|
+
sourceBtn.classList.toggle("is-active", source);
|
|
352
|
+
previewBtn.setAttribute("aria-pressed", String(!source));
|
|
353
|
+
sourceBtn.setAttribute("aria-pressed", String(source));
|
|
354
|
+
previewPane.classList.toggle("is-active", !source);
|
|
355
|
+
sourcePane.classList.toggle("is-active", source);
|
|
356
|
+
}
|
|
357
|
+
previewBtn.addEventListener("click", function () { show("preview"); });
|
|
358
|
+
sourceBtn.addEventListener("click", function () { show("source"); });
|
|
359
|
+
})();
|
|
360
|
+
<\/script>`}function W_(e){const t=Js(e.path),n=e.truncated?`<p class="notice">${Js(U_)}</p>`:"",a=c0(e.language);return`<!doctype html>
|
|
361
|
+
<html lang="zh-CN">
|
|
362
|
+
<head>
|
|
363
|
+
<meta charset="utf-8">
|
|
364
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
365
|
+
<title>${t}</title>
|
|
366
|
+
<style>
|
|
367
|
+
${V_()}
|
|
368
|
+
</style>
|
|
369
|
+
</head>
|
|
370
|
+
<body>
|
|
371
|
+
<header class="bar">
|
|
372
|
+
<div class="meta">
|
|
373
|
+
<strong>${t}</strong>
|
|
374
|
+
<span class="kind">${Js(a||"text")}${e.truncated?" · 已截断":""}</span>
|
|
375
|
+
</div>
|
|
376
|
+
<div class="modes" role="group" aria-label="查看模式">
|
|
377
|
+
<button type="button" id="view-preview" class="is-active" aria-pressed="true">预览</button>
|
|
378
|
+
<button type="button" id="view-source" aria-pressed="false">查看原文</button>
|
|
379
|
+
</div>
|
|
380
|
+
</header>
|
|
381
|
+
${n}
|
|
382
|
+
<div id="pane-preview" class="pane is-active">${Y_(e)}</div>
|
|
383
|
+
<div id="pane-source" class="pane">${X_(e)}</div>
|
|
384
|
+
${Z_()}
|
|
385
|
+
</body>
|
|
386
|
+
</html>`}function Q_(){const e=globalThis.screen;return{availWidth:e?.availWidth,availHeight:e?.availHeight}}function J_(){const e=globalThis;if(typeof e.open!="function")throw new Error("window.open is unavailable");return{open:e.open.bind(e),createObjectURL:e.URL.createObjectURL.bind(e.URL),revokeObjectURL:e.URL.revokeObjectURL.bind(e.URL)}}function eI(e,t=J_(),n=q_(Q_())){let a;try{const s=W_(e),l=new Blob([s],{type:"text/html;charset=utf-8"});a=t.createObjectURL(l);const c=t.open(a,"_blank",n);if(!c)return t.revokeObjectURL(a),{ok:!1,error:t2};try{c.opener=null}catch{}return{ok:!0}}catch{return a&&t.revokeObjectURL(a),{ok:!1,error:t2}}}function tI(e){return e.language==="md"||e.language==="markdown"}function r2(e){const t=e.previews.find(d=>d.path===e.activePath),n=t?tI(t):!1,[a,s]=S.useState(n?"preview":"source"),[l,c]=S.useState(null);return S.useEffect(()=>{s(n?"preview":"source"),c(null)},[t?.path,n]),!t&&!e.loading?null:f.jsxs(f.Fragment,{children:[t&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"oc-file-preview-backdrop",onMouseDown:d=>{d.target===d.currentTarget&&e.onClose(t.path)}}),f.jsxs("section",{className:"oc-file-preview","aria-label":`文件预览 ${t.path}`,children:[f.jsxs("header",{children:[f.jsx("div",{className:"oc-file-tabs",role:"tablist","aria-label":"文件预览 Tabs",children:e.previews.map(d=>f.jsx("button",{type:"button",role:"tab","aria-selected":d.path===t.path,className:d.path===t.path?"is-active":"",onClick:()=>e.onActivate(d.path),children:d.path},d.path))}),n&&f.jsxs("div",{className:"oc-file-view-modes",role:"group","aria-label":"文件查看模式",children:[f.jsx("button",{type:"button",className:`oc-file-view-mode${a==="preview"?" is-active":""}`,"aria-pressed":a==="preview",onClick:()=>s("preview"),children:"预览"}),f.jsx("button",{type:"button",className:`oc-file-view-mode${a==="source"?" is-active":""}`,"aria-pressed":a==="source",onClick:()=>s("source"),children:"源文件"})]}),f.jsxs("span",{children:[t.bytes," bytes",t.truncated?" · 已截断":""]}),f.jsx("button",{type:"button",className:"oc-file-preview-open",title:"新窗口打开","aria-label":`新窗口打开 ${t.path}`,onClick:()=>{const d=eI(t);c(d.ok?null:d.error)},children:f.jsx(B8,{size:16,"aria-hidden":"true"})}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>e.onClose(t.path),children:"关闭预览"})]}),l?f.jsx("p",{className:"oc-file-preview-open-error",role:"alert",children:l}):null,a==="preview"&&n?f.jsx("div",{className:"oc-file-preview-rendered",children:f.jsx(Mh,{text:t.content})}):f.jsx("pre",{children:f.jsx("code",{children:t.content})})]})]}),e.loading&&f.jsx("div",{className:"oc-file-preview-loading",children:"正在读取文件…"})]})}const k6=[{command:"/task",label:"Task context",description:"查看当前任务、Draft 与 assessment",action:"focus-panel:task",source:"operator"},{command:"/contract",label:"Contract",description:"查看 contract diff 与 apply gate",action:"focus-panel:contract",source:"operator"},{command:"/dag",label:"DAG",description:"查看 DAG spine、确认与运行状态",action:"focus-panel:dag",source:"operator"},{command:"/interview",label:"Interview",description:"打开 Requirement Interview",action:"focus:interview",source:"operator"},{command:"/reload",label:"Reload session",description:"重新加载当前 Pi 会话的设置、扩展、技能、提示词、主题与上下文文件(不产生消息)",action:"reload",source:"operator"}],E6=[{command:"/compact",label:"压缩上下文",description:"压缩当前会话上下文,释放 token",action:"compact",source:"web"},{command:"/name",label:"重命名会话",description:"设置当前会话标题",action:"name",source:"web"},{command:"/session",label:"会话信息",description:"显示当前会话元信息",action:"session",source:"web"},{command:"/copy",label:"复制回复",description:"复制最后一条助手消息原文",action:"copy",source:"web"}],as={operator:0,web:1,extension:2,skill:3,prompt:4};function a2(e){const t=e.trim().split(/\s+/,1)[0]??"";return t?t.startsWith("/")?t.toLowerCase():`/${t.toLowerCase()}`:""}function i2(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t?.startsWith("/"))return;const n=[...k6,...E6].find(a=>a.command===t);return n?{command:n.command,action:n.action}:{command:t,action:"unknown"}}function nI(e){if(e==="focus-panel:task"||e==="focus-panel:contract")return"tasks";if(e==="focus-panel:dag")return"recovery"}function rI(e=[]){const t=new Map,n=a=>{const s=a2(a.command);if(!s)return;const l=t.get(s);if(!l){t.set(s,{...a,command:s});return}as[a.source]<as[l.source]&&t.set(s,{...a,command:s})};for(const a of k6)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of E6)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of e){const s=a2(a.command);s&&n({command:s,label:a.label||s,description:a.description||"",source:a.source,action:"pi-prompt"})}return[...t.values()].sort((a,s)=>{const l=as[a.source]-as[s.source];return l!==0?l:a.command.localeCompare(s.command)})}function aI(e,t){const n=(t.trim().split(/\s+/,1)[0]??"").toLowerCase();if((/\s/.test(t.trimStart().slice(1))||t.includes(" "))&&t.trimStart().includes(" "))return[];const a=n.startsWith("/")?n:n?`/${n}`:"/",s=a==="/"?"":a.slice(1),l=[];for(const c of e){const d=c.command.toLowerCase(),m=d.startsWith("/")?d.slice(1):d,h=c.description.toLowerCase();let p=100;if(!s)p=10+as[c.source];else if(d===a||m===s)p=0;else if(d.startsWith(a)||m.startsWith(s))p=1;else if(m.includes(s)||d.includes(s))p=2;else if(h.includes(s))p=3;else continue;l.push({...c,score:p})}return l.sort((c,d)=>{if(c.score!==d.score)return c.score-d.score;const m=as[c.source]-as[d.source];return m!==0?m:c.command.localeCompare(d.command)})}const iI={operator:"Operator",web:"Pi Web",extension:"Extensions",prompt:"Prompts",skill:"Skills"},sI=new Set(["operatorCapabilities","operationList","operationGet","operationEventSummary","statsContext","sourceInstructions","spineCheck","inspect","observeLink"]);function lI(e){return sI.has(e)?"technical-only":e==="doctor"?"inline-detail":"activity-detail"}const oI={newTask:"创建任务",importPrd:"任务需求",contractShow:"任务边界",contractApply:"更新任务契约",contractDiff:"任务契约差异",contractDraftSave:"任务契约草稿",contractValidate:"检查任务契约",taskAdvance:"推进任务准备",dagRunTask:"执行流程",dagValidate:"校验执行流程",prepareDagConfirmation:"执行确认",confirmDagConfirmation:"确认执行边界",prepareDagExecution:"执行边界",runDag:"任务执行",operationWait:"执行监督",operationGet:"任务活动详情",operationList:"会话活动",operationEventSummary:"执行进展摘要",dagStatus:"执行状态",dagDoctor:"执行诊断",dagReport:"执行结果",dagRerunPlan:"节点恢复评估",dagRerun:"从失败节点恢复",dagInterruptEligibility:"中止资格",standaloneTaskRerun:"带反馈重新执行",workerTaskRetry:"重试 Worker 任务",workerPoolDoctor:"任务池诊断",promoteRun:"任务推进",status:"任务状态"},cI={newTask:{running:"正在创建任务",success:"任务已经创建",error:"创建任务时遇到问题"},importPrd:{running:"正在整理并导入任务需求",success:"任务需求已经导入",error:"导入任务需求时遇到问题"},contractShow:{running:"正在读取任务目标和执行边界",success:"任务目标与执行边界已经读取",error:"读取任务边界时遇到问题"},taskAdvance:{running:"正在推进任务契约并准备执行流程",success:"任务已经推进到下一安全阶段",error:"任务推进被契约或执行边界阻塞"},dagRunTask:{running:"正在生成并校验执行流程",success:"执行流程已经准备好",error:"准备执行流程时遇到问题"},prepareDagExecution:{running:"正在确认任务可以安全执行",success:"执行边界已经确认",error:"执行边界尚未通过确认"},runDag:{running:"正在启动任务执行",success:"任务执行已经启动",error:"启动任务执行时遇到问题"},dagReport:{running:"正在读取本次执行结果",success:"本次执行结果已经读取",error:"读取执行结果时遇到问题"},dagRerunPlan:{running:"正在评估能否从失败节点安全恢复",success:"节点恢复条件评估已经完成",error:"暂时无法确定安全的恢复方式"},dagRerun:{running:"正在创建节点恢复 run",success:"节点恢复 run 已经启动",error:"从失败节点恢复时遇到问题"},dagInterruptEligibility:{running:"正在检查能否协作中止此运行",success:"中止资格已经确认",error:"当前运行不能协作中止"},standaloneTaskRerun:{running:"正在创建新的完整 DAG,并带入上一轮未解决反馈",success:"新的完整 DAG 已经按上一轮反馈重新执行",error:"带反馈重新执行任务时遇到问题"},workerPoolDoctor:{running:"正在读取任务池状态",success:"任务池状态已经读取",error:"读取任务池状态时遇到问题"},promoteRun:{running:"正在推进任务状态",success:"任务状态已经更新",error:"推进任务状态时遇到问题"},status:{running:"正在读取任务状态",success:"任务状态已经更新",error:"读取任务状态时遇到问题"},contractApply:{running:"正在应用任务契约变更",success:"任务契约已经更新",error:"应用任务契约变更时遇到问题"},contractDiff:{running:"正在比较任务契约版本",success:"任务契约差异已经读取",error:"比较任务契约时遇到问题"},contractDraftSave:{running:"正在保存任务契约草稿",success:"任务契约草稿已经保存",error:"保存任务契约草稿时遇到问题"},contractValidate:{running:"正在检查任务契约",success:"任务契约检查已经完成",error:"任务契约检查没有通过"},dagValidate:{running:"正在校验执行流程",success:"执行流程校验已经通过",error:"执行流程校验没有通过"},prepareDagConfirmation:{running:"正在准备执行确认",success:"执行确认已经准备好",error:"准备执行确认时遇到问题"},confirmDagConfirmation:{running:"正在确认执行边界",success:"执行边界已经确认",error:"执行边界尚未通过确认"},operationGet:{running:"正在读取任务活动详情",success:"任务活动详情已经读取",error:"读取任务活动详情时遇到问题"},operationList:{running:"正在读取本次对话的活动",success:"本次对话的活动已经读取",error:"读取对话活动时遇到问题"},operationEventSummary:{running:"正在汇总执行进展",success:"执行进展已经汇总",error:"汇总执行进展时遇到问题"},dagStatus:{running:"正在读取执行状态",success:"执行状态已经更新",error:"读取执行状态时遇到问题"},dagDoctor:{running:"正在诊断本次任务执行",success:"任务执行诊断已经完成",error:"诊断任务执行时遇到问题"},workerTaskRetry:{running:"正在重试失败的任务",success:"失败任务已经重新开始",error:"重试失败任务时遇到问题"},doctor:{running:"正在检查运行环境",success:"运行环境检查已经完成",error:"运行环境检查发现问题"},inspect:{running:"正在读取详细运行信息",success:"详细运行信息已经读取",error:"读取详细运行信息时遇到问题"},observeLink:{running:"正在准备运行看板入口",success:"运行看板入口已经准备好",error:"准备运行看板入口时遇到问题"},operatorCapabilities:{running:"正在读取可用操作能力",success:"可用操作能力已经读取",error:"读取可用操作能力时遇到问题"},sourceInstructions:{running:"正在读取任务来源说明",success:"任务来源说明已经读取",error:"读取任务来源说明时遇到问题"},spineCheck:{running:"正在检查计划执行步骤",success:"计划执行步骤检查已经完成",error:"计划执行步骤检查发现问题"},statsContext:{running:"正在统计上下文使用情况",success:"上下文使用情况已经统计完成",error:"统计上下文使用情况时遇到问题"}},uI=[{pattern:/(?:^|-)contract(?:-pi)?$/i,running:"正在核对任务目标和执行边界",finished:"任务目标与执行边界已确认",error:"任务边界存在冲突,需要先处理"},{pattern:/scout-src/i,running:"正在梳理与任务相关的代码",finished:"相关代码范围已梳理",error:"梳理相关代码时遇到问题"},{pattern:/scout-tests/i,running:"正在检查现有测试和验证方式",finished:"现有测试与验证方式已确认",error:"检查现有测试时遇到问题"},{pattern:/plan/i,running:"正在整理具体实施步骤",finished:"实施步骤已经准备好",error:"实施方案还需要进一步完善"},{pattern:/implement|writer/i,running:"正在修改并保存相关文件",finished:"文件修改已经完成",error:"修改文件时遇到问题"},{pattern:/verify|reverify/i,running:"正在验证本次修改",finished:"本次修改已通过验证",error:"验证没有通过,正在检查原因"},{pattern:/review/i,running:"正在检查改动是否完整",finished:"改动完整性检查已通过",error:"发现需要补充或修正的内容"},{pattern:/closeout/i,running:"正在整理交付结果",finished:"任务已经完成并形成交付记录",error:"交付结果尚未整理完整"}];function T6(e){if(!(!e||typeof e!="object"))return e}function Sp(e){if(e&&typeof e=="object")return e;if(typeof e=="string")try{return T6(JSON.parse(e))}catch{return}}function Fm(e){const n=Sp(e)?.operationId;return typeof n=="string"&&n?n:void 0}function dI(e){const n=Sp(e)?.maxWaitMs;if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.max(1,Math.round(n/1e3))}function N6(e){const t=e.operationId??Fm(e.args)??Fm(e.result)??Fm(e.resultText);return t?`operation:${t}`:`tool:${e.id}`}function fI(e){return e==="running"?"progress":e==="error"?"error":"success"}function mI(e){return Sp(e.resultText??e.result)}function hI(e){return Array.isArray(e.events)?e.events.flatMap(t=>{const n=T6(t);if(!n)return[];const a=n.messagePreview??n.message;return typeof a=="string"?[a]:[]}):[]}function pI(e,t,n){const a=[];for(const m of e)for(const h of m.matchAll(/node-(started|finished)[^\n]*?node=([^\s,]+)/gi)){const p=h[1]?.toLowerCase(),b=h[2]??"",y=m.match(/status=([^\s,]+)/i)?.[1]?.toUpperCase();let x="finished";y==="ERROR"||y==="FAILED"?x="error":p==="started"&&(x="running"),a.push({node:b,status:x})}const s=a.at(-1);if(!s)return;const l=a.some(m=>/scout-src/i.test(m.node)&&m.status==="finished"),c=a.some(m=>/scout-tests/i.test(m.node)&&m.status==="finished");if(l&&c)return{id:t,kind:"success",title:"代码与测试的影响范围已确认",activityRef:n};const d=uI.find(m=>m.pattern.test(s.node));return d?s.status==="running"?{id:t,kind:"progress",title:d.running,activityRef:n}:s.status==="error"?{id:t,kind:"error",title:d.error,activityRef:n}:{id:t,kind:"success",title:d.finished,activityRef:n}:{id:t,kind:"success",title:"执行状态已经更新",activityRef:n}}function gI(e){const t=N6(e),n=`activity:${e.id}`,a=dI(e.args);if(e.status==="running")return{id:n,kind:"progress",title:a?`正在等待新的执行进展,最长等待时间 ${a} 秒`:"正在等待新的执行进展",activityRef:t};if(e.status==="error")return{id:n,kind:"error",title:"等待执行进展时遇到问题",activityRef:t};let s="";typeof e.resultText=="string"?s=e.resultText:typeof e.result=="string"&&(s=e.result);const l=mI(e),c=pI([s,...l?hI(l):[]],n,t);if(c)return c;if(l){if(l.timedOut===!0||l.changed===!1)return{id:n,kind:"warning",title:"等待期间没有新的执行进展",activityRef:t};if(l.changed===!0)return{id:n,kind:"success",title:"已经收到新的执行进展",activityRef:t}}return{id:n,kind:"success",title:"执行状态已经更新",activityRef:t}}function bI(e){const t=lI(e.toolName);if(t==="technical-only"||t==="inline-detail")return;if(e.toolName==="operationWait")return gI(e);const n=cI[e.toolName];if(!n)return;let a=n.success;return e.status==="running"?a=n.running:e.status==="error"&&(a=n.error),{id:`activity:${e.id}`,kind:fI(e.status),title:a,activityRef:N6(e)}}function C6(e){return oI[e]??"任务活动"}function kp(e){switch(e){case"starting":return{label:"正在启动",kind:"progress"};case"running":return{label:"运行中",kind:"progress"};case"succeeded":case"finished":case"FINISHED":case"pass":return{label:"已完成",kind:"success"};case"failed":case"partial_failed":case"ERROR":case"FAILED":case"timed-out":return{label:"未完成",kind:"error"};case"needs-reconcile":return{label:"需要同步",kind:"warning"};case"cancelled":case"abandoned":case"superseded":return{label:"已停止",kind:"warning"};default:return{label:"状态已更新",kind:"success"}}}function R6(e){return[e.activityRef??`operation:${e.operationId}`,`operation:${e.operationId}`,...e.toolCallId?[`tool:${e.toolCallId}`]:[]]}function A6(e){return[e.activityRef??`gate:${e.cardId}`]}function _6(e){return[e.activityRef??`artifact:${e.artifactId}`]}function vI(e){return new Set([...e.operations.flatMap(R6),...e.gates.flatMap(A6),...e.artifacts.flatMap(_6)])}function s2(e){return e.updatedSeq??e.eventSeq}function l2(e){const t=Date.parse(e.updatedAt);return Number.isFinite(t)?t:0}function Ep(e,t){const n=s2(e),a=s2(t);return n!==void 0&&a!==void 0?n-a:l2(e)-l2(t)}function yI(e){return e.taskId?`task:${e.taskId}`:e.dagRunId?`run:${e.dagRunId}`:`operation:${e.operationId}`}function xI(e){return e.taskId?e.taskId.replace(/^\d{4}-\d{2}-\d{2}-/,"").replace(/[-_]+/g," ").trim()||e.taskId:C6(e.action)}function wI(e){return[...new Set(e)]}function SI(e){const t=new Map;for(const n of e)t.set(n.action,n);return[...t.values()].sort(Ep).map(n=>{const a=kp(n.state);return{id:n.operationId,label:C6(n.action),stateLabel:a.label,kind:a.kind,at:n.updatedAt}})}function kI(e){const t=new Map;for(const n of e){const a=n.dagRunId??n.runSummary?.runId;if(!a)continue;const s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort((h,p)=>Ep(p,h)),l=s[0];if(!l)return[];const c=s.find(h=>h.runSummary)?.runSummary,d=c?.status??l.state,m=kp(d);return[{runId:n,state:d,stateLabel:m.label,kind:m.kind,updatedAt:l.updatedAt,operationCount:a.length,firstFailedNode:c?.nodes.find(h=>h.status==="ERROR")?.id,failureCategory:c?.failureCategory,inspectHref:l.inspectHref}]}).sort((n,a)=>Date.parse(a.updatedAt)-Date.parse(n.updatedAt))}function I6(e){const t=new Map;for(const n of e){const a=yI(n),s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort(Ep),l=s.at(-1);if(!l)return[];const c=kp(l.state);return[{key:n,taskId:l.taskId,displayTitle:xI(l),state:l.state,stateLabel:c.label,kind:c.kind,updatedAt:l.updatedAt,latestOperation:l,operations:s,steps:SI(s),runs:kI(s),activityRefs:wI(s.flatMap(R6)),compactEligible:c.kind==="success"}]}).sort((n,a)=>{const s=n.kind==="progress"||n.kind==="error"?0:1,l=a.kind==="progress"||a.kind==="error"?0:1;return s!==l?s-l:Date.parse(a.updatedAt)-Date.parse(n.updatedAt)})}const EI={operation:"执行记录",contract:"任务契约",dag:"执行流程",report:"报告",html:"HTML 预览"};function TI(e){const{artifact:t}=e,n=!!(t.reportText||t.htmlPreview);return f.jsxs("section",{className:"oc-artifact-card","aria-label":`任务产物:${t.title??t.artifactId}`,"data-activity-ref":t.activityRef??`artifact:${t.artifactId}`,children:[f.jsxs("header",{children:[f.jsxs("div",{children:[f.jsx("small",{children:"任务产物"}),f.jsx("strong",{children:t.title??t.artifactId}),f.jsx("code",{children:t.artifactId})]}),f.jsx("span",{children:EI[t.kind]})]}),t.summary?f.jsx("p",{children:t.summary}):null,n?f.jsxs("details",{className:"oc-artifact-details",children:[f.jsx("summary",{children:"预览与技术详情"}),t.reportText?f.jsx("pre",{children:t.reportText}):null,t.htmlPreview?f.jsx("iframe",{title:`${t.title??t.artifactId} preview`,sandbox:"",srcDoc:t.htmlPreview}):null]}):null,t.inspectHref?f.jsx("footer",{children:f.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>window.open(t.inspectHref,"_blank","noopener,noreferrer"),children:"打开产物"})}):null]})}const o2={prepared:"等待确认",confirmed:"已经确认",dispatched:"正在执行",consumed:"已经完成",stale:"已经失效",expired:"已经过期",error:"处理失败"};function c2(e){return e.gateType==="contract-apply"?"确认任务契约变更":e.gateType==="mutation"?"确认执行工作区修改":"确认启动任务执行"}function NI({card:e,origin:t,sessionId:n}){const[a,s]=S.useState(!1),[l,c]=S.useState(),d=async()=>{s(!0),c(void 0);try{let b="contract-apply";e.gateType==="dag-run"?b=e.state==="prepared"?"dag-confirm":"dag-run":e.gateType==="mutation"&&(b="mutation-apply");const y=e.gateType==="dag-run"?{confirmationId:e.confirmationId,...e.state==="prepared"?{humanGateToken:e.humanGateToken}:{}}:{receiptId:e.receiptId,humanGateToken:e.humanGateToken},x=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/human-gate/${b}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},body:JSON.stringify(y)}),k=await x.json();if(!x.ok)throw new Error(k.error?.message??`HTTP ${x.status}`)}catch(b){c(b instanceof Error?b.message:String(b))}finally{s(!1)}},m=e.state==="prepared"||e.gateType==="dag-run"&&e.state==="confirmed";let h="确认接受";e.gateType==="mutation"?h="确认执行":e.gateType==="dag-run"&&(h=e.state==="prepared"?"确认边界":"启动执行");const p=(e.displayOnlyChallenges?.length??0)+(e.dagSpine?.length??0);return f.jsxs("section",{className:`oc-human-gate-card is-${e.state}`,"aria-label":`${c2(e)}:${o2[e.state]}`,"data-activity-ref":e.activityRef??`gate:${e.cardId}`,children:[f.jsxs("header",{children:[f.jsxs("div",{children:[f.jsx("small",{children:"人工门禁"}),f.jsx("strong",{children:c2(e)}),f.jsx("code",{children:e.taskId})]}),f.jsx("span",{children:o2[e.state]})]}),e.contractDiffSummary?f.jsx("p",{className:"oc-human-gate-summary",children:e.contractDiffSummary}):null,p>0||e.errorMessage?f.jsxs("details",{className:"oc-human-gate-details",children:[f.jsxs("summary",{children:["门禁详情 · ",p," 项"]}),e.displayOnlyChallenges?.length?f.jsxs("div",{className:"oc-human-gate-challenges",children:[f.jsx("b",{children:"确认前请检查"}),f.jsx("ul",{children:e.displayOnlyChallenges.map(b=>f.jsx("li",{children:b},b))})]}):null,e.dagSpine?.length?f.jsxs("div",{children:[f.jsx("b",{children:"计划执行步骤"}),f.jsx("ol",{children:e.dagSpine.map(b=>f.jsx("li",{children:f.jsx("code",{children:b})},b))})]}):null,e.errorMessage?f.jsx("p",{className:"oc-human-gate-error",children:e.errorMessage}):null]}):null,f.jsxs("footer",{children:[f.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>window.open(e.inspectHref,"_blank","noopener,noreferrer"),children:"查看记录"}),f.jsx("button",{className:"btn btn-primary",type:"button",disabled:!m||a,onClick:()=>{d()},children:a?"提交中…":h})]}),l?f.jsx("div",{className:"oc-human-gate-error",children:l}):null]})}const Yr="loop-console.operator-chat.active-session.v1",CI="loop-console.operator-chat.default-landing.v1";function Du(e){const t=e?.trim().toLowerCase();if(t==="chat")return"chat";if(t==="tasks")return"tasks"}function M6(e){const t=e?.trim().toLowerCase();if(t==="chat"||t==="tasks"||t==="recovery"||t==="night"||t==="models"||t==="settings")return t}function O6(e){const t=n=>e.get(n)?.trim()||void 0;return{...t("taskId")?{taskId:t("taskId")}:{},...t("dagRunId")?{dagRunId:t("dagRunId")}:{},...t("fromNodeId")?{fromNodeId:t("fromNodeId")}:{},...t("featureId")?{featureId:t("featureId")}:{},...t("intent")?{intent:t("intent")}:{}}}function D6(e){const t=String(e??"").replace(/^#/,"");if(!t)return null;const n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n+1):"",l=(a||"/").split("?")[0]||"/";if(l==="/"||l==="")return null;const c=l.replace(/^\//,"").split("/")[0],d=M6(c);return d?{workspace:d,...O6(new URLSearchParams(s))}:null}function RI(e){const t=new URLSearchParams(e.search),n=e.hash.startsWith("#")?e.hash.slice(1):e.hash,a=new URLSearchParams(n),s=M6(t.get("workspace")??t.get("landing")??a.get("workspace"));return s?{workspace:s,...O6(t)}:null}function AI(e){if(!e)return;const t=D6(e.hash);if(t)return t.workspace;const n=new URLSearchParams(e.search),a=Du(n.get("landing")??n.get("workspace"));if(a)return a;const s=e.hash.startsWith("#")?e.hash.slice(1):e.hash;return Du(new URLSearchParams(s).get("workspace"))}function j6(e){return AI(e.location)??Du(e.storage?.getItem(CI))??Du(e.env)??"chat"}function L6(e,t={}){const n=new URLSearchParams;for(const[l,c]of Object.entries(t))c?.trim()&&n.set(l,c.trim());const a=n.toString(),s=`/${e}`;return a?`${s}?${a}`:s}function _I(e,t={}){return`#${L6(e,t)}`}function II(e){return D6(e.hash)??RI(e)}const MI={validation:"节点输出未通过契约或门禁校验。可在恢复页从失败节点重跑;若错误指向任务契约(如验证命令、Mock 策略),先修正任务配置并重新生成 DAG。",executor:"执行器或模型提供方调用失败(网络、配额或运行时错误)。稍后可在恢复页从失败节点重跑;反复出现请到「模型与认证」页检查配置与凭据。","write-guard":"写入越过了授权边界(writeSet / allowedPaths)。检查计划中的写入路径是否越界,修正后从失败节点重跑。",timeout:"节点执行超时。可在恢复页从失败节点重跑;反复超时建议缩小任务范围或排查卡住的命令。",auth:"模型或服务认证失败。请先到「模型与认证」页检查 API Key 与模型配置,再从失败节点重跑。","human-required":"节点正在等待人工审批。完成审批后该节点可继续执行;也可在恢复页查看对账状态。","human-rejected":"人工审批被拒绝。请调整任务描述或契约后重新发起任务。","shell-command":"验证/构建命令以非零退出。进入 DAG 查看命令输出定位具体失败,修复后从失败节点重跑。","static-error":"静态检查(typecheck / lint 等)失败。修复对应代码错误后从失败节点重跑。","decision-envelope":"决策与证据不匹配(决策包络校验失败)。进入 DAG 查看节点决策依据,修正后重跑。",unknown:"失败原因未归类。进入 DAG 查看节点详情,或在恢复页使用对账 / 诊断入口。"};function OI(e){if(e)return MI[e]}function u2(e,t=900){if(e)return e.length>t?`${e.slice(0,t)}…`:e}function Pm(e){return new Date(e).toLocaleString()}function d2(e){if(!e)return;const t=e.trim();if(/taskId[^\n]*(?:placeholder|占位)|["']?<id>["']?/i.test(t))return"任务编号仍是占位符;请提供实际的 YYYY-MM-DD-<slug> 任务编号后重试。";if(/ENOENT|no such file or directory/i.test(t))return"任务活动缺少所需文件或目录,可进入 DAG 查看详情。";if(/command failed|exited with code/i.test(t))return"相关命令没有成功完成,可进入 DAG 查看详情。";if(!(t.length>220||t.startsWith("{")||t.startsWith("[")||t.includes("[dag execute]")||t.includes("schemaVersion")||/[A-Za-z]:\\/.test(t)))return t}function DI(e){const t=e.latestOperation,n=t.runSummary;if(e.kind==="success"||e.kind==="progress")return;const a=n?.nodes.find(c=>c.status==="ERROR")?.id;if(a){const c=n?.failureCategory?`,原因分类为 ${n.failureCategory}`:"";return`执行在 ${a} 阶段未完成${c}。`}const s=n?.next?.description;if(s&&/fail|error|block|cannot|unable/i.test(s))return s;const l=d2(t.stderrPreview)??d2(t.summaryPreview);return l||(e.kind==="error"?"本次任务活动没有完成,可进入 DAG 查看详情或使用恢复选项。":"本次任务活动需要进一步确认,请查看相关记录。")}function jI(e){const{journey:t}=e,n=t.latestOperation,a=t.runs[0],s=t.runs.slice(1),l=n.inspectHref.startsWith("/")?`${e.origin}${n.inspectHref}`:n.inspectHref,c=DI(t),d=t.kind==="error"||t.kind==="warning",m=t.latestOperation.runSummary,h=m?.nodes.find(y=>y.failureCategory)?.failureCategory??m?.failureCategory,p=d?OI(h):void 0,b=(y,x)=>{e.onNavigateWorkspace?e.onNavigateWorkspace(y,x):window.location.assign(_I(y,x))};return e.compact?f.jsxs("details",{className:"oc-journey-compact",children:[f.jsxs("summary",{children:[f.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:t.displayTitle}),f.jsxs("small",{children:[t.stateLabel," · ",Pm(t.updatedAt)]})]}),f.jsx("span",{"aria-hidden":"true",children:"›"})]}),f.jsxs("div",{className:"oc-journey-compact-body",children:[t.taskId?f.jsx("code",{children:t.taskId}):null,f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>window.open(l,"_blank","noopener,noreferrer"),children:"查看记录"})]})]}):f.jsxs("section",{className:`oc-task-journey-card is-${t.kind}`,"aria-label":`${t.displayTitle}:${t.stateLabel}`,children:[f.jsxs("header",{className:"oc-journey-head",children:[f.jsxs("div",{children:[f.jsxs("div",{className:"oc-journey-state-line",children:[f.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),f.jsx("span",{children:t.stateLabel})]}),f.jsx("strong",{children:t.displayTitle}),t.taskId?f.jsxs("small",{children:["Task · ",f.jsx("code",{children:t.taskId})]}):null]}),f.jsx("time",{dateTime:t.updatedAt,children:Pm(t.updatedAt)})]}),f.jsx("div",{className:"oc-journey-steps","aria-label":"任务旅程",children:t.steps.slice(-6).map(y=>f.jsxs("div",{className:"oc-journey-step",children:[f.jsx("span",{className:`oc-journey-step-icon is-${y.kind}`,"aria-hidden":"true",children:y.kind==="success"?"✓":y.kind==="error"?"!":"•"}),f.jsx("span",{children:y.label}),f.jsx("small",{children:y.stateLabel})]},y.id))}),c?f.jsxs("div",{className:`oc-journey-outcome is-${t.kind}`,children:[f.jsx("strong",{children:d?"当前问题":"最新结果"}),f.jsx("p",{children:c}),p?f.jsxs("p",{className:"oc-journey-advice","data-testid":"oc-journey-advice",children:["建议:",p]}):null]}):null,a?f.jsxs("div",{className:"oc-journey-latest-run",children:[f.jsx("span",{children:"最新执行"}),f.jsx("code",{children:a.runId}),f.jsx("b",{className:`is-${a.kind}`,children:a.stateLabel}),a.firstFailedNode?f.jsxs("small",{children:["失败阶段 · ",a.firstFailedNode]}):null]}):null,s.length>0?f.jsxs("details",{className:"oc-journey-history",children:[f.jsxs("summary",{children:["执行历史 ",t.runs.length," 次"]}),f.jsx("div",{children:t.runs.map(y=>f.jsxs("div",{className:"oc-journey-run-row",children:[f.jsx("code",{children:y.runId}),f.jsx("span",{className:`is-${y.kind}`,children:y.stateLabel}),y.firstFailedNode?f.jsx("small",{children:y.firstFailedNode}):null,f.jsx("time",{dateTime:y.updatedAt,children:Pm(y.updatedAt)})]},y.runId))})]}):null,f.jsxs("footer",{className:"oc-journey-actions",children:[f.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>{const y=n.dagRunId??a?.runId,x=y?n.inspectHref.startsWith("/")?`${e.origin}/inspect/#/dag/${encodeURIComponent(y)}`:`/inspect/#/dag/${encodeURIComponent(y)}`:l;window.open(x,"_blank","noopener,noreferrer")},children:"进入 DAG"}),d&&(t.taskId||n.dagRunId)?f.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>b("recovery",{taskId:t.taskId,dagRunId:n.dagRunId}),children:"恢复选项"}):null]}),f.jsxs("details",{className:"oc-journey-technical",children:[f.jsxs("summary",{children:["技术详情 · ",t.operations.length," 项活动"]}),f.jsx("div",{className:"oc-journey-technical-body",children:t.operations.map(y=>f.jsxs("div",{className:"oc-journey-operation-row",children:[f.jsxs("div",{children:[f.jsx("code",{children:y.operationId}),f.jsx("span",{children:y.action})]}),y.dagRunId?f.jsxs("small",{children:["run · ",y.dagRunId]}):null,y.controller?f.jsxs("small",{children:["controller · ",y.controller]}):null,y.stderrPreview?f.jsx("pre",{className:"is-error",children:u2(y.stderrPreview)}):null,y.summaryPreview?f.jsx("pre",{children:u2(y.summaryPreview)}):null]},y.operationId))})]})]})}function f2(e){return e.state==="prepared"||e.state==="confirmed"?0:e.state==="dispatched"?1:e.state==="error"?2:3}function $m(e,t){return e!==null&&t.includes(e)}function LI(e){return e.operations>0?"operations":e.gates>0?"gates":"artifacts"}function zI(e){const t=e.presentation==="sidecar",n=t||e.open,a=S.useRef(null),[s,l]=S.useState("operations"),c=S.useMemo(()=>I6(e.operationCards),[e.operationCards]),d=c.length+e.humanGateCards.length+e.artifactCards.length,m=S.useMemo(()=>[...e.humanGateCards].sort((x,k)=>{const T=f2(x)-f2(k);return T!==0?T:(k.eventSeq??0)-(x.eventSeq??0)}),[e.humanGateCards]),h=S.useMemo(()=>[...e.artifactCards].sort((x,k)=>(k.eventSeq??0)-(x.eventSeq??0)),[e.artifactCards]);if(Pu({open:n&&!t,containerRef:a,triggerRef:e.triggerRef,onEscape:e.onClose}),S.useEffect(()=>{l(LI({operations:c.length,gates:e.humanGateCards.length,artifacts:e.artifactCards.length}))},[e.sessionId]),S.useEffect(()=>{e.focusRef&&(e.focusRef.startsWith("gate:")?l("gates"):e.focusRef.startsWith("artifact:")?l("artifacts"):l("operations"))},[e.focusRef]),S.useEffect(()=>{if(!n||!e.focusRef)return;const x=window.requestAnimationFrame(()=>{const k=a.current;if(!k)return;Array.from(k.querySelectorAll("[data-activity-ref], [data-tool-call-id], [data-activity-refs]")).find(C=>{const _=C.dataset.activityRefs?.split(" ")??[];return C.dataset.activityRef===e.focusRef||_.includes(e.focusRef??"")||C.dataset.toolCallId&&`tool:${C.dataset.toolCallId}`===e.focusRef})?.scrollIntoView({block:"nearest",behavior:"smooth"})});return()=>window.cancelAnimationFrame(x)},[n,s,e.focusRef]),!n||d===0)return null;let p="is-drawer";t?p="is-sidecar":e.presentation==="sheet"&&(p="is-sheet");const b=t&&e.sidecarRect?{top:e.sidecarRect.top,left:e.sidecarRect.left,height:e.sidecarRect.height,width:e.sidecarRect.width}:void 0,y=f.jsxs("aside",{ref:a,id:"oc-activity-rail",className:`oc-activity-rail ${p} is-${e.phase}`,style:b,"aria-label":"本次对话的活动","aria-busy":e.phase==="switching",tabIndex:-1,children:[f.jsxs("header",{className:"oc-activity-rail-head",children:[f.jsxs("div",{children:[f.jsx("strong",{children:"本次对话的活动"}),f.jsx("small",{children:"运行、门禁与任务产物"})]}),f.jsx("span",{className:"oc-activity-count",children:d}),t?null:f.jsx("button",{type:"button",className:"oc-activity-close","aria-label":"关闭运行活动",onClick:e.onClose,children:"×"})]}),f.jsxs("div",{className:"oc-activity-content",children:[f.jsxs("div",{className:"oc-activity-tabs",role:"tablist","aria-label":"活动类型",children:[f.jsxs("button",{type:"button",role:"tab","aria-selected":s==="operations",className:s==="operations"?"is-active":"",onClick:()=>l("operations"),children:["运行 ",f.jsx("span",{children:c.length})]}),f.jsxs("button",{type:"button",role:"tab","aria-selected":s==="gates",className:s==="gates"?"is-active":"",onClick:()=>l("gates"),children:["门禁 ",f.jsx("span",{children:m.length})]}),f.jsxs("button",{type:"button",role:"tab","aria-selected":s==="artifacts",className:s==="artifacts"?"is-active":"",onClick:()=>l("artifacts"),children:["产物 ",f.jsx("span",{children:h.length})]})]}),f.jsxs("div",{className:"oc-activity-list",children:[s==="operations"&&c.length===0?f.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务执行记录。"}):null,s==="operations"?c.map((x,k)=>{const T=x.activityRefs;return f.jsxs("div",{"data-activity-refs":T.join(" "),className:`oc-activity-card-wrap${$m(e.focusRef,T)?" is-focused":""}`,children:[f.jsx(jI,{journey:x,compact:k>0&&x.compactEligible,origin:e.origin,onNavigateWorkspace:e.onNavigateWorkspace}),f.jsx("button",{type:"button",className:"oc-activity-locate",onClick:()=>e.onLocateConversation(T),children:"查看对话位置"})]},x.key)}):null,s==="gates"&&m.length===0?f.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有需要展示的门禁。"}):null,s==="gates"?m.map(x=>{const k=A6(x);return f.jsx("div",{className:`oc-activity-card-wrap${$m(e.focusRef,k)?" is-focused":""}`,children:f.jsx(NI,{card:x,origin:e.origin,sessionId:e.sessionId})},x.cardId)}):null,s==="artifacts"&&h.length===0?f.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务产物。"}):null,s==="artifacts"?h.map(x=>{const k=_6(x);return f.jsx("div",{className:`oc-activity-card-wrap${$m(e.focusRef,k)?" is-focused":""}`,children:f.jsx(TI,{artifact:x})},x.artifactId)}):null]})]},e.sessionId)]});return t?Mo.createPortal(y,document.body):y}const z6=420,B6=12;function BI(e){if(e.layoutMode==="narrow")return"sheet";const t=e.railWidth??z6,n=e.gap??B6;return e.viewportWidth-e.mainRight>=t+n?"sidecar":"drawer"}const UI={presentation:"drawer",sidecarRect:null};function qI(e,t,n){const[a,s]=S.useState(UI);return S.useLayoutEffect(()=>{const l=e.current;if(!l)return;const c=l.closest(".panel--chat")??l;let d=0;const m=()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{const p=l.getBoundingClientRect(),b=c.getBoundingClientRect(),y=BI({layoutMode:t,viewportWidth:window.innerWidth,mainRight:p.right}),x=y==="sidecar"?{top:b.top,left:p.right+B6,height:b.height,width:z6}:null;s(k=>k.presentation===y&&k.sidecarRect?.top===x?.top&&k.sidecarRect?.left===x?.left&&k.sidecarRect?.height===x?.height&&k.sidecarRect?.width===x?.width?k:{presentation:y,sidecarRect:x})})};m();const h=new ResizeObserver(m);return h.observe(l),c!==l&&h.observe(c),window.addEventListener("resize",m),()=>{window.cancelAnimationFrame(d),h.disconnect(),window.removeEventListener("resize",m)}},[t,e,n]),a}const m2={comfortableMin:620,compactMin:480};function HI(e){return!Number.isFinite(e)||e<0?"extra-compact":e>=m2.comfortableMin?"comfortable":e>=m2.compactMin?"compact":"extra-compact"}function FI(e){return`is-landing-${e}`}const PI=[{label:"新建任务",hint:"先走需求分析 skills,再导入创建任务",prompt:["我要新建任务。请先做需求分析,不要用一句话直接 bootstrapFromPrd。","1. 先问我需求内容和范围(frontend / backend / both,默认 both)。","2. 读取并严格执行 `.agents/skills/analyze-product-requirements/SKILL.md`(`loop-agent init --profile full` 会投影该 skill):按规程澄清访谈、校验,并把产物写到 `docs/product-analysis/<requirement-id>/`(product-analysis.md、requirement-clarification.md、product-requirement.md)。","3. product-requirement 为 complete 且校验通过后,再严格执行 `.agents/skills/analyze-product-dependencies/SKILL.md`,生成 dependency-analysis.md 和按需的 api-documentation.md。","4. 两套产物都校验通过后,再用这些文件 bootstrapFromPrd 创建任务,并建议 taskKind。","若上述 skill 不存在,先说明缺失,并提示运行 `loop-agent init --repo-root . --profile full --merge`。"].join(`
|
|
387
|
+
`)},{label:"查看任务状态",hint:"列出任务与就绪/阻塞状态",prompt:"列出当前所有 task 及其状态,重点说明哪些是 Ready 可以推进、哪些 Blocked 及阻塞原因。"},{label:"诊断 DAG 运行",hint:"对失败运行跑 Doctor",prompt:"帮我诊断最近失败或异常的 DAG 运行:先列出最近的 DAG 运行,对有问题的运行执行 doctor,总结根因和可执行的恢复方案。"},{label:"恢复或重跑任务",hint:"默认从节点续跑,勿无故新开 task",prompt:"我要恢复失败或卡住的 DAG。请先 dagReport/dagDoctor 看 primaryFailure.nodeId 与 primaryRecovery;默认用 dagRerunPlan→dagRerun 从失败节点续跑(plan 合格后直接 dagRerun,不要 prepareMutationGate)。不要新建 task-id。plan 不合格时:Worker Task Pool Failed 用 workerPoolDoctor 确认后再 workerTaskRetry;独立 Console run 用 standaloneTaskRerun(整单重生,不是从节点续跑)。paused/中断需要 resume 时准备 Human Gate,不要自己调 dagResume。确定后直接帮我发起。"}];function U6(e){const t=e.readiness==="setup-required",n=!!e.disabled||t,a=e.density??"comfortable",s=e.mode==="no-session"?"开始一段新的对话":"今天想推进什么?",l=e.mode==="no-session"?"用自然语言编排 loop-agent:查询状态、诊断问题、创建与恢复任务。可先点选下方建议,或新建空白对话。":"会话已就绪。点选建议快速开场,或在下方输入框直接描述目标。业务写入仍经受治理 DAG。";return f.jsxs("div",{className:`oc-empty ${FI(a)}`,role:"status","data-landing-density":a,children:[f.jsxs("div",{className:"oc-empty-hero",children:[f.jsx("img",{className:"oc-empty-icon oc-empty-brand",src:"/favicon.svg",alt:"","aria-hidden":"true",draggable:!1}),f.jsxs("div",{className:"oc-empty-copy",children:[f.jsx("h3",{children:s}),f.jsx("p",{children:l})]})]}),f.jsx("div",{className:"oc-suggestions","aria-label":"开场建议",children:PI.map(c=>f.jsxs("button",{type:"button",className:"oc-suggestion",onClick:()=>e.onSuggest(c.prompt),disabled:n,children:[f.jsx("strong",{children:c.label}),f.jsx("span",{children:a==="extra-compact"?c.hint.replace(/[,,].*$/,""):c.hint})]},c.label))}),f.jsxs("ul",{className:"oc-empty-tips",children:[f.jsxs("li",{children:[f.jsx("kbd",{children:"@"}),f.jsx("span",{children:"引用仓库文件"})]}),f.jsxs("li",{children:[f.jsx("kbd",{children:"/"}),f.jsx("span",{children:"快捷命令"})]}),f.jsxs("li",{children:[f.jsx("kbd",{children:"Enter"}),f.jsx("span",{children:"发送 · Shift+Enter 换行"})]})]}),e.mode==="no-session"&&e.onCreateSession?f.jsx("button",{type:"button",className:"btn btn-primary oc-empty-cta",onClick:e.onCreateSession,disabled:n,"aria-busy":e.disabled||void 0,children:t?"需先完成 Pi setup":e.disabled?"创建中…":"新建空白对话"}):null]})}function $I(e){const{interview:t,interviewAnswer:n,onAnswerChange:a,onAnswer:s}=e;return f.jsxs("section",{className:"oc-draft-card","aria-label":"Requirement Interview",children:[f.jsxs("header",{children:[f.jsx("strong",{children:"Requirement Interview"}),f.jsx("span",{children:t.state})]}),t.question&&f.jsxs("div",{className:"oc-interview-bubble",children:[f.jsx("strong",{children:t.question.text}),f.jsxs("p",{children:["建议:",t.question.recommendation]}),f.jsx("textarea",{value:n,onChange:l=>a(l.target.value),placeholder:"输入答案"}),f.jsxs("div",{children:[f.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>s("override"),disabled:!n.trim(),children:"提交答案"}),f.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>s("accept-recommendation"),children:"接受建议"})]})]}),t.draft&&f.jsxs("details",{open:!0,children:[f.jsxs("summary",{children:["TaskContractDraftV1 · ",t.draftSha256?.slice(0,12)]}),f.jsx("pre",{children:JSON.stringify(t.draft,null,2)})]}),t.assessment&&f.jsxs("div",{className:`oc-assessment${t.assessment.fresh?" is-fresh":""}`,children:[f.jsxs("strong",{children:["完整性:",t.assessment.outcome]}),(t.assessment.missingFields??[]).length>0&&f.jsxs("p",{children:["缺失:",t.assessment.missingFields?.join("、")]})]}),t.taskKindRecommendation&&f.jsxs("div",{className:"oc-task-kind-card",children:[f.jsx("span",{children:"taskKind 建议"}),f.jsx("strong",{children:t.taskKindRecommendation}),f.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>e.onConfirmTaskKind(),children:"由我确认"}),f.jsx("small",{children:"模型不能代替人类确认。"})]}),t.confirmedTaskKind&&f.jsxs("div",{className:"oc-task-kind-card is-confirmed",children:["已由人类确认:",f.jsx("strong",{children:t.confirmedTaskKind})]})]})}function Or(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function GI(e){const t=[],n=e.inputTokens??0,a=e.outputTokens??0,s=e.cacheReadTokens??0,l=e.cacheWriteTokens??0,c=e.cost??0;if(n>0&&t.push(`${Or(n)} in`),a>0&&t.push(`${Or(a)} out`),s>0&&t.push(`${Or(s)} cache R`),l>0&&t.push(`${Or(l)} cache W`),c>0&&t.push(c>=.01?`$${c.toFixed(2)}`:"<$0.01"),t.length===0){const d=e.totalTokens??0;return d>0?`${Or(d)} tokens`:"—"}return t.join(" · ")}function KI(){return f.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),f.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function VI(){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"20 6 9 17 4 12"})})}function h2(){return f.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),f.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function YI(){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Tp(){return f.jsx("svg",{className:"oc-tool-chevron",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("polyline",{points:"4 2.5 7.5 6 4 9.5"})})}function XI(){return f.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})}function Oh(e){const[t,n]=S.useState(!1),a=()=>{navigator.clipboard?.writeText(e.text).then(()=>{n(!0),window.setTimeout(()=>n(!1),1600)},()=>{})};return f.jsx("button",{type:"button",className:`oc-message-copy${t?" is-copied":""}`,"aria-label":t?"已复制":"复制消息",title:t?"已复制":"复制",onClick:a,children:t?f.jsx(VI,{}):f.jsx(KI,{})})}function p2(e){const{message:t,streaming:n,activeAssistantId:a}=e;if(t.kind==="compaction")return f.jsxs("div",{className:"oc-compaction-card",role:"status",children:[f.jsx("span",{className:"oc-compaction-icon","aria-hidden":"true",children:f.jsx(U8,{size:16})}),f.jsxs("div",{className:"oc-compaction-body",children:[f.jsxs("div",{className:"oc-compaction-heading",children:[f.jsx("strong",{children:"上下文已压缩"}),f.jsx("span",{children:ko(t.createdAt)}),t.compaction?.tokensBefore?f.jsxs("span",{children:["压缩前 ",Or(t.compaction.tokensBefore)," tokens"]}):null]}),f.jsx("div",{className:"oc-compaction-summary",children:f.jsx(Mh,{text:t.text})})]})]});const s=t.role==="user",l=s?"你":"助手",c=!s&&n&&a!==null&&t.id===a,d=c&&t.text.length===0,m=t.text.trim().length>0;return f.jsxs("div",{className:`oc-row ${s?"is-user":"is-assistant"}`,"data-user-message-id":s?t.id:void 0,children:[f.jsxs("div",{className:"oc-meta",children:[!s&&f.jsx("span",{className:"oc-role oc-role-assistant","aria-hidden":"true",children:"π"}),f.jsxs("span",{className:"oc-time",children:[ko(t.createdAt),f.jsxs("span",{className:"sr-only",children:["(",l,")"]})]}),m&&f.jsx(Oh,{text:t.text})]}),f.jsxs("div",{className:`oc-bubble ${s?"oc-bubble-user":"oc-bubble-assistant"}`,children:[m?s?f.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t.text}):f.jsx(Mh,{text:t.text}):d?f.jsx("span",{className:"oc-cursor","aria-hidden":"true"}):null,c&&m&&f.jsx("span",{className:"oc-cursor","aria-hidden":"true"})]})]})}function ZI(e){if(!(!e||typeof e!="object"))return e}function ki(e){return typeof e=="string"?e:void 0}function Np(e){if(!Array.isArray(e))return;const t=[];for(const n of e){const a=ZI(n);if(!a)continue;const s=ki(a.type)??"";if(s==="thinking"||s==="reasoning"){const l=ki(a.thinking)??ki(a.text)??"";t.push({type:"thinking",thinking:l});continue}if(s==="toolCall"||s==="tool_call"||s==="toolUse"||s==="tool_use"){const l=ki(a.toolCallId)??ki(a.id)??"";if(!l)continue;const c=ki(a.toolName)??ki(a.name);t.push({type:"toolCall",toolCallId:l,...c?{toolName:c}:{}});continue}if(s==="text"||s==="output_text"||s===""){const l=ki(a.text);l!==void 0&&t.push({type:"text",text:l})}}return t}function WI(e,t={}){return e.type==="thinking"&&!t.isStreaming&&e.thinking.trim()===""}function q6(e,t={}){return e.filter(n=>!WI(n,t))}function QI(e){return e.type==="text"}function JI(e,t={}){const n=q6(e,t);let a=-1;for(let s=n.length-1;s>=0;s--)if(!QI(n[s])){a=s;break}return a===-1?{answerBlocks:n,processBlocks:[]}:{answerBlocks:n.slice(a+1),processBlocks:n.slice(0,a+1)}}function eM(e){return e.filter(t=>t.type==="text").map(t=>t.text).join("")}function tM(e){return{key:e,assistants:[],tools:[],processItems:[],live:!1}}function H6(e){const t=[],n=[];let a,s=[];const l=c=>{for(const d of s)d.assistantMessageId||(d.assistantMessageId=c),d.turnId||(d.turnId=a);s=[]};for(const c of e){const d=Date.parse(c.at)||Date.now();if(c.role==="user"){a=`restored-${c.id}`,s=[],t.push({id:c.id,role:"user",text:c.text,createdAt:d});continue}if(c.role==="assistant"){a||(a=`restored-${c.id}`);const m=Np(c.content);t.push({id:c.id,role:"assistant",text:c.text,createdAt:d,...m&&m.length>0?{content:m}:{}}),l(c.id);continue}if(c.role==="tool"){a||(a=`restored-tool-${c.id}`);const m={id:c.toolCallId||c.id,toolName:c.toolName||"tool",status:c.isError===!0?"error":"ok",resultText:c.text,result:c.text,createdAt:d,finishedAt:d,turnId:a,...c.operationId?{operationId:c.operationId}:{}};n.push(m),s.push(m)}}return{messages:t,toolCalls:n}}function nM(e){return[...e].sort((t,n)=>t.eventSeq!==void 0&&n.eventSeq!==void 0&&t.eventSeq!==n.eventSeq?t.eventSeq-n.eventSeq:t.createdAt!==n.createdAt?t.createdAt-n.createdAt:t.id<n.id?-1:1)}function wo(e,t){if(t.length===0)return;const n=nM(t);for(const a of n){const s=bI(a);s?e.push({kind:"activity",activity:s}):e.push({kind:"tool",tool:a})}}function g2(e,t,n,a){let s=[];for(const l of e){if(l.type==="thinking"){wo(n,s),s=[],n.push({kind:"thinking",thinking:l.thinking});continue}if(l.type==="text"){wo(n,s),s=[],l.text.trim()&&n.push({kind:"text",text:l.text});continue}const c=t.tools.find(d=>d.id===l.toolCallId);c&&!a.has(c.id)&&(s.push(c),a.add(c.id))}wo(n,s)}function b2(e,t,n,a){const s=e.tools.filter(l=>!a.has(l.id)&&l.assistantMessageId===t.id);if(s.length!==0){for(const l of s)a.add(l.id);wo(n,s)}}function rM(e){const t=new Set,n=[],a=e.assistants.slice(0,-1),s=e.assistants.at(-1);for(const h of a)g2(q6(h.content??[]),e,n,t),b2(e,h,n,t);const l=s?.content??[],c=JI(l,{isStreaming:e.live});g2(c.processBlocks,e,n,t),s&&b2(e,s,n,t);const d=e.tools.filter(h=>!t.has(h.id));if(d.length>0&&wo(n,d),e.processItems=n,!s)return;if(l.length===0){e.answer=s;return}const m=eM(c.answerBlocks);e.answer={...s,text:m,content:c.answerBlocks}}function aM(e){const t=e.messages.filter(d=>d.role==="user"||d.role==="assistant"),n=[];let a=null;const s=d=>{const m=tM(d);return n.push(m),m};for(const d of t){if(d.role==="user"){a=s(`user-${d.id}`),a.user=d;continue}if(d.kind==="compaction"){a=s(`compaction-${d.id}`),a.assistants.push(d),a=null;continue}a||(a=s(`assistant-${d.id}`)),a.assistants.push(d)}const l=new Set,c=new Map;for(const d of n)for(const m of d.assistants)c.set(m.id,d);for(const d of e.toolCalls)if(d.assistantMessageId){const m=c.get(d.assistantMessageId);m&&(m.tools.push(d),l.add(d.id))}for(const d of e.toolCalls)if(!l.has(d.id)&&d.turnId){const m=n.find(p=>p.tools.some(b=>b.turnId===d.turnId)||p.key===`turn-${d.turnId}`||p.user&&`restored-${p.user.id}`===d.turnId);if(m){m.tools.push(d),l.add(d.id);continue}const h=n.find(p=>d.turnId===`restored-${p.user?.id}`||p.assistants.some(b=>d.turnId===`restored-${b.id}`));h&&(h.tools.push(d),l.add(d.id))}for(const d of e.toolCalls){if(l.has(d.id))continue;const m=n.find((h,p)=>{const b=h.user?.createdAt??h.assistants[0]?.createdAt??0,x=n[p+1]?.user?.createdAt??Number.POSITIVE_INFINITY;return d.createdAt>=b&&d.createdAt<x});m&&(m.tools.push(d),l.add(d.id))}for(const d of n)d.tools.sort((m,h)=>m.eventSeq!==void 0&&h.eventSeq!==void 0?m.eventSeq-h.eventSeq:m.createdAt-h.createdAt),d.live=e.streaming&&e.activeAssistantId!==null&&d.assistants.some(m=>m.id===e.activeAssistantId),rM(d);return n}function iM(e,t){return t<=0?[]:e.length<=t?[...e]:e.slice(-t)}function sM(e,t){const n=e.length,a=t?.thinkingCount??0,s=t?.textCount??0,l=t?.activityCount??0,c=a+s+l+n,d=e.filter(p=>p.status==="error").length+(t?.activityErrorCount??0),m=e.filter(p=>p.status==="running").length+(t?.activityRunningCount??0),h=[`处理详情 · ${c} 步`];return n>0&&h.push(`${n} 工具`),l>0&&h.push(`${l} 进展`),d>0?h.push(`${d} 出错`):m>0&&h.push("运行中"),{count:n,errorCount:d,runningCount:m,stepCount:c,label:h.join(" · ")}}function lM(e){const t=[];let n=0,a=0,s=0,l=0,c=0;for(const d of e)d.kind==="thinking"?n+=1:d.kind==="text"?a+=1:d.kind==="activity"?(s+=1,d.activity.kind==="error"?l+=1:d.activity.kind==="progress"&&(c+=1)):t.push(d.tool);return sM(t,{thinkingCount:n,textCount:a,activityCount:s,activityErrorCount:l,activityRunningCount:c})}function F6(e){const{entry:t}=e,[n,a]=S.useState(t.status==="error"),[s,l]=S.useState(!1),c=t.status==="running"?"运行中":t.status==="error"?"出错":"完成",d=`is-${t.status}`,m=G8(t.args,{toolName:t.toolName}),h=X8(t.createdAt,t.finishedAt),p=K8(t.toolName),b=$2(t.resultText??t.result),y=Y8(b,s?{maxLen:Number.MAX_SAFE_INTEGER}:void 0);return f.jsxs("div",{className:`oc-tool ${t.status==="error"?"is-error":""} ${t.status==="running"?"is-running":""}`,children:[f.jsxs("button",{type:"button",className:"oc-tool-head","aria-expanded":n,onClick:()=>a(x=>!x),children:[f.jsx(Tp,{}),f.jsx("span",{className:"oc-tool-icon","aria-hidden":"true",children:f.jsx(XI,{})}),f.jsx("span",{className:"oc-tool-name",children:t.toolName}),m&&f.jsx("span",{className:"oc-tool-args",children:m}),h!==void 0&&f.jsxs("span",{className:"oc-tool-duration",children:[h,"s"]}),f.jsx("span",{className:`oc-tool-status ${d}`,children:c})]}),n&&f.jsxs("div",{className:"oc-tool-body",children:[t.args!==void 0&&f.jsxs("div",{className:"oc-tool-section",children:[f.jsx("div",{className:"oc-tool-label",children:p.argsLabel}),f.jsx("pre",{className:"oc-tool-code",children:V8(t.args)})]}),(t.resultText!==void 0||t.result!==void 0)&&f.jsxs("div",{className:"oc-tool-section",children:[f.jsx("div",{className:"oc-tool-label",children:t.status==="error"?"错误":p.resultLabel}),f.jsx("pre",{className:"oc-tool-code",children:y.text}),y.truncated&&!s&&f.jsx("button",{type:"button",className:"btn btn-ghost oc-tool-expand-result",onClick:()=>l(!0),children:"展开全部"})]}),t.status==="running"&&t.resultText===void 0&&t.result===void 0&&t.args===void 0&&f.jsx("div",{className:"oc-tool-section",children:f.jsx("div",{className:"oc-tool-waiting",children:"等待结果…"})})]})]})}function oM(e){const{thinking:t,defaultOpen:n}=e,[a,s]=S.useState(n);return S.useEffect(()=>{s(n)},[n]),f.jsxs("div",{className:"oc-thinking",children:[f.jsxs("button",{type:"button",className:`oc-thinking-summary${a?" is-open":""}`,"aria-expanded":a,onClick:()=>s(l=>!l),children:[f.jsx(Tp,{}),f.jsx("span",{children:"思考"})]}),a?f.jsx("pre",{className:"oc-thinking-body",children:t||"…"}):null]})}function cM(e){return e.kind==="progress"?"••":e.kind==="success"?"✓":e.kind==="warning"?"!":"×"}function uM(e){const{activity:t,onActivate:n}=e,a=!!(t.activityRef&&n&&(e.canActivate?.(t.activityRef)??!0)),s=f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"oc-semantic-activity-icon","aria-hidden":"true",children:cM(t)}),f.jsxs("span",{className:"oc-semantic-activity-copy",children:[f.jsx("strong",{children:t.title}),t.detail?f.jsx("small",{children:t.detail}):null]}),a?f.jsx("span",{className:"oc-semantic-activity-link",children:"查看详情"}):null]});if(a&&t.activityRef&&n){const l=t.activityRef;return f.jsx("button",{type:"button",className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":l,onClick:()=>n(l),children:s})}return f.jsx("div",{className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":t.activityRef,children:s})}function dM(e){const{items:t,live:n}=e,[a,s]=S.useState(!1);S.useEffect(()=>{n||s(!1)},[n]);const l=lM(t),c=f.jsx("div",{className:"oc-process-inline-body",children:t.map((d,m)=>{if(d.kind==="thinking")return f.jsx(oM,{thinking:d.thinking,defaultOpen:n},`thinking-${m}`);if(d.kind==="text")return f.jsx("div",{className:"oc-process-text",children:d.text},`text-${m}`);if(d.kind==="activity")return f.jsx(uM,{activity:d.activity,onActivate:e.onActivateActivity,canActivate:e.canActivateActivity},d.activity.id);if(d.kind==="tool")return f.jsx(F6,{entry:d.tool},d.tool.id)})});return n?f.jsx("div",{className:"oc-process-inline is-live",children:c}):f.jsxs("div",{className:"oc-process-inline",children:[f.jsxs("button",{type:"button",className:`oc-process-inline-summary${a?" is-open":""}${l.errorCount>0?" is-error":l.runningCount>0?" is-running":""}`,"aria-expanded":a,onClick:()=>s(d=>!d),children:[f.jsx(Tp,{}),f.jsx("span",{children:l.label})]}),a?c:null]})}function fM(e){const{scrollContainerRef:t,messagesEndRef:n,onScroll:a,hasThread:s,readiness:l,streaming:c,streamingAssistantId:d,messagesCount:m,visibleCount:h,onLoadMore:p,turnGroups:b,interview:y}=e;return f.jsxs("div",{ref:t,className:`oc-messages${s?" has-thread":" is-empty"}`,onScroll:a,children:[s?null:f.jsx(U6,{mode:"empty-session",readiness:l,disabled:c,onSuggest:e.onSuggest}),s&&m>h&&f.jsx("button",{type:"button",className:"btn btn-ghost oc-load-history",onClick:p,children:"加载更早消息"}),s&&b.map((x,k)=>{const T=x.user??x.assistants[0],R=k>0?b[k-1].user??b[k-1].assistants[0]:void 0,C=!!T&&(!R||Sf(R.createdAt)!==Sf(T.createdAt)),_=x.answer,I=!!_?.text.trim(),G=x.live&&x.processItems.length===0;return f.jsxs("div",{className:"oc-turn-group",children:[C&&T&&f.jsx("div",{className:"oc-day-sep",children:Sf(T.createdAt)}),x.user&&f.jsx(p2,{message:x.user,streaming:c,activeAssistantId:d}),x.processItems.length>0&&f.jsx(dM,{items:x.processItems,live:x.live,onActivateActivity:e.onActivateActivity,canActivateActivity:e.canActivateActivity}),_&&(I||G)?f.jsx(p2,{message:_,streaming:c,activeAssistantId:d}):null]},x.key)}),y&&f.jsx($I,{interview:y,interviewAnswer:e.interviewAnswer,onAnswerChange:e.onInterviewAnswerChange,onAnswer:e.onAnswerInterview,onConfirmTaskKind:e.onConfirmTaskKind}),f.jsx("div",{ref:n})]})}const mM=13,v2=240;function hM(e){const t=e.trim();return t.length>v2?`${t.slice(0,v2).trimEnd()}…`:t}function Gm(e,t=64){const n=e.trim().replace(/\s+/g," ");return n.length>t?`${n.slice(0,t)}…`:n}function pM(e,t){if(e.length===0)return[];const n=t>0?Math.max(1,Math.floor(t/mM)):e.length;if(e.length<=n)return e.map((s,l)=>({key:`b${l}`,members:[s]}));const a=[];for(let s=0;s<n;s+=1){const l=Math.floor(s*e.length/n),c=Math.floor((s+1)*e.length/n),d=e.slice(l,Math.max(c,l+1));d.length>0&&a.push({key:`b${s}`,members:d})}return a}function gM(e){const{scrollContainerRef:t,turnGroups:n,measureKey:a}=e,s=S.useRef(null),l=S.useMemo(()=>n.filter(I=>I.user).map((I,G)=>{const D=I.user;return{id:D.id,index:G+1,text:D.text,createdAt:D.createdAt}}),[n]),[c,d]=S.useState(0),[m,h]=S.useState(null),[p,b]=S.useState(null),y=S.useRef(new Map),x=S.useRef(0),k=S.useRef(null),T=S.useCallback(()=>{const I=t.current;if(!I)return;const G=I.offsetTop,D=new Map;for(const B of l){const X=I.querySelector(`[data-user-message-id="${CSS.escape(B.id)}"]`);X&&D.set(B.id,Math.max(0,X.offsetTop-G))}y.current=D;const M=s.current?.clientHeight??I.clientHeight;M!==x.current&&(x.current=M,d(M))},[t,l]),R=S.useCallback(()=>{const I=t.current;if(!I)return;const G=48;let D=null;for(const M of l){const B=y.current.get(M.id);if(B!==void 0)if(B<=I.scrollTop+G)D=M.id;else break}h(D)},[t,l]);S.useEffect(()=>{const I=window.requestAnimationFrame(T);return()=>window.cancelAnimationFrame(I)},[T,a]),S.useEffect(()=>{const I=t.current;if(!I)return;const G=()=>{k.current=null,T(),R()},D=()=>{k.current===null&&(k.current=window.requestAnimationFrame(G))};D(),I.addEventListener("scroll",D,{passive:!0}),window.addEventListener("resize",D);const M=new MutationObserver(D);return M.observe(I,{childList:!0,subtree:!0}),()=>{I.removeEventListener("scroll",D),window.removeEventListener("resize",D),M.disconnect(),k.current!==null&&(window.cancelAnimationFrame(k.current),k.current=null)}},[T,R,t]);const C=S.useMemo(()=>pM(l,c),[l,c]),_=S.useCallback(I=>{const G=t.current,D=y.current.get(I);!G||D===void 0||G.scrollTo({top:Math.max(0,D-8),behavior:"smooth"})},[t]);return l.length===0?null:f.jsx("nav",{ref:s,className:"oc-anchor-rail","aria-label":`用户消息锚点(共 ${l.length} 条)`,children:C.map(I=>{const G=I.members[0],D=m!==null&&I.members.some(X=>X.id===m),M=I.members.length,B=p===I.key;return f.jsxs("div",{className:"oc-anchor-cluster",onMouseEnter:()=>b(I.key),onMouseLeave:()=>b(null),children:[f.jsx("button",{type:"button",className:`oc-anchor-bar${D?" is-active":""}${M>1?" is-cluster":""}`,title:M>1?`${M} 条相邻输入`:void 0,"aria-label":M>1?`定位到 ${M} 条聚合输入中的第 ${G.index} 条:${Gm(G.text,40)}`:`定位到第 ${G.index} 条输入:${Gm(G.text,80)}`,onClick:()=>_(G.id),onFocus:()=>b(I.key),onBlur:()=>b(null)}),B?f.jsx("div",{className:"oc-anchor-popover",role:"tooltip",children:M>1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"oc-anchor-popover-head",children:[f.jsxs("span",{children:[M," 条聚合输入"]}),f.jsxs("span",{children:["第 ",G.index,"–",I.members[I.members.length-1].index," 条"]})]}),f.jsx("ul",{className:"oc-anchor-popover-list",children:I.members.map(X=>f.jsx("li",{children:f.jsxs("button",{type:"button",className:"oc-anchor-popover-item",onClick:()=>_(X.id),children:[f.jsx("span",{className:"oc-anchor-popover-item-time",children:ko(X.createdAt)}),f.jsx("span",{className:"oc-anchor-popover-item-text",children:Gm(X.text)})]})},X.id))})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"oc-anchor-popover-head",children:[f.jsxs("span",{children:["第 ",G.index,"/",l.length," 条输入"]}),f.jsx("span",{children:ko(G.createdAt)})]}),f.jsx("div",{className:"oc-anchor-popover-body",children:hM(G.text)})]})}):null]},I.key)})})}const bM={auto:"auto(跟随 Pi 默认等级)",off:"off · 关闭",minimal:"minimal · 极简",low:"low · 低",medium:"medium · 中",high:"high · 高",xhigh:"xhigh · 极高",max:"max · 最高"};function P6(e,t){const n=t.trim().toLowerCase(),a=new Map;for(const s of e){if(n&&!s.provider.toLowerCase().includes(n)&&!s.id.toLowerCase().includes(n)&&!(s.name??"").toLowerCase().includes(n))continue;const l=a.get(s.provider)??[];l.push(s),a.set(s.provider,l)}return[...a.entries()].map(([s,l])=>({provider:s,models:l}))}function vM(e,t){const n=new Set,a=[],s=l=>{n.has(l)||(n.add(l),a.push({value:l,label:bM[l]??l,...l==="auto"&&t?{effective:t}:{}}))};s("auto");for(const l of e)s(l);return a}function Ao(e,t){return`${e}/${t}`}function Dh(e){return{...e.modelProvider&&e.modelId?{model:{provider:e.modelProvider,modelId:e.modelId}}:{},...e.thinkingLevel?{thinkingLevel:e.thinkingLevel}:{}}}function $6(e,t){return{...e,model:t.model??e.model,thinkingLevel:t.thinkingLevel??e.thinkingLevel}}function yM(e,t){const n=$6(e,t);return n.model?.provider===e.model?.provider&&n.model?.modelId===e.model?.modelId&&n.thinkingLevel===e.thinkingLevel}function xM(){return f.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:f.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function wM(e){const t=sl(),[n,a]=S.useState(!1),[s,l]=S.useState(""),[c,d]=S.useState(0),m=S.useRef(null),h=S.useRef(null),p=t.snapshot,b=t.status==="loading",y=t.status==="error"?t.error:null,x=p?(p.models??[]).map(_=>({provider:_.provider,id:_.id,..._.name?{name:_.name}:{},..._.hasCredentials!==void 0?{hasCredentials:_.hasCredentials}:{}})):e.models,k=S.useMemo(()=>P6(x,s),[x,s]),T=S.useMemo(()=>k.flatMap(_=>_.models),[k]);S.useEffect(()=>{n&&(l(""),d(0),window.setTimeout(()=>h.current?.focus(),0))},[n]),S.useEffect(()=>{if(!n)return;const _=G=>{const D=m.current;D&&G.target instanceof Node&&!D.contains(G.target)&&a(!1)},I=G=>{G.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("keydown",I)}},[n]);const R=_=>{if(e.disabled)return;const I=T[_];I&&(a(!1),e.onSelect(I.provider,I.id))},C=_=>{if(_.key==="ArrowDown"){_.preventDefault(),d(I=>T.length?(I+1)%T.length:0);return}if(_.key==="ArrowUp"){_.preventDefault(),d(I=>T.length?(I-1+T.length)%T.length:0);return}if(_.key==="Enter"){_.preventDefault(),R(c);return}if(_.key==="Escape"){_.preventDefault(),a(!1);return}};return f.jsxs("div",{className:"oc-select-menu oc-model-menu",ref:m,children:[f.jsxs("button",{type:"button",className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":n,title:"选择模型",disabled:e.disabled,onClick:()=>a(_=>!_),children:[f.jsx("span",{className:"oc-select-trigger-label",children:e.triggerLabel}),f.jsx(xM,{})]}),n&&f.jsxs("div",{className:"oc-select-panel oc-model-panel",role:"listbox","aria-label":"选择模型",children:[f.jsx("input",{ref:h,className:"oc-select-search",placeholder:"搜索模型或 Provider…",value:s,onChange:_=>{l(_.target.value),d(0)},onKeyDown:C}),b&&f.jsx("div",{className:"oc-select-status",children:"模型列表加载中…"}),y&&f.jsxs("div",{className:"oc-select-status is-error",children:[f.jsxs("span",{children:[y.code?`${y.code}:`:"",y.message]}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{tl()},children:"重试"})]}),!b&&!y&&k.length===0&&f.jsx("div",{className:"oc-select-status",children:"当前没有可用模型(真实空态,未伪造列表)"}),k.map(_=>f.jsxs("div",{className:"oc-model-group",children:[f.jsx("div",{className:"oc-model-group-head",children:_.provider}),_.models.map(I=>{const G=Ao(I.provider,I.id),D=G===e.activeModelRef,M=T[c]===I;return f.jsxs("button",{type:"button",role:"option","aria-selected":D,disabled:e.disabled,className:`oc-select-option oc-model-option${M?" is-highlighted":""}${D?" is-active":""}`,onMouseDown:B=>B.preventDefault(),onClick:()=>{e.disabled||(a(!1),e.onSelect(I.provider,I.id))},children:[f.jsxs("span",{className:"oc-model-option-name",children:[I.name?`${I.name} · `:"",I.id]}),D&&f.jsx("span",{className:"oc-model-option-check",children:"✓"})]},G)})]},_.provider))]})]})}function SM(){return f.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:f.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function kM(e){const t=sl(),[n,a]=S.useState(!1),[s,l]=S.useState(0),c=S.useRef(null),d=e.effectiveLevel??t.snapshot?.selection?.effectiveThinkingLevel,m=t.snapshot?.thinkingLevels?.length?t.snapshot.thinkingLevels.map(y=>y.value):void 0,h=S.useMemo(()=>vM(m??e.levels,d),[m,e.levels,d]);S.useEffect(()=>{n&&l(0)},[n]),S.useEffect(()=>{if(!n)return;const y=k=>{const T=c.current;T&&k.target instanceof Node&&!T.contains(k.target)&&a(!1)},x=k=>{k.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",x)}},[n]);const p=y=>{if(e.disabled)return;const x=h[y];x&&(a(!1),e.onSelect(x.value))},b=y=>{if(y.key==="ArrowDown"){y.preventDefault(),l(x=>h.length?(x+1)%h.length:0);return}if(y.key==="ArrowUp"){y.preventDefault(),l(x=>h.length?(x-1+h.length)%h.length:0);return}if(y.key==="Enter"){y.preventDefault(),p(s);return}if(y.key==="Escape"){y.preventDefault(),a(!1);return}};return f.jsxs("div",{className:"oc-select-menu oc-thinking-menu",ref:c,children:[f.jsxs("button",{type:"button",className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":n,title:"思考等级",disabled:e.disabled,onClick:()=>a(y=>!y),children:[f.jsx("span",{className:"oc-select-trigger-label",children:e.triggerLabel}),f.jsx(SM,{})]}),n&&f.jsx("div",{className:"oc-select-panel oc-thinking-panel",role:"listbox","aria-label":"思考等级",onKeyDown:b,children:h.map((y,x)=>{const k=y.value===e.activeValue,T=x===s;return f.jsxs("button",{type:"button",role:"option","aria-selected":k,disabled:e.disabled,className:`oc-select-option oc-thinking-option${T?" is-highlighted":""}${k?" is-active":""}`,onMouseDown:R=>R.preventDefault(),onClick:()=>{e.disabled||(a(!1),e.onSelect(y.value))},children:[f.jsx("span",{className:"oc-thinking-option-label",children:y.label}),y.value==="auto"&&y.effective?f.jsxs("span",{className:"oc-thinking-badge",children:["Pi 实际:",y.effective]}):null,k&&f.jsx("span",{className:"oc-model-option-check",children:"✓"})]},y.value)})})]})}const Km="--oc-shortcut-palette-available-height",EM=8,TM=8;function NM(e){const t=e.viewportTop??0,n=e.topInset??EM,a=e.anchorGap??TM;if([e.boundaryTop,e.anchorTop,t,n,a].some(c=>!Number.isFinite(c)))return null;const l=Math.max(e.boundaryTop,t);return Math.max(0,Math.floor(e.anchorTop-l-n-a))}function CM(){return f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),f.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),f.jsx("path",{d:"m21 16-5.5-5.5L9 17"})]})}function RM(e){const{composer:t,streaming:n,turnPhase:a,deferredTurn:s,hasThread:l}=e,c=S.useRef(null),d=sl(),m=d.reloading,h=d.reloadError,b=d.mutationBusy||m||a!=="idle",y=s?"textPreview"in s?s.textPreview:s.text:"",x=s?"imageCount"in s?s.imageCount:s.images.length:0,k=s?.state==="dispatching"?"正在确认发送":s?.state==="accepted"?"已进入发送":s?.state==="failed"?"发送失败":a!=="idle"?"已排队 · 当前回合结束后自动发送":"已排队 · 等待发送",T=s?.state==="queued"||s?.state==="failed",R=S.useCallback(()=>{t.setInput(""),t.setShortcutOpen(!1),el()},[t.setInput,t.setShortcutOpen]),C=S.useCallback(B=>{const X=t.isComposingNow()||B.nativeEvent.isComposing,$=t.recentlyComposedNow();if(B.key==="Enter"&&!B.shiftKey&&!X&&!$&&(!n||a!=="idle")){if(t.shortcutOpen&&t.filteredShortcuts.length>0){if((t.filteredShortcuts[t.shortcutIndex]??t.filteredShortcuts[0])?.command==="/reload"){B.preventDefault(),R();return}}else if(t.input.trim()==="/reload"){B.preventDefault(),R();return}}e.onKeyDown(B)},[t.isComposingNow,t.recentlyComposedNow,t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,t.input,R,n,a,e.onKeyDown]),_=S.useCallback((B,X)=>{if(X==="pi-prompt"||B==="/name"||B==="/compact"){t.setInput(`${B} `),t.setShortcutOpen(!1),t.textareaRef.current?.focus();return}if(B==="/reload"){R();return}e.onRunShortcut(B)},[R,e.onRunShortcut,t]),I=S.useCallback(()=>{if(t.input.trim()==="/reload"){R();return}e.onSend(t.input)},[t.input,R,e.onSend]);S.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0||!e.paletteKeyboardNavRef.current)return;const B=e.shortcutPaletteRef.current;if(!B)return;B.querySelector(`[data-shortcut-index="${t.shortcutIndex}"]`)?.scrollIntoView({block:"nearest",inline:"nearest"}),e.paletteKeyboardNavRef.current=!1},[t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,e.shortcutPaletteRef,e.paletteKeyboardNavRef]),S.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0)return;const B=c.current,X=e.shortcutPaletteRef.current,$=B?.closest(".oc-main")??null;if(!B||!X||!$)return;let j=0;const F=()=>{j=0;const V=$.getBoundingClientRect(),Y=B.getBoundingClientRect(),K=NM({boundaryTop:V.top,anchorTop:Y.top,viewportTop:window.visualViewport?.offsetTop??0});if(K===null){X.style.removeProperty(Km);return}X.style.setProperty(Km,`${K}px`)},H=()=>{j!==0&&window.cancelAnimationFrame(j),j=window.requestAnimationFrame(F)};F();const ne=typeof ResizeObserver>"u"?null:new ResizeObserver(H);return ne?.observe($),ne?.observe(B),window.addEventListener("resize",H),window.visualViewport?.addEventListener("resize",H),window.visualViewport?.addEventListener("scroll",H),()=>{j!==0&&window.cancelAnimationFrame(j),ne?.disconnect(),window.removeEventListener("resize",H),window.visualViewport?.removeEventListener("resize",H),window.visualViewport?.removeEventListener("scroll",H),X.style.removeProperty(Km)}},[t.shortcutOpen,t.filteredShortcuts.length,e.layoutMode,e.shortcutPaletteRef]);const G=(()=>{const B=e.processSummary;return B?B.statusKind==="error"?`查看工具调用记录,共 ${B.count} 次,其中 ${B.statusLabel}`:B.statusKind==="running"?`查看工具调用记录,共 ${B.count} 次,${B.statusLabel||"正在运行"}`:`查看工具调用记录,共 ${B.count} 次,全部已完成`:"查看工具调用记录"})(),D=(()=>{const B=e.usage.inputTokens,X=e.usage.outputTokens,$=e.usage.cacheReadTokens,j=e.usage.cacheWriteTokens,F=e.usage.cost??0,H=e.usage.contextUsage,ne=[];if(H&&(H.percent!==null||H.tokens!==null)){const V=H.percent!==null?`${Math.round(H.percent*10)/10}%`:"—",Y=H.contextWindow>0?Or(H.contextWindow):"—",K=H.tokens!==null?Or(H.tokens):"—";ne.push(f.jsxs("span",{className:`oc-usage-part is-context${H.percent!==null&&H.percent>=80?" is-high":""}`,title:`上下文占用 ${K} / ${Y} tokens(达到约 80% 时建议压缩上下文)`,children:["上下文 ",V," / ",Y]},"context"))}if(B>0&&ne.push(f.jsxs("span",{className:"oc-usage-part is-in",title:"输入 tokens",children:["↑ ",Or(B)]},"in")),X>0&&ne.push(f.jsxs("span",{className:"oc-usage-part is-out",title:"输出 tokens",children:["↓ ",Or(X)]},"out")),$>0&&ne.push(f.jsxs("span",{className:"oc-usage-part",title:"缓存命中:这部分输入由提供商 prompt 缓存复用,计费约为原价的 10%",children:[f.jsx(wv,{size:12,"aria-hidden":"true"}),"缓存命中 ",Or($)]},"cache-read")),j>0&&ne.push(f.jsxs("span",{className:"oc-usage-part",title:"缓存写入:本次新建立 prompt 缓存的部分,下次请求可低价复用",children:[f.jsx(wv,{size:12,"aria-hidden":"true"}),"缓存写入 ",Or(j)]},"cache-write")),F>0&&ne.push(f.jsx("span",{className:"oc-usage-part",children:F>=.01?`$${F.toFixed(2)}`:"<$0.01"},"cost")),ne.length===0){const V=e.usage.totalTokens;V>0&&ne.push(f.jsxs("span",{className:"oc-usage-part",children:[Or(V)," tokens"]},"total"))}return ne})(),M=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"oc-runtime-controls-group",children:[f.jsx(wM,{models:e.models,activeModelRef:e.activeModelRef,triggerLabel:e.activeModelRef||"选择模型",disabled:b,onSelect:(B,X)=>e.onSwitchRuntime({provider:B,modelId:X})}),f.jsx(kM,{levels:e.thinkingLevels,activeValue:e.activeThinkingLevel||"auto",triggerLabel:e.activeThinkingLevel||"auto",disabled:b,onSelect:B=>e.onSwitchRuntime({thinkingLevel:B})}),f.jsxs("span",{className:"oc-usage",title:GI(e.usage),children:[f.jsx("span",{className:"oc-usage-state",children:a==="stopping"?"正在停止":a==="running"?"运行中":"空闲"}),e.unread>0?f.jsxs("span",{className:"oc-usage-unread",children:[e.unread," 未读"]}):null,D]}),e.processSummary&&f.jsxs("button",{type:"button",ref:e.processTriggerRef,className:`oc-process-summary is-${e.processSummary.statusKind}${e.processOpen?" is-open":""}`,"aria-expanded":e.processOpen,"aria-controls":"oc-process-panel","aria-label":G,title:G,onClick:e.onToggleProcess,children:[f.jsx("span",{className:"oc-process-summary-label",children:"调用记录"}),f.jsx("span",{className:"oc-process-summary-badge",children:e.processSummary.count}),e.processSummary.statusKind!=="ok"&&e.processSummary.statusLabel?f.jsx("span",{className:"oc-process-summary-status",children:e.processSummary.statusLabel}):null]})]}),f.jsxs("div",{className:"oc-runtime-controls-group is-right",children:[f.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:e.onCompact,disabled:a!=="idle"||!l||e.compacting,title:e.compacting?"正在压缩上下文…":l?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文","aria-label":e.compacting?"正在压缩上下文…":l?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文",children:[e.compacting?f.jsx("span",{className:"oc-spinner oc-spinner-inline","aria-hidden":"true"}):null,e.compacting?"压缩中…":"压缩"]}),e.runtimeContext?f.jsx("button",{type:"button",ref:e.runtimeContextTriggerRef,className:`btn btn-ghost oc-runtime-context-toggle${e.runtimeContextOpen?" is-active":""}`,"aria-expanded":e.runtimeContextOpen,"aria-controls":"oc-runtime-context-panel",onClick:e.onToggleRuntimeContext,children:"注入上下文"}):null]})]});return f.jsx("div",{className:"oc-composer",children:f.jsxs("div",{className:"oc-composer-inner",ref:c,children:[t.fileOptions.length>0&&f.jsx("div",{className:"oc-file-palette",role:"listbox","aria-label":"Repository files",children:t.fileOptions.map(B=>f.jsx("button",{type:"button",role:"option",className:B.endsWith("/")?"is-dir":void 0,onMouseDown:X=>X.preventDefault(),onClick:()=>t.insertFileReference(B),children:f.jsxs("code",{children:["@",B]})},B))}),t.pendingImages.length>0&&f.jsx("div",{className:"oc-attachment-list",children:t.pendingImages.map(B=>f.jsxs("span",{children:[B.name,f.jsx("button",{type:"button","aria-label":`移除 ${B.name}`,onClick:()=>t.removeImage(B),children:"×"})]},B.name))}),f.jsxs("div",{className:"oc-composer-toolbar",children:[f.jsxs("label",{className:"oc-attach-button oc-attach-icon",title:"添加图片","aria-label":"添加图片",children:[f.jsx(CM,{}),f.jsx("span",{className:"sr-only",children:"添加图片"}),f.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:B=>{t.addImagesFromFiles(Array.from(B.target.files??[]).slice(0,4)),B.target.value=""}})]}),f.jsxs("span",{className:"oc-composer-hint",children:[f.jsx("span",{className:"oc-kbd",children:"Enter"})," ",a==="running"?"排队发送":"发送"]}),f.jsxs("span",{className:"oc-composer-hint",children:[f.jsx("span",{className:"oc-kbd",children:"Shift"}),"+",f.jsx("span",{className:"oc-kbd",children:"Enter"})," 换行"]}),f.jsxs("span",{className:"oc-composer-hint",children:[f.jsx("span",{className:"oc-kbd",children:"↑"}),f.jsx("span",{className:"oc-kbd",children:"↓"})," 历史输入"]}),m&&f.jsx("span",{className:"oc-reload-status",children:"正在重新加载会话…"})]}),t.shortcutOpen&&t.filteredShortcuts.length>0&&f.jsxs("div",{className:"oc-shortcut-palette",id:"oc-shortcut-palette",ref:e.shortcutPaletteRef,role:"listbox","aria-label":"命令","aria-busy":t.dynamicCommandsLoading||void 0,"data-layout-mode":e.layoutMode,children:[f.jsxs("div",{className:"oc-shortcut-palette-head",children:[f.jsxs("strong",{children:["命令 · ",t.filteredShortcuts.length]}),t.dynamicCommandsLoading?f.jsx("span",{className:"oc-shortcut-palette-meta",children:"正在加载扩展、提示词与技能…"}):null,t.dynamicCommandsError?f.jsxs("span",{className:"oc-shortcut-palette-meta is-error",children:[t.dynamicCommandsError,f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t.retryDynamicCommands(),children:"重试"})]}):null]}),f.jsx("div",{className:"oc-shortcut-palette-body",children:e.paletteModel.map(B=>f.jsxs("div",{className:"oc-shortcut-group",children:[f.jsxs("small",{children:[B.label," · ",B.items.length]}),B.items.map(({entry:X,globalIndex:$})=>f.jsxs("button",{type:"button",role:"option",id:`oc-shortcut-option-${$}`,"aria-label":X.command,"aria-describedby":`oc-shortcut-option-desc-${$}`,"aria-selected":$===t.shortcutIndex,className:$===t.shortcutIndex?"is-active":"","data-shortcut-index":$,title:X.command,onMouseEnter:()=>t.setShortcutIndex($),onMouseDown:j=>j.preventDefault(),onClick:j=>{j.currentTarget.scrollIntoView({block:"nearest"}),_(X.command,X.action)},children:[f.jsx("code",{children:X.command}),f.jsx("small",{id:`oc-shortcut-option-desc-${$}`,children:X.description})]},`${X.source}:${X.command}`))]},B.source))})," "]}),s?f.jsxs("div",{className:`oc-deferred-turn is-${s.state}`,role:"status",children:[f.jsxs("div",{className:"oc-deferred-turn-info",children:[f.jsx("strong",{children:k}),f.jsx("span",{children:y||(x>0?`${x} 张图片`:"待发送消息")})]}),T?f.jsxs("div",{className:"oc-deferred-turn-actions",children:[s.state==="queued"&&a!=="idle"?f.jsx("button",{type:"button",title:"停止当前回复,立即发送排队消息",onClick:e.onSendDeferredNow,children:"立即发送"}):null,f.jsx("button",{type:"button",title:"把排队消息移回输入框编辑",onClick:e.onCancelDeferred,children:"编辑"}),f.jsx("button",{type:"button",className:"is-danger",title:"删除排队消息",onClick:e.onDiscardDeferred,children:"删除"})]}):null]}):null,f.jsxs("div",{className:`oc-composer-shell${a!=="idle"?" is-busy":""}`,children:[f.jsx("textarea",{ref:t.textareaRef,className:"oc-textarea",value:t.input,rows:1,placeholder:a==="stopping"?"上一轮正在停止…输入后可排队自动发送":n?"正在执行…继续输入以排队,当前回合结束后自动发送":l?"输入消息… Enter 发送 · Shift+Enter 换行 · ↑ 召回历史输入":"描述目标,或点选上方建议开始…",onChange:B=>t.handleInputChange(B.target.value),onKeyDown:C,onCompositionStart:t.onCompositionStart,onCompositionEnd:t.onCompositionEnd,"aria-expanded":t.shortcutOpen,"aria-controls":t.shortcutOpen?"oc-shortcut-palette":void 0,"aria-activedescendant":t.shortcutOpen&&t.filteredShortcuts.length>0?`oc-shortcut-option-${t.shortcutIndex}`:void 0}),a==="running"?f.jsxs(f.Fragment,{children:[(t.input.trim()!==""||t.pendingImages.length>0)&&f.jsx("button",{type:"button",className:"oc-send is-queue",title:"排队发送:当前回合结束后自动发送","aria-label":"排队发送:当前回合结束后自动发送",onClick:I,disabled:m,children:f.jsx(h2,{})}),f.jsxs("button",{type:"button",className:"oc-stop",title:s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止","aria-label":s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止",onClick:e.onStop,children:[f.jsx("span",{className:"oc-spinner","aria-hidden":"true"}),f.jsx(YI,{})]})]}):f.jsx("button",{type:"button",className:"oc-send",title:a==="stopping"?"停止后发送":"发送","aria-label":a==="stopping"?"停止后发送":"发送",onClick:I,disabled:!t.input.trim()&&t.pendingImages.length===0||m,children:f.jsx(h2,{})})]}),h&&f.jsxs("div",{className:"oc-reload-banner is-error",role:"alert",children:[f.jsxs("span",{children:[h.code?`${h.code}:`:"",h.message]}),f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{el()},children:"重试"})]}),f.jsx("div",{className:"oc-runtime-controls",children:M})]})})}function AM(e){const{toolCalls:t,onClose:n,overlay:a=!1}=e,s=S.useRef(null);return Pu({open:a,containerRef:s,triggerRef:e.triggerRef,onEscape:n}),f.jsxs("aside",{ref:s,id:"oc-process-panel",className:`oc-process${a?" is-process-overlay":""}`,"aria-label":"工具调用记录",role:a?"dialog":void 0,"aria-modal":a?!0:void 0,tabIndex:-1,children:[f.jsxs("header",{className:"oc-process-head",children:[f.jsxs("div",{className:"oc-process-title",children:[f.jsx("span",{className:"oc-process-title-mark","aria-hidden":"true"}),"工具调用记录",f.jsxs("span",{className:"oc-process-count",children:[t.length," 次"]})]}),f.jsx("button",{type:"button",className:"btn btn-ghost oc-process-close","aria-label":"关闭工具调用记录",onClick:n,children:"关闭"})]}),f.jsx("div",{className:"oc-process-timeline",children:t.length===0?f.jsx("div",{className:"oc-process-empty",children:"本轮对话尚无工具调用。诊断细节会在这里按时间线展示。"}):t.map((l,c)=>f.jsxs("div",{className:`oc-process-item${c===0?" is-first":""}${c===t.length-1?" is-last":""}${l.status==="error"?" is-error":""}${l.status==="running"?" is-running":""}`,children:[f.jsx("div",{className:"oc-process-rail","aria-hidden":"true",children:f.jsx("span",{className:"oc-process-dot"})}),f.jsx("div",{className:"oc-process-time",children:ko(l.createdAt)}),f.jsx("div",{className:"oc-process-body",children:f.jsx(F6,{entry:l})})]},l.id))})]})}const y2=[{id:"overview",label:"概览"},{id:"system",label:"System prompt"},{id:"files",label:"Context files"},{id:"skills",label:"Skills"},{id:"extensions",label:"Extensions"},{id:"packages",label:"Plugins"},{id:"tools",label:"Active tools"},{id:"raw",label:"原始 JSON"}];function hu(e){const t=Array.isArray(e.items)?e.items:void 0;return f.jsxs("section",{className:"oc-runtime-context-section",children:[f.jsxs("header",{className:"oc-runtime-context-section-head",children:[f.jsx("strong",{children:e.title}),f.jsx("span",{className:"oc-runtime-context-meta",children:t?`${t.length} 项`:"未投影"})]}),t===void 0?f.jsx("p",{className:"oc-runtime-context-empty",children:"该 session 未提供资源投影"}):t.length===0?f.jsx("p",{className:"oc-runtime-context-empty",children:e.emptyText}):f.jsx("ul",{className:"oc-runtime-context-resources",children:t.map((n,a)=>f.jsx(_M,{item:n},`${n.name??n.path??a}:${a}`))})]})}function _M(e){const t=e.item,a=[t.scope?`scope ${t.scope}`:"",t.source??"",t.version?`v${t.version}`:"",t.cwd?`cwd ${t.cwd}`:""].filter(Boolean).join(" · "),s=t.path?`${t.path}${t.baseDir?`(base: ${t.baseDir})`:""}`:"";return f.jsxs("li",{children:[f.jsxs("div",{className:"oc-runtime-context-resource-head",children:[f.jsx("strong",{className:"oc-runtime-context-resource-name",title:t.path??t.name,children:t.name||t.path||"未命名资源"}),t.enabled===!1?f.jsx("span",{className:"oc-runtime-context-resource-flag",children:"未启用"}):null,a?f.jsx("span",{className:"oc-runtime-context-meta",title:a,children:a}):null]}),t.description?f.jsx("span",{className:"oc-runtime-context-resource-desc",children:t.description}):null,t.path?f.jsx("code",{className:"oc-runtime-context-resource-path",title:s,children:s}):null,t.error?f.jsxs("span",{className:"oc-runtime-context-diag is-error",children:[f.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"✕"}),t.error]}):null,Array.isArray(t.diagnostics)&&t.diagnostics.length>0?f.jsxs("span",{className:"oc-runtime-context-diag",children:[f.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"⚠"}),t.diagnostics.join(";")]}):null,Array.isArray(t.resolved)&&t.resolved.length>0?f.jsxs("details",{className:"oc-runtime-context-resolved",children:[f.jsxs("summary",{children:["已解析 ",t.resolved.length," 项"]}),f.jsx("ul",{className:"oc-runtime-context-resolved-list",children:t.resolved.map((l,c)=>{const d=`${l.type??"?"}:${l.name??l.path??"?"}`;return f.jsx("li",{children:f.jsx("code",{title:d,children:d})},c)})})]}):null]})}const IM=S.forwardRef(function({open:t,onToggle:n,onClose:a,context:s,panelOnly:l=!1,triggerOnly:c=!1,triggerRef:d},m){const h=sl(),p=h.reloading,b=h.reloadError,[y,x]=S.useState("overview"),k=S.useRef(null);Pu({open:t&&!c,containerRef:k,triggerRef:d,onEscape:a}),S.useEffect(()=>{t||x("overview")},[t]);const T=Array.isArray(s.resources.activeTools)?s.resources.activeTools:[],R=typeof s.resources.activeToolCount=="number"?s.resources.activeToolCount:T.length,C=s.systemPrompt.text??s.systemPrompt.summary??"",_=s.systemPrompt.charCount??C.length,I=s.suffix.present?s.suffix.text??s.suffix.summary??"":"",G=s.model?Ao(s.model.provider,s.model.modelId):"",D=s.resources,M=String(s.resources.mode??"closed"),B=M.includes("open")?"open":"closed",X={files:D.contextFiles?.length??0,skills:D.skills?.length??0,extensions:D.extensions?.length??0,packages:D.packages?.length??0},$=["files","skills","extensions","packages"].map(H=>({id:H,label:y2.find(ne=>ne.id===H)?.label??H,count:X[H]??0})),j=f.jsx("button",{type:"button",ref:H=>{typeof m=="function"?m(H):m&&(m.current=H)},className:`btn btn-ghost oc-runtime-context-toggle${t?" is-active":""}`,"aria-expanded":t,"aria-controls":"oc-runtime-context-panel",onClick:n,children:"注入上下文"});if(c)return j;const F=t?f.jsxs("div",{ref:k,id:"oc-runtime-context-panel",className:"oc-runtime-context-sidepanel",role:"dialog","aria-modal":"true","aria-label":"注入上下文",tabIndex:-1,children:[f.jsxs("header",{className:"oc-runtime-context-head",children:[f.jsxs("div",{className:"oc-runtime-context-head-copy",children:[f.jsx("strong",{children:"注入上下文"}),f.jsx("span",{className:"oc-runtime-context-meta",children:"只读 · 本轮实际注入的 system prompt / 资源(已脱敏)"})]}),f.jsx("button",{type:"button",className:"btn btn-ghost oc-runtime-context-close","aria-label":"关闭注入上下文",onClick:a,children:"关闭"})]}),f.jsxs("div",{className:"oc-runtime-context-layout",children:[f.jsx("nav",{className:"oc-runtime-context-nav","aria-label":"上下文分类",children:y2.map(H=>{const ne=X[H.id];return f.jsxs("button",{type:"button",className:`oc-runtime-context-nav-item${y===H.id?" is-active":""}`,"aria-current":y===H.id?"page":void 0,onClick:()=>x(H.id),children:[f.jsx("span",{className:"oc-runtime-context-nav-label",title:H.label,children:H.label}),typeof ne=="number"?f.jsx("span",{className:"oc-runtime-context-nav-count",children:ne}):null]},H.id)})}),f.jsxs("div",{className:"oc-runtime-context-body",children:[y==="overview"?f.jsxs("div",{className:"oc-runtime-context-overview",children:[s.model?f.jsxs("section",{className:"oc-runtime-context-model-card",children:[f.jsx("span",{className:"oc-runtime-context-model-label",children:"模型"}),f.jsx("code",{className:"oc-runtime-context-model-ref",title:G,children:G})]}):null,f.jsxs("div",{className:"oc-runtime-context-stat-grid",children:[f.jsxs("div",{className:"oc-runtime-context-stat",children:[f.jsx("span",{className:"oc-runtime-context-stat-label",children:"Prompt 字数"}),f.jsxs("strong",{className:"oc-runtime-context-stat-value",children:[_.toLocaleString()," 字"]})]}),f.jsxs("div",{className:"oc-runtime-context-stat",children:[f.jsx("span",{className:"oc-runtime-context-stat-label",children:"工具"}),f.jsx("strong",{className:"oc-runtime-context-stat-value",children:R})]}),f.jsxs("div",{className:"oc-runtime-context-stat",children:[f.jsx("span",{className:"oc-runtime-context-stat-label",children:"思考"}),f.jsx("strong",{className:"oc-runtime-context-stat-value",children:s.thinkingLevel??"—"})]}),f.jsxs("div",{className:"oc-runtime-context-stat",children:[f.jsx("span",{className:"oc-runtime-context-stat-label",children:"资源面"}),f.jsxs("strong",{className:`oc-runtime-context-stat-value oc-runtime-context-mode is-${B}`,title:M,children:[f.jsx("span",{className:"oc-runtime-context-mode-dot","aria-hidden":"true"}),M]})]})]}),f.jsxs("section",{className:"oc-runtime-context-section",children:[f.jsx("header",{className:"oc-runtime-context-section-head",children:f.jsx("strong",{children:"已加载资源"})}),f.jsx("div",{className:"oc-runtime-context-resource-links",children:$.map(H=>f.jsxs("button",{type:"button",className:"oc-runtime-context-resource-link",onClick:()=>x(H.id),children:[f.jsx("span",{className:"oc-runtime-context-resource-label",children:H.label}),f.jsx("span",{className:`oc-runtime-context-resource-count${H.count===0?" is-zero":""}`,children:H.count}),f.jsx("span",{className:"oc-runtime-context-resource-chevron","aria-hidden":"true",children:"›"})]},H.id))})]})]}):null,y==="system"?f.jsxs(f.Fragment,{children:[f.jsxs("section",{className:"oc-runtime-context-section",children:[f.jsxs("header",{className:"oc-runtime-context-section-head",children:[f.jsxs("div",{children:[f.jsx("strong",{children:"System prompt"}),f.jsxs("code",{className:"oc-runtime-context-hash",children:[s.systemPrompt.hash.slice(0,12),"…"]})]}),C?f.jsx(Oh,{text:C}):null]}),f.jsx("pre",{className:"oc-runtime-context-text",children:C||"(空)"})]}),f.jsxs("section",{className:"oc-runtime-context-section",children:[f.jsxs("header",{className:"oc-runtime-context-section-head",children:[f.jsxs("div",{className:"oc-runtime-context-section-title",children:[f.jsx("strong",{children:"Session suffix"}),f.jsx("span",{className:"oc-runtime-context-meta",children:s.suffix.present?`${(s.suffix.charCount??0).toLocaleString()} 字`:"未注入"})]}),I?f.jsx(Oh,{text:I}):null]}),s.suffix.present?f.jsx("pre",{className:"oc-runtime-context-text",children:I||"已注入"}):f.jsx("p",{className:"oc-runtime-context-empty",children:"本会话无额外 suffix"})]})]}):null,y==="files"?f.jsx(hu,{title:"Context files",items:D.contextFiles?.map(H=>({name:H.path,description:`${H.characters.toLocaleString()} 字符`})),emptyText:"该 session 未加载任何上下文文件"}):null,y==="skills"?f.jsx(hu,{title:"Skills",items:D.skills,emptyText:"该 session 未加载任何 Skills"}):null,y==="extensions"?f.jsx(hu,{title:"Extensions",items:D.extensions,emptyText:"该 session 未加载任何 Extensions"}):null,y==="packages"?f.jsx(hu,{title:"Plugins",items:D.packages,emptyText:"该会话没有插件"}):null,y==="tools"?f.jsxs("section",{className:"oc-runtime-context-section",children:[f.jsxs("header",{className:"oc-runtime-context-section-head",children:[f.jsx("strong",{children:"Active tools"}),f.jsxs("span",{className:"oc-runtime-context-meta",children:[R," 项"]})]}),T.length===0?f.jsx("p",{className:"oc-runtime-context-empty",children:"无激活工具"}):f.jsx("ul",{className:"oc-runtime-context-tools",children:T.map(H=>f.jsx("li",{children:f.jsx("code",{children:H})},H))}),Array.isArray(D.diagnostics)&&D.diagnostics.length>0?f.jsx("ul",{className:"oc-runtime-context-resources",children:D.diagnostics.map((H,ne)=>f.jsxs("li",{children:[f.jsxs("span",{className:`oc-runtime-context-diag is-${H.type??"warning"}`,children:[H.type,": ",H.message]}),H.path?f.jsx("code",{children:H.path}):null]},ne))}):null]}):null,y==="raw"?f.jsxs("details",{className:"oc-runtime-context-raw",open:!0,children:[f.jsx("summary",{children:"原始投影 JSON"}),f.jsx("pre",{children:JSON.stringify(s,null,2)})]}):null]},y)]}),f.jsxs("footer",{className:"oc-runtime-context-foot",children:[f.jsx("span",{className:"oc-runtime-context-meta",children:p?"正在重新加载会话…":"重新加载 Pi 会话设置、扩展、技能、提示词与上下文文件"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:p,onClick:()=>{el()},children:"重新加载会话"}),b&&f.jsxs("span",{className:"oc-runtime-context-diag is-error",role:"alert",children:[b.code?`${b.code}:`:"",b.message,f.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{el()},children:"重试"})]})]})]}):null;return l?F:f.jsxs("div",{className:"oc-runtime-context-menu",children:[j,F]})});function MM(){const e=S.useRef(null),t=S.useRef(!1),n=S.useRef(null),a=S.useRef(new Map),s=S.useRef(new Set),l=S.useRef(null),c=S.useRef(null),d=S.useRef(0),m=S.useRef(null),h=S.useRef(new Set),p=S.useRef(new Set),b=S.useRef(new Map),y=S.useRef(new Set),x=S.useRef(null),k=S.useRef(null),T=S.useRef(!1),R=S.useRef(0),C=S.useRef(null),_=S.useRef(!1),I=S.useRef(!1),G=S.useRef(null),D=S.useRef(new Set),M=S.useRef(new Set),B=S.useRef(new Set),X=S.useRef(!1),$=S.useRef(0);return S.useMemo(()=>({sessionRef:e,streamingRef:t,abortRef:n,sessionAbortControllersRef:a,inlineStreamSessionIdsRef:s,assistantIdRef:l,lastEventIdRef:c,sessionGenerationRef:d,eventsStreamStateRef:m,settledTurnIdsRef:h,seenEventIdsRef:p,turnAssistantIdsRef:b,sealedAssistantIdsRef:y,reconnectAbortRef:x,activeTurnIdRef:k,submitInFlightRef:T,submitGenerationRef:R,pendingSubmissionRef:C,stopInFlightRef:_,stopRequestedRef:I,stoppingTurnIdRef:G,abortPostedTurnIdsRef:D,releasedClientRequestIdsRef:M,usageResponseKeysRef:B,isComposingRef:X,compositionEndedAtRef:$}),[e,t,n,a,s,l,c,d,m,h,p,b,y,x,k,T,R,C,_,I,G,D,M,B,X,$])}const OM=["operation","contract","dag","report","html"];function DM(e){const t=e.artifact;if(!t||typeof t!="object")return;const n=t;if(!(n.schemaVersion!==1||typeof n.artifactId!="string"||!n.artifactId||typeof n.kind!="string"||!OM.includes(n.kind)||typeof n.previewHash!="string")){for(const a of["title","summary","htmlPreview","reportText","inspectHref"])if(n[a]!==void 0&&typeof n[a]!="string")return;return n}}function jM(e,t){const n=e.findIndex(a=>a.artifactId===t.artifactId);return n<0?[...e,t]:e.map((a,s)=>s===n?{...a,...t,eventSeq:a.eventSeq??t.eventSeq,activityRef:a.activityRef??t.activityRef}:a)}function LM(e){if(!e||typeof e!="object")return;const t=e;if(!(t.schemaVersion!==1||typeof t.cardId!="string"||t.gateType!=="contract-apply"&&t.gateType!=="dag-run"||typeof t.taskId!="string"||typeof t.state!="string"||typeof t.expiresAt!="string"||typeof t.inspectHref!="string"||typeof t.previewHash!="string"))return t}function zM(e,t){const n=e.findIndex(l=>l.cardId===t.cardId);if(n<0)return[...e,t];const a=[...e],s=a[n];return s?(a[n]={...s,...t,eventSeq:s.eventSeq??t.eventSeq,activityRef:s.activityRef??t.activityRef},a):[...e,t]}function BM(e,t){const n=e.findIndex(a=>a.operationId===t.operationId);return n<0?[...e,t]:e.map((a,s)=>{if(s!==n)return a;let l=a.eventSeq;return l===void 0?l=t.eventSeq:t.eventSeq!==void 0&&(l=Math.min(l,t.eventSeq)),{...a,...t,...l===void 0?{}:{eventSeq:l},updatedSeq:Math.max(a.updatedSeq??a.eventSeq??0,t.updatedSeq??t.eventSeq??0),toolCallId:a.toolCallId??t.toolCallId,activityRef:a.activityRef??t.activityRef}})}function UM(e){const t=e.operation;if(!t||typeof t!="object")return;const n=t;if(n.schemaVersion!==1||typeof n.operationId!="string"||typeof n.action!="string"||typeof n.state!="string"||typeof n.inspectHref!="string"||typeof n.createdAt!="string"||typeof n.updatedAt!="string"||typeof n.previewHash!="string")return;const a=qM(n.runSummary),{runSummary:s,...l}=n;return{...l,...a?{runSummary:a}:{}}}function qM(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(typeof t.runId!="string"||!t.runId||typeof t.status!="string"||!t.status)return;let n=[];Array.isArray(t.nodes)&&(n=t.nodes.flatMap(l=>{if(!l||typeof l!="object")return[];const c=String(l.id??""),d=String(l.status??"");if(!c||!d)return[];const m=String(l.failureCategory??"");return[{id:c,status:d,...m?{failureCategory:m}:{}}]}).slice(0,20));let a;if(t.next&&typeof t.next=="object"){const l=t.next;a={kind:String(l.kind??""),...typeof l.description=="string"?{description:l.description}:{}}}return{runId:t.runId,status:t.status,nodes:n,...typeof t.verdict=="string"?{verdict:t.verdict}:{},...typeof t.failureCategory=="string"?{failureCategory:t.failureCategory}:{},...a&&a.kind?{next:a}:{}}}function HM(e){const{refs:t,onReconcile:n,setError:a,setInterview:s,setHumanGateCards:l,setArtifactCards:c,setStreaming:d,setTurnPhase:m=()=>{},setDeferredTurn:h=()=>{},setStreamingAssistantId:p,setUnread:b,setOperationCards:y,setUsage:x,setMessages:k,setToolCalls:T}=e;return(R,C,_,I)=>{if(I?.generation!==void 0&&t.sessionGenerationRef.current!==I.generation)return;const G=I?.replay===!0;if(R==="stream_ready")return;if(R==="reconcile"){const F={reason:typeof C.reason=="string"?C.reason:"cursor_expired",...typeof C.minSeq=="number"?{minSeq:C.minSeq}:{},...typeof C.epoch=="string"?{epoch:C.epoch}:{},...typeof C.latestTurnId=="string"?{latestTurnId:C.latestTurnId}:{}};(typeof C.latestEventId=="string"||C.latestEventId===null)&&(F.latestEventId=C.latestEventId),n?.(F);return}const D=C.data&&typeof C.data=="object"?C.data:C,M=typeof C.turnId=="string"?C.turnId:void 0,B=typeof C.seq=="number"&&Number.isFinite(C.seq)?C.seq:void 0,X=typeof C.at=="string"&&Number.isFinite(Date.parse(C.at))?Date.parse(C.at):Date.now();if(R==="queue_update"){const j=typeof D.revision=="number"?D.revision:-1;h(F=>F&&j<F.revision?F:D.deferredTurn&&typeof D.deferredTurn=="object"?D.deferredTurn:null);return}if(R==="user_message"){const j=D.message&&typeof D.message=="object"?D.message:null;if(j&&typeof j.id=="string"&&typeof j.text=="string"){const F=typeof j.at=="string"&&Number.isFinite(Date.parse(j.at))?Date.parse(j.at):Date.now();k(H=>H.some(ne=>ne.id===j.id)?H:[...H,{id:j.id,role:"user",text:j.text,createdAt:F}])}return}if(M&&(R==="agent_start"||R==="message_update")&&t.settledTurnIdsRef.current.has(M))return;let $=_;if(M){const j=t.turnAssistantIdsRef.current.get(M);j?$=j:t.turnAssistantIdsRef.current.set(M,_)}if(R==="interview-turn"){s(j=>({...j??{},interviewSessionId:typeof D.interviewSessionId=="string"?D.interviewSessionId:j?.interviewSessionId,taskId:typeof D.taskId=="string"?D.taskId:j?.taskId,state:typeof D.state=="string"?D.state:j?.state,question:D.question&&typeof D.question=="object"?D.question:void 0}));return}if(R==="draft"){s(j=>({...j??{},taskId:typeof D.taskId=="string"?D.taskId:j?.taskId,draft:D.draft&&typeof D.draft=="object"?D.draft:j?.draft,draftSha256:typeof D.draftSha256=="string"?D.draftSha256:j?.draftSha256,taskKindRecommendation:typeof D.taskKindRecommendation=="string"?D.taskKindRecommendation:j?.taskKindRecommendation}));return}if(R==="assessment"){s(j=>({...j??{},assessment:D}));return}if(R==="taskKind-confirmed"){s(j=>({...j??{},confirmedTaskKind:typeof D.taskKind=="string"?D.taskKind:j?.confirmedTaskKind,taskKindRecommendation:void 0}));return}if(R==="human-gate-card"){const j=LM(D);j&&l(F=>zM(F,{...j,...B===void 0?{}:{eventSeq:B},...M?{turnId:M}:{},activityRef:`gate:${j.cardId}`}));return}if(R==="artifact-ref"){const j=DM(D);j&&c(F=>jM(F,{...j,...B===void 0?{}:{eventSeq:B},...M?{turnId:M}:{},activityRef:`artifact:${j.artifactId}`}));return}if(R==="agent_start"){if(G&&M!==void 0&&M!==t.activeTurnIdRef.current)return;M&&(t.settledTurnIdsRef.current.delete(M),t.activeTurnIdRef.current=M),t.streamingRef.current=!0,d(!0),m("running"),p($);return}if(R==="agent_settled"||R==="agent_end"){if(M&&t.settledTurnIdsRef.current.add(M),R==="agent_end")return;M===t.activeTurnIdRef.current&&(t.activeTurnIdRef.current=null),t.streamingRef.current=!1,d(!1),m("idle"),p(null),R==="agent_settled"&&!G&&typeof document<"u"&&document.hidden&&b(F=>F+1);let j=!1;T(F=>(j=F.some(H=>H.assistantMessageId===$),F.map(H=>H.status==="running"&&(M!==void 0&&H.turnId===M||H.assistantMessageId===$)?{...H,status:"error",finishedAt:Date.now()}:H))),k(F=>F.filter(H=>H.id!==$||H.role!=="assistant"||H.text.trim()||H.content&&H.content.length>0?!0:j));return}if(R==="operation-ref"||R==="operation-status"){const j=UM(D);if(j){const F=typeof D.toolCallId=="string"?D.toolCallId:void 0;y(H=>BM(H,{...j,...B===void 0?{}:{eventSeq:B,updatedSeq:B},...M?{turnId:M}:{},...F?{toolCallId:F}:{},activityRef:`operation:${j.operationId}`}))}return}if(R==="usage"){if(G)return;const j=D,F=typeof j.responseKey=="string"&&j.responseKey?j.responseKey:void 0;if(F&&t.usageResponseKeysRef.current.has(F))return;F&&t.usageResponseKeysRef.current.add(F),x(H=>{const ne=j.inputTokens??0,V=j.outputTokens??0,Y=j.cacheReadTokens??0,K=j.cacheWriteTokens??0,re=j.totalTokens??ne+V+Y+K,ue=j.contextUsage,Te=ue&&typeof ue=="object"?{tokens:typeof ue.tokens=="number"?ue.tokens:null,contextWindow:typeof ue.contextWindow=="number"?ue.contextWindow:0,percent:typeof ue.percent=="number"?ue.percent:null}:H.contextUsage;return{inputTokens:H.inputTokens+ne,outputTokens:H.outputTokens+V,cacheReadTokens:H.cacheReadTokens+Y,cacheWriteTokens:H.cacheWriteTokens+K,totalTokens:H.totalTokens+re,cost:j.cost===void 0?H.cost:(H.cost??0)+j.cost,...Te?{contextUsage:Te}:{}}});return}if(R==="message_update"||R==="message_end"){if(G)return;const j=t.sealedAssistantIdsRef.current;if(R==="message_update"&&j.has($)){const V=rs("a");M&&t.turnAssistantIdsRef.current.set(M,V);const Y=$;T(K=>K.map(re=>re.assistantMessageId===Y?{...re,assistantMessageId:V}:re)),$=V,p(V)}const F=typeof D.text=="string"?D.text:"",H=Np(D.content),ne=$;k(V=>V.some(K=>K.id===ne)?V.map(K=>K.id!==ne?K:{...K,text:F,...H?{content:H}:{}}):[...V,{id:ne,role:"assistant",text:F,createdAt:X,...H?{content:H}:{}}]),R==="message_end"&&j.add(ne)}else if(R==="tool_call"){const j=typeof D.toolCallId=="string"?D.toolCallId:rs("t"),F=typeof D.toolName=="string"?D.toolName:"tool",H=typeof D.argsPreview=="string"?D.argsPreview:"{}";T(ne=>ne.some(V=>V.id===j)?ne.map(V=>V.id!==j?V:{...V,args:H,status:"running",turnId:M??V.turnId,assistantMessageId:$,...B===void 0?{}:{eventSeq:B}}):[...ne,{id:j,toolName:F,args:H,status:"running",createdAt:X,...B===void 0?{}:{eventSeq:B},turnId:M,assistantMessageId:$}])}else if(R==="tool_result"){const j=typeof D.toolCallId=="string"?D.toolCallId:rs("r"),F=typeof D.toolName=="string"?D.toolName:"tool",H=D.isError===!0,ne=typeof D.resultPreview=="string"?D.resultPreview:"{}",V=typeof D.operationId=="string"&&D.operationId?D.operationId:void 0;T(Y=>Y.find(re=>re.id===j)?Y.map(re=>re.id!==j?re:{...re,result:ne,resultText:ne,status:H?"error":"ok",finishedAt:X,...B===void 0?{}:{finishedSeq:B},turnId:M??re.turnId,assistantMessageId:re.assistantMessageId??$,...V?{operationId:V}:re.operationId?{operationId:re.operationId}:{}}):[...Y,{id:j,toolName:F,result:ne,resultText:ne,status:H?"error":"ok",createdAt:X,finishedAt:X,...B===void 0?{}:{eventSeq:B,finishedSeq:B},turnId:M,assistantMessageId:$,...V?{operationId:V}:{}}])}else R==="error"&&a(typeof D.message=="string"?D.message:"chat error")}}const Vm={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0};function FM(e){const{origin:t,refs:n,sessionId:a,setError:s,onReconcile:l}=e,[c,d]=S.useState([]),[m,h]=S.useState([]),[p,b]=S.useState([]),[y,x]=S.useState([]),[k,T]=S.useState(50),[R,C]=S.useState(0),[_,I]=S.useState([]),[G,D]=S.useState(null),[M,B]=S.useState(null),[X,$]=S.useState(!1),[j,F]=S.useState(Vm),[H,ne]=S.useState(!1),[V,Y]=S.useState("idle"),[K,re]=S.useState(null),[ue,Te]=S.useState(null),[P]=S.useState(!1),U=S.useMemo(()=>HM({refs:n,onReconcile:l,setError:s,setInterview:D,setHumanGateCards:I,setArtifactCards:x,setStreaming:ne,setTurnPhase:Y,setDeferredTurn:re,setStreamingAssistantId:Te,setUnread:C,setOperationCards:b,setUsage:F,setMessages:d,setToolCalls:h}),[n,l,s]),q=S.useCallback((Oe,ve,Ue)=>{if(Ue?.targetSessionId&&n.sessionRef.current?.sessionId!==Ue.targetSessionId||Ue?.generation!==void 0&&n.sessionGenerationRef.current!==Ue.generation)return null;const Ve=Oe.split(`
|
|
388
|
+
`);let nt="message",lt="",Lt=null;for(const Ye of Ve)Ye.startsWith("event: ")?nt=Ye.slice(7).trim():Ye.startsWith("data: ")?lt+=Ye.slice(6):Ye.startsWith("id: ")&&(Lt=Ye.slice(4).trim());if(!lt)return Lt;let _t;try{_t=JSON.parse(lt)}catch{return Lt}const ut=Lt??(typeof _t.eventId=="string"?_t.eventId:null);if(ut){if(n.seenEventIdsRef.current.has(ut))return ut;n.seenEventIdsRef.current.add(ut)}return U(nt,_t,ve,Ue),Lt??ut},[U,n]),A=S.useCallback(async(Oe,ve)=>{const Ue=ve?.background===!0;Ue||$(!0);try{const Ve=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Oe)}/context`,{credentials:"include"});if(!Ve.ok)return;const nt=await Ve.json();nt.context&&n.sessionRef.current?.sessionId===Oe&&B(lt=>Z8(lt,nt.context)?lt:nt.context)}finally{Ue||$(!1)}},[t,n]);S.useEffect(()=>{a&&A(a)},[a,A]),S.useEffect(()=>{if(!a)return;const Oe=window.setTimeout(()=>{A(a,{background:!0})},350);return()=>window.clearTimeout(Oe)},[a,p,_,G,A]);const ae=S.useMemo(()=>c.filter(Oe=>Oe.role!=="system"||P),[c,P]);S.useEffect(()=>{const Oe=()=>{document.hidden||C(0)};return document.addEventListener("visibilitychange",Oe),()=>document.removeEventListener("visibilitychange",Oe)},[]);const pe=S.useMemo(()=>{if(m.length===0)return null;const Oe=m.filter(lt=>lt.status==="running"),ve=m.filter(lt=>lt.status==="error"),Ue=Oe[Oe.length-1];let Ve="完成",nt="ok";return ve.length>0?(Ve=`${ve.length} 次出错`,nt="error"):Oe.length>0?(Ve=Ue?`${Ue.toolName} 运行中`:"运行中",nt="running"):Ve="",{count:m.length,statusLabel:Ve,statusKind:nt}},[m]),te=S.useMemo(()=>{const Oe=aM({messages:ae,toolCalls:m,streaming:H,activeAssistantId:ue});return iM(Oe,k)},[ae,m,H,ue,k]),ee=S.useMemo(()=>{const Oe=[];for(const ve of te)ve.user&&Oe.push(ve.user),Oe.push(...ve.assistants);return Oe},[te]),ce=S.useCallback(()=>{d([]),h([]),b([]),I([]),x([]),D(null),B(null),F(Vm),ne(!1),Y("idle"),re(null),Te(null),C(0),T(50),n.usageResponseKeysRef.current=new Set},[n]),ge=S.useCallback(Oe=>{d(Oe.messages),h(Oe.toolCalls),b([]),I([]),x([]),B(null),D(null),F(Vm),n.usageResponseKeysRef.current=new Set,ne(Oe.streaming),Y(Oe.turnPhase??(Oe.streaming?"running":"idle")),re(Oe.deferredTurn??null),Te(null),C(0),T(50)},[n]),Ae=S.useCallback(async Oe=>{try{const ve=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Oe)}`,{credentials:"include"});if(!ve.ok)return!1;const Ue=await ve.json();if(!Ue.session||n.sessionRef.current?.sessionId!==Oe)return!1;const Ve=Ue.session.activeTurnId??null;n.activeTurnIdRef.current=Ve,n.streamingRef.current=!!Ve,Y(Ue.session.turnPhase??(Ve?"running":"idle")),re(Ue.session.deferredTurn??null),n.lastEventIdRef.current=Ue.lastEventId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set;const nt=H6(Ue.session.messages??[]);return d(nt.messages),h(nt.toolCalls),Te(null),!0}catch{return!1}},[t,n,d,h,Te,Y,re]);return{messages:c,setMessages:d,toolCalls:m,setToolCalls:h,operationCards:p,artifactCards:y,historyLimit:k,setHistoryLimit:T,unread:R,humanGateCards:_,interview:G,setInterview:D,taskContext:M,contextLoading:X,usage:j,streaming:H,setStreaming:ne,turnPhase:V,setTurnPhase:Y,deferredTurn:K,setDeferredTurn:re,streamingAssistantId:ue,setStreamingAssistantId:Te,visibleMessages:ee,turnGroups:te,processSummary:pe,applyChatSseEvent:U,applySseBlock:q,loadTaskContext:A,resetForNewSession:ce,applyActivatedSession:ge,recoverSession:Ae}}const PM={error:6e3,info:4e3};function $M(e){const{toast:t,onDismiss:n}=e,[a,s]=S.useState(!1),l=S.useRef(null),c=S.useRef(null),d=()=>{l.current!==null&&window.clearTimeout(l.current),c.current!==null&&window.clearTimeout(c.current),l.current=null,c.current=null},m=()=>{d(),s(!0),c.current=window.setTimeout(()=>{s(!1),n()},140)};if(S.useEffect(()=>{if(t)return s(!1),l.current=window.setTimeout(m,PM[t.kind]),d},[t?.id]),S.useEffect(()=>d,[]),!t)return null;const h=t.kind==="error";return Mo.createPortal(f.jsxs("div",{className:`oc-toast is-${t.kind}${a?" is-leaving":""}`,role:h?"alert":"status",onMouseEnter:d,onMouseLeave:()=>{a||(l.current=window.setTimeout(m,1600))},children:[f.jsx("span",{className:"oc-toast-icon","aria-hidden":"true",children:h?f.jsx(P2,{size:16}):f.jsx(z8,{size:16})}),f.jsx("span",{className:"oc-toast-message",children:t.message}),f.jsx("button",{type:"button",className:"oc-toast-close","aria-label":"关闭提示",onClick:m,children:f.jsx(O8,{size:14,"aria-hidden":"true"})})]}),document.body)}function GM(e){return e==="missing-capability-token"||e==="invalid-capability-token"||e==="missing-confirmation-token"||e==="invalid-confirmation-token"||e==="host-not-loopback"||e==="origin-mismatch"||e==="cross-site-fetch"}function G6(e){return e==="invalid-capability-token"||e==="invalid-confirmation-token"||e==="missing-capability-token"||e==="missing-confirmation-token"}function KM(e){return G6(e)?"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。":e==="host-not-loopback"?"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。":e==="origin-mismatch"?"请求来源与控制台地址不一致,请通过控制台页面操作。":e==="cross-site-fetch"?"检测到跨站请求,已拒绝。请通过控制台页面操作。":"操作被拒绝,请刷新页面后重试。"}class VM{constructor(t){this.options=t,this.fetchFn=t.fetchFn??fetch,this.backoffMs=t.backoffMs??1e3,this.deadlineMs=t.deadlineMs??3e4}options;eligible=new Set;controllers=new Map;fetchFn;backoffMs;deadlineMs;markEligible(t){this.eligible.add(t)}startIfEligible(t){if(!this.eligible.delete(t)||this.controllers.has(t))return;const n=new AbortController;this.controllers.set(t,n),this.run(t,n)}cancel(t){this.eligible.delete(t),this.controllers.get(t)?.abort(),this.controllers.delete(t)}reconcile(t){const n=new Set(t);for(const a of this.controllers.keys())n.has(a)||this.cancel(a)}dispose(){for(const t of this.controllers.values())t.abort();this.controllers.clear(),this.eligible.clear()}async run(t,n){let a;const s=new Set;let l=!1;const c=window.setTimeout(()=>{l=!0,n.abort()},this.deadlineMs);try{for(;!n.signal.aborted;){try{const d={Accept:"text/event-stream"};a&&(d["Last-Event-ID"]=a);const m=await this.fetchFn(`${this.options.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`,{headers:d,credentials:"include",signal:n.signal});if(m.status===404||!m.body)return;if(!m.ok)throw new Error(`HTTP ${m.status}`);const h=m.body.getReader(),p=new TextDecoder;let b="";for(;;){const{done:y,value:x}=await h.read();if(y||n.signal.aborted)break;b+=p.decode(x,{stream:!0});const k=b.split(`
|
|
389
|
+
|
|
390
|
+
`);b=k.pop()??"";for(const T of k){const R=T.split(`
|
|
391
|
+
`).find(_=>_.startsWith("id: "))?.slice(4);if(R&&(a=R),!R||s.has(R)||!T.includes("event: session_title"))continue;const C=T.split(`
|
|
392
|
+
`).find(_=>_.startsWith("data: "))?.slice(6);if(C)try{const _=JSON.parse(C),I=_.data?.title?.trim();if(!I)continue;if(s.add(R),!this.options.hasSession(t)||(this.options.onTitle(t,{title:I,automatic:!!_.data?.automatic}),_.data?.automatic))return}catch{}}}}catch{if(n.signal.aborted)return}n.signal.aborted||await YM(this.backoffMs,n.signal)}}finally{window.clearTimeout(c),this.controllers.get(t)===n&&this.controllers.delete(t),(l||!this.options.hasSession(t))&&this.options.refresh()}}}function YM(e,t){return new Promise(n=>{const a=window.setTimeout(l,e),s=()=>l();function l(){window.clearTimeout(a),t.removeEventListener("abort",s),n()}t.addEventListener("abort",s,{once:!0})})}async function XM(e){if(e.creatingRef?.current)throw new Error("CREATE_SESSION_IN_FLIGHT");e.creatingRef&&(e.creatingRef.current=!0),e.setCreatingSession?.(!0);try{const t=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/chat/sessions`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify(e.options??{})});if(!t.ok){const c=await t.json().catch(()=>({}));throw new Error(c.error?.message??`HTTP ${t.status}`)}const n=await t.json();if(!n.session)throw new Error("创建会话响应缺少 durable session");const a=n.session,s={sessionId:a.sessionId,...Dh(a)},l=[a,...e.sessionListRef.current.filter(c=>c.sessionId!==a.sessionId)].slice(0,ku);return e.sessionListRef.current=l,e.setSessionList(l),e.titleWatcher?.markEligible(a.sessionId),e.refreshSessionList(),s}finally{e.creatingRef&&(e.creatingRef.current=!1),e.setCreatingSession?.(!1)}}function ZM(e){const{origin:t,refs:n,setSession:a,thread:s,composer:l,browser:c,setError:d,setNotice:m,onCompactionChange:h,setProcessOpen:p,setAutoScroll:b}=e,{applyActivatedSession:y,resetForNewSession:x,setMessages:k}=s,{setInput:T,setPendingImages:R}=l,{setPreviews:C,setActivePreviewPath:_}=c,[I,G]=S.useState([]),D=S.useRef([]);D.current=I;const M=S.useRef(null),[B,X]=S.useState(!1),$=S.useRef(!1),j=S.useRef(!1),F=S.useRef(0),H=S.useCallback(()=>{n.sessionGenerationRef.current+=1,n.abortRef.current?.abort(),n.reconnectAbortRef.current?.abort();for(const U of n.sessionAbortControllersRef.current.values())U.abort();n.sessionAbortControllersRef.current.clear(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null,n.streamingRef.current=!1,n.abortRef.current=null,n.assistantIdRef.current=null,n.lastEventIdRef.current=null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.activeTurnIdRef.current=null,x(),T(""),R([]),C([]),_(null),p(!1),b(!0)},[n,x,T,R,C,_,p,b]),ne=S.useCallback(async()=>{try{const U=await fetch(`${t}/api/operator/v1/chat/sessions`,{credentials:"include"});if(!U.ok)return;const q=(await U.json()).sessions??[],A=q.slice(0,ku),ae=q.slice(ku);if(G(A),ae.length===0)return;await Promise.all(ae.map(te=>fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(te.sessionId)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":tr()}}).catch(()=>{})));const pe=n.sessionRef.current?.sessionId;pe&&ae.some(te=>te.sessionId===pe)&&(F.current+=1,n.sessionRef.current=null,H(),a(null),window.localStorage.removeItem(Yr))}catch{}},[t,n,H,a]),V=S.useCallback(async U=>{try{return(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(U)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":tr()}})).ok?(M.current?.cancel(U),n.sessionRef.current?.sessionId===U&&(F.current+=1,n.sessionRef.current=null,H(),a(null),window.localStorage.removeItem(Yr)),await ne(),!0):(d("删除会话失败"),!1)}catch(q){return d(q instanceof Error?q.message:String(q)),!1}},[t,n,a,H,ne,d]),Y=S.useCallback(async U=>{const q=++F.current;try{const A=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(U)}`,{credentials:"include"}),ae=await A.json();if(!A.ok||!ae.session)throw new Error(ae.error?.message??"会话不可用");if(q!==F.current)return;const pe={sessionId:ae.session.sessionId,...Dh(ae.session)};H(),n.sessionRef.current=pe,n.streamingRef.current=!!ae.session.activeTurnId,n.activeTurnIdRef.current=ae.session.activeTurnId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(pe),n.assistantIdRef.current=null,n.abortRef.current=n.sessionAbortControllersRef.current.get(U)??null,R([]),C([]),T(ae.session.composerDraft??"");const te=H6(ae.session.messages??[]);y({messages:te.messages,toolCalls:te.toolCalls,streaming:!!ae.session.activeTurnId,turnPhase:ae.session.turnPhase??(ae.session.activeTurnId?"running":"idle"),deferredTurn:ae.session.deferredTurn??null}),window.localStorage.setItem(Yr,U),_(null)}catch(A){if(q!==F.current)return;d(A instanceof Error?A.message:String(A))}},[t,n,a,R,C,T,y,H,_,d]);S.useEffect(()=>{ne()},[ne]),M.current||(M.current=new VM({origin:t,hasSession:U=>D.current.some(q=>q.sessionId===U),onTitle:(U,q)=>{G(A=>A.map(ae=>ae.sessionId!==U||q.automatic&&ae.title?ae:q.automatic?{...ae,title:q.title}:{...ae,displayTitle:q.title}))},refresh:ne}));const K=S.useCallback(U=>M.current?.startIfEligible(U),[]);S.useEffect(()=>{M.current?.reconcile(I.filter(U=>U.state!=="archived"&&!U.title).map(U=>U.sessionId))},[I]),S.useEffect(()=>()=>M.current?.dispose(),[]),S.useEffect(()=>{let U=!1;const q=window.localStorage.getItem(Yr);if(!q)return;const A=++F.current;return(async()=>{try{const ae=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(q)}`,{credentials:"include"});if(!ae.ok){window.localStorage.removeItem(Yr);return}const pe=await ae.json();if(U||A!==F.current||!pe.session)return;const te={sessionId:pe.session.sessionId,...Dh(pe.session)};n.sessionGenerationRef.current+=1,n.sessionRef.current=te,n.activeTurnIdRef.current=pe.session.activeTurnId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(te),T(pe.session.composerDraft??""),k((pe.session.messages??[]).filter(ee=>ee.role==="user"||ee.role==="assistant").map(ee=>{const ce=Np(ee.content);return{id:ee.id,role:ee.role,text:ee.text,createdAt:Date.parse(ee.at)||Date.now(),...ce&&ce.length>0?{content:ce}:{}}}))}catch{}})(),()=>{U=!0}},[t,n,a,T,k]);const re=S.useCallback(U=>XM({origin:t,sessionListRef:D,setSessionList:G,titleWatcher:M.current,refreshSessionList:ne,options:U,setCreatingSession:X,creatingRef:$}),[t,ne]),ue=S.useCallback(async U=>{if($.current)return null;const q=++F.current;d(null);try{const A=await re(U);return q!==F.current?null:(H(),n.sessionRef.current=A,window.localStorage.setItem(Yr,A.sessionId),a(A),A)}catch(A){if(q!==F.current)return null;const ae=A instanceof Error?A.message:String(A);return ae!=="CREATE_SESSION_IN_FLIGHT"&&d(ae),null}},[n,a,d,H,re]),Te=S.useCallback(async U=>{const q=n.sessionRef.current;if(!q||n.streamingRef.current)return;const A=typeof U=="string"?U.trim():"";h?.(!0);try{const ae={"x-loop-console-confirmation":tr()};A&&(ae["content-type"]="application/json");const pe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(q.sessionId)}/compact`,{method:"POST",credentials:"include",headers:ae,...A?{body:JSON.stringify({instructions:A})}:{}}),te=await pe.json().catch(()=>({}));if(!pe.ok){const Ae=te.error?.code;if(GM(Ae)){d(KM(Ae)),G6(Ae)&&!j.current&&(j.current=!0,window.setTimeout(()=>window.location.reload(),1200));return}d(te.error?.message??"上下文压缩失败");return}d(null);const ee=te.snapshot?.summary?.trim(),ce=te.snapshot?.tokensBefore,ge=ee||"历史上下文已精简,关键决策与当前任务已保留。";await Y(q.sessionId),k(Ae=>[...Ae,{id:`compaction-${Date.now()}`,role:"assistant",kind:"compaction",text:ge,createdAt:Date.now(),...ce?{compaction:{tokensBefore:ce}}:{}}]),m({id:Date.now(),message:`已压缩上下文:${ge.slice(0,72)}${ge.length>72?"…":""}`})}catch(ae){d(ae instanceof Error?ae.message:"上下文压缩失败")}finally{h?.(!1)}},[t,n,d,m,k,h,Y]);return{sessionList:I,creatingSession:B,activateSession:Y,refreshSessionList:ne,deleteSession:V,createSession:ue,updateSession:async(U,q)=>{if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(U)}`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":tr()},body:JSON.stringify(q)})).ok){d("会话更新失败");return}await ne(),q.state==="archived"&&M.current?.cancel(U),q.state==="archived"&&n.sessionRef.current?.sessionId===U&&(F.current+=1,n.sessionRef.current=null,H(),a(null),window.localStorage.removeItem(Yr))},watchSessionTitle:K,compactSession:Te}}const So={"worker-managed-rerun-unsupported":"这次运行由 Console/Worker 启动,不能只从某个节点续跑","workspace-drift":"工作区在上次运行后又改过文件,旧结果不能接着用","controller-drift":"控制器版本已变化,不能接到上次运行上继续","binding-drift":"任务契约或源文件已变化,不能只续跑旧计划","restart-subgraph-contains-unsafe-shell":"下游包含会执行命令的验证步骤,不能只重跑这一段","restart-subgraph-contains-writer":"下游包含会改代码的写入步骤,不能只重跑这一段","restart-subgraph-contains-decision-gate":"下游包含需要人工决策的门禁,不能只重跑这一段","dynamic-rerun-unsupported":"这次运行含动态展开节点,不支持从节点续跑","parent-lifecycle-ineligible":"当前运行状态不允许从节点续跑","convergence-rerun-unsupported":"收敛型运行不支持从节点续跑","evaluation-rerun-unsupported":"带评估的运行不支持从节点续跑","budget-rerun-unsupported":"硬预算运行不支持从节点续跑","workspace-checkpoint-missing":"缺少工作区快照,无法安全地只续跑一段","skill-snapshot-invalid":"技能快照缺失或损坏,不能接到上次运行上继续","unresolved-errors-outside-reset-closure":"选中节点之外还有未解决的失败,只重跑这一段不够","selected-node-missing":"找不到要续跑的起始节点","ambiguous-skipped-rewrite":"跳过的节点有多个上游失败,无法自动选定起点","skipped-without-upstream-error":"该节点被跳过且没有明确的上游失败","parent-facts-invalid":"上次运行的证据不完整或已损坏,不能只续跑一段",RUN_NOT_ACTIVE:"这次运行不在活动状态,不能协作中止",RUN_NOT_CONSOLE_OWNED:"此运行不由当前 Console 持有,暂不支持协作中止",RUNNER_IDENTITY_MISMATCH:"运行身份已变化,不能中止这份过期请求",INTERRUPT_ALREADY_PENDING:"已有一条中止请求等待结算",RUN_ALREADY_TERMINAL:"运行已经结束,没有可中止的活 runner",INTERRUPT_NEEDS_RECONCILE:"中止请求已登记但无法确认 runner 已处理,需要对账"};function WM(){return Object.keys(So)}function xu(e){const t=e.trim().replace(/[.…]+$/,"");if(!t)return null;if(So[t])return{code:t};const n=t.lastIndexOf(":");if(n>0){const a=t.slice(n+1),s=t.slice(0,n);if(So[a])return{code:a,nodeId:s};const l=WM().find(c=>a.length>=3&&c.startsWith(a));if(l)return{code:l,nodeId:s}}return So[t]?{code:t}:null}function QM(e){const t=[];for(const n of e.blockedReasons??[]){const a=xu(String(n));a&&t.push(a)}for(const n of e.blockingNodes??[]){const a=n.reasonCode?.trim();if(!a)continue;const s=xu(n.nodeId?`${n.nodeId}:${a}`:a);s&&t.push(s)}if(t.length===0&&e.fallbackMessage?.trim()){const n=e.fallbackMessage.trim().replace(/^从节点重跑不具备安全资格[::]?\s*/,"").replace(/[。..]+$/,"");for(const a of n.split(/[;;]/)){const s=xu(a);s&&t.push(s)}}return t}function JM(e){const t=new Map;for(const a of e){const s=t.get(a.code)??[];a.nodeId&&!s.includes(a.nodeId)&&s.push(a.nodeId),t.set(a.code,s)}const n=[];for(const[a,s]of t){const l=So[a];l&&(s.length>0&&a.startsWith("restart-subgraph-contains-")?n.push(`${l}(${s.join("、")})`):n.push(l))}return n}function eO(e){return e.join("; ").includes("worker-managed-rerun-unsupported")||e.some(n=>xu(n)?.code==="worker-managed-rerun-unsupported")?"下一步:请点下方「重新排队 Worker Task」,从头完整执行。":"下一步:请改用「带反馈重新执行任务」,重新生成完整 DAG。"}function K6(e){const t=e.fallbackMessage?.trim();if(t?.startsWith("无法从该节点续跑"))return t;const n=QM(e),a=JM(n),s=n.map(c=>c.code),l=eO(s.length>0?s:[t??""]);return a.length===0?["无法从该节点续跑。这次续跑不够安全(工作区、控制器或下游步骤不允许只重跑一段)。",l].join(`
|
|
393
|
+
`):["无法从该节点续跑,因为:",...a.map(c=>`• ${c}`),"",l].join(`
|
|
394
|
+
`)}function tO(e){const t=e.trim();if(!t)return null;if(t.startsWith("无法从该节点续跑"))return t;if(/从节点重跑不具备安全资格|worker-managed-rerun-unsupported|restart-subgraph-contains-|workspace-drift|controller-drift|binding-drift/.test(t))return K6({fallbackMessage:t});if(/action must be a mutation-gate target/i.test(t))return"这个操作不能再走确认门。Worker 启动的任务请直接点「重新排队 Worker Task」;独立运行请点「带反馈重新执行任务」。";if(/cannot read dagReport run facts/i.test(t))return"读不到这次运行的失败报告,不能完整重跑。请先点「查看报告」或「Doctor 诊断」。";if(/dagRerunPlan run facts unavailable/i.test(t))return"读不到节点恢复资格,不能直接改走完整重跑。请先点「从失败节点恢复」查看资格,或先「查看报告」。";if(/node rerun plan is eligible/i.test(t))return"节点恢复是安全的,请改用「从失败节点恢复」,不必重新执行完整任务。";if(/does not support autonomous standaloneTaskRerun/i.test(t))return"当前失败不适合自动完整重跑。请先点「查看报告」,按建议操作。";if(/primaryRecovery requires a human decision/i.test(t))return"这次失败需要人工决策,不能自动重跑。请先点「查看报告」。";if(/is not bound to run/i.test(t))return"填写的任务 ID 与这次运行不匹配。请使用该运行绑定的原任务 ID。";if(/cannot read pool doctor/i.test(t))return"读不到任务队列状态,暂时不能重新排队。请稍后重试,或先跑 Doctor 诊断。";if(/not found in the pool doctor inventory/i.test(t))return"任务队列里找不到这个任务,不能重新排队。请确认 Task ID 来自 Worker 队列,而不是只填了 DAG 运行 ID。";if(/only Failed tasks are retry-eligible/i.test(t)){const n=t.match(/is ([A-Za-z_]+); only Failed/)?.[1];return n?`该任务当前是「${n}」,只有失败(Failed)的任务才能重新排队。`:"只有失败(Failed)的任务才能重新排队。请先确认任务已失败。"}return/featureId .+ does not match the pool task/i.test(t)?"Feature ID 与队列中的任务不一致。请改用队列里记录的 Feature ID,或留空后重试。":/RUN_NOT_CONSOLE_OWNED|不由当前 Console 持有/.test(t)?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":/RUNNER_IDENTITY_MISMATCH|运行身份已变化/.test(t)?"运行身份已变化,不能中止这份过期请求。请刷新后再试。":/INTERRUPT_ALREADY_PENDING|已有一条中止请求/.test(t)?"已有一条中止请求等待当前节点安全收敛。请稍候刷新,不要重复提交。":/RUN_ALREADY_TERMINAL|运行已经结束/.test(t)?"运行已经结束,没有可中止的活 runner。请改用报告或对账。":/INTERRUPT_NEEDS_RECONCILE|无法确认 runner 已处理/.test(t)?"中止请求已登记,但无法确认 runner 已处理。请用 Doctor 对账,不要当成已经中止。":/RUN_NOT_ACTIVE/.test(t)?"这次运行不在本机活动目录,或已经不是 running,不能协作中止。":null}const nO=[{pattern:/invalid (boot capability|confirmation header) token/i,copy:"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。"},{pattern:/mutation requires boot capability cookie|mutation requires confirmation header token/i,copy:"页面状态异常,请刷新页面(F5)后重试。"},{pattern:/Host header is required for non-loopback/i,copy:"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。"}];function Ua(e){const t=(e??"").trim();if(!t)return"操作失败";const n=tO(t);if(n)return n;if(/controller identity changed|package fingerprint changed|entry binary sha256 changed/i.test(t))return"控制器版本已变更(Console 启动后代码被重新编译,或提交了 package.json / bin / dist / skills 等指纹范围文件)。请重启 Console 进程使其重新加载当前构建后再重试本操作;一次会话中途不要重建控制器。";if(/Pi session file missing or not openable|cannot reopen chat session .* no persisted Pi session file/i.test(t))return"该对话的 Pi 会话文件已丢失,无法恢复上下文。请新建对话继续(历史记录无法重开)。";if(/reopened Pi sessionId mismatch/i.test(t))return"重开对话失败:Pi 会话身份与记录不一致(常见于会话文件丢失后被误建)。请新建对话继续。";if(/base HEAD .+ != frozen baseCommit|exact-base|not a descendant of frozen baseCommit/i.test(t))return"主分支已相对夜间冻结的 baseCommit 前进,无法安全 fast-forward harvest。请人工核对后使用 Discard(必要时勾选强制),或改走日间合并流程。";if(/force-required|requires --force/i.test(t))return"该终态需要强制 Discard。请确认后勾选强制再试。";for(const a of nO)if(a.pattern.test(t))return a.copy;return t}function rO(e){return e.turnPhase==="stopping"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:e.turnPhase==="running"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:{action:"send-now"}}function x2(e){const{clientRequestId:t,blockedByTurnId:n,state:a}=e;if(!a)return{action:"hold"};if(a.deferredTurn?.clientRequestId===t)return{action:"deferred",deferredTurn:a.deferredTurn};if(a.activeTurn?.clientRequestId===t)return{action:"accepted",turn:a.activeTurn};if(a.latestTurn?.clientRequestId===t)return{action:"accepted",turn:a.latestTurn};const s=a.activeTurn?.turnId??a.activeTurnId??null;return a.turnPhase==="stopping"&&s===n?{action:"retry-deferred"}:_o(a)?{action:"hold"}:{action:"send-now"}}function aO(e){let t;const n=new Promise(a=>{t=a});return{...e,outcomePromise:n,resolveOutcome:t}}function w2(e="network error while creating turn"){return{kind:"ambiguous",message:e}}function iO(e="无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"){return{kind:"ambiguous",message:e}}function S2(e){const{body:t,clientRequestId:n}=e,a=t.error?.code,s=t.error?.message??(e.httpOk?"turn was not accepted":`HTTP ${e.status}`);if(a==="TURN_ACTIVE"&&t.activeTurn?.turnId)return{kind:"adopt-active",activeTurn:t.activeTurn,message:"上一轮仍在运行,已重新连接;当前消息已保留。"};if(t.accepted===!0||e.httpOk&&t.turnId){const l=t.turn?.turnId??t.turnId;return l?{kind:"accepted",turnId:l,idempotent:t.idempotent===!0,turn:t.turn??{turnId:l,clientRequestId:n,state:t.state}}:{kind:"ambiguous",message:s}}return t.accepted===!1||a?{kind:"rejected",code:a,message:s}:{kind:"ambiguous",message:s}}function sO(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn;return n?.clientRequestId===t&&n.turnId?{kind:"accepted",turnId:n.turnId,idempotent:!0,turn:n}:a?.clientRequestId===t&&a.turnId?{kind:"accepted",turnId:a.turnId,idempotent:!0,turn:a}:n?.turnId?{kind:"adopt-active",activeTurn:n,message:"上一轮仍在运行,已重新连接;当前消息已保留。"}:null}function lO(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn,s=n?.state??e.state?.activeTurnState??void 0,l=a?.state??e.state?.latestTurnState??void 0;if(n?.clientRequestId===t&&n.turnId)return is(s)?{action:"release-terminal",turnId:n.turnId,state:String(s)}:{action:"bind-active",turnId:n.turnId};if(a?.clientRequestId===t&&a.turnId){if(is(l))return{action:"release-terminal",turnId:a.turnId,state:String(l)};if(!n?.turnId||n.clientRequestId===t)return{action:"bind-active",turnId:a.turnId}}return!_o(e.state)&&!(!!n?.turnId&&n?.clientRequestId!==t)?{action:"release-not-accepted"}:{action:"hold"}}function _o(e){if(e?.activeTurnId||e?.activeTurn?.turnId)return!0;const t=e?.runtime;return t?t.isStreaming===!0||t.isPromptRunning===!0||t.isCompacting===!0||t.isBashRunning===!0:!1}function is(e){return e==="settled"||e==="aborted"||e==="failed"}function ju(e){return e.pending.sessionId===e.sessionId&&e.pending.sessionGeneration===e.sessionGeneration&&e.pending.submitGeneration===e.submitGeneration}function oO(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns`}function k2(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/state`}function cO(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`}function uO(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns/${encodeURIComponent(n)}/abort`}function Ys(e){return e.stoppingTurnId||e.stopRequested?"stopping":e.activeTurnId||e.streaming||e.submitInFlight||e.pendingSubmission?"running":"idle"}function ml(e,t){const n=e.pendingSubmission;t&&n&&n.clientRequestId!==t||(e.submitInFlight=!1,(!t||n?.clientRequestId===t)&&(n?.clientRequestId?e.releasedClientRequestIds.add(n.clientRequestId):t&&e.releasedClientRequestIds.add(t),e.pendingSubmission=null),e.pendingSubmission||(e.stopRequested=!1))}function V6(e){e.stopRequested=!0}function Lu(e){e.stopRequested=!1}function dO(e,t){return!(!t||e.abortPostedTurnIds.has(t))}function fO(e,t){t&&e.abortPostedTurnIds.add(t)}function zu(e,t){return!e.stopRequested||!dO(e,t)?null:(fO(e,t),e.stoppingTurnId=t,e.activeTurnId=t,t)}function E2(e,t){const n=e.pendingSubmission;return n&&n.clientRequestId!==t.clientRequestId?!1:(t.turnId&&e.settledTurnIds.add(t.turnId),ml(e,t.clientRequestId),Lu(e),t.markIdle!==!1&&(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null),!0)}function mO(e,t){return ju({pending:t.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration})?(t.pending.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,t.assistantId),e.streaming=!0,e.submitInFlight=!1,t.pending.resolveOutcome({kind:"accepted",turnId:t.turnId}),t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(t.assistantId),t.ui?.setPendingImages([]),t.ui?.watchSessionTitle?.(t.sessionId),!0):(t.pending.resolveOutcome({kind:"stale"}),!1)}function hO(e,t){t.pending.resolveOutcome({kind:"adopt-active",activeTurn:{turnId:t.activeTurnId},message:t.message}),ml(e,t.pending.clientRequestId),t.current&&(t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images),e.activeTurnId=t.activeTurnId,e.assistantId=null,e.streaming=!0,t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(null),t.notice.setError(null),t.notice.showNotice(t.message))}function pO(e,t){if(t.pending.resolveOutcome({kind:"rejected",message:t.message}),ml(e,t.pending.clientRequestId),!t.current)return;const n=t.ui?.formatError?t.ui.formatError(t.message):t.message;t.ui?.setError(n),e.streaming=!1,e.assistantId=null,t.ui?.setStreaming(!1),t.ui?.setStreamingAssistantId(null),t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images)}function gO(e,t,n){const a=ju({pending:n.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration});if(t.kind==="accepted"){if(mO(e,{turnId:t.turnId,assistantId:n.assistantId,pending:n.pending,sessionId:n.sessionId,ui:n.acceptedUi})){const l=zu(e,t.turnId);l&&n.onAutoAbort?.(l)}return}if(t.kind==="adopt-active"){const s=a?zu(e,t.activeTurn.turnId):null;hO(e,{activeTurnId:t.activeTurn.turnId,message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,notice:n.notice,ui:n.adoptUi}),s&&n.onAutoAbort?.(s);return}if(t.kind==="rejected"){pO(e,{message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,ui:n.rejectedUi}),Lu(e);return}if(t.kind==="stale"){n.pending.resolveOutcome(t),ml(e,n.pending.clientRequestId),Lu(e);return}n.pending.resolveOutcome(t)}function bO(e,t,n,a){const s=e.pendingSubmission;if(!s)return"held";if(t.action==="bind-active"){const c=!!s.acceptedTurnId;c||(s.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,s.assistantId),e.streaming=!0,e.submitInFlight=!1);const d=zu(e,t.turnId);return d&&a?.onAutoAbort?.(d),c?"held":"bound"}if(t.action==="release-terminal"||t.action==="release-not-accepted")return t.action==="release-terminal"&&e.settledTurnIds.add(t.turnId),ml(e,s.clientRequestId),Lu(e),_o(n)||(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.()),"released";const l=n?.activeTurn?.turnId??n?.activeTurnId??null;return l&&(e.activeTurnId=l),"held"}const vO="正在停止…",yO="正在停止…",xO="停止请求未完成,正在与服务端对账…",wO="停止请求失败,正在与服务端对账…";function T2(e){e.showNotice(vO)}function N2(e){if(e.networkError)return{action:"keep-busy-notice",message:wO};const t=e.body.turn?.state;return e.body.accepted===!0&&is(t)?{action:"terminal-idle",turnId:e.turnId}:e.body.error?.code==="TURN_ABORT_PENDING"?{action:"abort-pending-notice"}:e.body.error?.code==="CHAT_TURN_OWNER_LOST"||e.body.error?.code==="OWNER_LOST"?{action:"owner-lost-reconcile"}:e.httpOk?{action:"noop"}:{action:"keep-busy-notice",message:xO}}function Ym(e,t,n,a){const s=a?.sessionStillCurrent!==!1;if(t.action==="terminal-idle"){if(!s)return;e.settledTurnIds.add(t.turnId),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.();return}if(t.action==="abort-pending-notice"){n.showNotice(yO);return}if(t.action==="owner-lost-reconcile"){if(!s)return;a?.runtimeBusy||(e.stoppingTurnId&&e.settledTurnIds.add(e.stoppingTurnId),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.());return}if(t.action==="keep-busy-notice"){n.showNotice(t.message);return}}function C2(e,t){V6(e);const n=e.activeTurnId??e.pendingSubmission?.acceptedTurnId??null;if(n){const a=zu(e,n);return a?(t.notice&&T2(t.notice),t.postAbort(a),{abortedTurnId:a,stopRequested:!0}):{abortedTurnId:null,stopRequested:!0}}return t.notice&&T2(t.notice),{abortedTurnId:null,stopRequested:!0}}function la(e){return{submitInFlight:e.submitInFlightRef.current,pendingSubmission:e.pendingSubmissionRef.current,activeTurnId:e.activeTurnIdRef.current,streaming:e.streamingRef.current,assistantId:e.assistantIdRef.current,stoppingTurnId:e.stoppingTurnIdRef.current,settledTurnIds:e.settledTurnIdsRef.current,turnAssistantIds:e.turnAssistantIdsRef.current,sessionId:e.sessionRef.current?.sessionId??null,sessionGeneration:e.sessionGenerationRef.current,submitGeneration:e.submitGenerationRef.current,stopInFlight:e.stopInFlightRef.current,stopRequested:e.stopRequestedRef.current,abortPostedTurnIds:e.abortPostedTurnIdsRef.current,releasedClientRequestIds:e.releasedClientRequestIdsRef.current}}function oa(e,t){e.submitInFlightRef.current=t.submitInFlight,e.pendingSubmissionRef.current=t.pendingSubmission,e.activeTurnIdRef.current=t.activeTurnId,e.streamingRef.current=t.streaming,e.assistantIdRef.current=t.assistantId,e.stoppingTurnIdRef.current=t.stoppingTurnId,e.submitGenerationRef.current=t.submitGeneration,e.stopInFlightRef.current=t.stopInFlight,e.stopRequestedRef.current=t.stopRequested}function SO(e){return e.split(`
|
|
395
|
+
`).find(t=>t.startsWith("event: "))?.slice(7).trim()??"message"}function kO(){return new Promise(e=>window.setTimeout(e,25))}function Xm(e,t){t&&e(n=>n.filter(a=>!(a.id===t&&a.role==="assistant"&&!a.text.trim())))}function EO(e){const{origin:t,refs:n,session:a,thread:s,composer:l,setError:c,setAutoScroll:d,setNotice:m,recoveryVersion:h=0,watchSessionTitle:p}=e,{applySseBlock:b,setMessages:y,setStreaming:x,setStreamingAssistantId:k,streaming:T,setTurnPhase:R,setDeferredTurn:C}=s,{setInput:_,setPendingImages:I,recordHistory:G}=l,D=S.useCallback(q=>{m&&m({id:Date.now(),message:q})},[m]),M=S.useCallback(q=>{const A=la(n);ml(A,q),oa(n,A)},[n]),B=S.useCallback((q,A,ae)=>{n.sessionRef.current?.sessionId!==q||n.sessionGenerationRef.current!==A||(n.streamingRef.current=!1,n.activeTurnIdRef.current=null,n.assistantIdRef.current=null,n.stoppingTurnIdRef.current=null,x(!1),R("idle"),k(null),Xm(y,ae))},[n,x,R,k,y]),X=S.useCallback(async(q,A,ae)=>{for(;!ae.aborted;){const pe=n.eventsStreamStateRef.current;if(!pe||pe.sessionId!==q||pe.generation!==A)return;pe.ready=!1;try{const te={Accept:"text/event-stream"},ee=n.lastEventIdRef.current;ee&&(te["Last-Event-ID"]=ee);const ce=await fetch(cO(t,q),{headers:te,credentials:"include",signal:ae});if(!ce.ok||!ce.body){if(ce.status===404)return;await wf(2e3,ae);continue}const ge=ce.body.getReader(),Ae=new TextDecoder;let Oe="",ve=!0;const Ue=rs("a");for(;;){const{done:nt,value:lt}=await ge.read();if(nt)break;Oe+=Ae.decode(lt,{stream:!0});const Lt=Oe.split(`
|
|
396
|
+
|
|
397
|
+
`);Oe=Lt.pop()??"";for(const _t of Lt){if(SO(_t)==="stream_ready"){const Fe=n.eventsStreamStateRef.current;Fe?.sessionId===q&&Fe.generation===A&&(Fe.ready=!0),ve=!1;continue}const ut=n.assistantIdRef.current??Ue,Ye=b(_t,ut,{replay:ve,targetSessionId:q,generation:A});Ye&&(n.lastEventIdRef.current=Ye)}}const Ve=n.eventsStreamStateRef.current;Ve?.sessionId===q&&Ve.generation===A&&(Ve.ready=!1),await wf(1e3,ae)}catch{if(ae.aborted)return;await wf(2e3,ae)}}},[t,n,b]),$=S.useCallback((q,A)=>{const ae=n.eventsStreamStateRef.current;if(ae?.sessionId===q&&ae.generation===A&&n.reconnectAbortRef.current)return;n.reconnectAbortRef.current?.abort();const pe=new AbortController;n.reconnectAbortRef.current=pe,n.eventsStreamStateRef.current={sessionId:q,generation:A,ready:!1},X(q,A,pe.signal)},[n,X]),j=S.useCallback(async(q,A)=>{$(q,A);const ae=Date.now()+5e3;for(;Date.now()<ae;){const pe=n.eventsStreamStateRef.current;if(pe?.sessionId===q&&pe.generation===A&&pe.ready)return;if(n.sessionRef.current?.sessionId!==q||n.sessionGenerationRef.current!==A)throw new Error("会话已切换");await kO()}throw new Error("事件连接未就绪,请检查 Console 连接后重试")},[n,$]),F=S.useCallback(async q=>{try{const A=await fetch(k2(t,q),{credentials:"include"}),ae=await A.json().catch(()=>({}));return A.ok?ae.state??null:null}catch{return null}},[t]),H=S.useCallback(async q=>{try{const A=await fetch(oO(t,q.sessionId),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({clientRequestId:q.clientRequestId,text:q.text.trim()||"请查看附件图片。",images:q.images.map(({type:pe,mimeType:te,data:ee})=>({type:pe,mimeType:te,data:ee}))})}),ae=await A.json().catch(()=>({}));return{httpOk:A.ok,status:A.status,body:ae}}catch{return{httpOk:!1,status:0,body:{},networkError:!0}}},[t]),ne=S.useCallback(()=>({showNotice:D,setError:q=>c(q)}),[D,c]),V=S.useCallback(async(q,A,ae)=>{n.stoppingTurnIdRef.current=ae,n.streamingRef.current=!1,x(!1),R("stopping"),k(null);try{const pe=await fetch(uO(t,q,ae),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:"{}"}),te=await pe.json().catch(()=>({}));if(n.sessionRef.current?.sessionId!==q||n.sessionGenerationRef.current!==A||n.stoppingTurnIdRef.current!==ae)return;const ee=N2({httpOk:pe.ok,turnId:ae,body:te}),ce=la(n);if(ce.stoppingTurnId=ae,ee.action==="owner-lost-reconcile"){const ge=await F(q),Ae=n.sessionRef.current?.sessionId===q&&n.sessionGenerationRef.current===A;Ym(ce,ee,ne(),{sessionStillCurrent:Ae,runtimeBusy:_o(ge??void 0),markIdle:()=>B(q,A,n.assistantIdRef.current)}),oa(n,ce),R(Ys(ce));return}Ym(ce,ee,ne(),{sessionStillCurrent:!0,markIdle:()=>B(q,A,n.assistantIdRef.current)}),oa(n,ce),R(Ys(ce)),ce.streaming&&x(!0)}catch{const pe=la(n);Ym(pe,N2({httpOk:!1,turnId:ae,body:{},networkError:!0}),ne()),oa(n,pe),n.streamingRef.current=!0,x(!0),R("stopping")}},[t,n,x,R,B,F,ne]),Y=S.useCallback((q,A)=>{const ae=la(n);ae.sessionId=n.sessionRef.current?.sessionId??null,ae.sessionGeneration=n.sessionGenerationRef.current,ae.submitGeneration=n.submitGenerationRef.current;const pe=te=>{I(te)};gO(ae,q,{assistantId:A.assistantId,text:A.text,images:A.images,pending:A.pending,sessionId:A.sessionId,notice:ne(),acceptedUi:{setStreaming:x,setStreamingAssistantId:k,setPendingImages:pe,watchSessionTitle:p},adoptUi:{clearEmptyAssistant:te=>Xm(y,te),setInput:_,setPendingImages:pe,setStreaming:x,setStreamingAssistantId:k},rejectedUi:{setError:c,setStreaming:x,setStreamingAssistantId:k,clearEmptyAssistant:te=>Xm(y,te),setInput:_,setPendingImages:pe,formatError:Ua},onAutoAbort:te=>{V(A.sessionId,A.generation,te)}}),oa(n,ae),R(Ys(ae))},[n,ne,x,R,k,I,p,y,_,c,V]),K=S.useCallback(async q=>{const A=n.sessionRef.current;if(!A||!q.text.trim()&&q.images.length===0)return{action:"handled"};const ae=s.deferredTurn;D("正在排队…");const pe=ce=>{C(ce),_(""),I([]),c(null),D(ae?"已更新排队消息":"已排队,将在当前回合结束后自动发送")},te=()=>{C(null),_(""),I([]),c(null),D("消息已进入发送")},ee=async()=>{const ce=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(A.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({clientRequestId:q.clientRequestId,blockedByTurnId:q.blockedByTurnId,text:q.text,images:q.images,...ae?{expectedRevision:ae.revision}:{}})}),ge=await ce.json().catch(()=>({}));return{response:ce,body:ge}};try{for(let ce=0;ce<2;ce+=1){const{response:ge,body:Ae}=await ee();if(ge.ok&&Ae.accepted&&Ae.deferredTurn)return pe(Ae.deferredTurn),{action:"handled"};if(Ae.deferredTurn&&C(Ae.deferredTurn),Ae.error?.code!=="TURN_NOT_ACTIVE")return c(Ae.error?.message??`待发送消息未被服务端接受(HTTP ${ge.status})`),{action:"handled"};const Oe=await F(A.sessionId),ve=x2({clientRequestId:q.clientRequestId,blockedByTurnId:q.blockedByTurnId,state:Oe??void 0});if(ve.action==="deferred")return pe(ve.deferredTurn),{action:"handled"};if(ve.action==="accepted")return te(),{action:"handled"};if(!(ve.action==="retry-deferred"&&ce===0))return ve.action==="send-now"&&!ae?(D("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(Ae.error?.message??"停止状态已变化,当前消息仍保留在输入框"),{action:"handled"})}return{action:"handled"}}catch(ce){const ge=await F(A.sessionId),Ae=x2({clientRequestId:q.clientRequestId,blockedByTurnId:q.blockedByTurnId,state:ge??void 0});return Ae.action==="deferred"?(pe(Ae.deferredTurn),{action:"handled"}):Ae.action==="accepted"?(te(),{action:"handled"}):Ae.action==="send-now"&&!ae?(D("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(ce instanceof Error?`无法确认消息是否已排队:${ce.message}`:"无法确认消息是否已排队,请刷新后查看服务端状态"),{action:"handled"})}},[t,n,s.deferredTurn,C,_,I,c,D,F]),re=S.useCallback(async q=>{const A=n.sessionRef.current,ae=s.deferredTurn;if(!(!A||!ae))try{const pe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(A.sessionId)}/deferred-turn`,{method:"DELETE",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({clientRequestId:ae.clientRequestId,expectedRevision:ae.revision})}),te=await pe.json().catch(()=>({}));if(!pe.ok||!te.cancelled){c(te.error?.message??"待发送消息撤回失败");return}C(null),q==="restore"?(_(te.deferredTurn?.text??""),I(te.deferredTurn?.images??[]),D("待发送消息已移回输入框")):D("已删除排队消息"),c(null)}catch(pe){c(pe instanceof Error?pe.message:String(pe))}},[t,n,s.deferredTurn,C,_,I,c,D]),ue=S.useCallback(()=>re("restore"),[re]),Te=S.useCallback(()=>re("discard"),[re]),P=S.useCallback(async(q,A)=>{const ae=n.sessionRef.current;if(!ae||!q.trim()&&A.length===0)return;const pe=la(n),te=rO({turnPhase:Ys(pe),blockedByTurnId:pe.stoppingTurnId??pe.activeTurnId}),ee=rs("chat-submit");if(te.action==="hold"){const Ye=Ys(pe);Ye==="stopping"?D("正在确认上一轮停止状态,当前消息已保留"):Ye==="running"&&D("正在确认当前回合状态,当前消息已保留");return}if(G?.(q),te.action==="queue-deferred"&&(await K({text:q,images:A,clientRequestId:ee,blockedByTurnId:te.blockedByTurnId})).action!=="send-now")return;const ce=n.sessionRef.current,ge=n.sessionGenerationRef.current;if(!ce||ce.sessionId!==ae.sessionId||!q.trim()&&A.length===0||n.streamingRef.current||n.submitInFlightRef.current||n.pendingSubmissionRef.current)return;n.submitInFlightRef.current=!0;const Ae=++n.submitGenerationRef.current,Oe=rs("u"),ve=rs("a"),Ue=q.trim(),Ve=A.slice(),nt=aO({clientRequestId:ee,submitGeneration:Ae,sessionId:ce.sessionId,sessionGeneration:ge,text:Ue,images:Ve,assistantId:ve,userMessageId:Oe});n.pendingSubmissionRef.current=nt;try{await j(ce.sessionId,ge)}catch(Ye){n.sessionRef.current?.sessionId===ce.sessionId&&n.sessionGenerationRef.current===ge&&c(Ua(Ye instanceof Error?Ye.message:String(Ye))),M(ee);return}if(n.sessionRef.current?.sessionId!==ce.sessionId||n.sessionGenerationRef.current!==ge){M(ee);return}const lt={id:Oe,role:"user",text:Ue,createdAt:Date.now()};y(Ye=>[...Ye,lt,{id:ve,role:"assistant",text:"",createdAt:Date.now()}]),_(""),d(!0),c(null),n.streamingRef.current=!0,R("running"),n.assistantIdRef.current=ve,x(!0),k(ve);const Lt={sessionId:ce.sessionId,generation:ge,submitGeneration:Ae,assistantId:ve,text:Ue,images:Ve,pending:nt},_t=await H({sessionId:ce.sessionId,clientRequestId:ee,text:Ue,images:Ve});if(!ju({pending:nt,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){nt.resolveOutcome({kind:"stale"}),M(ee);return}let ut=_t.networkError?w2():S2({httpOk:_t.httpOk,status:_t.status,body:_t.body,clientRequestId:ee});if(ut.kind==="ambiguous"){const Ye=await F(ce.sessionId),Fe=Ye?sO({clientRequestId:ee,state:Ye}):null;if(Fe)ut=Fe;else{const ct=await H({sessionId:ce.sessionId,clientRequestId:ee,text:Ue,images:Ve});if(!ju({pending:nt,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){nt.resolveOutcome({kind:"stale"}),M(ee);return}if(ut=ct.networkError?w2("无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"):S2({httpOk:ct.httpOk,status:ct.status,body:ct.body,clientRequestId:ee}),ut.kind==="ambiguous"){const zt=ut.message||"无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)";ut=iO(zt),D(zt)}}}Y(ut,Lt)},[t,n,j,H,F,Y,M,D,y,_,d,c,x,R,k,K,G]),U=S.useCallback(async()=>{const q=n.sessionRef.current?.sessionId,A=n.sessionGenerationRef.current;if(!q)return;const ae=la(n),pe=C2(ae,{postAbort:()=>{},notice:ne()});if(oa(n,ae),R("stopping"),pe.abortedTurnId){if(n.stopInFlightRef.current)return;n.stopInFlightRef.current=!0;try{await V(q,A,pe.abortedTurnId)}finally{n.stopInFlightRef.current=!1}return}const te=n.pendingSubmissionRef.current;if(te&&!n.stopInFlightRef.current){n.stopInFlightRef.current=!0;try{const ee=await te.outcomePromise;if(n.sessionRef.current?.sessionId!==q||n.sessionGenerationRef.current!==A)return;let ce=null;if(ee.kind==="accepted")ce=ee.turnId;else if(ee.kind==="adopt-active")ce=ee.activeTurn.turnId;else{if(ee.kind==="ambiguous")return;n.stopRequestedRef.current=!1;return}if(!ce)return;const ge=la(n);V6(ge);const Ae=C2(ge,{postAbort:()=>{},notice:ne()});oa(n,ge),Ae.abortedTurnId&&await V(q,A,Ae.abortedTurnId)}finally{n.stopInFlightRef.current=!1}}},[n,ne,V]);return S.useEffect(()=>{const q=!!n.pendingSubmissionRef.current||n.submitInFlightRef.current||n.stopRequestedRef.current||!!n.activeTurnIdRef.current;if(!a||!T&&!q)return;const A=a.sessionId,ae=n.sessionGenerationRef.current;let pe=!1;const te=async()=>{try{const Ae=await fetch(k2(t,A),{credentials:"include"}),Oe=await Ae.json().catch(()=>({}));if(pe||!Ae.ok||n.sessionRef.current?.sessionId!==A||n.sessionGenerationRef.current!==ae)return;const ve=Oe.state,Ue=n.pendingSubmissionRef.current;if(Ue){const ut=lO({clientRequestId:Ue.clientRequestId,state:ve}),Ye=la(n),Fe=bO(Ye,ut,ve,{markIdle:()=>B(A,ae,n.assistantIdRef.current),onAutoAbort:ct=>{V(A,ae,ct)}});if(oa(n,Ye),R(Ys(Ye)),ve&&"deferredTurn"in ve&&C(ve.deferredTurn??null),Fe==="bound"){x(!0);return}if(Fe==="released"||!Ue.acceptedTurnId&&!Ye.pendingSubmission?.acceptedTurnId)return}const Ve=ve?.activeTurn?.turnId??ve?.activeTurnId??null;n.activeTurnIdRef.current=Ve;const nt=_o(ve),lt=n.pendingSubmissionRef.current;if(lt){const ut=ve?.latestTurn?.clientRequestId===lt.clientRequestId&&is(ve?.latestTurn?.state),Ye=ve?.activeTurn?.clientRequestId===lt.clientRequestId&&is(ve?.activeTurn?.state);if(ut||Ye){const Fe=Ye?ve?.activeTurn?.turnId??null:ve?.latestTurn?.turnId??lt.acceptedTurnId??null,ct=la(n);E2(ct,{clientRequestId:lt.clientRequestId,turnId:Fe,markIdle:!nt}),oa(n,ct),nt||B(A,ae,n.assistantIdRef.current);return}}if(nt)return;const Lt=n.assistantIdRef.current;if(Ve&&!(is(ve?.activeTurn?.state)||is(ve?.activeTurnState)))return;Ve&&n.settledTurnIdsRef.current.add(Ve);const _t=lt?.clientRequestId;if(_t){const ut=la(n);E2(ut,{clientRequestId:_t,turnId:Ve,markIdle:!0}),oa(n,ut)}else M();B(A,ae,Lt)}catch{}},ee=()=>{document.visibilityState==="visible"&&te()},ce=()=>{te()},ge=window.setInterval(()=>{te()},15e3);return document.addEventListener("visibilitychange",ee),window.addEventListener("online",ce),te(),()=>{pe=!0,window.clearInterval(ge),document.removeEventListener("visibilitychange",ee),window.removeEventListener("online",ce)}},[t,n,a,T,R,B,M,V]),S.useEffect(()=>{if(!a)return;const q=n.sessionGenerationRef.current;return $(a.sessionId,q),()=>{const A=n.eventsStreamStateRef.current;A?.sessionId===a.sessionId&&A.generation===q&&(n.reconnectAbortRef.current?.abort(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null)}},[a,h,n,$]),{sendPrompt:P,handleStop:U,cancelDeferredTurn:ue,discardDeferredTurn:Te,openEventsStream:X}}function TO(e){const{origin:t,refs:n,thread:a,setError:s}=e,{interview:l,setInterview:c}=a,[d,m]=S.useState(""),h=S.useCallback(async()=>{const y=n.sessionRef.current;if(!y)return;const x=window.prompt("Task ID(例如 2026-07-26-my-task)")?.trim();if(!x)return;const k=await fetch(`${t}/api/operator/v1/chat/sessions/${y.sessionId}/interviews`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({taskId:x})}),T=await k.json();if(!k.ok){s(T.error?.message??`HTTP ${k.status}`);return}c({interviewSessionId:T.interview?.sessionId,taskId:x,state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment})},[t,n,c,s]),p=S.useCallback(async y=>{const x=n.sessionRef.current;if(!x||!l?.interviewSessionId||!l.question)return;const k=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews/${l.interviewSessionId}/answers`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({questionId:l.question.id,response:y,...y==="override"?{text:d}:{}})}),T=await k.json();if(!k.ok){s(T.error?.message??`HTTP ${k.status}`);return}c(R=>({...R??{},state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment,taskKindRecommendation:T.taskKindRecommendation??R?.taskKindRecommendation})),m("")},[t,n,l,d,c,s]),b=S.useCallback(async()=>{const y=n.sessionRef.current;if(!y||!l?.interviewSessionId||!l.taskKindRecommendation)return;const x=await fetch(`${t}/api/operator/v1/chat/sessions/${y.sessionId}/interviews/${l.interviewSessionId}/task-kind/confirm`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":tr()},credentials:"include",body:JSON.stringify({taskKind:l.taskKindRecommendation})}),k=await x.json();if(!x.ok){s(k.error?.message??`HTTP ${x.status}`);return}c(T=>({...T??{},confirmedTaskKind:T?.taskKindRecommendation,taskKindRecommendation:void 0,draft:k.draft?.draft,draftSha256:k.draft?.draftSha256,assessment:k.assessment}))},[t,n,l,c,s]);return{interviewAnswer:d,setInterviewAnswer:m,startInterview:h,answerInterview:p,confirmTaskKind:b}}function NO(e){const{origin:t,refs:n,sessionId:a,setError:s}=e,[l,c]=S.useState({}),[d,m]=S.useState(new Set),[h,p]=S.useState(null),[b,y]=S.useState([]),[x,k]=S.useState(null),[T,R]=S.useState(!1),C=S.useRef(new Set);C.current=d;const _=S.useCallback(async($="")=>{try{p(null);const j=await fetch(`${t}/api/operator/v1/chat/repo/tree?path=${encodeURIComponent($)}`,{credentials:"include"}),F=await j.json();if(!j.ok)throw new Error(F.error?.message??"无法读取仓库目录");c(H=>({...H,[$]:F.data?.entries??[]}))}catch(j){p(j instanceof Error?j.message:String(j))}},[t]);S.useEffect(()=>{_()},[_]);const[I,G]=S.useState(0),D=S.useCallback(()=>{G($=>$+1)},[]);S.useEffect(()=>{const $=["",...C.current];for(const j of $)_(j)},[_,I]),S.useEffect(()=>{const $=()=>{document.hidden||D()};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[D]);const M=S.useCallback(async $=>{R(!0);try{const j=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent($)}`,{credentials:"include"}),F=await j.json();if(!j.ok||!F.data)throw new Error(F.error?.message??"无法预览文件");y(H=>{const ne=[...H.filter(Y=>Y.path!==F.data.path),F.data],V=n.sessionRef.current?.sessionId;return V&&window.localStorage.setItem(`${Yr}.previews.${V}`,JSON.stringify(ne.map(Y=>Y.path))),ne}),k(F.data.path)}catch(j){s(j instanceof Error?j.message:String(j))}finally{R(!1)}},[t,n,s]);S.useEffect(()=>{if(!a)return;let $=[];try{const j=JSON.parse(window.localStorage.getItem(`${Yr}.previews.${a}`)??"[]");Array.isArray(j)&&($=j.filter(F=>typeof F=="string").slice(0,10))}catch{}$.length&&Promise.all($.map(async j=>{const F=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(j)}`,{credentials:"include"});if(F.ok)return(await F.json()).data})).then(j=>{if(n.sessionRef.current?.sessionId!==a)return;const F=j.filter(H=>!!H);y(F),k(F.at(-1)?.path??null)})},[t,a,n]);const B=S.useCallback($=>{m(j=>{const F=new Set(j);return F.has($)?F.delete($):F.add($),F}),l[$]||_($)},[l,_]),X=S.useCallback($=>{y(j=>{const F=j.filter(H=>H.path!==$);return a&&window.localStorage.setItem(`${Yr}.previews.${a}`,JSON.stringify(F.map(H=>H.path))),F}),k(j=>j===$?b.find(F=>F.path!==$)?.path??null:j)},[b,a]);return{tree:l,expandedDirs:d,treeError:h,previews:b,activePreviewPath:x,setActivePreviewPath:k,previewLoading:T,setPreviews:y,loadTree:_,refreshTree:D,openPreview:M,closePreview:X,toggleDir:B}}const CO=["operator","web","extension","prompt","skill"];function RO(e){const t=[];for(const n of CO){const a=[];for(let s=0;s<e.length;s+=1)e[s].source===n&&a.push({entry:e[s],globalIndex:s});a.length!==0&&t.push({source:n,label:iI[n],items:a})}return t}function AO(e,t){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<0?0:e>=t?t-1:e}function _O(e){return e==="comfortable"?3:e==="compact"?2:1}function R2(e,t,n,a){const s=t.findIndex(b=>b.items.some(y=>y.globalIndex===e));if(s<0)return e;const l=t[s],c=l.items.findIndex(b=>b.globalIndex===e);if(c<0)return e;const d=Math.floor(c/n),m=c%n;if(a==="left"||a==="right"){if(n<=1)return e;const y=c+(a==="left"?-1:1);return y<0||y>=l.items.length||Math.floor(y/n)!==d?e:l.items[y].globalIndex}const h=a==="up"?-1:1,p=c+h*n;if(p>=0&&p<l.items.length)return l.items[p].globalIndex;for(let b=s+h;b>=0&&b<t.length;b+=h){const y=t[b];if(y.items.length===0)continue;const x=Math.floor((y.items.length-1)/n)*n,k=a==="up"?x+m:m;return k>=y.items.length?e:y.items[k].globalIndex}return e}function IO(e,t,n){const a=(e.left+e.right)/2;let s=null;for(const l of t){if(l.globalIndex===e.globalIndex)continue;const c=n==="up"?e.top-l.bottom:l.top-e.bottom;if(c<0)continue;const d=(l.left+l.right)/2,m=Math.abs(d-a);(s===null||c<s.gap||c===s.gap&&m<s.dist||c===s.gap&&m===s.dist&&l.globalIndex<s.index)&&(s={gap:c,dist:m,index:l.globalIndex})}return s?.index??null}function MO(){return{entries:[],index:-1,draft:""}}function OO(e,t){return t.trim()?e.entries[e.entries.length-1]===t?e.index===-1?e:{...e,index:-1,draft:""}:{entries:[...e.entries,t].slice(-100),index:-1,draft:""}:e}function DO(e){return e.index===-1?e:{...e,index:-1}}function jO(e,t,n){const{text:a,caretStart:s,caretEnd:l}=n;if(e.entries.length===0)return{handled:!1};if(t==="up"){if(a.slice(0,s).includes(`
|
|
398
|
+
`))return{handled:!1};if(e.index===-1){const m=e.entries.length-1;return{handled:!0,state:{...e,index:m,draft:a},text:e.entries[m]}}if(e.index===0)return{handled:!0,state:e,text:e.entries[0]};const d=e.index-1;return{handled:!0,state:{...e,index:d},text:e.entries[d]}}if(e.index===-1)return{handled:!1};if(a.slice(l).includes(`
|
|
399
|
+
`))return{handled:!1};if(e.index>=e.entries.length-1)return{handled:!0,state:{...e,index:-1},text:e.draft};const c=e.index+1;return{handled:!0,state:{...e,index:c},text:e.entries[c]}}function LO(e){const{origin:t,sessionId:n,refs:a,setError:s}=e,[l,c]=S.useState(""),[d,m]=S.useState([]),[h,p]=S.useState([]),[b,y]=S.useState(!1),x=S.useCallback(te=>{if(typeof te=="function"){c(ee=>{const ce=te(ee);return y(ce.startsWith("/")),ce});return}c(te),y(te.startsWith("/"))},[]),[k,T]=S.useState(0),[R,C]=S.useState([]),[_,I]=S.useState(!1),[G,D]=S.useState(null),[M,B]=S.useState(0),X=S.useRef(null),$=S.useRef(MO()),j=S.useRef(n),F=S.useRef(0),H=S.useCallback(te=>{x(te),y(te.startsWith("/")),T(0),$.current=DO($.current)},[]),ne=S.useCallback(te=>{const ee=X.current,ce=jO($.current,te,{text:l,caretStart:ee?.selectionStart??l.length,caretEnd:ee?.selectionEnd??l.length});if(!ce.handled)return!1;$.current=ce.state,x(ce.text);const ge=ce.text.length;return queueMicrotask(()=>{const Ae=X.current;Ae&&Ae.value===ce.text&&Ae.setSelectionRange(ge,ge)}),!0},[l,x]),V=S.useCallback(te=>{$.current=OO($.current,te)},[]);S.useLayoutEffect(()=>{j.current=n,F.current+=1,C([]),D(null),I(!1)},[n]);const Y=S.useCallback(async()=>{if(!n){C([]),D(null),I(!1);return}const te=n,ee=F.current;j.current=te,I(!0),D(null);const ce=()=>j.current===te&&F.current===ee;try{const ge=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(te)}/commands`,{credentials:"include"});if(!ce())return;if(!ge.ok){D("动态命令加载失败"),C([]);return}const Ae=await ge.json().catch(()=>null),Oe=[];for(const Ue of Ae?.commands??[]){const Ve=Ue.source;if(Ve!=="extension"&&Ve!=="prompt"&&Ve!=="skill")continue;const nt=String(Ue.command??Ue.name??"").trim();nt&&Oe.push({command:nt.startsWith("/")?nt:`/${nt}`,label:String(Ue.label??Ue.name??nt),description:String(Ue.description??""),source:Ve})}if(!ce())return;C(Oe);const ve=typeof Ae?.warning=="string"?Ae.warning.trim():"";D(ve?ve.slice(0,160):null)}catch{if(!ce())return;D("动态命令加载失败"),C([])}finally{ce()&&I(!1)}},[t,n]);S.useEffect(()=>{n&&(!b&&M===0||Y())},[n,b,M,Y]);const K=S.useCallback(()=>{B(te=>te+1),Y()},[Y]);S.useEffect(()=>{if(!n)return;const te=l.slice(0,X.current?.selectionStart??l.length).match(/(?:^|\s)@([^\s@]*)$/);if(!te){m([]);return}const ee=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/files?q=${encodeURIComponent(te[1]??"")}`).then(ce=>ce.ok?ce.json():null).then(ce=>m((ce?.files??[]).map(ge=>ge.path)))},150);return()=>window.clearTimeout(ee)},[t,n,l]);const re=S.useCallback(te=>{const ee=X.current?.selectionStart??l.length,ge=l.slice(0,ee).search(/@[^\s@]*$/);ge<0||(x(`${l.slice(0,ge)}@${te} ${l.slice(ee)}`),m([]))},[l]),ue=S.useCallback(te=>{for(const ee of Array.from(te).slice(0,4)){if(!ee.type.startsWith("image/")||ee.size>5*1024*1024){s("图片仅支持 PNG/JPEG/GIF/WebP,单张不超过 5 MiB");continue}const ce=new FileReader;ce.onload=()=>{const ge=String(ce.result??""),Ae=ge.slice(ge.indexOf(",")+1);p(Oe=>[...Oe,{name:ee.name,type:"image",mimeType:ee.type,data:Ae}].slice(0,4))},ce.readAsDataURL(ee)}},[s]),Te=S.useCallback(te=>{p(ee=>ee.filter(ce=>ce!==te))},[]);S.useLayoutEffect(()=>{const te=X.current;te&&(te.style.height="auto",te.style.height=`${Math.min(te.scrollHeight,280)}px`)},[l]),S.useEffect(()=>{if(!n)return;const te=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/draft`,{method:"PUT",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":tr()},body:JSON.stringify({text:l})})},400);return()=>window.clearTimeout(te)},[t,n,l]);const P=S.useMemo(()=>rI(R),[R]),U=S.useMemo(()=>l.startsWith("/")?aI(P,l):[],[l,P]);S.useEffect(()=>{T(te=>AO(te,U.length))},[U.length]);const q=S.useCallback(()=>{a.isComposingRef.current=!0},[a]),A=S.useCallback(()=>{a.isComposingRef.current=!1,a.compositionEndedAtRef.current=Date.now()},[a]),ae=S.useCallback(()=>a.isComposingRef.current,[a]),pe=S.useCallback(()=>Date.now()-a.compositionEndedAtRef.current<100,[a]);return S.useEffect(()=>{ew({origin:t,sessionId:n,refs:a})},[t,n,a]),{input:l,setInput:x,handleInputChange:H,navigateHistory:ne,recordHistory:V,fileOptions:d,pendingImages:h,setPendingImages:p,addImagesFromFiles:ue,removeImage:Te,shortcutOpen:b,setShortcutOpen:y,shortcutIndex:k,setShortcutIndex:T,filteredShortcuts:U,dynamicCommandsLoading:_,dynamicCommandsError:G,retryDynamicCommands:K,insertFileReference:re,textareaRef:X,onCompositionStart:q,onCompositionEnd:A,isComposingNow:ae,recentlyComposedNow:pe}}const zO=[{toolId:"read",kind:"explore",description:"Pi 内置读取文件。"},{toolId:"write",kind:"explore",description:"Pi 内置写入文件(软约束:大改优先走 DAG)。"},{toolId:"edit",kind:"explore",description:"Pi 内置编辑文件(软约束:大改优先走 DAG)。"},{toolId:"bash",kind:"explore",description:"Pi 内置 shell 执行(软约束:优先受治路径)。"},{toolId:"grep",kind:"explore",description:"Pi 内置内容搜索。"},{toolId:"find",kind:"explore",description:"按名称查找文件路径。"},{toolId:"ls",kind:"explore",description:"列出目录内容。"},{toolId:"safe-read",kind:"explore",description:"安全读取仓库相对路径文件;拒绝敏感文件并自动脱敏 secret。"},{toolId:"safe-grep",kind:"explore",description:"安全搜索仓库内容;跳过敏感文件并自动脱敏搜索结果。"},{toolId:"git-status",kind:"explore",description:"固定参数执行 git status --porcelain(无 shell)。"},{toolId:"git-diff",kind:"explore",description:"固定参数查看 git diff;敏感路径不可查看且结果自动脱敏。"}];function BO(e){if(!e)return null;const t=(e.tools??[]).map(a=>({toolId:a.toolId,action:a.action,description:a.description,kind:a.kind??"read",cli:a.cli})),n=[...zO];return{explore:n,operator:t,total:n.length+t.length}}let UO=0;function qO(e){const{origin:t,session:n,setSession:a,refs:s,setError:l}=e,[c,d]=S.useState(null),[m,h]=S.useState([]),[p,b]=S.useState("idle"),[y,x]=S.useState(null),[k,T]=S.useState([]),[R,C]=S.useState(null),[_,I]=S.useState(null),[G,D]=S.useState(!1),[M,B]=S.useState(!1),[X,$]=S.useState(!1),j=S.useRef(null),F=S.useRef(null),H=S.useRef(0);S.useEffect(()=>{H.current=-1,D(!1)},[n?.sessionId,D]);const V=sl().snapshot,Y=S.useCallback(async()=>{try{const te=await fetch(`${t}/api/operator/v1/chat/capabilities`);if(!te.ok)return;const ee=await te.json();d(ee)}catch{}},[t]);S.useEffect(()=>{Y()},[Y]);const K=S.useCallback(async()=>{if(!n){h([]),b("idle");return}const te=n.sessionId;b("loading"),x(null);try{const ee=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(te)}/models`,{credentials:"include"}),ce=await ee.json().catch(()=>null);if(s.sessionRef.current?.sessionId!==te)return;if(!ee.ok||!ce){b("error"),x(ce?.error?.message??`模型列表读取失败(HTTP ${ee.status})`);return}h(ce.models??[]),T(ce.thinkingLevels??[]),b("ready")}catch(ee){if(s.sessionRef.current?.sessionId!==te)return;b("error"),x(ee instanceof Error?ee.message:String(ee))}},[t,n,s]);S.useEffect(()=>{K()},[K]),S.useEffect(()=>{if(!n){C(null),I(null);return}const te=n.sessionId,ee=`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(te)}`;I(null),fetch(`${ee}/runtime-context`,{credentials:"include"}).then(async ce=>{const ge=await ce.json().catch(()=>null);if(!ge?.context||s.sessionRef.current?.sessionId!==te)return;const Ae=ge.context,Oe=rw().snapshot;C(ve=>Q8(ve,Ae,Oe,te))}).catch(()=>{s.sessionRef.current?.sessionId===te&&I("注入上下文读取失败,请重试")})},[t,n?.sessionId,s]),S.useEffect(()=>{if(!V||!n||V.sessionId!==n.sessionId)return;const te=K2(V);a(ee=>{if(!ee||ee.sessionId!==V.sessionId||yM(ee,te))return ee;const ce=$6(ee,te);return s.sessionRef.current=ce,ce}),C(ee=>{if(!ee)return ee;const ce={...ee,...te.model?{model:te.model}:{},...te.thinkingLevel?{thinkingLevel:te.thinkingLevel}:{}};return ce.model?.provider===ee.model?.provider&&ce.model?.modelId===ee.model?.modelId&&ce.thinkingLevel===ee.thinkingLevel?ee:ce})},[V,n?.sessionId,s,a,C]);const re=S.useCallback(async te=>{if(!n)return!1;const ee=n.sessionId,ce=++UO;H.current=ce,X2({type:"mutation-start",token:ce}),D(!0);try{const ge=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n.sessionId)}/model`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":tr()},body:JSON.stringify(te)}),Ae=await ge.json().catch(()=>({}));return H.current!==ce?!1:ge.ok?!Ae.session||s.sessionRef.current?.sessionId!==ee?!1:tw(ce,ee,Ae.snapshot):(s.sessionRef.current?.sessionId===ee&&(l(Ae.error?.message??`模型或思考等级切换失败(HTTP ${ge.status})`),tl()),!1)}catch(ge){return H.current!==ce||s.sessionRef.current?.sessionId===ee&&l(ge instanceof Error?ge.message:String(ge)),!1}finally{nw(ce,ee,s)&&H.current===ce&&D(!1)}},[t,n,s,a,l]);S.useEffect(()=>{if(!M)return;const te=ce=>{const ge=j.current;ge&&ce.target instanceof Node&&!ge.contains(ce.target)&&B(!1)},ee=ce=>{ce.key==="Escape"&&B(!1)};return document.addEventListener("mousedown",te),document.addEventListener("keydown",ee),()=>{document.removeEventListener("mousedown",te),document.removeEventListener("keydown",ee)}},[M]),S.useEffect(()=>{if(!X)return;const te=ce=>{const ge=F.current;ge&&ce.target instanceof Node&&!ge.contains(ce.target)&&$(!1)},ee=ce=>{ce.key==="Escape"&&$(!1)};return document.addEventListener("mousedown",te),document.addEventListener("keydown",ee),()=>{document.removeEventListener("mousedown",te),document.removeEventListener("keydown",ee)}},[X]);const ue=S.useMemo(()=>BO(c),[c]),Te=V?(V.models??[]).map(te=>({provider:te.provider,id:te.id,...te.name?{name:te.name}:{},...te.hasCredentials!==void 0?{hasCredentials:te.hasCredentials}:{}})):m,P=V?.thinkingLevels?.length?V.thinkingLevels.map(te=>te.value):k,U=n?.model??R?.model,q=U?Ao(U.provider,U.modelId):"",A=V?.selection?.thinkingSelection??n?.thinkingLevel??"",ae=V?.selection?.effectiveThinkingLevel??n?.thinkingLevel??void 0,pe=!q||Te.some(te=>Ao(te.provider,te.id)===q);return{capabilities:c,models:Te,modelsStatus:p,modelsError:y,onRetryModels:()=>{K()},thinkingLevels:P,runtimeContext:R,runtimeContextError:_,onRetryRuntimeContext:()=>{I(null),tl()},toolsOpen:M,setToolsOpen:B,runtimeContextOpen:X,setRuntimeContextOpen:$,toolsMenuRef:j,runtimeContextMenuRef:F,switchRuntime:re,switching:G,toolCatalog:ue,activeModel:U,activeModelRef:q,activeThinkingLevel:A,effectiveThinkingLevel:ae,activeModelListed:pe}}const A2={comfortableMin:1450,compactMin:1100};function HO(e){return!Number.isFinite(e)||e<0?"narrow":e>=A2.comfortableMin?"comfortable":e>=A2.compactMin?"compact":"narrow"}const FO={mode:"comfortable",width:1600,landingDensity:"comfortable",emptyHeight:720};function PO(e,t){const[n,a]=S.useState(FO);return S.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const l=()=>{const p=s.getBoundingClientRect().width,b=t?.current??null,y=b?b.getBoundingClientRect().height:720;a({mode:HO(p),width:p,landingDensity:HI(y),emptyHeight:y})};l();const c=new ResizeObserver(()=>l());c.observe(s);let d=null;const m=()=>{const p=t?.current??null;p&&p!==d&&(d&&c.unobserve(d),c.observe(p),d=p,l())};m();const h=window.setInterval(m,250);return()=>{window.clearInterval(h),c.disconnect()}},[e,t]),n}function $O(e="none"){return{active:e}}function Xs(e,t){return{active:t}}function ta(e={active:"none"}){return{active:"none"}}function GO(e){return{sidebarDrawerOpen:e.active==="sidebar-drawer",processOpen:e.active==="process",runtimeContextOpen:e.active==="runtime-context",toolsOpen:e.active==="tools",activityOpen:e.active==="activity"}}const KO=160,VO=120,YO=120;function XO(e){return e?e.operationCards.length+e.humanGateCards.length+e.artifactCards.length:0}function ZO(e){const t=XO(e),[n,a]=S.useState(()=>t>0?{phase:"visible",snapshot:e}:{phase:"hidden",snapshot:null}),s=S.useRef(n);s.current=n;const l=S.useMemo(()=>`${e?.sessionId??"none"}:${t}`,[e?.sessionId,t]);return S.useEffect(()=>{const c=[],d=s.current.snapshot;if(!e||t===0){if(!d){a({phase:"hidden",snapshot:null});return}a({phase:"leaving",snapshot:d}),c.push(window.setTimeout(()=>{a({phase:"hidden",snapshot:null})},VO))}else d?d.sessionId!==e.sessionId?(a({phase:"switching",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},YO))):a({phase:"visible",snapshot:e}):(a({phase:"entering",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},KO)));return()=>{for(const m of c)window.clearTimeout(m)}},[e,l,t]),n}function WO(e){const{origin:t,surface:n="standalone"}=e,a=n==="workspace",s=MM(),[l,c]=S.useState(null),[d,m]=S.useState(!1),[h,p]=S.useState(null),[b,y]=S.useState(!0),[x,k]=S.useState(!0),[T,R]=S.useState(()=>$O()),[C,_]=S.useState(null),[I,G]=S.useState(null),[D,M]=S.useState(0),B=S.useRef(null),X=S.useRef(null),$=S.useRef(null),j=S.useRef(null),F=S.useRef(null),H=S.useRef(null),ne=S.useRef(null),V=S.useRef(null),Y=S.useRef(null),K=S.useRef(()=>{}),re=S.useRef(null),ue=S.useRef(!1),Te=PO($,F),P=Te.mode,U=GO(T),q=U.processOpen,A=q,ae=U.runtimeContextOpen,pe=U.activityOpen,te=S.useCallback(ie=>{R(Se=>{const Be=Se.active==="process";return(typeof ie=="function"?ie(Be):ie)?Xs(Se,"process"):Se.active==="process"?ta(Se):Se})},[]),ee=LO({origin:t,sessionId:h?.sessionId,refs:s,setError:c}),ce=S.useMemo(()=>RO(ee.filteredShortcuts),[ee.filteredShortcuts]),ge=NO({origin:t,refs:s,sessionId:h?.sessionId,setError:c}),Ae=S.useRef(()=>{}),Oe=S.useCallback(ie=>{Ae.current(ie)},[]),ve=FM({origin:t,refs:s,sessionId:h?.sessionId,setError:c,onReconcile:Oe});Ae.current=ie=>{const Se=s.sessionRef.current?.sessionId;Se&&(async()=>await ve.recoverSession(Se)?(G({id:Date.now(),message:"已自动恢复:会话事件已重新同步,可继续对话。"}),M(yt=>yt+1)):G({id:Date.now(),message:"自动恢复未完成,将在重连时重试。"}))()};const Ue=ve.operationCards.length+ve.humanGateCards.length+ve.artifactCards.length,Ve=S.useMemo(()=>I6(ve.operationCards).length+ve.humanGateCards.length+ve.artifactCards.length,[ve.operationCards,ve.humanGateCards.length,ve.artifactCards.length]),nt=S.useMemo(()=>h?{sessionId:h.sessionId,operationCards:ve.operationCards,humanGateCards:ve.humanGateCards,artifactCards:ve.artifactCards}:null,[h,ve.operationCards,ve.humanGateCards,ve.artifactCards]),lt=ZO(nt),Lt=S.useMemo(()=>vI({operations:ve.operationCards,gates:ve.humanGateCards,artifacts:ve.artifactCards}),[ve.operationCards,ve.humanGateCards,ve.artifactCards]),_t=S.useCallback(ie=>Lt.has(ie),[Lt]),ut=qI(j,P,h?.sessionId??"no-session"),Ye=ut.presentation==="sidecar";S.useEffect(()=>{const ie=P==="comfortable"&&T.active==="sidebar-drawer",Se=Ye&&T.active==="activity";(ie||Se)&&R(Be=>Be.active===T.active?ta(Be):Be)},[Ye,P,T.active]),S.useEffect(()=>{_(null)},[h?.sessionId]),S.useEffect(()=>{Ue>0||T.active!=="activity"||R(ie=>ie.active==="activity"?ta(ie):ie)},[Ue,T.active]);const Fe=S.useCallback(ie=>{ie&&_(ie),Ye||R(Se=>Xs(Se,"activity"))},[Ye]),ct=S.useCallback(()=>{R(ie=>ie.active==="activity"?ta(ie):ie)},[]),zt=S.useCallback(ie=>{const Se=X.current;if(!Se)return;const yt=Array.from(Se.querySelectorAll("[data-activity-ref]")).find(Et=>ie.includes(Et.dataset.activityRef??""));if(!yt){G({id:Date.now(),message:"详细运行记录暂时没有对应的对话位置。"});return}yt.scrollIntoView({block:"center",behavior:"smooth"}),yt.classList.add("is-located"),window.setTimeout(()=>yt.classList.remove("is-located"),1400),Ye||ct()},[Ye,ct]),Pe=ZM({origin:t,refs:s,setSession:p,thread:ve,composer:{setInput:ee.setInput,setPendingImages:ee.setPendingImages},browser:{setPreviews:ge.setPreviews,setActivePreviewPath:ge.setActivePreviewPath},setError:c,setNotice:G,onCompactionChange:m,setProcessOpen:te,setAutoScroll:k}),Wt=EO({origin:t,refs:s,session:h,thread:ve,composer:{setInput:ee.setInput,setPendingImages:ee.setPendingImages,recordHistory:ee.recordHistory},setError:c,setNotice:G,setAutoScroll:k,recoveryVersion:D,watchSessionTitle:Pe.watchSessionTitle}),me=TO({origin:t,refs:s,thread:ve,setError:c}),ye=qO({origin:t,session:h,setSession:p,refs:s,setError:c});S.useEffect(()=>{if(ve.streaming){Pe.refreshSessionList();return}ge.refreshTree();const ie=window.setTimeout(()=>{Pe.refreshSessionList()},1200);return()=>window.clearTimeout(ie)},[ve.streaming,ve.turnPhase,ve.deferredTurn?.revision,ve.deferredTurn?.state,Pe.refreshSessionList,ge.refreshTree]),S.useEffect(()=>{ye.runtimeContextOpen&&T.active!=="runtime-context"?R(ie=>Xs(ie,"runtime-context")):!ye.runtimeContextOpen&&T.active==="runtime-context"&&R(ie=>ta(ie))},[ye.runtimeContextOpen,T.active]),S.useEffect(()=>{T.active!=="runtime-context"&&ye.runtimeContextOpen&&ye.setRuntimeContextOpen(!1)},[T.active]),S.useEffect(()=>{if(!q&&!ae)return;const ie=Se=>{if(Se.target instanceof Node){if(q){const Be=document.getElementById("oc-process-panel"),yt=ne.current;!Be?.contains(Se.target)&&!yt?.contains(Se.target)&&te(!1)}if(ae){const Be=document.getElementById("oc-runtime-context-panel"),yt=V.current;!Be?.contains(Se.target)&&!yt?.contains(Se.target)&&(ye.setRuntimeContextOpen(!1),R(Et=>Et.active==="runtime-context"?ta(Et):Et))}}};return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[q,ae,te,ye.setRuntimeContextOpen]),S.useEffect(()=>{ve.streaming&&T.active==="process"&&R(ta)},[ve.streaming,T.active]);const{sendPrompt:qe,handleStop:Qe,cancelDeferredTurn:rt,discardDeferredTurn:tn}=Wt,un=S.useRef(()=>{}),Bt=S.useCallback(async ie=>{const Se=i2(ie);if(Se&&Se.action!=="unknown"&&Se.action!=="pi-prompt"){if(s.streamingRef.current){G({id:Date.now(),message:"当前回合进行中,命令请在回合结束后执行"});return}un.current(ie);return}await qe(ie,ee.pendingImages)},[qe,ee.pendingImages,s]);K.current=ie=>{Bt(ie)};const dt=S.useCallback(()=>{ee.textareaRef.current?.focus()},[ee.textareaRef]),Ht=S.useCallback(()=>{R(ie=>ie.active==="sidebar-drawer"?ta(ie):ie)},[]),bt=S.useCallback(()=>{ye.setRuntimeContextOpen(!1),R(ie=>Xs(ie,"sidebar-drawer"))},[ye.setRuntimeContextOpen]),Wn=S.useCallback(ie=>{Pe.activateSession(ie),Ht(),queueMicrotask(()=>{X.current?.focus?.(),dt()})},[Pe,Ht,dt]),wn=S.useCallback(ie=>{ee.setInput(Se=>`${Se}${Se&&!Se.endsWith(" ")?" ":""}@${ie} `),Ht(),queueMicrotask(()=>dt())},[ee,Ht,dt]),it=S.useCallback(ie=>{ge.openPreview(ie),Ht()},[ge,Ht]),We=S.useCallback(()=>{const ie=X.current;if(!ie)return;const Se=ie.scrollHeight-ie.scrollTop-ie.clientHeight<80;k(Se)},[]);S.useEffect(()=>{x&&B.current?.scrollIntoView({behavior:"smooth",block:"end"})},[ve.messages,x,ve.streaming]),S.useEffect(()=>{if(!I)return;const ie=window.setTimeout(()=>G(null),6500);return()=>window.clearTimeout(ie)},[I]);const St=l?{id:I?.id??1,kind:"error",message:l}:I?{id:I.id,kind:"info",message:I.message}:null,Dt=S.useCallback(ie=>{if(ie.action==="pi-prompt"||ie.command==="/name"||ie.command==="/compact"){ee.setInput(`${ie.command} `),ee.setShortcutOpen(!1),ee.textareaRef.current?.focus();return}un.current(ie.command)},[ee]),Ft=S.useCallback(ie=>{const Se=i2(ie),Be=ie.trim(),yt=Be.split(/\s+/,1)[0]?.toLowerCase()??"";if(ee.setInput(""),ee.setShortcutOpen(!1),!Se)return;if(Se.action==="focus:interview"){if(!h){G({id:Date.now(),message:"请先创建或打开一个会话,再开始 Interview"});return}me.startInterview();return}const Et=nI(Se.action);if(Et){e.onNavigateWorkspace?.(Et,{});return}if(Se.action==="compact"){const Sn=Be.slice(yt.length).trim();Pe.compactSession(Sn||void 0);return}if(Se.action==="name"){const Sn=Be.slice(yt.length).trim(),Un=h?.sessionId;if(!Un){c("当前没有可重命名的会话");return}const Qn=Pe.sessionList.find(Pt=>Pt.sessionId===Un),$n=Sn||window.prompt("会话名称",Qn?.title??Qn?.displayTitle??"")||"";$n.trim()&&Pe.updateSession(Un,{title:$n.trim()});return}if(Se.action==="session"){const Sn=h?.sessionId??"(none)",Un=Pe.sessionList.find($n=>$n.sessionId===Sn),Qn=Un?.title||Un?.displayTitle||"未命名对话";G({id:Date.now(),message:`当前会话:${Qn}(${Sn})`});return}if(Se.action==="copy"){const Un=[...ve.visibleMessages??[]].reverse().find(Qn=>Qn.role==="assistant");if(!Un?.text){c("没有可复制的助手消息");return}navigator.clipboard?.writeText(Un.text).then(()=>G({id:Date.now(),message:"已复制最后一条助手消息"}),()=>c("复制失败"));return}if(Se.action==="unknown"){qe(Be,ee.pendingImages);return}c(`未知 shortcut:${Se.command}`)},[ee.setInput,ee.setShortcutOpen,ee.pendingImages,me.startInterview,e.onNavigateWorkspace,Pe,h,ve.visibleMessages,qe]);un.current=Ft;const Q=S.useCallback(ie=>{const Se=s.isComposingRef.current||ie.nativeEvent.isComposing,Be=Date.now()-s.compositionEndedAtRef.current<100;if(ee.shortcutOpen&&ee.filteredShortcuts.length>0&&!Se&&!Be){if(ie.key==="ArrowLeft"||ie.key==="ArrowRight"||ie.key==="ArrowUp"||ie.key==="ArrowDown"){ie.preventDefault();const yt=_O(P);let Et=ee.shortcutIndex;if(ie.key==="ArrowLeft"||ie.key==="ArrowRight")Et=R2(ee.shortcutIndex,ce,yt,ie.key==="ArrowLeft"?"left":"right");else{const Sn=re.current;let Un=null;if(Sn){const Qn=Array.from(Sn.querySelectorAll("[data-shortcut-index]")).map(Pt=>{const kn=Pt.getBoundingClientRect();return{globalIndex:Number(Pt.dataset.shortcutIndex??-1),top:kn.top,bottom:kn.bottom,left:kn.left,right:kn.right}}).filter(Pt=>Number.isFinite(Pt.globalIndex)&&Pt.globalIndex>=0),$n=Qn.find(Pt=>Pt.globalIndex===ee.shortcutIndex)??null;$n&&(Un=IO($n,Qn,ie.key==="ArrowUp"?"up":"down"))}Et=Un??R2(ee.shortcutIndex,ce,yt,ie.key==="ArrowUp"?"up":"down")}Et!==ee.shortcutIndex&&(ue.current=!0,ee.setShortcutIndex(Et));return}if(ie.key==="Escape"){ie.preventDefault(),ee.setShortcutOpen(!1);return}if(ie.key==="Enter"||ie.key==="Tab"){ie.preventDefault();const yt=ee.filteredShortcuts[ee.shortcutIndex]??ee.filteredShortcuts[0];Dt(yt);return}}if(ie.key==="Enter"&&!ie.shiftKey&&(Se||Be)){Be&&ie.preventDefault();return}if((ie.key==="ArrowUp"||ie.key==="ArrowDown")&&!Se&&!Be&&ee.fileOptions.length===0&&ee.navigateHistory(ie.key==="ArrowUp"?"up":"down")){ie.preventDefault();return}if(ie.key==="Enter"&&!ie.shiftKey){ie.preventDefault(),Bt(ee.input);return}},[ee.input,ee.shortcutOpen,ee.filteredShortcuts,ee.shortcutIndex,ee.setShortcutIndex,ee.setShortcutOpen,ee.fileOptions,ee.navigateHistory,s,Bt,Dt,P,ce,re,ue]),xe=ve.visibleMessages.length>0||ve.operationCards.length>0||ve.humanGateCards.length>0||ve.artifactCards.length>0||!!ve.interview,je=e.readiness==="setup-required"?"⚠ Pi 未就绪(setup-required):Chat 需要先完成 Pi 认证 / 模型配置。":e.readiness==="degraded"?"⚠ Pi 降级(degraded):可继续对话,但部分能力不可用。":null,Xe=f.jsx(Hw,{origin:t,open:b,layoutMode:P,drawerOpen:U.sidebarDrawerOpen,activeSessionId:h?.sessionId,activeSessionStreaming:ve.streaming,activeSessionTurnPhase:ve.turnPhase,sessions:Pe.sessionList,tree:ge.tree,expanded:ge.expandedDirs,treeError:ge.treeError,onToggleOpen:()=>y(ie=>!ie),onOpenDrawer:bt,onCloseDrawer:Ht,onCreate:()=>{Pe.createSession()},creatingSession:Pe.creatingSession,onActivate:ie=>{U.sidebarDrawerOpen?Wn(ie):Pe.activateSession(ie)},onRename:(ie,Se)=>{Pe.updateSession(ie,{title:Se})},onSetState:(ie,Se)=>{Pe.updateSession(ie,{state:Se})},onDelete:ie=>Pe.deleteSession(ie),onRefreshTree:ge.refreshTree,onToggleDir:ge.toggleDir,onInsert:ie=>{U.sidebarDrawerOpen?wn(ie):ee.setInput(Se=>`${Se}${Se&&!Se.endsWith(" ")?" ":""}@${ie} `)},onPreview:ie=>{U.sidebarDrawerOpen?it(ie):ge.openPreview(ie)},drawerTriggerRef:H}),ht=["oc-workspace",q&&!A?"has-process":"",A?"has-process-overlay":""].filter(Boolean).join(" "),kt=ie=>f.jsx("div",{className:"oc-messages is-empty",ref:F,"data-landing-density":Te.landingDensity,children:f.jsx(U6,{mode:ie,readiness:e.readiness,density:Te.landingDensity,onSuggest:async Se=>{Pe.creatingSession||(ie==="no-session"?await Pe.createSession()&&await Bt(Se):await Bt(Se))},disabled:Pe.creatingSession,onCreateSession:ie==="no-session"?()=>{Pe.createSession()}:void 0})});return f.jsxs("div",{className:"oc-shell",children:[a?null:f.jsxs("div",{className:"oc-banner",children:[f.jsxs("span",{className:"oc-banner-title",children:[f.jsx("span",{className:"oc-banner-dot","aria-hidden":"true"}),"对话"]}),f.jsxs("span",{className:"oc-banner-body",children:["用自然语言编排 loop-agent / agent-worker 的",f.jsx("strong",{children:"全部能力"}),"。这是 ",f.jsx("strong",{children:"Operator"})," 面:默认具备完整 Pi 工具(read/write/edit/bash/grep/find/ls)与 safe-* 探查、以及受策略约束的 operator action(ADR 0011)。",f.jsx("strong",{children:"软约束"}),":大改与高风险变更优先走受治 DAG 的 implement-pi / repair-pi 与 Human Gate,而非把 Chat 当作第二套 DAG kernel。"]})]}),je&&f.jsx("div",{className:"oc-alert oc-alert-warning",children:je}),f.jsx($M,{toast:St,onDismiss:()=>{c(null),G(null)}}),h?f.jsxs("div",{className:ht,ref:$,"data-layout-mode":P,children:[Xe,f.jsxs("div",{ref:j,className:`oc-main${xe?"":" is-landing"}`,children:[!Ye&&(P==="narrow"||Ue>0)?f.jsxs("div",{className:"oc-main-topbar",children:[P==="narrow"?f.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:H,"aria-label":"打开会话与仓库","aria-expanded":U.sidebarDrawerOpen,onClick:()=>U.sidebarDrawerOpen?Ht():bt(),children:"会话与仓库"}):null,Ue>0?f.jsxs("button",{type:"button",className:"oc-main-topbar-btn oc-activity-trigger",ref:Y,"aria-controls":"oc-activity-rail","aria-expanded":pe,onClick:()=>pe?ct():Fe(),children:["运行活动 ",f.jsx("span",{children:Ve})]}):null]}):null,f.jsx(r2,{previews:ge.previews,activePath:ge.activePreviewPath,loading:ge.previewLoading,onActivate:ge.setActivePreviewPath,onClose:ge.closePreview}),xe?f.jsxs("div",{className:"oc-thread-anchor-wrap",children:[f.jsx(gM,{scrollContainerRef:X,turnGroups:ve.turnGroups,measureKey:ve.visibleMessages.length}),f.jsx(fM,{scrollContainerRef:X,messagesEndRef:B,onScroll:We,hasThread:xe,readiness:e.readiness,streaming:ve.streaming,streamingAssistantId:ve.streamingAssistantId,messagesCount:ve.messages.length,visibleCount:ve.visibleMessages.length,onLoadMore:()=>ve.setHistoryLimit(ie=>ie+50),turnGroups:ve.turnGroups,interview:ve.interview,interviewAnswer:me.interviewAnswer,onInterviewAnswerChange:me.setInterviewAnswer,onAnswerInterview:ie=>{me.answerInterview(ie)},onConfirmTaskKind:()=>{me.confirmTaskKind()},onActivateActivity:Fe,canActivateActivity:_t,onSuggest:ie=>{Bt(ie)}})]}):kt("empty-session"),f.jsx(RM,{composer:ee,streaming:ve.streaming,turnPhase:ve.turnPhase,deferredTurn:ve.deferredTurn,hasThread:xe,layoutMode:P,paletteModel:ce,shortcutPaletteRef:re,paletteKeyboardNavRef:ue,onSend:ie=>{Bt(ie)},onStop:Qe,onCancelDeferred:rt,onDiscardDeferred:()=>{tn()},onSendDeferredNow:()=>{Qe()},onKeyDown:Q,onRunShortcut:Ft,models:ye.models,activeModel:ye.activeModel,activeModelRef:ye.activeModelRef,activeModelListed:ye.activeModelListed,activeThinkingLevel:ye.activeThinkingLevel,thinkingLevels:ye.thinkingLevels,onSwitchRuntime:ie=>{ye.switchRuntime(ie)},usage:ve.usage,unread:ve.unread,onCompact:()=>{Pe.compactSession()},compacting:d,processSummary:ve.streaming?null:ve.processSummary,processOpen:q,onToggleProcess:()=>{R(ie=>ie.active==="process"?ta(ie):Xs(ie,"process")),q||ye.setRuntimeContextOpen(!1)},processTriggerRef:ne,runtimeContext:ye.runtimeContext,runtimeContextOpen:ae,onToggleRuntimeContext:()=>{ae?(ye.setRuntimeContextOpen(!1),R(ie=>ie.active==="runtime-context"?ta(ie):ie)):(ye.setRuntimeContextOpen(!0),R(ie=>Xs(ie,"runtime-context")))},runtimeContextTriggerRef:V})]}),Ue>0&&!Ye&&pe?f.jsx("button",{type:"button",className:"oc-overlay-backdrop is-activity","aria-label":"关闭运行活动遮罩",onClick:ct}):null,lt.snapshot?f.jsx(zI,{origin:t,sessionId:lt.snapshot.sessionId,presentation:ut.presentation,sidecarRect:ut.sidecarRect,phase:lt.phase,open:pe,focusRef:C,triggerRef:Y,operationCards:lt.snapshot.operationCards,humanGateCards:lt.snapshot.humanGateCards,artifactCards:lt.snapshot.artifactCards,onClose:ct,onLocateConversation:zt,onNavigateWorkspace:e.onNavigateWorkspace}):null,ae&&ye.runtimeContext?f.jsx(IM,{panelOnly:!0,open:ae,onToggle:()=>{},onClose:()=>{ye.setRuntimeContextOpen(!1),R(ie=>ie.active==="runtime-context"?ta(ie):ie)},context:ye.runtimeContext,triggerRef:V}):null,q&&f.jsx(AM,{toolCalls:ve.toolCalls,overlay:A,onClose:()=>te(!1),triggerRef:ne})]}):f.jsxs("div",{className:ht,ref:$,"data-layout-mode":P,children:[Xe,f.jsxs("div",{className:"oc-main is-landing",children:[P==="narrow"?f.jsx("div",{className:"oc-main-topbar",children:f.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:H,"aria-label":"打开会话与仓库","aria-expanded":U.sidebarDrawerOpen,onClick:()=>U.sidebarDrawerOpen?Ht():bt(),children:"会话与仓库"})}):null,f.jsx(r2,{previews:ge.previews,activePath:ge.activePreviewPath,loading:ge.previewLoading,onActivate:ge.setActivePreviewPath,onClose:ge.closePreview}),kt("no-session")]})]})]})}function QO(e){return e==="validate"||e==="apply"||e==="spine"?"contract":e}const u0="X-Loop-Console-Confirmation",Y6="agent-worker console doctor --repo .",Cp=["LOW","MED","HIGH"];function JO(e){if(e.length===0)return"模型值不能为空";if(e.trim()!==e)return"模型值不能包含首尾空白";if(e==="default")return"default 是保留哨兵,不能作为模型值";if(e.startsWith("/")||e.endsWith("/")||e.includes("//"))return"provider/model 格式非法:不允许 /model、provider/ 或 a//b"}function eD(e){const t={};for(const n of Cp){const a=JO(e[n]);a&&(t[n]=a)}return t}function _2(e){return{LOW:e?.LOW?.value??"",MED:e?.MED?.value??"",HIGH:e?.HIGH?.value??""}}function tD(e){return Cp.every(t=>e[t]===void 0)}const jh=[{kind:"standard",label:"后端研发(默认 DAG)",hint:"生成标准 hybrid DAG(contract → implement → verify)"},{kind:"frontend-implementation",label:"前端研发",hint:"生成 frontend-implementation 专用节点链"},{kind:"backend-test",label:"后端测试",hint:"生成 backend-test-dag(分析 / 用例 / pytest)"},{kind:"frontend-test",label:"前端测试",hint:"生成 frontend-test-dag(RAG 用例 + Playwright CLI)"}],X6={"setup-required":"需要设置",ready:"已就绪",degraded:"降级可用",unknown:"未知"},nD={idle:"未探测",match:"匹配",mismatch:"仓库不匹配",unavailable:"不可用"},Z6={low:"低",medium:"中",high:"高"},W6={"validation-failed":"校验失败","contract-drift":"契约漂移","runtime-mismatch":"运行时不匹配","pause-on-human":"等待人工","verification-failed":"验证失败","orphan-unknown":"孤立/未知","terminal-failed":"已终止(失败)","terminal-succeeded":"已终止(成功)","needs-reconcile":"需要对账","running-active":"正在运行"},rD={idle:"空闲","not-started":"未开始","not-run":"未运行","n/a (MVP)":"不适用(MVP)",accepted:"已接受",succeeded:"已成功",running:"运行中",ran:"已执行"};function pu(e){return rD[e]??e}function Rp(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function Bu(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}async function Io(e,t={},n){const a={"Content-Type":"application/json",[u0]:Rp()},s=await fetch("/api/operator/v1/operations",{method:"POST",credentials:"same-origin",headers:a,body:JSON.stringify({action:e,actionParams:t,...n?{clientRequestId:n}:{}})});let l={};try{l=await s.json()}catch{l={ok:!1,error:{code:"INVALID_INPUT",message:"操作响应不是合法 JSON"}}}return{status:s.status,body:l}}const aD=new Set(["runDag","dagRerun","dagReconcileRun","dagRequestInterrupt","standaloneTaskRerun"]);function Zm(e,t){return K6({blockedReasons:e.blockedReasons,blockingNodes:e.blockingNodes,fallbackMessage:t})}async function I2(e,t=3e5){const n=Date.now();for(;Date.now()-n<t;){const a=await fetch(`/api/operator/v1/operations/${encodeURIComponent(e)}`,{credentials:"same-origin"});if(!a.ok)return null;const s=await a.json(),l=s.operation??s,c=l.state??"";if(c==="succeeded"||c==="failed"||c==="needs-reconcile"||c==="timed-out")return l;await new Promise(d=>setTimeout(d,250))}return{state:"needs-reconcile",errorMessage:"等待操作结果超时"}}const iD={};function sD(){const[e,t]=S.useState(()=>j6({env:iD?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location})),[n,a]=S.useState(null),[s,l]=S.useState("setup-required"),[c,d]=S.useState(null),[m,h]=S.useState(null),[p,b]=S.useState(!1),[y,x]=S.useState(!1),[k,T]=S.useState(null),[R,C]=S.useState(null),[_,I]=S.useState(null),[G,D]=S.useState(null),[M,B]=S.useState({command:"idle",dag:"not-started",verification:"not-run",promote:"n/a (MVP)"}),[X,$]=S.useState("setup"),j=S.useCallback(Y=>{$(K=>QO(typeof Y=="function"?Y(K):Y))},[]),F=s==="setup-required",H=s==="degraded",ne=S.useCallback(Y=>{Y!==e&&(T(null),I(null),C(null)),t(Y)},[e]),V=S.useCallback(async()=>{try{const K=await(await fetch("/api/health")).json();a(K);const re=K.piReadiness??"setup-required";l(re),h(null),j(re==="ready"||re==="degraded"?ue=>ue==="setup"?"import-prd":ue:"setup")}catch(Y){h(Y instanceof Error?Y.message:String(Y))}try{const K=await(await fetch("/api/operator/v1/readiness")).json();d(K),K.state&&l(K.state)}catch{}},[j]);return{nav:e,setNav:t,selectNav:ne,health:n,readiness:s,setReadiness:l,readinessReport:c,healthError:m,loadHealth:V,busy:p,setBusy:b,observeBusy:y,setObserveBusy:x,opError:k,setOpError:T,opMessage:R,setOpMessage:C,opErrorCode:_,setOpErrorCode:I,lastOpState:G,setLastOpState:D,layers:M,setLayers:B,step:X,setStep:j,setupBlocked:F,degraded:H}}const lD={bootstrapFromPrd:"正在导入 PRD 并创建任务:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",importPrd:"正在导入 PRD:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",interviewStart:"正在启动需求访谈…",interviewTurn:"正在提交访谈回答…",interviewSkip:"正在跳过访谈并生成评估…",contractValidate:"正在校验契约草稿…",contractDiff:"正在计算契约差异…",contractApply:"正在应用契约(写入需求与执行约束)…",spineCheck:"正在运行 Spine 审计…",dagGenerate:"正在生成 DAG…",standaloneTaskRerun:"正在带反馈重新执行任务:服务端校验资格后生成并启动新 DAG…",workerTaskRetry:"正在重新排队 Worker Task…"};function oD(e){const{shell:t,applyInterviewPayload:n}=e,{setBusy:a,setOpError:s,setOpErrorCode:l,setOpMessage:c,setReadiness:d,setStep:m,setNav:h,setLastOpState:p,setLayers:b,step:y,nav:x}=t,[k,T]=S.useState(null),[R,C]=S.useState([]),[_,I]=S.useState(!0),G=S.useRef(null),[D,M]=S.useState(null),[B,X]=S.useState(null),$=S.useCallback(async(V,Y={},K)=>{a(!0),s(null),l(null),c(lD[V]??null);try{const{status:re,body:ue}=await Io(V,Y,K?.clientRequestId);if(re===412||ue.error?.code==="PI_SETUP_REQUIRED")return s(Ua(ue.error?.message??"Pi 未就绪或已降级:该操作暂不可用")),l(ue.error?.code??"PI_SETUP_REQUIRED"),d("setup-required"),m("setup"),h("models"),ue;if(re>=400||ue.ok===!1)return s(Ua(ue.error?.message??ue.message??`操作失败(HTTP ${re})`)),l(ue.error?.code??String(re)),p(ue.state??`failed:${re}`),b(U=>({...U,command:ue.error?.message??`failed:${ue.error?.code??re}`})),ue;if(ue.operationId){const U=window.localStorage.getItem(Yr)?.trim();if(U&&fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(U)}/operation-links`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[u0]:Rp()},body:JSON.stringify({operationId:ue.operationId})}).then(q=>{q.ok||console.warn("Operator Chat operation link failed",q.status)}).catch(q=>console.warn("Operator Chat operation link failed",q)),T(ue.operationId),p(ue.state??"accepted"),b(q=>({...q,command:ue.state??"accepted",dag:V==="runDag"?"running":q.dag})),aD.has(V)){I(!0),c(`操作已接受,后台运行中:${ue.operationId}(请看事件流;可同时打开 Observe)`);const q=ue.operationId;I2(q,30*6e4).then(A=>{if(A){if(p(A.state??null),A.state==="failed"||A.state==="needs-reconcile"||A.state==="timed-out"){s(Ua(A.errorMessage??A.stderrPreview??`操作失败:${A.state}`)),l(A.errorCode??A.state??null),b(ae=>({...ae,command:`failed:${A.errorCode??A.state}`}));return}A.state==="succeeded"&&(c(`${V} 已成功`),b(ae=>({...ae,command:"succeeded"})))}})}else{c(`操作已接受:${ue.operationId}`);const q=await I2(ue.operationId);if(q){if(p(q.state??null),q.state==="failed"||q.state==="needs-reconcile"||q.state==="timed-out")return s(Ua(q.errorMessage??q.stderrPreview??`操作失败:${q.state}`)),l(q.errorCode??q.state??null),b(te=>({...te,command:`failed:${q.errorCode??q.state}`})),{ok:!1,operationId:ue.operationId,state:q.state,error:{code:q.errorCode??q.state??"INTERNAL_ERROR",message:q.errorMessage??q.stderrPreview??`操作失败:${q.state}`}};c(q.errorMessage?`${V}:${q.errorMessage}`:`${V} 已成功`),b(te=>({...te,command:q.state??"succeeded"}));const A=q.result??{},ae={ok:!0,operationId:ue.operationId,state:q.state??"succeeded",result:A};(V==="interviewStart"||V==="interviewTurn"||V==="interviewSkip")&&n(A);const pe=A.confirmation;return pe?.confirmationId&&(M(pe.confirmationId),X(A)),K?.advanceTo&&m(K.advanceTo),ae}}}else c(`${V} 已完成`),p(ue.state??"succeeded"),b(U=>({...U,command:"succeeded",verification:V==="contractValidate"||V==="spineCheck"?"ran":U.verification}));const Te=ue.result??{};(V==="interviewStart"||V==="interviewTurn"||V==="interviewSkip")&&n(Te);const P=Te.confirmation;return P?.confirmationId&&(M(P.confirmationId),X(Te)),K?.advanceTo&&m(K.advanceTo),ue}catch(re){s(re instanceof Error?re.message:String(re));return}finally{a(!1)}},[n,a,s,l,c,d,m,h,p,b]),j=S.useCallback(V=>{if(!V)return"无响应";if(V.error?.message)return V.error.message;if(V.message)return V.message;const Y=V.result;if(Y&&typeof Y=="object")try{return JSON.stringify(Y).slice(0,1200)}catch{return"已返回结果"}return V.ok===!1?"失败":"成功"},[]),F=S.useCallback(V=>{if(!V||V.ok===!1||V.error)return!1;const Y=V.result;if(!Y)return!0;if(typeof Y.valid=="boolean")return Y.valid;const K=Y.result;return K&&typeof K.valid=="boolean"?K.valid:!0},[]),H=S.useCallback(async V=>{G.current?.abort();const Y=new AbortController;G.current=Y,C(K=>[...K,`开始跟随事件流 ${V}`]);try{const K=await fetch(`/api/operator/v1/operations/${encodeURIComponent(V)}/events`,{credentials:"same-origin",signal:Y.signal});if(!K.ok||!K.body){C(P=>[...P,`事件流 HTTP ${K.status}`]);return}const re=K.body.getReader(),ue=new TextDecoder;let Te="";for(;_;){const{done:P,value:U}=await re.read();if(P)break;Te+=ue.decode(U,{stream:!0});const q=Te.split(`
|
|
400
|
+
|
|
401
|
+
`);Te=q.pop()??"";for(const A of q){const ae=A.split(`
|
|
402
|
+
`).find(te=>te.startsWith("data:"));if(!ae)continue;const pe=ae.slice(5).trim();C(te=>[...te.slice(-80),pe.slice(0,240)])}}}catch(K){K.name!=="AbortError"&&C(re=>[...re,`事件流错误:${K instanceof Error?K.message:String(K)}`])}},[_]);S.useEffect(()=>(k&&_&&(y==="run"||x==="recovery")&&H(k),()=>G.current?.abort()),[k,_,y,x,H]);const ne=S.useCallback(()=>{I(!1),G.current?.abort(),c("已停止跟随日志(未取消子进程)")},[c]);return{runAction:$,summarizeEnvelope:j,isActionSuccess:F,operationId:k,setOperationId:T,sseLog:R,followSse:_,setFollowSse:I,stopFollowSse:ne,confirmationId:D,setConfirmationId:M,confirmationDetails:B,setConfirmationDetails:X}}const Lh=8*1024*1024,cD=10*1024*1024,Uu=8,uD=".md,.markdown,.txt,text/markdown,text/plain",dD=[".md",".markdown",".txt"],Ap=/\.[^.]+$/;function fD(e){const t=Ap.exec(e.trim());return t?t[0].toLowerCase():""}function mD(e){const t=fD(e);return dD.includes(t)}function zh(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;if(e<1024*1024){const n=e/1024;return`${n>=10?n.toFixed(0):n.toFixed(1)} KiB`}const t=e/(1024*1024);return`${t>=10?t.toFixed(1):t.toFixed(2)} MiB`}function Ba(e,t){return{ok:!1,code:e,message:t}}function hD(e,t){const n=e?Array.from(e):[],a=t?.maxFiles??Uu,s=t?.existingCount??0;return n.length===0?Ba("file-count","请选择至少一个 .md / .markdown / .txt 文件"):s+n.length>a?Ba("file-count",`最多支持 ${a} 个文件(当前已有 ${s} 个)`):null}async function pD(e){const t=e.name?.trim()||"untitled.md";if(!mD(t))return Ba("unsupported-extension","仅支持 .md、.markdown、.txt 文件");if(e.size>Lh)return Ba("file-too-large",`文件不能超过 ${zh(Lh)}`);let n;try{n=await e.arrayBuffer()}catch{return Ba("read-failed","文件读取失败,请重试或直接粘贴")}let a;try{a=new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return Ba("invalid-utf8","文件不是有效 UTF-8,请另存为 UTF-8")}if(a.trim().length===0)return Ba("empty-content","文件内容不能为空或只有空白");const s=new TextEncoder().encode(a).byteLength;return{ok:!0,text:a,fileName:t,sourceBytes:e.size,textBytes:s}}async function gD(e){if(e.length===0)return Ba("file-count","请选择至少一个 .md / .markdown / .txt 文件");if(e.length>Uu)return Ba("file-count",`最多支持 ${Uu} 个文件`);const t=[];for(const n of e){const a=await pD(n);if(!a.ok)return a;t.push({fileName:a.fileName,text:a.text,sourceBytes:a.sourceBytes,textBytes:a.textBytes})}return{ok:!0,documents:t}}function bD(e,t){const n=e.split(/\r?\n/);for(const s of n){const l=/^(#{1,6})\s+(.+)$/.exec(s.trim());if(l?.[2])return l[2].trim()}for(const s of n){const l=s.trim();if(l&&!/^---+$/.test(l)&&!/^```/.test(l)&&!/^<!--/.test(l))return l.replace(/^>\s+/,"").slice(0,120)}return t.replace(Ap,"").trim()||"需求"}function vD(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||"requirement"}function yD(e,t){const n=e.replace(Ap,"").trim(),a=vD(n);return a==="requirement"&&/[^\u0000-\u007f]/.test(n)?`part-${t+1}`:a==="requirement"?n?`part-${t+1}`:`part-${t+1}`:a}function xD(e){const t=new Set;return e.map((n,a)=>{let s=yD(n.fileName,a);if(t.has(s)){let l=2;for(;t.has(`${s}-${l}`);)l+=1;s=`${s}-${l}`}return t.add(s),{name:s,content:n.text,fileName:n.fileName}})}function wD(e,t){if(e.length===0)return"";if(e.length===1)return e[0].text;const n=Math.min(Math.max(0,t?.primaryIndex??0),e.length-1),a=e[n],s=bD(a.text,a.fileName),c=[`<!-- composed-from: ${e.map(d=>d.fileName).join(", ")} -->`,"",`# ${s}`,""];for(const d of e)c.push(`## 来源:${d.fileName}`,"",d.text.trim(),"");return`${c.join(`
|
|
403
|
+
`).trimEnd()}
|
|
404
|
+
`}function SD(e,t,n){const a={action:e,actionParams:t};return new TextEncoder().encode(JSON.stringify(a)).byteLength<=cD}function kD(){return"最终内容导致请求体超过服务端限制,请缩小文档或减少文件数量"}function ED(){const[e,t]=S.useState(""),[n,a]=S.useState([]),[s,l]=S.useState(0),[c,d]=S.useState(!1),[m,h]=S.useState(null),[p,b]=S.useState(!1),[y,x]=S.useState(!1),k=S.useRef(0),T=S.useRef(0),R=S.useCallback((F,H)=>{const ne=F.length===0?0:Math.min(Math.max(0,H),F.length-1);l(ne),t(wD(F,{primaryIndex:ne})),d(!1)},[]),C=S.useCallback(async F=>{const H=hD(F,{existingCount:n.length});if(H){h(H.message);return}const ne=Array.from(F),V=++T.current;b(!0),h(null);try{const Y=await gD(ne);if(V!==T.current)return;if(!Y.ok){h(Y.message);return}const K=[...n,...Y.documents],re=n.length===0?0:s;a(K),n.length===0||!c?(R(K,re),h(null)):h("已追加文件,未改正文(正文已手动编辑);可点「按文件重新合成」覆盖。")}catch{if(V!==T.current)return;h("文件读取失败,请重试或直接粘贴")}finally{V===T.current&&b(!1)}},[R,c,n,s]),_=S.useCallback(F=>{t(F),n.length>0&&d(!0)},[n.length]),I=S.useCallback(F=>{l(F),c||R(n,F)},[R,c,n]),G=S.useCallback((F,H)=>{const ne=F+H,V=[...n],Y=V[ne];V[ne]=V[F],V[F]=Y;const K=s===F?ne:s===ne?F:s;a(V),l(K),c||R(V,K)},[R,c,n,s]),D=S.useCallback(F=>{const H=n.filter((V,Y)=>Y!==F),ne=H.length===0?0:Math.min(s>=F?Math.max(0,s-1):s,Math.max(0,H.length-1));a(H),l(ne),H.length===0?d(!1):c||R(H,ne)},[R,c,n,s]),M=S.useCallback(()=>{a([]),l(0),d(!1),h(null)},[]),B=S.useCallback(()=>{c&&!window.confirm("将用当前文件列表重新合成正文,覆盖你在编辑区的修改。继续?")||(R(n,s),h(null))},[R,c,n,s]),X=S.useCallback((F,H)=>{F.preventDefault(),F.stopPropagation(),!H&&(k.current+=1,x(!0))},[]),$=S.useCallback(F=>{F.preventDefault(),F.stopPropagation(),k.current=Math.max(0,k.current-1),k.current===0&&x(!1)},[]),j=S.useCallback((F,H)=>{F.preventDefault(),F.stopPropagation(),k.current=0,x(!1),!H&&C(F.dataTransfer.files)},[C]);return{prdText:e,setPrdText:t,onPrdTextChange:_,prdDocuments:n,prdPrimaryIndex:s,prdComposedDirty:c,prdFileError:m,setPrdFileError:h,prdFileReading:p,prdDragOver:y,loadPrdFromFiles:C,applyPrdComposition:R,setPrimaryDocument:I,moveDocument:G,removeDocument:D,clearDocuments:M,recomposeDocuments:B,onDragEnter:X,onDragLeave:$,onDrop:j}}const TD={report:{id:"report",label:"查看报告",action:"dagReport",lane:"dag",guide:"看失败分类与建议动作(交接报告摘要)",commandHint:"loop-agent dag report --run-id <run-id> --json"},doctor:{id:"doctor",label:"Doctor 诊断",action:"doctor",lane:"dag",guide:"只读诊断:检查 Console / Pi / 仓库就绪,不是重跑前置",commandHint:"agent-worker console doctor --repo ."},decision:{id:"decision",label:"人工决策",lane:"dag",guide:"暂停等人时:先看 doctor 输出再做决策(经 CLI)",commandHint:"loop-agent dag doctor --run-id <run-id> --markdown"},resume:{id:"resume",label:"恢复运行",lane:"dag",guide:"仅当运行可安全 resume 时使用(经 CLI)",commandHint:"loop-agent task advance <task-id> --json"},reconcile:{id:"reconcile",label:"对账 / reconcile",requiresReason:!0,action:"dagReconcileRun",lane:"dag",guide:"Orphan/中断时先对账归档(默认 supersede);runner 仍存活时勿盲 supersede",commandHint:"loop-agent dag reconcile-run --run-id <run-id> --action supersede --reason <structured-reason>"},regenerate:{id:"regenerate",label:"重新生成契约/计划",lane:"dag",guide:"契约/计划过期时:回任务页或经 CLI 重新 task advance(本页仅提示)",commandHint:"loop-agent task advance <task-id> --json"},observeLink:{id:"observeLink",label:"全屏观测",action:"observeLink",lane:"dag",guide:"打开完整 Inspect 画布;顶栏可返回操作台",commandHint:"agent-worker console --repo . --port 8790"},dagRerun:{id:"dagRerun",label:"从失败节点恢复",requiresReason:!0,action:"dagRerun",lane:"dag",guide:"Provider、网络、限流或超时等非代码问题的首选:先评估安全子图,合格后创建 continuation run 从有效节点恢复(无需 Human Gate)。Worker 持有的 run、workspace/controller 漂移或含 unsafe shell 时不要强跑子图",commandHint:"loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan"},standaloneTaskRerun:{id:"standaloneTaskRerun",label:"带反馈重新执行任务",requiresReason:!0,action:"standaloneTaskRerun",lane:"dag",guide:"独立 DAG run 无法安全从节点恢复时,重新生成完整 DAG,并带入上一轮仍未解决的 verify/review 反馈;没有可继承反馈时会明确说明(无需 Human Gate)。Worker 持有的 run 请用下方「重新排队 Worker Task」",commandHint:"loop-agent dag rerun-task --run-id <run-id> --reason <text> --json"},workerTaskRetry:{id:"workerTaskRetry",label:"重新排队 Worker Task",requiresReason:!0,action:"workerTaskRetry",lane:"worker",guide:"仅 Worker 队列任务失败时直调执行,服务端校验 Failed 状态,无需 Human Gate;不要与 DAG 完整重跑混用",commandHint:"agent-worker task retry <task-id> --feature-id <feature-id> --repo . --reason <reason>"},interrupt:{id:"interrupt",label:"中止运行",requiresReason:!0,action:"dagRequestInterrupt",lane:"dag",guide:"仅本机 Console 持有的正在运行 DAG:经 Human Gate 登记协作中止,等待当前节点安全收敛。不会立即强杀进程",commandHint:"loop-agent dag request-interrupt --run-id <run-id> --reason-code operator-request --reason <structured-reason>"}},M2={"validation-failed":["report","doctor","regenerate"],"contract-drift":["report","doctor","decision","reconcile","regenerate"],"runtime-mismatch":["report","doctor","reconcile","regenerate"],"pause-on-human":["decision","resume","report","doctor"],"verification-failed":["report","doctor","dagRerun","standaloneTaskRerun","resume","regenerate"],"orphan-unknown":["report","doctor"],"terminal-failed":["report","doctor","dagRerun","standaloneTaskRerun","workerTaskRetry","regenerate"],"terminal-succeeded":["report","observeLink"],"needs-reconcile":["report","doctor","reconcile","regenerate"],"running-active":["interrupt","report","doctor","observeLink"]},ND=new Set(["succeeded","failed","timed-out"]);function CD(e){const t=(e.interruptStatus??"").trim();if(!t||t==="none")return null;if(t==="requested")return"请求已登记,等待 runner 确认。";if(t==="acknowledged")return"等待当前节点安全收敛(不会立即强杀)。";if(t==="needs-reconcile")return"需要对账:中止请求未能确认。";if(t==="settled"){const n=e.dagStatus==="failed"||e.dagStatus==="partial_failed",a=(e.failureCategory??"").includes("controller-interrupted"),s=ND.has(e.targetOperationState??"");return n&&a&&s?"已中止。":"正在对账,尚未确认退出。"}return null}function RD(e){return(M2[e]??M2["orphan-unknown"]).map(n=>TD[n])}function AD(e){const t=[],n=[];for(const a of e)a.lane==="worker"?n.push(a):t.push(a);return{dag:t,worker:n}}function _D(e){return typeof e.action=="string"&&e.action.trim().length>0}function Q6(e){return RD(e).filter(_D)}function ID(e){const t=new Set(Q6(e).map(a=>a.id)),n=(...a)=>{for(const s of a)if(t.has(s))return s;return null};switch(e){case"terminal-failed":case"verification-failed":return n("dagRerun","standaloneTaskRerun","doctor","report");case"pause-on-human":return n("doctor","report");case"needs-reconcile":return n("doctor","reconcile","report");case"running-active":return n("interrupt","doctor","report");case"runtime-mismatch":case"contract-drift":return n("doctor","report");case"validation-failed":return n("doctor","report");case"terminal-succeeded":return n("observeLink","report");default:return n("doctor","report")}}function MD(e){if(e.needsReconcile)return"needs-reconcile";const t=(e.errorCode??"").toLowerCase(),n=(e.operationState??"").toLowerCase(),a=(e.dagStatus??"").toLowerCase(),s=(e.failureCategory??"").toLowerCase();return t.includes("validation")||t.includes("invalid")||n.includes("validation")?"validation-failed":t.includes("contract")||t.includes("drift")||t.includes("binding")?"contract-drift":t.includes("runtime")||t.includes("mismatch")||t.includes("fingerprint")?"runtime-mismatch":t.includes("human")||n.includes("paused")||a.includes("paused")||n.includes("awaiting")?"pause-on-human":t.includes("verif")||n.includes("verif")?"verification-failed":s==="controller-interrupted"||t.includes("controller-interrupted")||t.includes("interrupted")||a==="interrupted"||a==="orphaned"||n.includes("controller-interrupted")||n.includes("interrupted")?"needs-reconcile":a==="running-suspected-stall"||a==="running-quiet"||a==="suspected-stall"||a.includes("suspected-stall")||n.includes("suspected-stall")?"orphan-unknown":a==="running"||a==="active"?"running-active":n==="succeeded"||n==="completed"||n==="finished"||a==="succeeded"||a==="completed"||a==="finished"?"terminal-succeeded":n==="failed"||n.includes("fail")||a==="failed"||a==="partial_failed"||t.includes("fail")?"terminal-failed":t.includes("reconcil")||n.includes("reconcil")?"needs-reconcile":"orphan-unknown"}const _p=new Set(["failed","error","partial_failed"]),J6=new Set(["blocked","paused","awaiting_human"]);function d0(e){return(e??"").trim().toLowerCase()}function OD(e){return _p.has(d0(e))}function O2(e){const t=d0(e.status);return _p.has(t)||t.includes("fail")?0:e.lifecycle==="paused"||t==="paused"?1:e.lifecycle==="active"?2:3}function DD(e){return[...e].sort((t,n)=>{const a=O2(t)-O2(n);return a!==0?a:n.mtimeMs-t.mtimeMs})}function jD(e){return DD(e)[0]?.dagRunId}function D2(e){const t=d0(e.status);return _p.has(t)?0:J6.has(t)?1:2}function ex(e){return[...e].sort((t,n)=>{const a=D2(t)-D2(n);return a!==0?a:t.nodeId.localeCompare(n.nodeId)})}function LD(e){const t=ex(e);return t.find(a=>OD(a.status)||J6.has(d0(a.status)))?.nodeId??t[0]?.nodeId}function zD(e){const t=e.status?.trim()||e.lifecycle;return`${e.dagRunId.length>36?`${e.dagRunId.slice(0,18)}…${e.dagRunId.slice(-8)}`:e.dagRunId} · ${t}`}function BD(e){const t=e.status?.trim()||"unknown",n=e.label?.trim();return n&&n!==e.nodeId?`${e.nodeId} · ${t} · ${n}`:`${e.nodeId} · ${t}`}function UD(e){const n=[`operator-recovery: ${e.actionLabel?.trim()||"恢复"}`],a=e.dagRunId?.trim();if(a){const d=e.runStatus?.trim();n.push(d?`run=${a} (${d})`:`run=${a}`)}const s=e.fromNodeId?.trim();if(s){const d=e.nodeStatus?.trim();n.push(d?`from-node=${s} (${d})`:`from-node=${s}`)}const l=e.factClassLabel?.trim();l&&n.push(`fact=${l}`);const c=e.nodeError?.trim()||e.errorMessage?.trim()||(e.errorCode?.trim()?`code=${e.errorCode.trim()}`:"");return c&&n.push(`detail=${c.replace(/\s+/g," ").slice(0,280)}`),n.join(`
|
|
405
|
+
`).slice(0,500)}function tx(e){const t=e.trim();return t?t==="operator-recovery"||t.startsWith("operator-recovery:")||t.startsWith("recovery:"):!0}async function j2(e){const t=await e.runAction("prepareMutationGate",{action:e.action,actionParams:e.actionParams});if(!e.isActionSuccess(t))return;const n=t?.result??t,a=n.receiptId?n:n.result??n;if(!a.receiptId||!a.humanGateToken){e.setOpError("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await e.runAction(e.action,{...e.actionParams,confirmationId:a.receiptId,humanGateToken:a.humanGateToken},{clientRequestId:e.clientRequestId})}function qD(e){const{shell:t,actions:n,taskId:a,dagRunId:s,fromNodeId:l,featureId:c,recoveryReason:d,recoveryReasonTouched:m,recoveryConfirm:h,recoveryPlanSummary:p,interruptReasonCode:b,setRecoveryConfirm:y,setRecoveryPlanSummary:x,setRecoveryReport:k,setRecoveryReason:T,setRecoveryReasonTouched:R,buildCurrentRecoveryReason:C,openFullCanvas:_}=e,{setOpError:I,setOpErrorCode:G,setOpMessage:D,setBusy:M}=t,{runAction:B,isActionSuccess:X}=n,$=S.useCallback(async F=>{if(F.requiresReason||(y(null),x(null)),F.action==="doctor"){k(null),B("doctor",{});return}if(F.action==="dagReport"||F.id==="report"){const H=s.trim();if(H){y(null),x(null);const ne=await B("dagReport",{runId:H}),V=ne?.result??{},Y=(V.raw?.runs??V.runs)?.[0];ne&&ne.ok!==!1&&!ne.error&&Y&&(k({runId:Y.runId??H,title:Y.title,status:Y.status,category:Y.productLineFailureCategory,recommendation:Y.recoveryRecommendation?.summary??Y.recommendedFollowUp??void 0}),D(null));return}if(a.trim()){k(null),B("status",{taskId:a});return}I("查看报告需要先选择 DAG 运行 ID(或填写任务 ID)");return}if(F.action==="observeLink"){k(null),_();return}if(F.requiresReason){if(k(null),y(F),x(null),F.id!=="dagRerun"&&(I(null),G(null)),(!m||tx(d))&&(T(C(F.label)),R(!1)),F.id==="dagRerun"&&s.trim()&&l.trim()){M(!0);try{const{status:H,body:ne}=await Io("dagRerunPlan",{runId:s.trim(),fromNode:l.trim()}),V=ne.result??{};V&&typeof V=="object"&&("eligible"in V||V.planHash)&&x(V),H<400&&ne.ok!==!1&&V.eligible!==!1?D(null):V.eligible===!1?I(Ua(Zm(V,ne.error?.message))):D(ne.error?.message??"无法预检重跑计划;确认后仍将尝试提交(CLI 可能尚未就绪)")}finally{M(!1)}}return}I(null),G(null),D(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[C,s,l,_,d,m,B,M,I,G,D,y,x,k,T,R,a]),j=S.useCallback(async()=>{const F=h;if(!F)return;const H=d.trim();if(!H){I("恢复操作需要结构化原因");return}const ne=Bu(`recovery-${F.id}`);if(y(null),F.id==="dagRerun"){const V=s.trim(),Y=l.trim();if(!V||!Y){I("从失败节点恢复需要 DAG 运行 ID 与起始节点 ID");return}let K=p?.planHash?.trim(),re=p?.eligible;if(!K||re===void 0){const ue=await B("dagRerunPlan",{runId:V,fromNode:Y}),Te=ue?.result??{};if((Te.planHash||Te.eligible!==void 0)&&x(Te),K=Te.planHash?.trim()||K,re=Te.eligible,Te.eligible===!1){I(Ua(Zm(Te,ue?.error?.message)));return}if(ue&&ue.ok===!1&&!K){I(ue.error?.message??"无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}}if(re===!1){I(Ua(Zm(p??{})));return}if(!K){I("无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}await B("dagRerun",{runId:V,fromNode:Y,planHash:K,reason:H},{clientRequestId:ne});return}if(F.id==="standaloneTaskRerun"){const V=s.trim();if(!V){I("带反馈重新执行任务需要 DAG 运行 ID");return}await B("standaloneTaskRerun",{runId:V,reason:H,...a.trim()?{taskId:a.trim()}:{}},{clientRequestId:ne});return}if(F.id==="workerTaskRetry"){const V=a.trim();if(!V){I("重新排队 Worker Task 需要任务 ID");return}await B("workerTaskRetry",{taskId:V,reason:H,...c.trim()?{featureId:c.trim()}:{}},{clientRequestId:ne});return}if(F.id==="interrupt"){const V=s.trim();if(!V){I("中止运行需要 DAG 运行 ID");return}if(H.trim().length<10||H.trim().length>500){I("中止原因去首尾空白后必须是 10–500 个字符,请手写说明,不要用占位句。");return}await j2({runAction:B,isActionSuccess:X,setOpError:I,action:"dagRequestInterrupt",actionParams:{runId:V,reasonCode:b.trim()||"operator-request",reasonDetail:H},clientRequestId:ne});return}if(F.id==="reconcile"){const V=s.trim();if(!V){I("对账恢复需要 DAG 运行 ID");return}await j2({runAction:B,isActionSuccess:X,setOpError:I,action:"dagReconcileRun",actionParams:{runId:V,reason:H,reconcileAction:"supersede"},clientRequestId:ne});return}D(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[s,c,l,h,p?.planHash,d,b,B,X,I,D,y,x,a]);return{handleRecoveryCta:$,submitRecoveryConfirm:j}}function HD(e){const{shell:t,actions:n,wizard:a}=e,{nav:s,opError:l,opErrorCode:c,lastOpState:d,setOpError:m,setObserveBusy:h}=t,{taskId:p}=a,[b,y]=S.useState(""),[x,k]=S.useState(""),[T,R]=S.useState(""),[C,_]=S.useState(""),[I,G]=S.useState(!1),[D,M]=S.useState(null),[B,X]=S.useState(null),[$,j]=S.useState(!1),[F,H]=S.useState("operator-request"),[ne,V]=S.useState(null),[Y,K]=S.useState([]),[re,ue]=S.useState([]),[Te,P]=S.useState(!1),[U,q]=S.useState(!1),[A,ae]=S.useState(null),[pe,te]=S.useState(null),[ee,ce]=S.useState(null),[ge,Ae]=S.useState(!1),[Oe,ve]=S.useState(!1),[Ue,Ve]=S.useState(null),[nt,lt]=S.useState("idle"),[Lt,_t]=S.useState(null),[ut,Ye]=S.useState(null),[Fe,ct]=S.useState(!1),zt=S.useCallback(()=>b.trim()?`/inspect/#/dag/${encodeURIComponent(b.trim())}?from=recovery`:"/inspect/#/",[b]),Pe=S.useCallback(()=>{window.location.assign(zt())},[zt]),Wt=S.useCallback(async()=>{if(b.trim())return b.trim();const it=p.trim();if(!it)return m("打开 DAG 检视需要任务 ID 或 DAG 运行 ID"),null;h(!0),m(null);try{const{status:We,body:St}=await Io("observeLink",{taskId:it}),Dt=St.result??{};if(We>=400||St.ok===!1)return m(St.error?.message??"无法解析 DAG 画布地址"),lt("unavailable"),_t(St.error?.message??null),null;const Ft=typeof Dt.dagRunId=="string"?Dt.dagRunId.trim():"";return Ft?(y(Ft),lt("match"),_t(null),Ye(`/inspect/#/dag/${encodeURIComponent(Ft)}`),Ft):(m("尚未找到该任务的 DAG 运行,请稍后再打开检视"),lt("unavailable"),_t(Dt.message??"未解析到 DAG run"),null)}catch(We){return m(We instanceof Error?We.message:String(We)),null}finally{h(!1)}},[b,p,m,h]),me=S.useCallback(async()=>{await Wt()&&ct(!0)},[Wt]),ye=S.useCallback(async()=>{const it=await Wt();it&&window.location.assign(`/inspect/#/dag/${encodeURIComponent(it)}?from=recovery`)},[Wt]),qe=S.useCallback(async()=>{P(!0);try{const it=p.trim(),We=new URLSearchParams;it&&We.set("taskId",it),We.set("limit","40");const St=await fetch(`/api/operator/v1/recovery/candidates?${We.toString()}`,{credentials:"same-origin"});if(!St.ok){K([]);return}const Dt=await St.json();K(Array.isArray(Dt.runs)?Dt.runs:[])}catch{K([])}finally{P(!1)}},[p]),Qe=S.useCallback(async it=>{const We=it.trim();if(!We){ue([]),ae(null),te(null),ce(null);return}q(!0);try{const St=await fetch(`/api/dag-runs/${encodeURIComponent(We)}`,{credentials:"same-origin"});if(!St.ok){ue([]),ae(null),te(null);return}const Dt=await St.json(),Ft=typeof Dt.effectiveStatus=="string"&&Dt.effectiveStatus||typeof Dt.status=="string"&&Dt.status||null;ae(Ft);const Q=Array.isArray(Dt.nodes)?Dt.nodes:[],xe=ex(Q.map(ht=>{const kt=(ht.nodeId??ht.id??"").trim();return kt?{nodeId:kt,status:ht.status,label:ht.label??ht.name,errorPreview:ht.errorPreview}:null}).filter(ht=>ht!==null));ue(xe);const je=typeof Dt.failureCategory=="string"&&Dt.failureCategory||void 0,Xe=Q.find(ht=>typeof ht.failureCategory=="string"&&ht.failureCategory&&ht.failureCategory!=="success")?.failureCategory;te(je??Xe??null),ce(Dt.frontendRecovery??null)}catch{ue([]),ae(null),te(null),ce(null)}finally{q(!1)}},[]);S.useEffect(()=>{s==="recovery"&&qe()},[s,p,qe]),S.useEffect(()=>{if(s!=="recovery"||ge||Y.length===0)return;const it=b.trim(),We=it?Y.some(St=>St.dagRunId===it):!1;if(!it||!We){const St=jD(Y);St&&St!==it&&y(St)}},[s,Y,b,ge]),S.useEffect(()=>{s==="recovery"&&Qe(b)},[s,b,Qe]),S.useEffect(()=>{if(s!=="recovery")return;const it=b.trim();if(!it){V(null);return}const St=A&&new Set(["finished","failed","partial_failed","superseded","abandoned","interrupted"]).has(A)?3e4:4e3,Dt=St===4e3;let Ft=!1;const Q=async()=>{const{body:je}=await Io("dagInterruptEligibility",{runId:it});if(Ft)return;const Xe=je.result??je;if(V({eligible:Xe.eligible===!0,ownerKind:Xe.ownerKind,message:Xe.message,interruptStatus:Xe.interruptStatus,reasonCodes:Xe.reasonCodes,targetOperationId:Xe.targetOperationId,targetOperationState:Xe.targetOperationState}),!!Dt)try{const ht=await fetch(`/api/dag-runs/${encodeURIComponent(it)}`,{credentials:"same-origin"});if(!ht.ok||Ft)return;const kt=await ht.json();if(Ft)return;const ie=typeof kt.effectiveStatus=="string"&&kt.effectiveStatus||typeof kt.status=="string"&&kt.status||null;ae(ie)}catch{}};Q();const xe=window.setInterval(()=>{Q()},St);return()=>{Ft=!0,window.clearInterval(xe)}},[s,b,A]),S.useEffect(()=>{if(s!=="recovery"||Oe||re.length===0)return;const it=x.trim(),We=it?re.some(St=>St.nodeId===it):!1;if(!it||!We){const St=LD(re);St&&St!==it&&k(St)}},[s,re,x,Oe]);const rt=MD({operationState:A?null:d,errorCode:A?null:c,dagStatus:A,failureCategory:pe}),tn=S.useMemo(()=>{const it=Q6(rt);return rt!=="running-active"||ne?.eligible?it:it.filter(We=>We.id!=="interrupt")},[rt,ne?.eligible]),un=S.useMemo(()=>AD(tn),[tn]),Bt=S.useMemo(()=>ID(rt),[rt]),dt=S.useMemo(()=>re.find(it=>it.nodeId===x.trim()),[re,x]),Ht=S.useRef(null);S.useEffect(()=>{B&&Ht.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[B?.id]);const bt=S.useCallback(it=>UD({actionLabel:it,dagRunId:b.trim()||void 0,fromNodeId:x.trim()||void 0,runStatus:A,nodeStatus:dt?.status,nodeError:dt?.errorPreview,factClassLabel:W6[rt],errorMessage:l,errorCode:c}),[b,x,l,c,rt,A,dt?.errorPreview,dt?.status]);S.useEffect(()=>{if(s!=="recovery"||I&&!tx(C))return;const it=bt(B?.label);it&&it!==C&&_(it)},[s,b,x,A,dt,rt,l,c,B?.label,I,C,bt]);const{handleRecoveryCta:Wn,submitRecoveryConfirm:wn}=qD({shell:t,actions:n,taskId:p,dagRunId:b,fromNodeId:x,featureId:T,recoveryReason:C,recoveryReasonTouched:I,recoveryConfirm:B,recoveryPlanSummary:D,interruptReasonCode:F,setRecoveryConfirm:X,setRecoveryPlanSummary:M,setRecoveryReport:Ve,setRecoveryReason:_,setRecoveryReasonTouched:G,buildCurrentRecoveryReason:bt,openFullCanvas:ye});return S.useEffect(()=>{if(s!=="recovery"||!$||!ne?.eligible)return;const it=tn.find(We=>We.id==="interrupt");it&&(X(it),_(bt(it.label)),G(!1),j(!1))},[s,$,ne?.eligible,tn,bt]),{dagRunId:b,setDagRunId:y,fromNodeId:x,setFromNodeId:k,featureId:T,setFeatureId:R,recoveryReason:C,setRecoveryReason:_,recoveryReasonTouched:I,setRecoveryReasonTouched:G,recoveryPlanSummary:D,recoveryConfirm:B,setRecoveryConfirm:X,setRecoveryPlanSummary:M,recoveryRuns:Y,recoveryNodes:re,recoveryRunsLoading:Te,recoveryNodesLoading:U,recoveryRunStatus:A,recoveryFailureCategory:pe,frontendRecovery:ee,manualRunId:ge,setManualRunId:Ae,manualNodeId:Oe,setManualNodeId:ve,recoveryReport:Ue,setRecoveryReport:Ve,observeLinkStatus:nt,observeLinkMessage:Lt,observeUrl:ut,inspectSplitOpen:Fe,setInspectSplitOpen:ct,inspectPath:zt,openFullInspect:Pe,resolveDagRunForInspect:Wt,openInspectSplit:me,openFullCanvas:ye,loadRecoveryRuns:qe,loadRecoveryNodes:Qe,recoveryFact:rt,recoveryCtas:tn,recoveryLanes:un,recommendedCtaId:Bt,interruptIntent:$,setInterruptIntent:j,interruptReasonCode:F,setInterruptReasonCode:H,interruptEligibility:ne,recoveryConfirmRef:Ht,buildCurrentRecoveryReason:bt,handleRecoveryCta:Wn,submitRecoveryConfirm:wn}}function FD(e){const{shell:t,actions:n,prd:a}=e,{step:s,setStep:l,setOpMessage:c}=t,{runAction:d,isActionSuccess:m,summarizeEnvelope:h}=n,[p,b]=S.useState(""),[y,x]=S.useState(""),[k,T]=S.useState("standard"),[R,C]=S.useState(""),[_,I]=S.useState(""),[G,D]=S.useState(""),M=jh.find(Fe=>Fe.kind===k)??jh[0],[B,X]=S.useState(null),[$,j]=S.useState(null),[F,H]=S.useState(""),[ne,V]=S.useState(null),[Y,K]=S.useState(null),[re,ue]=S.useState(null),[Te,P]=S.useState(null),[U,q]=S.useState(null),[A,ae]=S.useState(!1),[pe,te]=S.useState(null),[ee,ce]=S.useState(null),ge=S.useRef(!1),Ae=S.useCallback(()=>{ue(null),P(null),q(null),ae(!1),te(null),ce(null),ge.current=!1},[]),Oe=S.useCallback(()=>{Ae(),l("contract")},[Ae,l]),ve=S.useCallback(Fe=>{const ct=Fe.session;ct?.sessionId&&X(ct.sessionId);const zt=Fe.question;j(zt),V(Fe.summary??null);const Pe=Fe.assessmentId;typeof Pe=="string"&&Pe&&K(Pe),(Fe.complete===!0||typeof Pe=="string"&&Pe)&&(Oe(),c(Fe.skipped===!0?"已跳过访谈:已按推荐补齐草稿并签发评估":"访谈已完成:草稿已绑定完整评估结果"))},[Oe,c]),Ue=S.useCallback(async(Fe=!1)=>{const ct=p.trim();if(!ct)return;const zt=`${ct}:${Y??""}`;if(!(!Fe&&ee===zt&&re!==null)&&!ge.current){ge.current=!0,ue(null),P(null),q(null),te(null),ae(!1);try{const Pe=await d("contractValidate",{taskId:ct}),Wt=m(Pe);if(ue(Wt),P(h(Pe)),!Wt){ce(zt),c("契约校验未通过:请先修正草稿后再应用");return}const me=await d("contractDiff",{taskId:ct});q(h(me)),ce(zt),c(m(me)?"校验与差异已就绪:确认后可应用契约":"校验通过,但差异查询失败(仍可查看下方摘要)")}finally{ge.current=!1}}},[Y,ee,re,m,d,c,h,p]),Ve=S.useCallback(async()=>{const Fe=p.trim();if(!Fe||!Y)return;const ct=await d("contractApply",{taskId:Fe,assessmentId:Y},{clientRequestId:Bu("apply")});if(!m(ct)){ae(!1);return}ae(!0);const zt=await d("spineCheck",{taskId:Fe});if(m(zt)){te(!0),l("dag-confirm"),c("契约已应用并通过 Spine 审计,可生成并运行 DAG");return}te(!1),c("契约已应用,但 Spine 审计未通过:可重试 Spine")},[Y,m,d,c,l,p]),nt=S.useCallback(async()=>{const Fe=p.trim();if(!Fe)return;const ct=await d("spineCheck",{taskId:Fe});if(m(ct)){te(!0),l("dag-confirm"),c("Spine 审计已通过,可生成并运行 DAG");return}te(!1)},[m,d,c,l,p]),lt=S.useCallback(async()=>{const Fe=n.confirmationId?.trim();if(!Fe)return;const ct=n.confirmationDetails?.confirmation?.humanGateToken,zt=await d("confirmDagConfirmation",{confirmationId:Fe,humanGateToken:ct});m(zt)&&(l("run"),await d("runDag",{confirmationId:Fe},{clientRequestId:Bu("run")}))},[n.confirmationId,n.confirmationDetails,m,d,l]);S.useEffect(()=>{s==="contract"&&p.trim()&&Ue(!1)},[s,p,Y,Ue]);const Lt=S.useCallback(Fe=>Fe.split(/[\n,;,;]+/).map(ct=>ct.trim()).filter(Boolean),[]),_t=S.useCallback(async()=>{const Fe=a.prdDocuments.length>0?xD(a.prdDocuments):void 0,ct=Lt(R),zt=Lt(_),Pe=Lt(G),Wt={content:a.prdText,taskKind:k,...Fe?{documents:Fe}:{},...ct.length>0?{allowedPaths:ct}:{},...zt.length>0?{forbiddenPaths:zt}:{},...Pe.length>0?{verifyCommands:Pe}:{}};if(!SD("bootstrapFromPrd",Wt)){a.setPrdFileError(kD());return}const me=await d("bootstrapFromPrd",Wt);if(!me||me.ok===!1)return;const ye=me.result??{};ye.taskId&&b(ye.taskId),ye.title&&x(ye.title);const qe=ye.parseStatus??"pending",Qe=ye.draftPreview?.objective?.trim(),rt=Array.isArray(ye.gaps)?ye.gaps.length:0,tn=ye.semanticIntake?.applied?"semantic":ye.semanticIntake?.code??"no-semantic",un=(ye.autoImportedReferences??[]).filter(dt=>dt.repoRelative),Bt=(ye.unresolvedReferences??[]).filter(dt=>dt.token);c([`已创建任务「${ye.title??""}」(${ye.taskId??""})`,`来源:${ye.identitySource??"prd"}`,`解析:${qe}(${tn})`,Qe?`目标:${Qe.slice(0,120)}`:null,rt>0?`缺口 ${rt} 项待确认`:null,un.length>0?`已自动导入 ${un.length} 个引用文档(${un.map(dt=>`${dt.repoRelative}${dt.role?`:${dt.role}`:""}`).join("、")})`:null,Bt.length>0?`有 ${Bt.length} 个引用未能解析:${Bt.map(dt=>`${dt.token}(${dt.reason??"未知原因"})`).join("、")}`:null].filter(Boolean).join(" · ")),l("interview")},[R,_,a,d,c,l,Lt,k,G]),ut=[{id:"setup",label:"就绪检查"},{id:"import-prd",label:"导入需求"},{id:"interview",label:"需求访谈(可跳过)"},{id:"contract",label:"契约落地"},{id:"dag-confirm",label:"确认 DAG"},{id:"run",label:"运行"}],Ye=ut.findIndex(Fe=>Fe.id===s);return{taskId:p,setTaskId:b,taskTitle:y,taskKind:k,setTaskKind:T,engineering:{allowedPathsText:R,forbiddenPathsText:_,verifyCommandsText:G},setEngineering:Fe=>{Fe.allowedPathsText!==void 0&&C(Fe.allowedPathsText),Fe.forbiddenPathsText!==void 0&&I(Fe.forbiddenPathsText),Fe.verifyCommandsText!==void 0&&D(Fe.verifyCommandsText)},workflowMeta:M,sessionId:B,question:$,answerText:F,setAnswerText:H,draftSummary:ne,assessmentId:Y,contractValidateOk:re,contractValidateSummary:Te,contractDiffSummary:U,contractApplied:A,spineOk:pe,applyInterviewPayload:ve,runContractPreflight:Ue,applyContractThenSpine:Ve,retrySpineOnly:nt,confirmAndRunDag:lt,importPrdAndCreate:_t,wizardSteps:ut,stepIndex:Ye}}const PD={chat:"对话",tasks:"任务",recovery:"恢复",night:"夜间",models:"模型与认证",settings:"设置"};async function $D(e){return await import(e)}function GD(e){const t=e.repoName?.trim();if(t)return t;const n=(e.repoRoot??"").split(/[\\/]/).filter(Boolean);return n.length?n[n.length-1]:"repository"}function KD(e){const{nav:t,readiness:n,setupBlocked:a,degraded:s,health:l,inspectHref:c}=e,d=a||s?"models":"settings",m=a?"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。点击前往模型与认证。":s?"Pi 暂时降级:仍可恢复草稿与需求访谈。点击查看详情。":"Pi 已就绪。点击打开设置查看详情。";return{mode:"operate",activeTabHref:`#/${t}`,operateHref:"/#/chat",inspectHref:c,freshness:!1,readinessState:n,readinessHref:`#/${d}`,readinessTitle:m,repo:l?{name:GD(l),fingerprint:l.repoFingerprint??"",version:l.packageVersion??"",product:l.productName??l.product??"",inspectReady:l.inspect?.ready}:null}}function VD(e){const t=S.useRef(null),n=S.useRef(null),[a,s]=S.useState(!1),l=S.useMemo(()=>KD(e),[e.nav,e.readiness,e.setupBlocked,e.degraded,e.health,e.inspectHref]),c=S.useRef(l);return c.current=l,S.useEffect(()=>{let d=!1;return $D("/inspect/operator-chrome.js").then(m=>{d||!t.current||(n.current=m.mountOperatorChrome(t.current,c.current))}).catch(()=>{d||s(!0)}),()=>{d=!0,n.current?.destroy(),n.current=null}},[]),S.useEffect(()=>{n.current?.update(l)},[l]),f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:t,"data-testid":"operator-chrome"}),a?f.jsxs("nav",{className:"operator-chrome-fallback","aria-label":"操作工作区",children:[f.jsx("button",{type:"button",onClick:()=>window.location.assign("/#/"),children:"Loop Agent"}),f.jsx("button",{type:"button",onClick:()=>window.location.assign(`#/${e.nav}`),children:PD[e.nav]}),f.jsx("button",{type:"button",onClick:()=>window.location.assign(e.inspectHref),children:"观测"}),f.jsx("span",{role:"status",children:"共享导航加载失败,请刷新页面"})]}):null]})}function YD(e){return f.jsxs(f.Fragment,{children:[e.opError?f.jsxs("div",{className:"flash flash-error","data-testid":"op-error",children:[f.jsx("span",{className:"flash-label",children:"错误"}),f.jsx("p",{className:"flash-body",children:e.opError})]}):null,e.opMessage?f.jsxs("div",{className:"flash flash-info","data-testid":"op-message",children:[f.jsx("span",{className:"flash-label",children:"状态"}),f.jsx("p",{className:"flash-body",children:e.opMessage})]}):null]})}function XD(){return f.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:f.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function gu(e){return e.provider?Ao(e.provider,e.id):e.id}function ZD(e){const t=e.trim();if(!t)return;const n=t.indexOf("/");return n<=0||n===t.length-1?{provider:"",id:t}:{provider:t.slice(0,n),id:t.slice(n+1)}}function WD(e){const[t,n]=S.useState(!1),[a,s]=S.useState(""),[l,c]=S.useState(0),d=S.useRef(null),m=S.useRef(null),h=S.useRef(null),p=S.useMemo(()=>{const T=[...e.models];if(e.value&&!T.some(R=>gu(R)===e.value)){const R=ZD(e.value);R&&T.push(R)}return T},[e.models,e.value]),b=S.useMemo(()=>P6(p,a),[p,a]),y=S.useMemo(()=>b.flatMap(T=>T.models),[b]);S.useEffect(()=>{t&&(s(""),c(Math.max(0,p.findIndex(T=>gu(T)===e.value))),window.setTimeout(()=>h.current?.focus(),0))},[t,p,e.value]),S.useEffect(()=>{if(!t)return;const T=C=>{const _=d.current;_&&C.target instanceof Node&&!_.contains(C.target)&&n(!1)},R=C=>{C.key==="Escape"&&(n(!1),m.current?.focus())};return document.addEventListener("mousedown",T),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",R)}},[t]);const x=T=>{if(e.disabled)return;const R=y[T];R&&(n(!1),e.onChange(gu(R)),m.current?.focus())},k=T=>{if(T.key==="ArrowDown"){T.preventDefault(),c(R=>y.length?(R+1)%y.length:0);return}if(T.key==="ArrowUp"){T.preventDefault(),c(R=>y.length?(R-1+y.length)%y.length:0);return}if(T.key==="Enter"){T.preventDefault(),x(l);return}if(T.key==="Escape"){T.preventDefault(),n(!1),m.current?.focus();return}};return f.jsxs("div",{className:"oc-select-menu models-matrix-select",ref:d,children:[f.jsxs("button",{type:"button",ref:m,id:e.id,className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":t,"aria-invalid":e.ariaInvalid,"data-testid":e.dataTestId,disabled:e.disabled,onClick:()=>n(T=>!T),children:[f.jsx("span",{className:"oc-select-trigger-label",children:e.value||"选择模型"}),f.jsx(XD,{})]}),t&&f.jsxs("div",{className:"oc-select-panel oc-model-panel is-below",role:"listbox","aria-label":"选择模型",children:[f.jsx("input",{ref:h,className:"oc-select-search",placeholder:"搜索模型…",value:a,onChange:T=>{s(T.target.value),c(0)},onKeyDown:k}),b.length===0&&f.jsx("div",{className:"oc-select-status",children:"没有可用模型"}),b.map(T=>f.jsxs("div",{className:"oc-model-group",children:[f.jsx("div",{className:"oc-model-group-head",children:T.provider||"其他"}),T.models.map(R=>{const C=gu(R),_=C===e.value,I=y[l]===R;return f.jsxs("button",{type:"button",role:"option","aria-selected":_,disabled:e.disabled,className:`oc-select-option oc-model-option${I?" is-highlighted":""}${_?" is-active":""}`,onMouseDown:G=>G.preventDefault(),onClick:()=>{e.disabled||(n(!1),e.onChange(C))},children:[f.jsxs("span",{className:"oc-model-option-name",children:[R.name?`${R.name} · `:"",R.id]}),_&&f.jsx("span",{className:"oc-model-option-check",children:"✓"})]},C)})]},T.provider))]})]})}const QD=[{key:"sdkAvailable",detailKey:"sdkMessage",label:"Pi SDK",hint:"Node 侧 Pi SDK 可加载"},{key:"authReady",detailKey:"authMessage",label:"认证凭据",hint:"Pi auth / provider 密钥已配置"},{key:"modelsAvailable",detailKey:"modelsMessage",label:"可用模型",hint:"harness.json executors.pi(LOW/MED/HIGH)可在 Pi 凭据面解析"},{key:"interviewSessionOk",detailKey:"sessionMessage",label:"访谈会话",hint:"Interview 会话预检通过"}];function JD(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function ej(e){const t=e.readinessReport?.state??e.readiness,n=e.readinessReport?.probe,a=n?.details??{},s=e.readinessReport?.blockedActions??[],l=JD(e.readinessReport?.generatedAt),c=e.readinessReport??{state:e.readiness,health:e.health},d=n?.piModelMatrix,m=n?.piAvailableModels??[],[h,p]=S.useState(()=>_2(d)),[b,y]=S.useState(!1),[x,k]=S.useState(null),[T,R]=S.useState(null);S.useEffect(()=>{p(_2(d)),k(null)},[d]);const C=eD(h),_=!tD(C),I=e.busy||b||_;async function G(){if(!I){y(!0),k(null),R(null);try{const D=await e.onSaveMatrix({LOW:h.LOW,MED:h.MED,HIGH:h.HIGH});if(D&&D.ok===!1){k(D.error?.message??"保存模型矩阵失败");return}const M=window.localStorage.getItem(Yr)?.trim();if(M)try{const B=await fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(M)}/reload`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[u0]:Rp()},body:"{}"});B.ok?R("配置已保存,活动会话已重载。"):B.status===409?R("配置已保存;活动会话正忙(PI_SESSION_BUSY),请稍后手动重载。"):R("配置已保存;活动会话重载未完成,请手动重载。")}catch{R("配置已保存;活动会话重载未完成,请手动重载。")}else R("配置已保存,检测结果已刷新。")}catch(D){k(D instanceof Error?D.message:String(D))}finally{y(!1)}}}return f.jsxs("section",{className:"panel models-page","aria-labelledby":"models-title",children:[f.jsxs("div",{className:"models-header",children:[f.jsx("h2",{id:"models-title",children:"模型与认证"}),f.jsx("span",{className:"models-status-pill","data-state":t,"data-testid":"models-readiness-pill",children:X6[t]??t})]}),f.jsxs("p",{className:"panel-lead",children:["复用 Pi ModelRuntime 凭据平面;密钥不会回传到页面。请用"," ",f.jsx("code",{children:"pi"})," 或 Pi 认证存储完成配置,然后刷新就绪探测。"]}),f.jsxs("section",{className:"models-probe-card","aria-labelledby":"models-probe-title","data-testid":"readiness-details",children:[f.jsx("h3",{id:"models-probe-title",className:"models-subtitle",children:"就绪检查"}),f.jsx("ul",{className:"models-probe-list",children:QD.map(D=>{const M=n?.[D.key],B=a[D.detailKey],X=M===void 0;return f.jsxs("li",{className:`models-probe-item${X?" is-pending":M?" is-ok":" is-bad"}`,children:[f.jsx("span",{className:"models-probe-badge","aria-label":X?"未探测":M?"通过":"未通过",children:X?"—":M?"✓":"✕"}),f.jsxs("div",{className:"models-probe-body",children:[f.jsx("strong",{children:D.label}),f.jsx("span",{className:"muted",children:D.hint}),B?f.jsx("p",{className:"models-probe-detail",children:B}):null]})]},D.key)})})]}),f.jsxs("section",{className:"models-matrix-card","aria-labelledby":"models-matrix-title","data-testid":"models-matrix-editor",children:[f.jsx("h3",{id:"models-matrix-title",className:"models-subtitle",children:"Herness模型矩阵(LOW/MED/HIGH)"}),f.jsxs("p",{className:"models-matrix-lead",children:["从 Pi 可用模型中选择 ",f.jsx("code",{children:"provider/model"})," 或裸 model id; 保存后原子写入 ",f.jsx("code",{children:"executors.pi"})," 并自动重测就绪。"]}),f.jsx("div",{className:"models-matrix-list",children:Cp.map(D=>f.jsxs("div",{className:"models-matrix-row",children:[f.jsxs("label",{htmlFor:`pi-model-${D}`,children:[D," 档",C[D]?f.jsxs("span",{className:"error","data-testid":`pi-model-error-${D}`,children:[" ","— ",C[D]]}):null]}),f.jsx(WD,{id:`pi-model-${D}`,value:h[D],models:m,onChange:M=>p(B=>({...B,[D]:M})),ariaInvalid:C[D]!==void 0,"data-testid":`pi-model-select-${D}`})]},D))}),x?f.jsx("p",{className:"error","data-testid":"models-matrix-save-error",children:x}):null,T?f.jsx("p",{className:"muted","data-testid":"models-matrix-save-notice",children:T}):null,f.jsxs("div",{className:"models-actions",children:[f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:I,"data-testid":"models-matrix-save",onClick:()=>{G()},children:b||e.busy?"保存中…":"保存模型矩阵"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e.busy||b,"data-testid":"models-matrix-refresh-models",onClick:e.onRefreshReadiness,children:e.busy?"刷新中…":"刷新模型"})]})]}),t==="setup-required"?f.jsxs("div",{className:"models-setup-card","data-testid":"models-setup-hint",children:[f.jsx("h3",{className:"models-subtitle",children:"如何完成配置"}),f.jsxs("ol",{className:"models-setup-steps",children:[f.jsxs("li",{children:["在终端配置 Pi 认证(例如 ",f.jsx("code",{children:"pi auth login"}),")或写入 provider API key。"]}),f.jsxs("li",{children:["确认 agent 目录下 ",f.jsx("code",{children:"models.json"})," / 认证文件可读。"]}),f.jsx("li",{children:"点击下方「刷新就绪探测」,或运行诊断命令查看详情。"})]}),f.jsx("pre",{className:"cmd",children:Y6})]}):null,t==="degraded"?f.jsx("p",{className:"models-degraded-note","data-testid":"models-degraded-note",children:"Pi 暂时降级:仍可恢复草稿与需求访谈;部分写入/运行类操作会被拦截。"}):null,s.length>0?f.jsxs("div",{className:"models-blocked-card",children:[f.jsx("h3",{className:"models-subtitle",children:"当前受限操作"}),f.jsx("ul",{className:"models-blocked-list",children:s.map(D=>f.jsx("li",{children:f.jsx("code",{children:D})},D))})]}):null,f.jsxs("div",{className:"models-actions",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:e.busy,onClick:e.onRefreshReadiness,children:"刷新就绪探测"}),l?f.jsxs("span",{className:"muted models-generated-at",children:["上次探测:",l]}):null]}),f.jsxs("details",{className:"models-raw-details",children:[f.jsx("summary",{children:"查看原始探测数据(调试)"}),f.jsx("pre",{className:"cmd models-raw-json",children:JSON.stringify(c,null,2)})]})]})}const tj=[{value:"requirements-changed",label:"需求已变更"},{value:"suspected-runaway",label:"疑似失控"},{value:"resource-protection",label:"保护资源"},{value:"operator-request",label:"操作者请求"},{value:"other",label:"其他"}];function L2(e){const{lane:t,cta:n,planSummary:a,reason:s,busy:l,confirmRef:c}=e;return!n||n.lane!==t?null:f.jsxs("div",{ref:c,className:"recovery-confirm","data-testid":"recovery-confirm",children:[f.jsxs("h3",{children:["待确认:",n.label]}),f.jsx("p",{className:"muted",children:n.id==="reconcile"?"破坏性对账需经浏览器 Human Gate 确认。请核对运行与原因后再点「确定」。":n.id==="interrupt"?"协作中止需经浏览器 Human Gate。原因已按当前运行预填,可改分类或编辑后再确定。提交只表示请求已登记,当前节点仍会跑完。":"核对上方运行 / 节点与恢复原因后直接执行;服务端会校验资格,不再走 Human Gate。"}),n.id==="interrupt"?f.jsxs("fieldset",{className:"recovery-reason-code","data-testid":"recovery-interrupt-reason-code",disabled:l,children:[f.jsx("legend",{children:"原因分类"}),f.jsx("div",{className:"recovery-reason-code-group",children:tj.map(d=>{const m=(e.reasonCode??"operator-request")===d.value;return f.jsxs("label",{className:m?"recovery-reason-code-option is-active":"recovery-reason-code-option",children:[f.jsx("input",{type:"radio",name:"recovery-interrupt-reason-code",value:d.value,checked:m,onChange:()=>e.onReasonCodeChange?.(d.value)}),d.label]},d.value)})})]}):null,a?f.jsxs("div",{className:"recovery-plan-summary",children:[f.jsxs("p",{className:"muted",children:["计划 eligible=",String(a.eligible??"—")," · 风险=",Z6[a.risk??""]??a.risk??"—"]}),a.effectiveFromNodeId?f.jsxs("p",{className:"muted",children:["有效起点:",a.effectiveFromNodeId]}):null,a.estimatedExecution?f.jsxs("p",{className:"muted",children:["将执行 ",a.estimatedExecution.nodeCount??"?"," 个节点 / ",a.estimatedExecution.piCallCount??"?"," 次 Pi;预计避免"," ",a.estimatedExecution.avoidedNodeCount??"?"," 个节点"]}):null,a.planHash?f.jsxs("p",{className:"muted",children:["planHash: ",f.jsxs("code",{children:[a.planHash.slice(0,16),"…"]})]}):null]}):n.id==="dagRerun"?f.jsx("p",{className:"muted",children:"未加载计划摘要;点「确定」前将再次尝试资格检查。"}):null,f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:l||!s.trim(),"data-testid":"recovery-confirm-submit",onClick:e.onSubmit,children:"确定"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:l,"data-testid":"recovery-confirm-cancel",onClick:e.onCancel,children:"取消"})]})]})}function nj(e){const{shell:t,recovery:n,wizard:a}=e,{busy:s}=t,l=CD({interruptStatus:n.interruptEligibility?.interruptStatus,dagStatus:n.recoveryRunStatus,failureCategory:n.recoveryFailureCategory,targetOperationState:n.interruptEligibility?.targetOperationState}),c={planSummary:n.recoveryPlanSummary,reason:n.recoveryReason,reasonCode:n.interruptReasonCode,onReasonCodeChange:n.setInterruptReasonCode,busy:s,confirmRef:n.recoveryConfirmRef,onSubmit:()=>{n.submitRecoveryConfirm()},onCancel:()=>{n.setRecoveryConfirm(null),n.setRecoveryPlanSummary(null)}};return f.jsxs("section",{className:"panel","aria-labelledby":"recovery-title",children:[f.jsx("h2",{id:"recovery-title",children:"恢复"}),f.jsxs("p",{className:"muted",children:["事实分类:",W6[n.recoveryFact]," · 无 Cancel · 无「直接改代码」"]}),n.frontendRecovery?f.jsxs("div",{className:"muted","data-testid":"frontend-recovery-lineage",style:{marginBottom:"0.75rem"},children:[f.jsxs("div",{children:["前端恢复:outcome=",f.jsx("code",{children:n.frontendRecovery.outcome??"—"})," phase=",f.jsx("code",{children:n.frontendRecovery.phase??"—"})]}),f.jsxs("div",{children:["root ",f.jsx("code",{children:n.frontendRecovery.recoveryRootRunId??"—"}),n.frontendRecovery.parentRunId?` · parent ${n.frontendRecovery.parentRunId}`:"",n.frontendRecovery.childRunId?` · child ${n.frontendRecovery.childRunId}`:"",n.frontendRecovery.attemptIndex!==void 0?` · attempt ${n.frontendRecovery.attemptIndex}`:""]})]}):null,f.jsxs("ol",{className:"muted recovery-steps",children:[f.jsx("li",{children:"上方选 DAG 运行 / 节点,用「DAG 运行恢复」动作"}),f.jsx("li",{children:"Worker 持有的失败 run 用下方「Worker Task 重排队」;独立 DAG run 无法从节点恢复时才用「带反馈重新执行任务」"}),f.jsx("li",{children:"带 * 的动作:核对预填原因后点「确定」。重跑/重试直接执行;对账与中止运行走 Human Gate"})]}),l?f.jsxs("p",{className:"muted","data-testid":"recovery-interrupt-status",children:["中止进度:",l]}):null,n.recoveryFact==="running-active"&&n.interruptEligibility&&!n.interruptEligibility.eligible&&(!n.interruptEligibility.interruptStatus||n.interruptEligibility.interruptStatus==="none")?f.jsx("p",{className:"muted","data-testid":"recovery-interrupt-unavailable",children:n.interruptEligibility.ownerKind==="worker-managed"?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":n.interruptEligibility.message??"当前运行不具备协作中止资格。"}):null,f.jsxs("p",{className:"muted",children:[a.taskId.trim()?`按任务 ${a.taskId.trim()} 拉取候选。`:"未填任务 ID 时列出最近 DAG 运行。","Doctor 诊断可选,不是重跑前置。"," ",f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s||n.recoveryRunsLoading,"data-testid":"recovery-refresh-candidates",onClick:()=>{n.loadRecoveryRuns()},children:n.recoveryRunsLoading?"刷新中…":"刷新候选"})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"DAG 运行 ID"}),!n.manualRunId&&n.recoveryRuns.length>0?f.jsxs("select",{"data-testid":"recovery-run-select",value:n.dagRunId,disabled:s||n.recoveryRunsLoading,onChange:d=>{n.setManualRunId(!1),n.setManualNodeId(!1),n.setFromNodeId(""),n.setDagRunId(d.target.value),n.recoveryReasonTouched||n.setRecoveryReasonTouched(!1)},children:[n.recoveryRuns.some(d=>d.dagRunId===n.dagRunId)?null:f.jsx("option",{value:n.dagRunId||"",children:n.dagRunId?`${n.dagRunId}(当前)`:"— 请选择 —"}),n.recoveryRuns.map(d=>f.jsx("option",{value:d.dagRunId,children:zD(d)},d.dagRunId))]}):f.jsx("input",{"data-testid":"recovery-run-input",value:n.dagRunId,disabled:s,onChange:d=>{n.setManualRunId(!0),n.setDagRunId(d.target.value.trim())},placeholder:"dag-run-id(节点恢复/完整重新执行)"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-run-manual-toggle",onClick:()=>{if(!n.manualRunId&&n.recoveryRuns.length>0){n.setManualRunId(!0);return}n.setManualRunId(!1),n.loadRecoveryRuns()},children:!n.manualRunId&&n.recoveryRuns.length>0?"手动输入运行 ID":"刷新并改用下拉"})]}),f.jsxs("label",{className:"field",children:[f.jsxs("span",{className:"muted",children:["起始节点 ID(从失败节点恢复)",n.recoveryNodesLoading?" · 加载节点…":""]}),!n.manualNodeId&&n.recoveryNodes.length>0?f.jsxs("select",{"data-testid":"recovery-node-select",value:n.fromNodeId,disabled:s||n.recoveryNodesLoading,onChange:d=>{n.setManualNodeId(!1),n.setFromNodeId(d.target.value)},children:[n.recoveryNodes.some(d=>d.nodeId===n.fromNodeId)?null:f.jsx("option",{value:n.fromNodeId||"",children:n.fromNodeId?`${n.fromNodeId}(当前)`:"— 请选择 —"}),n.recoveryNodes.map(d=>f.jsx("option",{value:d.nodeId,children:BD(d)},d.nodeId))]}):f.jsx("input",{"data-testid":"recovery-node-input",value:n.fromNodeId,disabled:s,onChange:d=>{n.setManualNodeId(!0),n.setFromNodeId(d.target.value.trim())},placeholder:"例如 review-verdict-recovery-pi"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-node-manual-toggle",onClick:()=>{if(!n.manualNodeId&&n.recoveryNodes.length>0){n.setManualNodeId(!0);return}n.setManualNodeId(!1),n.loadRecoveryNodes(n.dagRunId)},children:!n.manualNodeId&&n.recoveryNodes.length>0?"手动输入节点 ID":"刷新并改用下拉"})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"恢复原因(已按 run/节点失败事实自动预填,可编辑)"}),f.jsx("textarea",{"data-testid":"recovery-reason",value:n.recoveryReason,disabled:s,rows:4,onChange:d=>{n.setRecoveryReasonTouched(!0),n.setRecoveryReason(d.target.value)},placeholder:"将自动预填 operator-recovery / run / from-node / detail"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-reason-refresh",onClick:()=>{n.setRecoveryReasonTouched(!1),n.setRecoveryReason(n.buildCurrentRecoveryReason(n.recoveryConfirm?.label))},children:"重新预填原因"})]}),f.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-dag",children:[f.jsx("h3",{children:"DAG 运行恢复"}),f.jsx("p",{className:"muted",children:"针对 `.harness/dag-runs` 的 Agent DAG 运行。橙色为当前建议;带 * 需确认原因。"}),f.jsxs("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-dag",children:[n.recoveryLanes.dag.map(d=>{const m=d.id===n.recommendedCtaId;return f.jsxs("button",{type:"button",className:m?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"aria-pressed":n.recoveryConfirm?.id===d.id?!0:void 0,"data-testid":`recovery-cta-${d.id}`,"data-recommended":m?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!n.dagRunId.trim(),"data-testid":"recovery-dag-preview",title:"在本页侧栏预览,可关闭返回",onClick:()=>{if(!n.dagRunId.trim()){t.setOpError("侧栏预览需要先选择 DAG 运行 ID");return}n.setInspectSplitOpen(!0)},children:"侧栏预览"})]}),n.recoveryReport?f.jsxs("div",{className:"recovery-report","data-testid":"recovery-report",children:[f.jsxs("div",{className:"recovery-report-header",children:[f.jsx("h3",{children:"交接报告摘要"}),f.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"recovery-report-close",onClick:()=>n.setRecoveryReport(null),children:"关闭"})]}),f.jsxs("dl",{className:"recovery-report-facts",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"运行"}),f.jsx("dd",{children:f.jsx("code",{children:n.recoveryReport.runId})})]}),n.recoveryReport.title?f.jsxs("div",{children:[f.jsx("dt",{children:"标题"}),f.jsx("dd",{children:n.recoveryReport.title})]}):null,f.jsxs("div",{children:[f.jsx("dt",{children:"状态"}),f.jsx("dd",{children:n.recoveryReport.status??"—"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"失败分类"}),f.jsx("dd",{children:n.recoveryReport.category??"—"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"建议"}),f.jsx("dd",{children:n.recoveryReport.recommendation??"暂无结构化建议"})]})]}),f.jsxs("p",{className:"muted",children:["完整 Markdown 可用 CLI:",f.jsxs("code",{children:["loop-agent dag report --run-id"," ",n.recoveryReport.runId," --markdown"]})]})]}):null,f.jsx(L2,{lane:"dag",cta:n.recoveryConfirm,...c})]}),f.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-worker",children:[f.jsx("h3",{children:"Worker Task 重排队"}),f.jsx("p",{className:"muted",children:"针对 agent-worker Task Pool,不是 DAG run。需要 Task ID;Feature ID 可选。"}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"Task ID(Worker 重排队必填)"}),f.jsx("input",{"data-testid":"recovery-worker-task-id",value:a.taskId,disabled:s,onChange:d=>a.setTaskId(d.target.value.trim()),placeholder:"harness / worker task-id"})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"Feature ID(可选)"}),f.jsx("input",{"data-testid":"recovery-feature-id",value:n.featureId,disabled:s,onChange:d=>n.setFeatureId(d.target.value.trim()),placeholder:"feature-id"})]}),f.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-worker",children:n.recoveryLanes.worker.length>0?n.recoveryLanes.worker.map(d=>f.jsxs("button",{type:"button",className:d.id===n.recommendedCtaId?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"data-testid":`recovery-cta-${d.id}`,"data-recommended":d.id===n.recommendedCtaId?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)):f.jsx("p",{className:"muted","data-testid":"recovery-worker-unavailable",children:"当前事实分类下不提供 Worker 重排队。"})}),f.jsx(L2,{lane:"worker",cta:n.recoveryConfirm,...c})]}),f.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row",hidden:!0,children:n.recoveryCtas.map(d=>f.jsx("span",{children:d.id},d.id))}),n.observeLinkMessage?f.jsxs("p",{className:"muted",children:["[",nD[n.observeLinkStatus],"]"," ",n.observeLinkMessage]}):null,n.observeUrl?f.jsx("p",{className:"muted",children:f.jsx("a",{className:"external-link",href:n.observeUrl,children:n.observeUrl})}):null]})}const rj=()=>window.__CONSOLE_CONFIRMATION_TOKEN__??"";function aj(){const[e,t]=S.useState(void 0),[n,a]=S.useState(!1),[s,l]=S.useState(null),[c,d]=S.useState(!0),m=async()=>{d(!0),l(null);try{const p=await fetch("/api/operator/v1/pi/models-config",{credentials:"same-origin"}),b=await p.json();if(!p.ok||b.ok===!1)throw new Error(b.error?.message??"读取模型配置失败");t(b.data)}catch(p){l(p instanceof Error?p.message:String(p))}finally{d(!1)}};S.useEffect(()=>{m()},[]);const h=async p=>{a(!0),l(null);try{const b=await fetch("/api/operator/v1/pi/models-config",{method:"PATCH",credentials:"same-origin",headers:{"Content-Type":"application/json",[u0]:rj()},body:JSON.stringify(p)}),y=await b.json();if(!b.ok||y.ok===!1)throw new Error(y.error?.message??"保存模型配置失败");t(y.data)}catch(b){l(b instanceof Error?b.message:String(b))}finally{a(!1)}};return f.jsxs("section",{className:"panel models-config-section","aria-labelledby":"settings-models-title",children:[f.jsx("h2",{id:"settings-models-title",children:"模型配置(models.json)"}),f.jsx("p",{className:"muted",children:"增删改 Pi 的模型条目(写入走确认门)。Console 不读取或写入 API key;凭据请通过 Pi CLI 配置。"}),c?f.jsx("p",{className:"muted","data-testid":"models-config-loading",children:"正在读取模型配置…"}):s?f.jsx("p",{className:"error",role:"alert","data-testid":"models-config-error",children:s}):f.jsx(e3,{busy:n,data:e,onMutate:h})]})}function ij(e){const{health:t,readiness:n,healthError:a,layers:s,setupBlocked:l,degraded:c}=e;return f.jsxs(f.Fragment,{children:[f.jsxs("section",{className:"panel","aria-labelledby":"settings-title",children:[f.jsx("h2",{id:"settings-title",children:"设置"}),f.jsxs("dl",{className:"kv",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"产品"}),f.jsx("dd",{children:t?.productName??"Loop Operator Console"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"仓库根目录"}),f.jsx("dd",{children:f.jsx("code",{children:t?.repoRoot??"—"})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"仓库指纹"}),f.jsx("dd",{children:f.jsx("code",{title:t?.repoFingerprint??void 0,children:t?.repoFingerprint?`${t.repoFingerprint.slice(0,12)}…`:"—"})})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Pi 就绪"}),f.jsxs("dd",{children:[f.jsxs("code",{children:[X6[n]??n,"(",n,")"]}),l?f.jsx("p",{className:"muted",children:"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。请前往「模型与认证」。"}):c?f.jsx("p",{className:"muted",children:"Pi 暂时降级:仍可恢复草稿与需求访谈。"}):null]})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Inspect"}),f.jsxs("dd",{children:[f.jsx("code",{children:"/inspect/"}),"(同一 Console 进程)"]})]})]}),a?f.jsx("p",{className:"error",children:a}):null]}),f.jsxs("section",{className:"panel","aria-labelledby":"layers-title",children:[f.jsx("h2",{id:"layers-title",children:"完成语义分层"}),f.jsx("p",{className:"muted",children:"MVP 不执行收尾提交;不显示「任务已关闭/已交付」。"}),f.jsxs("dl",{className:"kv","data-testid":"completion-layers",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"命令"}),f.jsx("dd",{children:pu(s.command)})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"DAG 生命周期"}),f.jsx("dd",{children:pu(s.dag)})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"最终验证"}),f.jsx("dd",{children:pu(s.verification)})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"晋升"}),f.jsx("dd",{children:pu(s.promote)})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"任务关闭"}),f.jsx("dd",{children:"不可用(MVP)"})]})]})]}),f.jsx(aj,{})]})}function sj(e){const t=(e??"").trim().toLowerCase();return t?t.includes("running")||t==="in_progress"||t==="active"?"running":t.includes("fail")||t.includes("error")||t==="blocked"?"failed":t.includes("finish")||t.includes("success")||t==="done"||t==="ok"?"finished":t.includes("skip")?"skipped":"pending":"pending"}function lj(e){const t=String(e.nodeId??e.id??"").trim();return{nodeId:t,label:String((e.label??e.name??t)||"未命名节点"),status:String(e.status??""),rank:typeof e.rank=="string"?e.rank:void 0,startedAt:typeof e.startedAt=="string"?e.startedAt:void 0,durationMs:typeof e.durationMs=="number"?e.durationMs:void 0,errorPreview:typeof e.errorPreview=="string"?e.errorPreview:void 0}}function Wm(e,t){if(!e)return null;const n=Date.parse(e);if(Number.isNaN(n))return null;const a=t-n;return a>=0?a:null}function oj(e,t=Date.now()){if(!e)return{total:0,finished:0,running:null,failed:null,terminal:!1,effectiveStatus:null,stalled:!1,currentNodeElapsedMs:null,runElapsedMs:null};const a=(Array.isArray(e.nodes)?e.nodes:[]).map(lj),s=a.map(k=>sj(k.status)),l=s.filter(k=>k==="finished"||k==="skipped").length,c=s.indexOf("running"),d=c>=0?a[c]:null,m=s.indexOf("failed"),h=m>=0?a[m]:null,p=String(e.effectiveStatus??e.status??"").toLowerCase(),b=cj.has(p),y=typeof e.startedAt=="string"?e.startedAt:void 0,x=typeof e.durationMs=="number"?e.durationMs:void 0;return{total:a.length,finished:l,running:d,failed:h,terminal:b,effectiveStatus:p||null,stalled:p==="running-suspected-stall",currentNodeElapsedMs:d?.durationMs??Wm(d?.startedAt,t),runElapsedMs:b?x??Wm(y,t):Wm(y,t)}}const cj=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function z2(e){if(e==null||!Number.isFinite(e)||e<0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n} 时 ${a} 分`:a>0?`${a} 分 ${s} 秒`:`${s} 秒`}const uj=5e3;function dj(e){const[t,n]=S.useState(null);return S.useEffect(()=>{const a=e.trim();if(n(null),!a)return;const s=new AbortController;let l;const c=async()=>{try{const d=await fetch(`/api/dag-runs/${encodeURIComponent(a)}`,{credentials:"same-origin",signal:s.signal});if(!d.ok)return;const m=await d.json();if(s.signal.aborted)return;n(m),Qm(m)&&l!==void 0&&(window.clearInterval(l),l=void 0)}catch{}};return c(),l=window.setInterval(()=>{c()},uj),()=>{s.abort(),l!==void 0&&window.clearInterval(l)}},[e]),S.useMemo(()=>oj(t),[t])}function fj(e){const{busy:t,degraded:n,taskId:a,assessmentId:s,contractValidateOk:l,contractValidateSummary:c,contractDiffSummary:d,contractApplied:m,spineOk:h,onRerunPreflight:p,onApplyContract:b,onRetrySpine:y}=e;return f.jsxs("div",{"data-testid":"panel-contract",children:[f.jsx("h3",{children:"契约落地"}),f.jsx("p",{className:"muted",children:"进入本步后自动跑确定性校验与差异(非 AI 代判)。写入仓库仍需你人工确认一次;应用成功后会自动跑 Spine 审计。"}),f.jsxs("p",{className:"muted",children:["评估 ID: ",f.jsx("code",{children:s??"—"})]}),f.jsxs("div",{className:"contract-checks",children:[f.jsxs("p",{children:[f.jsx("strong",{children:"校验"}),":"," ",l===null?t?"进行中…":"等待开始":l?"通过":"未通过"]}),c?f.jsx("pre",{className:"cmd","data-testid":"contract-validate-summary",children:c}):null,f.jsxs("p",{children:[f.jsx("strong",{children:"差异"}),d?"":":尚未拉取"]}),d?f.jsx("pre",{className:"cmd","data-testid":"contract-diff-summary",children:d}):null,m?f.jsxs("p",{children:[f.jsx("strong",{children:"Spine"}),":"," ",h===null?"待检查":h?"通过":"未通过"]}):null]}),f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||!a.trim(),onClick:p,children:"重新校验"}),f.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"contract-apply",disabled:t||n||!s||l!==!0||m,onClick:b,children:"确认并应用契约"}),m&&h===!1?f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:y,children:"重试 Spine"}):null]})]})}function mj(e){const{busy:t,taskId:n,confirmationId:a,confirmationDetails:s,runAction:l,onConfirmAndRun:c}=e;return f.jsxs("div",{"data-testid":"panel-dag-confirm",children:[f.jsx("h3",{children:"DAG 确认(§5.5)"}),f.jsxs("ul",{className:"checklist",children:[f.jsx("li",{children:"源绑定(source)"}),f.jsx("li",{children:"Writer 写集范围(writer-scope)"}),f.jsx("li",{children:"验证命令(verification)"}),f.jsx("li",{children:"人工门禁(human-gates)"})]}),s?f.jsx("pre",{className:"cmd",children:JSON.stringify(s,null,2).slice(0,4e3)}):null,f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{l("prepareDagConfirmation",{taskId:n,dagHandle:`${n}.dag.json`,profile:"auto"})},children:"生成 DAG 并准备确认"}),f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!a,onClick:c,children:"开始运行"})]}),a?f.jsxs("p",{className:"muted",children:["确认 ID: ",f.jsx("code",{children:a})]}):null]})}function hj(e){const{busy:t,taskKind:n,onTaskKindChange:a,workflowHint:s,prd:l,engineering:c,onEngineeringChange:d,onImport:m}=e,h=t||l.prdFileReading;return f.jsxs("div",{"data-testid":"panel-import-prd",children:[f.jsx("h3",{children:"导入需求"}),f.jsx("p",{className:"muted",children:"粘贴、选择或拖入一份或多份 PRD / 需求 Markdown。多文件会分别归档到 source/references,并合成一份可编辑正文。创建前可继续编辑。 系统会对 PRD 做确定性/语义结构化;工程边界(路径与验证)须人类确认,不会由模型编造。"}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"流程类型"}),f.jsx("select",{"data-testid":"workflow-kind-select",value:n,disabled:t||l.prdFileReading,onChange:p=>a(p.target.value),children:jh.map(p=>f.jsx("option",{value:p.kind,children:p.label},p.kind))})]}),f.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-hint",children:[s," · taskKind=",f.jsx("code",{children:n})]}),f.jsxs("div",{className:`prd-drop-zone${l.prdDragOver?" is-dragover":""}`,"data-testid":"prd-drop-zone","data-dragover":l.prdDragOver?"true":"false",onDragEnter:p=>l.onDragEnter(p,h),onDragOver:p=>{p.preventDefault(),p.stopPropagation()},onDragLeave:l.onDragLeave,onDrop:p=>l.onDrop(p,h),children:[f.jsxs("div",{className:"prd-upload-toolbar",children:[f.jsxs("label",{className:`btn btn-ghost prd-upload-btn${h?" is-disabled":""}`,children:["选择需求文档",f.jsx("input",{type:"file",accept:uD,multiple:!0,hidden:!0,disabled:h,"data-testid":"prd-file-input",onChange:p=>{const b=p.currentTarget;l.loadPrdFromFiles(b.files).finally(()=>{b.value=""})}})]}),f.jsxs("span",{className:"muted prd-upload-hint",children:["支持多文件 .md / .markdown / .txt,单文件最大"," ",zh(Lh),",最多 ",Uu," 个"]}),l.prdDocuments.length>0?f.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"prd-recompose",disabled:h,onClick:l.recomposeDocuments,children:"按文件重新合成"}):null]}),l.prdDocuments.length>0?f.jsx("ul",{className:"prd-file-list","data-testid":"prd-file-list",children:l.prdDocuments.map((p,b)=>f.jsxs("li",{className:b===l.prdPrimaryIndex?"is-primary":void 0,"data-testid":`prd-file-item-${b}`,children:[f.jsxs("span",{className:"prd-file-item-name",children:[p.fileName,b===l.prdPrimaryIndex?f.jsx("span",{className:"prd-file-primary-tag",children:"主"}):null,f.jsxs("span",{className:"muted",children:[" ","· ",zh(p.sourceBytes)]})]}),f.jsxs("span",{className:"prd-file-item-actions",children:[f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===l.prdPrimaryIndex,onClick:()=>l.setPrimaryDocument(b),children:"设为主"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===0,onClick:()=>l.moveDocument(b,-1),children:"上移"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===l.prdDocuments.length-1,onClick:()=>l.moveDocument(b,1),children:"下移"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h,onClick:()=>l.removeDocument(b),children:"移除"})]})]},`${p.fileName}-${b}`))}):null,l.prdDocuments.length>0?f.jsxs("div",{className:"prd-file-meta",children:[f.jsxs("span",{children:["分卷=上传原件(将分别归档);正文=本会话采用稿",l.prdComposedDirty?"(已手动编辑)":""]}),f.jsx("button",{type:"button",className:"btn btn-ghost prd-file-clear","data-testid":"prd-file-clear",disabled:h,onClick:l.clearDocuments,children:"清除来源列表"})]}):null,l.prdDragOver?f.jsx("p",{className:"prd-drop-hint","data-testid":"prd-drop-hint",children:"释放以载入"}):null,f.jsxs("label",{className:"field prd-text-field",children:[f.jsx("span",{className:"muted",children:"PRD Markdown"}),f.jsx("textarea",{rows:10,value:l.prdText,disabled:h,"data-testid":"prd-textarea",onChange:p=>l.onPrdTextChange(p.target.value)})]})]}),l.prdFileError?f.jsx("p",{className:"prd-file-error",role:"alert","aria-live":"polite","data-testid":"prd-file-error",children:l.prdFileError}):null,f.jsxs("details",{className:"engineering-boundary","data-testid":"engineering-boundary",children:[f.jsx("summary",{children:"工程边界(可选,人类确认)"}),f.jsxs("p",{className:"muted",children:["逗号或换行分隔。留空则 intake 后进入访谈补齐;不会自动填",f.jsx("code",{children:"src/worker/console/**"})," 模板。"]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"allowedPaths"}),f.jsx("textarea",{rows:2,value:c.allowedPathsText,disabled:h,"data-testid":"prd-allowed-paths",placeholder:"src/**, test/**",onChange:p=>d({allowedPathsText:p.target.value})})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"forbiddenPaths"}),f.jsx("textarea",{rows:2,value:c.forbiddenPathsText,disabled:h,"data-testid":"prd-forbidden-paths",placeholder:".harness/**, node_modules/**",onChange:p=>d({forbiddenPathsText:p.target.value})})]}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"verifyCommands(label:command 或纯命令)"}),f.jsx("textarea",{rows:2,value:c.verifyCommandsText,disabled:h,"data-testid":"prd-verify-commands",placeholder:"typecheck:npm run typecheck",onChange:p=>d({verifyCommandsText:p.target.value})})]})]}),f.jsx("div",{className:"cta-row",children:f.jsxs("button",{type:"button",className:`btn btn-primary${t?" is-loading":""}`,disabled:t||l.prdFileReading||!l.prdText.trim(),"aria-busy":t||void 0,onClick:m,children:[t?f.jsx("span",{className:"spinner","aria-hidden":"true"}):null,t?"导入中…":"导入并创建任务"]})})]})}function pj(e){const{busy:t,taskId:n,taskTitle:a,taskKind:s,sessionId:l,question:c,answerText:d,onAnswerTextChange:m,draftSummary:h,assessmentId:p,runAction:b}=e;return f.jsxs("div",{"data-testid":"panel-interview",children:[f.jsx("h3",{children:"需求访谈(grill-me)"}),f.jsx("p",{className:"muted",children:"一次一问;也可跳过:系统会按推荐补齐草稿并签发评估,随后进入校验。 访谈中不可应用契约 / 运行 DAG / 对账。"}),h?f.jsx("pre",{className:"cmd","data-testid":"draft-summary",children:JSON.stringify(h,null,2)}):null,f.jsxs("div",{className:"cta-row",style:{marginBottom:"0.75rem"},children:[!l||!c?f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n.trim(),onClick:()=>{b("interviewStart",{taskId:n,title:a,taskKind:s})},children:"开始 / 继续访谈"}):null,f.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"interview-skip",disabled:t||!n.trim(),onClick:()=>{b("interviewSkip",{taskId:n,title:a,taskKind:s})},children:"跳过访谈"})]}),l&&c?f.jsxs("div",{className:"interview-card",children:[f.jsxs("p",{className:"interview-q",children:[f.jsx("strong",{children:c.id})," · 风险=",Z6[c.risk??""]??c.risk??"—"]}),f.jsx("p",{children:c.text}),c.recommendation?f.jsxs("p",{className:"muted",children:["推荐:",c.recommendation]}):null,f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"你的回答(覆盖推荐)"}),f.jsx("textarea",{rows:3,value:d,disabled:t,onChange:y=>m(y.target.value)})]}),f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{b("interviewTurn",{sessionId:l,questionId:c.id,response:"accept-recommendation"}).then(()=>m(""))},children:"接受推荐"}),f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!d.trim(),onClick:()=>{b("interviewTurn",{sessionId:l,questionId:c.id,response:"override",text:d}).then(()=>m(""))},children:"提交自定义回答"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||c.risk==="high",onClick:()=>{b("interviewTurn",{sessionId:l,questionId:c.id,response:"defer",text:d||c.recommendation}).then(()=>m(""))},children:"暂缓(非高风险)"})]})]}):null,p?f.jsxs("p",{className:"muted",children:["评估 ID: ",f.jsx("code",{children:p})]}):null]})}function gj({progress:e}){const t=e.total>0?Math.round(e.finished/e.total*100):0;return f.jsxs("div",{className:"run-progress","data-testid":"run-progress",children:[f.jsxs("div",{className:"run-progress-head",children:[f.jsxs("b",{children:["节点进度 ",e.finished,"/",e.total||"—",e.total>0?`(${t}%)`:""]}),f.jsx("span",{className:`run-progress-status${e.stalled?" is-stalled":""}`,"data-testid":"run-progress-status",children:e.effectiveStatus??"未知状态"})]}),f.jsx("div",{className:"run-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.finished,"aria-label":"DAG 节点完成进度",children:f.jsx("span",{style:{width:`${t}%`}})}),f.jsx("p",{className:"run-progress-current","data-testid":"run-progress-current",children:e.running?f.jsxs(f.Fragment,{children:["当前节点:",f.jsx("strong",{children:e.running.label}),"(已运行 ",z2(e.currentNodeElapsedMs),")"]}):e.terminal?f.jsxs(f.Fragment,{children:["运行已结束(总时长 ",z2(e.runElapsedMs),")"]}):f.jsx(f.Fragment,{children:"暂无正在运行的节点"})}),e.stalled?f.jsx("p",{className:"run-progress-stall","data-testid":"run-progress-stall",children:"疑似停滞:超过阈值没有实质进展。可打开检视查看节点活动,或到恢复页 使用协作中止 / 诊断入口判断是否继续等待。"}):null,e.failed?f.jsxs("p",{className:"run-progress-failed","data-testid":"run-progress-failed",children:["失败节点:",f.jsx("strong",{children:e.failed.label}),e.failed.errorPreview?` — ${e.failed.errorPreview}`:""]}):null]})}function bj(e){const{busy:t,confirmationId:n,operationId:a,dagRunId:s,observeBusy:l,sseLog:c,progress:d,runAction:m,onStopFollow:h,onShowInspectSplit:p,onOpenInspectSplit:b}=e;return f.jsxs("div",{"data-testid":"panel-run",children:[f.jsx("h3",{children:"运行详情"}),f.jsxs("div",{className:"meta-row",children:[f.jsxs("div",{children:["操作 ID: ",f.jsx("code",{children:a??"—"})]}),f.jsxs("div",{children:["确认 ID: ",f.jsx("code",{children:n??"—"})]})]}),f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n,onClick:()=>{m("runDag",{confirmationId:n},{clientRequestId:Bu("run")})},children:"重新运行"}),f.jsx("button",{type:"button",className:"btn btn-secondary",onClick:h,children:"停止跟随日志"}),f.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!s.trim(),onClick:p,children:"打开检视"}),f.jsx("button",{type:"button",className:"btn btn-ghost",disabled:l||!s.trim(),title:"在本页侧栏预览当前运行的 DAG,可关闭返回",onClick:b,children:"侧栏预览"})]}),d?f.jsx(gj,{progress:d}):null,f.jsxs("details",{className:"run-sse-log",children:[f.jsx("summary",{children:"原始事件日志(最近 80 条)"}),f.jsx("pre",{className:"cmd","data-testid":"sse-log",children:c.join(`
|
|
406
|
+
`)||"(尚无事件)"})]})]})}const nx=[2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3,3e4,3e4];function vj(e,t){if(e===!0)return{kind:"own"};if(e===!1)return{kind:"clear"};const n=nx[t];return n===void 0?{kind:"give-up"}:{kind:"retry",delayMs:n}}nx.reduce((e,t)=>e+t,0);function yj(){return{baseline:null,ownedRunId:"",pendingSelection:""}}function xj(e,t){const n=e.task===void 0,a=!n&&e.task!==t.task,s=!n&&e.dispatch!==t.dispatchId,l={...e,task:t.task,dispatch:t.dispatchId,pendingSelection:""};if(a)return l.baseline=null,l.ownedRunId="",{state:l,observation:{action:"reset-selection"}};if(s&&(l.ownedRunId="",t.selectedRunId))return l.baseline=t.selectedRunId,{state:l,observation:{action:"invalidate-selection"}};const c=t.selectedRunId;return c&&c!==l.ownedRunId?(l.pendingSelection=c,{state:l,observation:{action:"verify-ownership"}}):{state:l,observation:{action:c?"idle":"probe"}}}function B2(e){return{...e,baseline:null}}function wj(e,t){return{...e,baseline:t??""}}function Sj(e,t){return!t.ok||!t.dagRunId?{state:e,acceptedRunId:null}:e.baseline===null||t.dagRunId===e.baseline?{state:e,acceptedRunId:null}:{state:{...e,ownedRunId:t.dagRunId},acceptedRunId:t.dagRunId}}function kj(e,t){return t?{state:{...e,ownedRunId:e.pendingSelection,pendingSelection:""},clearSelection:!1}:{state:{...e,ownedRunId:"",pendingSelection:"",baseline:null},clearSelection:!0}}async function U2(e){try{const{status:t,body:n}=await Io("observeLink",{taskId:e});if(t>=400||n.ok===!1)return{ok:!1};const a=n.result??{};return{ok:!0,dagRunId:(typeof a.dagRunId=="string"?a.dagRunId.trim():"")||null}}catch{return{ok:!1}}}async function Ej(e,t){try{const n=await fetch(`/api/dag-runs/${encodeURIComponent(e)}`,{credentials:"same-origin"});if(n.status===404)return!1;if(!n.ok)return null;const a=await n.json(),s=typeof a.taskId=="string"?a.taskId.trim():"";return s?s===t.trim():null}catch{return null}}function Tj(e){const{shell:t,actions:n,wizard:a,prd:s,recovery:l}=e,{busy:c,step:d,setupBlocked:m,degraded:h}=t,p=S.useRef(yj()),b=S.useRef(0),[y,x]=S.useState(""),k=S.useCallback(C=>{const _=++b.current;p.current=B2(p.current);const I=async G=>{const D=await U2(C);if(b.current===_){if(D.ok){p.current=wj(p.current,D.dagRunId);return}G>0&&window.setTimeout(()=>{I(G-1)},1500)}};I(8)},[]);S.useEffect(()=>{if(d!=="dag-confirm")return;const C=a.taskId.trim();if(!C){b.current+=1,p.current=B2(p.current);return}k(C)},[d,a.taskId,k]),S.useEffect(()=>{if(d!=="run")return;const C=a.taskId.trim();if(!C)return;const _=xj(p.current,{task:C,dispatchId:n.operationId??null,selectedRunId:l.dagRunId.trim()});switch(p.current=_.state,x(_.state.ownedRunId),_.observation.action){case"reset-selection":{l.setManualRunId(!1),l.setDagRunId(""),k(C);return}case"invalidate-selection":{l.setManualRunId(!1),l.setDagRunId("");return}case"verify-ownership":{const I=_.state.pendingSelection;let G=!1,D=0;const M=async B=>{if(G)return;const X=await Ej(I,C);if(G)return;const $=vj(X,B);if($.kind==="own"||$.kind==="clear"){const j=kj(p.current,$.kind==="own");p.current=j.state,x(j.state.ownedRunId),j.clearSelection&&(l.setManualRunId(!1),l.setDagRunId(""),k(C));return}$.kind==="retry"&&(D=window.setTimeout(()=>{M(B+1)},$.delayMs))};return M(0),()=>{G=!0,window.clearTimeout(D)}}case"idle":return;case"probe":{p.current.baseline===null&&k(C);let I=!1,G=0,D=0;const M=async()=>{if(I)return;if(p.current.baseline===null){D+=1,D<120&&(G=window.setTimeout(()=>{M()},1e3));return}const B=await U2(C);if(I)return;D+=1;const X=Sj(p.current,B);if(p.current=X.state,X.acceptedRunId){x(X.state.ownedRunId),l.setManualRunId(!0),l.setDagRunId(X.acceptedRunId);return}D<120&&(G=window.setTimeout(()=>{M()},2500))};return G=window.setTimeout(()=>{M()},1200),()=>{I=!0,window.clearTimeout(G)}}}},[d,n.operationId,a.taskId,l.dagRunId,l.setManualRunId,l.setDagRunId,k]);const T=l.dagRunId===y?l.dagRunId:"",R=dj(d==="run"?T:"");return f.jsxs("section",{className:"panel task-ops","aria-labelledby":"task-ops-title",children:[f.jsx("h2",{id:"task-ops-title",children:"任务操作"}),f.jsx("p",{className:"panel-lead",children:"按 Happy Path 推进;契约落地一步内自动校验,人工确认写入。"}),f.jsx("ol",{className:"wizard-steps","data-testid":"wizard-steps",children:a.wizardSteps.map((C,_)=>f.jsxs("li",{"data-active":d===C.id,"data-done":_<a.stepIndex,children:[f.jsx("span",{className:"step-index",children:String(_+1).padStart(2,"0")}),f.jsx("span",{className:"step-label",children:C.label})]},C.id))}),f.jsxs("label",{className:"field",children:[f.jsx("span",{className:"muted",children:"任务 ID"}),f.jsx("input",{"data-testid":"task-id-input",value:a.taskId,disabled:c||m||d==="import-prd",placeholder:d==="import-prd"?"导入需求后自动生成":"task-id",onChange:C=>a.setTaskId(C.target.value.trim())})]}),a.taskTitle?f.jsxs("p",{className:"workflow-hint","data-testid":"task-title-chip",children:["任务名称:",a.taskTitle]}):null,d!=="import-prd"&&!m?f.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-chip",children:["当前流程:",a.workflowMeta.label," ·"," ",f.jsx("code",{children:a.taskKind})]}):null,m||d==="setup"?f.jsxs("div",{className:"empty-state","data-testid":"setup-gate",children:[f.jsx("p",{className:"empty-title",children:"需要先完成设置"}),f.jsx("p",{className:"muted",children:"请先在「模型与认证」完成 Pi 就绪,再导入需求与访谈。"}),f.jsxs("div",{className:"cta-row",children:[f.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{t.selectNav("models"),n.runAction("refreshReadiness",{}).then(()=>t.loadHealth())},children:"刷新就绪状态"}),f.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{n.runAction("doctor",{})},children:"运行诊断"}),f.jsx("pre",{className:"cmd",children:Y6})]})]}):f.jsxs("div",{className:"wizard-body","data-testid":"wizard-body",children:[d==="import-prd"&&f.jsx(hj,{busy:c,taskKind:a.taskKind,onTaskKindChange:a.setTaskKind,workflowHint:a.workflowMeta.hint,prd:s,engineering:a.engineering,onEngineeringChange:a.setEngineering,onImport:()=>{a.importPrdAndCreate()}}),d==="interview"&&f.jsx(pj,{busy:c,taskId:a.taskId,taskTitle:a.taskTitle,taskKind:a.taskKind,sessionId:a.sessionId,question:a.question,answerText:a.answerText,onAnswerTextChange:a.setAnswerText,draftSummary:a.draftSummary,assessmentId:a.assessmentId,runAction:n.runAction}),d==="contract"&&f.jsx(fj,{busy:c,degraded:h,taskId:a.taskId,assessmentId:a.assessmentId,contractValidateOk:a.contractValidateOk,contractValidateSummary:a.contractValidateSummary,contractDiffSummary:a.contractDiffSummary,contractApplied:a.contractApplied,spineOk:a.spineOk,onRerunPreflight:()=>{a.runContractPreflight(!0)},onApplyContract:()=>{a.applyContractThenSpine()},onRetrySpine:()=>{a.retrySpineOnly()}}),d==="dag-confirm"&&f.jsx(mj,{busy:c,taskId:a.taskId,confirmationId:n.confirmationId,confirmationDetails:n.confirmationDetails,runAction:n.runAction,onConfirmAndRun:()=>{a.confirmAndRunDag()}}),d==="run"&&f.jsx(bj,{busy:c,confirmationId:n.confirmationId,operationId:n.operationId,dagRunId:T,observeBusy:t.observeBusy,sseLog:n.sseLog,progress:R,runAction:n.runAction,onStopFollow:n.stopFollowSse,onShowInspectSplit:()=>{T.trim()&&l.setInspectSplitOpen(!0)},onOpenInspectSplit:()=>{T.trim()&&l.openInspectSplit()}})]})]})}const Nj={};function Cj(){const e=sD(),t=S.useRef(()=>{}),n=S.useCallback(p=>t.current(p),[]),a=oD({shell:e,applyInterviewPayload:n}),s=ED(),l=FD({shell:e,actions:a,prd:s}),c=HD({shell:e,actions:a,wizard:l});S.useEffect(()=>{t.current=l.applyInterviewPayload}),S.useEffect(()=>{e.loadHealth()},[e.loadHealth]);const d=S.useCallback((p,b={})=>{e.selectNav(p),b.taskId&&l.setTaskId(b.taskId),b.dagRunId&&c.setDagRunId(b.dagRunId),b.fromNodeId&&c.setFromNodeId(b.fromNodeId),b.featureId&&c.setFeatureId(b.featureId),c.setInterruptIntent(b.intent==="interrupt");const y=L6(p,b);window.location.hash.replace(/^#/,"")!==y&&(window.location.hash=y)},[e.selectNav,l.setTaskId,c.setDagRunId,c.setFromNodeId,c.setFeatureId,c.setInterruptIntent]),m=S.useCallback(()=>{const p=II(window.location);if(p){d(p.workspace,p);return}const b=j6({env:Nj?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location});d(b,{})},[d]);S.useEffect(()=>(m(),window.addEventListener("hashchange",m),()=>window.removeEventListener("hashchange",m)),[m]);const h=e.nav==="recovery"&&c.dagRunId.trim()?`/inspect/#/dag/${encodeURIComponent(c.dagRunId.trim())}?from=recovery`:"/inspect/#/";return f.jsx(f.Fragment,{children:f.jsxs("div",{className:`console-app${e.nav==="chat"?" is-chat-focus":""}`,children:[f.jsx(VD,{nav:e.nav,readiness:e.readiness,setupBlocked:e.setupBlocked,degraded:e.degraded,health:e.health,inspectHref:h}),f.jsxs("div",{className:`console-shell${e.nav==="chat"?" is-chat-focus":""}`,children:[f.jsx(YD,{opError:e.opError,opMessage:e.opMessage}),f.jsxs("main",{className:`console-main${e.nav==="chat"?" console-main--fill":""}`,children:[e.nav==="tasks"?f.jsx(Tj,{shell:e,actions:a,wizard:l,prd:s,recovery:c}):null,e.nav==="recovery"?f.jsx(nj,{shell:e,recovery:c,wizard:l}):null,e.nav==="night"?f.jsx(I8,{busy:e.busy,runAction:a.runAction,isActionSuccess:a.isActionSuccess,setOpError:e.setOpError}):null,e.nav==="models"?f.jsx(ej,{busy:e.busy,readiness:e.readiness,readinessReport:e.readinessReport,health:e.health,onRefreshReadiness:()=>{a.runAction("refreshReadiness",{}).then(()=>e.loadHealth())},onSaveMatrix:async p=>{const b=await a.runAction("savePiModelMatrix",{matrix:p});return await e.loadHealth(),b}}):null,e.nav==="chat"?f.jsxs("section",{className:"panel panel--chat","aria-labelledby":"chat-title",children:[f.jsx("h2",{id:"chat-title",className:"sr-only",children:"对话"}),f.jsx(WO,{origin:"",readiness:e.readiness,surface:"workspace",onNavigateWorkspace:d})]}):null,e.nav==="settings"?f.jsx(ij,{health:e.health,readiness:e.readiness,healthError:e.healthError,layers:e.layers,setupBlocked:e.setupBlocked,degraded:e.degraded}):null]}),c.inspectSplitOpen&&c.dagRunId.trim()?f.jsx(v8,{dagRunId:c.dagRunId.trim(),nodeId:c.fromNodeId.trim()||void 0,onClose:()=>c.setInspectSplitOpen(!1),onOpenFull:c.openFullInspect}):null]})]})})}const rx=document.getElementById("root");if(!rx)throw new Error("Loop Operator Console: #root missing");h8.createRoot(rx).render(f.jsx(S.StrictMode,{children:f.jsx(Cj,{})}));export{Gw as _,qu as g,Rj as k};
|