circuschief 0.1.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/package.json +33 -0
- package/packages/server/bin/cli.js +4 -0
- package/packages/server/src/agents/AgentGateway.js +64 -0
- package/packages/server/src/agents/BaseAgent.js +41 -0
- package/packages/server/src/agents/LoggingAgentWrapper.js +73 -0
- package/packages/server/src/agents/adapters/ClaudeCodeAdapter.js +33 -0
- package/packages/server/src/agents/adapters/CodexAdapter.js +26 -0
- package/packages/server/src/agents/types.js +43 -0
- package/packages/server/src/agents/vcr/CassetteStore.js +111 -0
- package/packages/server/src/agents/vcr/VCRAgentAdapter.js +126 -0
- package/packages/server/src/agents/vcr/VCRSummaryWrapper.js +71 -0
- package/packages/server/src/api/canvas-helpers.js +249 -0
- package/packages/server/src/api/canvas-trash-routes.js +205 -0
- package/packages/server/src/api/canvas.js +331 -0
- package/packages/server/src/api/commandButtons.js +312 -0
- package/packages/server/src/api/commands.js +169 -0
- package/packages/server/src/api/filesystem.js +62 -0
- package/packages/server/src/api/git.js +85 -0
- package/packages/server/src/api/index.js +44 -0
- package/packages/server/src/api/kanban.js +342 -0
- package/packages/server/src/api/metrics.js +194 -0
- package/packages/server/src/api/projects-helpers.js +43 -0
- package/packages/server/src/api/projects-session-helpers.js +295 -0
- package/packages/server/src/api/projects.js +384 -0
- package/packages/server/src/api/providers.js +249 -0
- package/packages/server/src/api/quickResponses.js +129 -0
- package/packages/server/src/api/sessions-archive.js +69 -0
- package/packages/server/src/api/sessions-commands.js +220 -0
- package/packages/server/src/api/sessions-conversations.js +168 -0
- package/packages/server/src/api/sessions-draft.js +72 -0
- package/packages/server/src/api/sessions-lifecycle.js +190 -0
- package/packages/server/src/api/sessions-messages.js +141 -0
- package/packages/server/src/api/sessions-notes.js +51 -0
- package/packages/server/src/api/sessions-patch.js +252 -0
- package/packages/server/src/api/sessions-streaming.js +86 -0
- package/packages/server/src/api/sessions.js +269 -0
- package/packages/server/src/api/settings.js +194 -0
- package/packages/server/src/api/templates.js +63 -0
- package/packages/server/src/app.js +51 -0
- package/packages/server/src/database.js +58 -0
- package/packages/server/src/db/AgentCallLogRepository.js +322 -0
- package/packages/server/src/db/AttachmentRepository.js +191 -0
- package/packages/server/src/db/BaseRepository.js +39 -0
- package/packages/server/src/db/CanvasItemRepository.js +315 -0
- package/packages/server/src/db/CommandButtonRepository.js +75 -0
- package/packages/server/src/db/CommandRunRepository.js +219 -0
- package/packages/server/src/db/ConversationRepository.js +379 -0
- package/packages/server/src/db/DatabaseManager.js +91 -0
- package/packages/server/src/db/KanbanBoardRepository.js +92 -0
- package/packages/server/src/db/KanbanCardRepository.js +286 -0
- package/packages/server/src/db/KanbanLaneRepository.js +279 -0
- package/packages/server/src/db/MessageRepository.js +156 -0
- package/packages/server/src/db/ProjectDefaultsRepository.js +173 -0
- package/packages/server/src/db/ProjectRepository.js +110 -0
- package/packages/server/src/db/ProviderRepository.js +307 -0
- package/packages/server/src/db/QuickResponseRepository.js +186 -0
- package/packages/server/src/db/SessionNoteRepository.js +60 -0
- package/packages/server/src/db/SessionRepository.js +314 -0
- package/packages/server/src/db/SessionSummaryRepository.js +200 -0
- package/packages/server/src/db/SessionTemplateRepository.js +171 -0
- package/packages/server/src/db/SettingsRepository.js +211 -0
- package/packages/server/src/db/TodoRepository.js +132 -0
- package/packages/server/src/db/WorkLogRepository.js +122 -0
- package/packages/server/src/db/conversation-helpers.js +119 -0
- package/packages/server/src/db/index.js +100 -0
- package/packages/server/src/db/migrations/canvasItemsMigrations.js +109 -0
- package/packages/server/src/db/migrations/conversationsMigrations.js +183 -0
- package/packages/server/src/db/migrations/index.js +199 -0
- package/packages/server/src/db/migrations/kanbanMigrations.js +99 -0
- package/packages/server/src/db/migrations/migrationUtils.js +55 -0
- package/packages/server/src/db/migrations/miscMigrations.js +242 -0
- package/packages/server/src/db/migrations/projectsMigrations.js +95 -0
- package/packages/server/src/db/migrations/sessionsMigrations.js +282 -0
- package/packages/server/src/db/session-helpers.js +150 -0
- package/packages/server/src/index.js +106 -0
- package/packages/server/src/logger.js +22 -0
- package/packages/server/src/middleware/sessionLookup.js +57 -0
- package/packages/server/src/middleware/upload.js +94 -0
- package/packages/server/src/schema.sql +363 -0
- package/packages/server/src/services/agentCallLogger.js +116 -0
- package/packages/server/src/services/canvasStore.js +56 -0
- package/packages/server/src/services/childSessionContext.js +61 -0
- package/packages/server/src/services/commandRunner.js +422 -0
- package/packages/server/src/services/conversationContext.js +72 -0
- package/packages/server/src/services/diffService.js +172 -0
- package/packages/server/src/services/draftSessionService.js +181 -0
- package/packages/server/src/services/encryption.js +134 -0
- package/packages/server/src/services/ghService.js +169 -0
- package/packages/server/src/services/gitService.js +520 -0
- package/packages/server/src/services/gitSessionSetup.js +48 -0
- package/packages/server/src/services/hookService.js +60 -0
- package/packages/server/src/services/kanbanService.js +262 -0
- package/packages/server/src/services/kanbanTriggers.js +273 -0
- package/packages/server/src/services/nodeSpawnHelper.js +63 -0
- package/packages/server/src/services/prStatusService.js +204 -0
- package/packages/server/src/services/prUrlService.js +224 -0
- package/packages/server/src/services/providerTestService.js +81 -0
- package/packages/server/src/services/scheduleService.js +110 -0
- package/packages/server/src/services/schedulerService.js +281 -0
- package/packages/server/src/services/sessionDuplicator.js +63 -0
- package/packages/server/src/services/sessionErrors.js +173 -0
- package/packages/server/src/services/sessionExecution.js +378 -0
- package/packages/server/src/services/sessionManager.js +356 -0
- package/packages/server/src/services/sessionPrompts.js +427 -0
- package/packages/server/src/services/sessionProvider.js +107 -0
- package/packages/server/src/services/slashCommandDiscovery.js +258 -0
- package/packages/server/src/services/slashCommandPluginDiscovery.js +216 -0
- package/packages/server/src/services/slashCommandService.js +306 -0
- package/packages/server/src/services/streamEventCallbacks.js +170 -0
- package/packages/server/src/services/streamEventHandler.js +488 -0
- package/packages/server/src/services/streamUsageHandler.js +228 -0
- package/packages/server/src/services/summaryBroadcast.js +61 -0
- package/packages/server/src/services/summaryClaudeClient.js +180 -0
- package/packages/server/src/services/summaryPrompts.js +169 -0
- package/packages/server/src/services/summaryService.js +552 -0
- package/packages/server/src/services/summaryStaleCheck.js +35 -0
- package/packages/server/src/services/systemMonitor.js +281 -0
- package/packages/server/src/services/templateTriggerService.js +197 -0
- package/packages/server/src/services/terminalOutput.js +160 -0
- package/packages/server/src/services/todoStore.js +58 -0
- package/packages/server/src/services/usageTracker.js +69 -0
- package/packages/server/src/services/withConcurrencyGuard.js +110 -0
- package/packages/server/src/websocket.js +10 -0
- package/packages/server/src/ws/WebSocketManager.js +240 -0
- package/packages/server/src/ws/index.js +50 -0
- package/packages/shared/package.json +27 -0
- package/packages/shared/src/constants.js +44 -0
- package/packages/shared/src/contracts/canvas.js +25 -0
- package/packages/shared/src/contracts/commandButtons.js +36 -0
- package/packages/shared/src/contracts/kanban.js +142 -0
- package/packages/shared/src/contracts/projects.js +63 -0
- package/packages/shared/src/contracts/providers.js +81 -0
- package/packages/shared/src/contracts/quickResponses.js +44 -0
- package/packages/shared/src/contracts/sessions.js +112 -0
- package/packages/shared/src/contracts/templates.js +51 -0
- package/packages/shared/src/index.js +5 -0
- package/packages/shared/src/protocol.js +76 -0
- package/packages/shared/src/routeParams.js +36 -0
- package/packages/shared/src/types.js +167 -0
- package/packages/shared/src/utils.js +101 -0
- package/packages/web/dist/assets/ActiveSessionsView-BQc76Jc8.js +1 -0
- package/packages/web/dist/assets/ActiveSessionsView-ofSvx-K1.css +1 -0
- package/packages/web/dist/assets/AgentLogsView-CTCjHjsu.js +2 -0
- package/packages/web/dist/assets/AgentLogsView-D90PnQVk.css +1 -0
- package/packages/web/dist/assets/ApiClient-Dbs1H78V.js +1 -0
- package/packages/web/dist/assets/ArchiveConfirmModal-CCxSZ52u.js +1 -0
- package/packages/web/dist/assets/ArchiveConfirmModal-CQZeuYBz.css +1 -0
- package/packages/web/dist/assets/CommandButtonDetailView-CF_-LXpU.js +1 -0
- package/packages/web/dist/assets/CommandButtonDetailView-DBm3rzhw.css +1 -0
- package/packages/web/dist/assets/EffortLevelSelector-BQaQmU2d.css +1 -0
- package/packages/web/dist/assets/EffortLevelSelector-DPofLvm-.js +1 -0
- package/packages/web/dist/assets/GeneralSettingsView-BCf53fpC.css +1 -0
- package/packages/web/dist/assets/GeneralSettingsView-BY1G-Kv8.js +1 -0
- package/packages/web/dist/assets/InterpolationHelp-CgdbNcJB.js +1 -0
- package/packages/web/dist/assets/InterpolationHelp-iNxTxmhs.css +1 -0
- package/packages/web/dist/assets/MarkdownEditor-CqT1U8lo.js +2 -0
- package/packages/web/dist/assets/MarkdownEditor-enuH2yvP.css +1 -0
- package/packages/web/dist/assets/ModelSelector-BBn_Ve0D.js +1 -0
- package/packages/web/dist/assets/ModelSelector-DPPD-92R.css +1 -0
- package/packages/web/dist/assets/NewSessionView-Bo5l49nu.js +3 -0
- package/packages/web/dist/assets/NewSessionView-Byoi1XdQ.css +1 -0
- package/packages/web/dist/assets/PathChooser-BoMGzeg2.css +1 -0
- package/packages/web/dist/assets/PathChooser-Cx9gQ-Qt.js +1 -0
- package/packages/web/dist/assets/ProjectEditView-BFuscj-V.js +1 -0
- package/packages/web/dist/assets/ProjectEditView-DNwBUNRk.css +1 -0
- package/packages/web/dist/assets/ProjectListView-C55H1JHQ.css +1 -0
- package/packages/web/dist/assets/ProjectListView-Dj0jBZ46.js +1 -0
- package/packages/web/dist/assets/ProjectNewView-Brdp-xUu.js +1 -0
- package/packages/web/dist/assets/ProjectNewView-CpgE4R-l.css +1 -0
- package/packages/web/dist/assets/ProvidersView-B_QQF3RM.css +1 -0
- package/packages/web/dist/assets/ProvidersView-Cxc-1skq.js +1 -0
- package/packages/web/dist/assets/QuickResponseSettings-B2eVAtHW.js +1 -0
- package/packages/web/dist/assets/QuickResponseSettings-B8188A1D.css +1 -0
- package/packages/web/dist/assets/QuickResponsesPanel-DIBQFj0W.css +1 -0
- package/packages/web/dist/assets/QuickResponsesPanel-lU8pW2B0.js +1 -0
- package/packages/web/dist/assets/ResizableTextarea-B5nAA0RV.css +1 -0
- package/packages/web/dist/assets/ResizableTextarea-DSy1mWGY.js +1 -0
- package/packages/web/dist/assets/SessionCard-BvjLwVYg.js +1 -0
- package/packages/web/dist/assets/SessionCard-D20G3bX8.css +1 -0
- package/packages/web/dist/assets/SessionDetailView-BQbPg-RJ.js +36 -0
- package/packages/web/dist/assets/SessionDetailView-BrMG4p2-.css +1 -0
- package/packages/web/dist/assets/SessionFormOptions-BgqFR-5f.js +1 -0
- package/packages/web/dist/assets/SessionFormOptions-BuLlDF-7.css +1 -0
- package/packages/web/dist/assets/SessionListView-BAIBtJF7.css +1 -0
- package/packages/web/dist/assets/SessionListView-CYIHI8qF.js +1 -0
- package/packages/web/dist/assets/SessionLogStream-B-FwUMJQ.js +18 -0
- package/packages/web/dist/assets/SessionLogStream-zPUTiGbe.css +1 -0
- package/packages/web/dist/assets/SettingsView-DC8-hTQ-.css +1 -0
- package/packages/web/dist/assets/SettingsView-fZxpiGp7.js +1 -0
- package/packages/web/dist/assets/SlashCommandWizard-BB30cSvo.css +1 -0
- package/packages/web/dist/assets/SlashCommandWizard-BgaOw9W3.js +1 -0
- package/packages/web/dist/assets/SummarySettingsView-DcsmSVJI.css +1 -0
- package/packages/web/dist/assets/SummarySettingsView-eeu1Xq86.js +1 -0
- package/packages/web/dist/assets/TemplateDetailView-DEPKSwDo.js +1 -0
- package/packages/web/dist/assets/TemplateDetailView-DT2m06W7.css +1 -0
- package/packages/web/dist/assets/apl-B4CMkyY2.js +1 -0
- package/packages/web/dist/assets/asciiarmor-Df11BRmG.js +1 -0
- package/packages/web/dist/assets/asn1-EdZsLKOL.js +1 -0
- package/packages/web/dist/assets/asterisk-B-8jnY81.js +1 -0
- package/packages/web/dist/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/packages/web/dist/assets/clike-B9uivgTg.js +1 -0
- package/packages/web/dist/assets/clojure-BMjYHr_A.js +1 -0
- package/packages/web/dist/assets/cmake-BQqOBYOt.js +1 -0
- package/packages/web/dist/assets/cobol-CWcv1MsR.js +1 -0
- package/packages/web/dist/assets/coffeescript-S37ZYGWr.js +1 -0
- package/packages/web/dist/assets/commandButtons-DNSHH8IA.js +4 -0
- package/packages/web/dist/assets/commonlisp-DBKNyK5s.js +1 -0
- package/packages/web/dist/assets/crystal-SjHAIU92.js +1 -0
- package/packages/web/dist/assets/css-BnMrqG3P.js +1 -0
- package/packages/web/dist/assets/cypher-C_CwsFkJ.js +1 -0
- package/packages/web/dist/assets/d-pRatUO7H.js +1 -0
- package/packages/web/dist/assets/diff-DbItnlRl.js +1 -0
- package/packages/web/dist/assets/dockerfile-BKs6k2Af.js +1 -0
- package/packages/web/dist/assets/dtd-DF_7sFjM.js +1 -0
- package/packages/web/dist/assets/dylan-DwRh75JA.js +1 -0
- package/packages/web/dist/assets/ebnf-CDyGwa7X.js +1 -0
- package/packages/web/dist/assets/ecl-Cabwm37j.js +1 -0
- package/packages/web/dist/assets/eiffel-CnydiIhH.js +1 -0
- package/packages/web/dist/assets/elm-vLlmbW-K.js +1 -0
- package/packages/web/dist/assets/erlang-BNw1qcRV.js +1 -0
- package/packages/web/dist/assets/factor-kuTfRLto.js +1 -0
- package/packages/web/dist/assets/fcl-Kvtd6kyn.js +1 -0
- package/packages/web/dist/assets/forth-Ffai-XNe.js +1 -0
- package/packages/web/dist/assets/fortran-DYz_wnZ1.js +1 -0
- package/packages/web/dist/assets/gas-Bneqetm1.js +1 -0
- package/packages/web/dist/assets/gherkin-heZmZLOM.js +1 -0
- package/packages/web/dist/assets/groovy-D9Dt4D0W.js +1 -0
- package/packages/web/dist/assets/haskell-BWDZoCOh.js +1 -0
- package/packages/web/dist/assets/haxe-H-WmDvRZ.js +1 -0
- package/packages/web/dist/assets/http-DBlCnlav.js +1 -0
- package/packages/web/dist/assets/idl-BEugSyMb.js +1 -0
- package/packages/web/dist/assets/index-BZlHgDSz.js +1 -0
- package/packages/web/dist/assets/index-BhWX8AfE.js +2 -0
- package/packages/web/dist/assets/index-Bi3XvF_f.js +1 -0
- package/packages/web/dist/assets/index-BqXoPf_D.js +1 -0
- package/packages/web/dist/assets/index-CAuTOZSD.js +1 -0
- package/packages/web/dist/assets/index-CKYk-fkb.js +1 -0
- package/packages/web/dist/assets/index-CTumW_tV.js +318 -0
- package/packages/web/dist/assets/index-CVOJVSsC.js +82 -0
- package/packages/web/dist/assets/index-CXK2Z3_z.js +1 -0
- package/packages/web/dist/assets/index-CYllQ3Vd.js +1 -0
- package/packages/web/dist/assets/index-CpsfI08O.js +1 -0
- package/packages/web/dist/assets/index-DQkhDeTA.js +3 -0
- package/packages/web/dist/assets/index-DWP8iCBp.js +1 -0
- package/packages/web/dist/assets/index-DkVb9W_J.js +1 -0
- package/packages/web/dist/assets/index-DmKHPbIa.js +1 -0
- package/packages/web/dist/assets/index-DrlQi03X.js +1 -0
- package/packages/web/dist/assets/index-gmCCsCQ1.css +1 -0
- package/packages/web/dist/assets/index-prTEzzgO.js +1 -0
- package/packages/web/dist/assets/index-wqgejMCM.js +1 -0
- package/packages/web/dist/assets/index-yh0ZHIWw.js +7 -0
- package/packages/web/dist/assets/javascript-qCveANmP.js +1 -0
- package/packages/web/dist/assets/julia-DuME0IfC.js +1 -0
- package/packages/web/dist/assets/livescript-BwQOo05w.js +1 -0
- package/packages/web/dist/assets/lua-BgMRiT3U.js +1 -0
- package/packages/web/dist/assets/mathematica-DTrFuWx2.js +1 -0
- package/packages/web/dist/assets/mbox-CNhZ1qSd.js +1 -0
- package/packages/web/dist/assets/mirc-CjQqDB4T.js +1 -0
- package/packages/web/dist/assets/mllike-CXdrOF99.js +1 -0
- package/packages/web/dist/assets/modelica-Dc1JOy9r.js +1 -0
- package/packages/web/dist/assets/mscgen-BA5vi2Kp.js +1 -0
- package/packages/web/dist/assets/mumps-BT43cFF4.js +1 -0
- package/packages/web/dist/assets/nginx-DdIZxoE0.js +1 -0
- package/packages/web/dist/assets/nsis-LdVXkNf5.js +1 -0
- package/packages/web/dist/assets/ntriples-BfvgReVJ.js +1 -0
- package/packages/web/dist/assets/octave-Ck1zUtKM.js +1 -0
- package/packages/web/dist/assets/oz-BzwKVEFT.js +1 -0
- package/packages/web/dist/assets/pascal--L3eBynH.js +1 -0
- package/packages/web/dist/assets/perl-CdXCOZ3F.js +1 -0
- package/packages/web/dist/assets/pig-CevX1Tat.js +1 -0
- package/packages/web/dist/assets/powershell-CFHJl5sT.js +1 -0
- package/packages/web/dist/assets/projects-DbBQQH-V.js +1 -0
- package/packages/web/dist/assets/properties-C78fOPTZ.js +1 -0
- package/packages/web/dist/assets/protobuf-ChK-085T.js +1 -0
- package/packages/web/dist/assets/providers-ceCc4xRU.js +1 -0
- package/packages/web/dist/assets/pug-DukmZTjD.js +1 -0
- package/packages/web/dist/assets/puppet-DMA9R1ak.js +1 -0
- package/packages/web/dist/assets/python-BuPzkPfP.js +1 -0
- package/packages/web/dist/assets/q-pXgVlZs6.js +1 -0
- package/packages/web/dist/assets/r-DUYO_cvP.js +1 -0
- package/packages/web/dist/assets/rpm-CTu-6PCP.js +1 -0
- package/packages/web/dist/assets/ruby-B2Rjki9n.js +1 -0
- package/packages/web/dist/assets/sas-B4kiWyti.js +1 -0
- package/packages/web/dist/assets/scheme-C41bIUwD.js +1 -0
- package/packages/web/dist/assets/sessions-D681M81k.js +1 -0
- package/packages/web/dist/assets/settings-D0evez2V.js +1 -0
- package/packages/web/dist/assets/shell-CjFT_Tl9.js +1 -0
- package/packages/web/dist/assets/sieve-C3Gn_uJK.js +1 -0
- package/packages/web/dist/assets/simple-mode-GW_nhZxv.js +1 -0
- package/packages/web/dist/assets/smalltalk-CnHTOXQT.js +1 -0
- package/packages/web/dist/assets/solr-DehyRSwq.js +1 -0
- package/packages/web/dist/assets/sparql-DkYu6x3z.js +1 -0
- package/packages/web/dist/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/packages/web/dist/assets/sql-D0XecflT.js +1 -0
- package/packages/web/dist/assets/stex-C3f8Ysf7.js +1 -0
- package/packages/web/dist/assets/style-BTin-zR_.css +1 -0
- package/packages/web/dist/assets/stylus-B533Al4x.js +1 -0
- package/packages/web/dist/assets/swift-BzpIVaGY.js +1 -0
- package/packages/web/dist/assets/tcl-DVfN8rqt.js +1 -0
- package/packages/web/dist/assets/textile-CnDTJFAw.js +1 -0
- package/packages/web/dist/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/packages/web/dist/assets/tiki-DGYXhP31.js +1 -0
- package/packages/web/dist/assets/toml-Bm5Em-hy.js +1 -0
- package/packages/web/dist/assets/troff-wAsdV37c.js +1 -0
- package/packages/web/dist/assets/ttcn-CfJYG6tj.js +1 -0
- package/packages/web/dist/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/packages/web/dist/assets/turtle-B1tBg_DP.js +1 -0
- package/packages/web/dist/assets/vb-CmGdzxic.js +1 -0
- package/packages/web/dist/assets/vbscript-BuJXcnF6.js +1 -0
- package/packages/web/dist/assets/velocity-D8B20fx6.js +1 -0
- package/packages/web/dist/assets/verilog-C6RDOZhf.js +1 -0
- package/packages/web/dist/assets/vhdl-lSbBsy5d.js +1 -0
- package/packages/web/dist/assets/webidl-ZXfAyPTL.js +1 -0
- package/packages/web/dist/assets/xquery-CQfU5ijd.js +1 -0
- package/packages/web/dist/assets/yacas-BJ4BC0dw.js +1 -0
- package/packages/web/dist/assets/z80-Hz9HOZM7.js +1 -0
- package/packages/web/dist/favicon.png +0 -0
- package/packages/web/dist/index.html +17 -0
- package/packages/web/dist/logo.png +0 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BhWX8AfE.js","assets/index-CVOJVSsC.js","assets/index-gmCCsCQ1.css","assets/SessionDetailView-BQbPg-RJ.js","assets/sessions-D681M81k.js","assets/ApiClient-Dbs1H78V.js","assets/settings-D0evez2V.js","assets/projects-DbBQQH-V.js","assets/EffortLevelSelector-DPofLvm-.js","assets/EffortLevelSelector-BQaQmU2d.css","assets/SessionLogStream-B-FwUMJQ.js","assets/commandButtons-DNSHH8IA.js","assets/SessionLogStream-zPUTiGbe.css","assets/ArchiveConfirmModal-CCxSZ52u.js","assets/ModelSelector-BBn_Ve0D.js","assets/providers-ceCc4xRU.js","assets/ModelSelector-DPPD-92R.css","assets/SlashCommandWizard-BgaOw9W3.js","assets/SlashCommandWizard-BB30cSvo.css","assets/ArchiveConfirmModal-CQZeuYBz.css","assets/QuickResponseSettings-B2eVAtHW.js","assets/QuickResponseSettings-B8188A1D.css","assets/QuickResponsesPanel-lU8pW2B0.js","assets/QuickResponsesPanel-DIBQFj0W.css","assets/ResizableTextarea-DSy1mWGY.js","assets/ResizableTextarea-B5nAA0RV.css","assets/SessionDetailView-BrMG4p2-.css","assets/index-BqXoPf_D.js","assets/index-yh0ZHIWw.js","assets/index-CKYk-fkb.js","assets/index-Bi3XvF_f.js","assets/index-wqgejMCM.js","assets/index-CAuTOZSD.js","assets/index-DrlQi03X.js","assets/index-CXK2Z3_z.js","assets/index-DQkhDeTA.js","assets/index-DkVb9W_J.js","assets/index-CpsfI08O.js","assets/index-CYllQ3Vd.js","assets/index-prTEzzgO.js","assets/index-BZlHgDSz.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DukmZTjD.js","assets/javascript-qCveANmP.js","assets/index-DmKHPbIa.js","assets/index-DWP8iCBp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var T0=Object.defineProperty;var Cc=i=>{throw TypeError(i)};var C0=(i,e,t)=>e in i?T0(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ve=(i,e,t)=>C0(i,typeof e!="symbol"?e+"":e,t),Ol=(i,e,t)=>e.has(i)||Cc("Cannot "+t);var S=(i,e,t)=>(Ol(i,e,"read from private field"),t?t.call(i):e.get(i)),pe=(i,e,t)=>e.has(i)?Cc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ne=(i,e,t,n)=>(Ol(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),K=(i,e,t)=>(Ol(i,e,"access private method"),t);var xs=(i,e,t,n)=>({set _(r){ne(i,e,r,t)},get _(){return S(i,e,n)}});import{a4 as ie,a0 as P,d as w,m as le,o as Ee,N as $i,a5 as qr,y as zt,l as he,F as ds,x as ke,a6 as qi,X as Me,a7 as A0,a8 as qn,I as Dt,$ as ua,V as _0,a9 as E0,P as L,aa as L0}from"./index-CVOJVSsC.js";import{M as R0}from"./SessionDetailView-BQbPg-RJ.js";const M0=i=>{const e=typeof i;return e!=="function"&&e!=="object"||i===null},Z0=i=>{const e=i.flags===""?void 0:i.flags;return new RegExp(i.source,e)},kr=(i,e=new WeakMap)=>{if(i===null||M0(i))return i;if(e.has(i))return e.get(i);if(i instanceof RegExp)return Z0(i);if(i instanceof Date)return new Date(i.getTime());if(i instanceof Function)return i;if(i instanceof Map){const n=new Map;return e.set(i,n),i.forEach((r,s)=>{n.set(s,kr(r,e))}),n}if(i instanceof Set){const n=new Set;e.set(i,n);for(const r of i)n.add(kr(r,e));return n}if(Array.isArray(i)){const n=[];return e.set(i,n),i.forEach(r=>{n.push(kr(r,e))}),n}const t={};e.set(i,t);for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=kr(i[n],e));return t},Df=(i,e=200)=>{let t=0;return(...n)=>new Promise(r=>{t&&(clearTimeout(t),r("cancel")),t=window.setTimeout(()=>{i.apply(void 0,n),t=0,r("done")},e)})},X0=(i,e={_blank:!0,nofollow:!0})=>{const t=document.createElement("a");t.href=i,e._blank&&(t.target="_blank"),e.nofollow&&(t.rel="noopener noreferrer"),t.click()},vh=()=>{let i=-1;return(e,t,n,r=100)=>{const s=()=>{n&&(typeof r=="number"?setTimeout(n,r):n())};i!==-1&&(cancelAnimationFrame(i),s());let o=e.scrollTop;const l=()=>{i=-1;const a=t-o;o=o+a/5,Math.abs(a)<1?(e.scrollTo(0,t),s()):(e.scrollTo(0,o),i=requestAnimationFrame(l))};i=requestAnimationFrame(l)}},I0=(i,e=200)=>{let t=0,n=null;const r=s=>{t===0&&(t=s),s-t>=e?(i.apply(void 0,n),n=null,t=0):window.requestAnimationFrame(r)};return(...s)=>{n===null&&window.requestAnimationFrame(r),n=s}},z0=i=>{const e=t=>{const{scrollHeight:n,scrollWidth:r,offsetHeight:s,offsetWidth:o,scrollLeft:l,scrollTop:a}=i,h=t.x,c=t.y,u=f=>{const p=a+c-f.y,m=l+h-f.x,O=n-s,g=r-o,b={};m>=0&&m<=g&&(b.left=m),p>=0&&p<=O&&(b.top=p),i.scroll(b)};document.addEventListener("mousemove",u);const d=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d)};document.addEventListener("mouseup",d)};return i.addEventListener("mousedown",e),()=>{i.removeEventListener("mousedown",e)}},da=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,mo=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),Uo=(i,e,t={})=>{if(Array.isArray(i)&&Array.isArray(e))return fa(i,e,t);const{excludeKeys:n}=t;for(const r in e){const s=e[r],o=i[r];n&&n(r)?i[r]=s:Array.isArray(s)&&Array.isArray(o)?i[r]=fa(o,s,t):mo(s)&&mo(o)?i[r]=Uo(o,s,t):i[r]=s}return i},fa=(i,e,t)=>{const n=i.slice();return e.forEach((r,s)=>{const o=n[s];Array.isArray(r)&&Array.isArray(o)?n[s]=fa(o,r,t):mo(r)&&mo(o)?n[s]=Uo(o,r,t):n[s]=r}),n},v="md-editor",V0="MdEditor",Pe="https://unpkg.com",D0=`${Pe}/@highlightjs/cdn-assets@11.11.1/highlight.min.js`,Ac={main:`${Pe}/prettier@3.8.1/standalone.js`,markdown:`${Pe}/prettier@3.8.1/plugins/markdown.js`},B0={css:`${Pe}/cropperjs@1.6.2/dist/cropper.min.css`,js:`${Pe}/cropperjs@1.6.2/dist/cropper.min.js`},q0=`${Pe}/screenfull@5.2.0/dist/screenfull.js`,j0=`${Pe}/mermaid@11.12.3/dist/mermaid.min.js`,W0={js:`${Pe}/katex@0.16.33/dist/katex.min.js`,css:`${Pe}/katex@0.16.33/dist/katex.min.css`},pa={a11y:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/a11y-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/a11y-dark.min.css`},atom:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/atom-one-dark.min.css`},github:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/github.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/github-dark.min.css`},gradient:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/gradient-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/gradient-dark.min.css`},kimbie:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/kimbie-dark.min.css`},paraiso:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/paraiso-dark.min.css`},qtcreator:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.11.1/styles/stackoverflow-dark.min.css`}},Y0=`${Pe}/echarts@6.0.0/dist/echarts.min.js`,N0={highlight:{js:{integrity:"sha384-RH2xi4eIQ/gjtbs9fUXM68sLSi99C7ZWBRX1vDrVv6GQXRibxXLbwO2NGZB74MbU",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-Q+dEbdxfNurK4ryC0T77wU8G3EYhxdAierqqKOppGHnJ4e/85wVnMXDNWbaYYghP",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-UGdkYlLyq47VQhe9mHyNzuPhBTL9GA9YO5Vb0sXf2fnMYGuSMGAbZ8upsQj1+u4O",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-jrOgQzBlDeUNdmQn3rUt/PZD+pdcRBdWd/HWRqRo+n2OR2QtGyjSaJC0GiCeH+ir",crossOrigin:"anonymous"},css:{integrity:"sha384-6LFfkTKLRlzFtgx8xsWyBdKGpcMMQTkv+dB7rAbugeJAu1Ym2q1Aji1cjHBG12Xh",crossOrigin:"anonymous"}},screenfull:{js:{integrity:"sha384-Qfbv8upMDu/ikv42M0Jnym2hahbDQ77Nm8PGU0G+iA6UIwt1+scE6P1qKXA0anWU",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-jFhLSLFn4m565eRAS0CDMWubMqOtfZWWbE8kqgGdU+VHbJ3B2G/4X8u+0BM8MtdU",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-YPHNAPyrxGS8BNnA7Q4ommqra8WQPEjooVSLzFgwgs8OXJBvadbyvx4QpfiFurGr",crossOrigin:"anonymous"},css:{integrity:"sha384-fgYS3VC1089n2J3rVcEbXDHlnDLQ9B2Y1hvpQ720q1NvxCduQqT4JoGc4u2QCnzE",crossOrigin:"anonymous"}},echarts:{js:{integrity:"sha384-F07Cpw5v8spSU0H113F33m2NQQ/o6GqPTnTjf45ssG4Q6q58ZwhxBiQtIaqvnSpR",crossOrigin:"anonymous"}}},yh=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],kh=["markdownTotal","=","scrollSwitch"],Oo={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Image Link",upload:"Upload Images",clip2upload:"Crop And Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},ze={editorExtensions:{highlight:{js:D0,css:pa},prettier:{standaloneJs:Ac.main,parserMarkdownJs:Ac.markdown},cropper:{...B0},screenfull:{js:q0},mermaid:{js:j0,enableZoom:!0},katex:{...W0},echarts:{js:Y0}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:i=>i,markdownItConfig:()=>{},markdownItPlugins:i=>i,mermaidConfig:i=>i,katexConfig:i=>i,echartsConfig:i=>i},G0=i=>Uo(ze,i,{excludeKeys(e){return/[iI]{1}nstance/.test(e)}}),ws=.1,at=({instance:i,ctx:e,props:t={}},n="default")=>{const r=(i==null?void 0:i.$slots[n])||(e==null?void 0:e.slots[n]);return(r?r(i):"")||t[n]},F0={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"},disabled:{type:Boolean,default:void 0}},rr=ie({name:`${v}-dropdown`,props:F0,setup(i,e){const t=`${v}-dropdown-hidden`,n=zt({overlayClass:[t],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=he(),s=he(),o=()=>{var k,$;if(i.disabled)return!1;n.triggerHover=!0;const c=r.value,u=s.value;if(!c||!u)return;const d=c.getBoundingClientRect(),f=c.offsetTop,p=c.offsetLeft,m=d.height,O=d.width,g=c.getRootNode(),b=((k=g.querySelector(i.relative))==null?void 0:k.scrollLeft)||0,Q=(($=g.querySelector(i.relative))==null?void 0:$.clientWidth)||0;let x=p-u.offsetWidth/2+O/2-b;x+u.offsetWidth>b+Q&&(x=b+Q-u.offsetWidth),x<0&&(x=0),n.overlayStyle={...n.overlayStyle,insetBlockStart:f+m+"px",insetInlineStart:x+"px"},i.onChange(!0)},l=()=>{if(i.disabled)return!1;n.overlayHover=!0};le(()=>i.visible,c=>{c?n.overlayClass=n.overlayClass.filter(u=>u!==t):n.overlayClass.push(t)});let a=-1;const h=c=>{r.value===c.target?n.triggerHover=!1:n.overlayHover=!1,clearTimeout(a),a=window.setTimeout(()=>{!n.overlayHover&&!n.triggerHover&&i.onChange(!1)},10)};return Ee(()=>{r.value.addEventListener("mouseenter",o),r.value.addEventListener("mouseleave",h),s.value.addEventListener("mouseenter",l),s.value.addEventListener("mouseleave",h)}),$i(()=>{r.value.removeEventListener("mouseenter",o),r.value.removeEventListener("mouseleave",h),s.value.removeEventListener("mouseenter",l),s.value.removeEventListener("mouseleave",h)}),()=>{const c=at({ctx:e}),u=at({props:i,ctx:e},"overlay"),d=qr(c instanceof Array?c[0]:c,{ref:r,key:"cloned-dropdown-trigger"}),f=w("div",{class:[`${v}-dropdown`,n.overlayClass],style:n.overlayStyle,ref:s},[w("div",{class:`${v}-dropdown-overlay`},[u instanceof Array?u[0]:u])]);return[d,f]}}}),U0={title:{type:String,default:""},visible:{type:Boolean,default:void 0},trigger:{type:[String,Object],default:void 0},onChange:{type:Function,default:void 0},overlay:{type:[String,Object],default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},Tr=ie({name:"DropdownToolbar",props:U0,emits:["onChange"],setup(i,e){const t=P("editorId"),n=r=>{var s;(s=i.onChange)==null||s.call(i,r),e.emit("onChange",r)};return()=>{const r=at({props:i,ctx:e},"trigger"),s=at({props:i,ctx:e},"overlay"),o=at({props:i,ctx:e});return w(rr,{relative:`#${t}-toolbar-wrapper`,visible:i.visible,onChange:n,overlay:s,disabled:i.disabled},{default:()=>[w("button",{class:[`${v}-toolbar-item`,i.disabled&&`${v}-disabled`],title:i.title||"",disabled:i.disabled,type:"button"},[o||r])]})}}});Tr.install=i=>(i.component(Tr.name,Tr),i);const Ho="onSave",Sh="changeCatalogVisible",Bf="changeFullscreen",_c="pageFullscreenChanged",Ec="fullscreenChanged",Lc="previewChanged",Rc="previewOnlyChanged",Mc="htmlPreviewChanged",Zc="catalogVisibleChanged",Ks="buildFinished",Oi="errorCatcher",re="replace",Ko="uploadImage",qf="ctrlZ",jf="ctrlShiftZ",Cr="catalogChanged",Wf="pushCatalog",xh="rerender",Yf="eventListener",Nf="taskStateChanged",Gf="sendEditorView",go="getEditorView";class H0{constructor(){ve(this,"pools",{})}remove(e,t,n){const r=this.pools[e]&&this.pools[e][t];r&&(this.pools[e][t]=r.filter(s=>s!==n))}clear(e){this.pools[e]={}}on(e,t){return this.pools[e]||(this.pools[e]={}),this.pools[e][t.name]||(this.pools[e][t.name]=[]),this.pools[e][t.name].push(t.callback),this.pools[e][t.name].includes(t.callback)}emit(e,t,...n){this.pools[e]||(this.pools[e]={});const r=this.pools[e][t];r&&r.forEach(s=>{try{s(...n)}catch(o){console.error(`${t} monitor event exception!`,o)}})}}const X=new H0,K0=(i,e="image.png")=>{const t=i.split(","),n=t[0].match(/:(.*?);/);if(n){const r=n[1],s=atob(t[1]);let o=s.length;const l=new Uint8Array(o);for(;o--;)l[o]=s.charCodeAt(o);return new File([l],e,{type:r})}return null},J0=(i,e)=>{if(!i)return i;const t=e.split(`
|
|
3
|
+
`),n=['<span rn-wrapper aria-hidden="true">'];return t.forEach(()=>{n.push("<span></span>")}),n.push("</span>"),`<span class="${v}-code-block">${i}</span>${n.join("")}`},eb=(i,e)=>{if(!i||!e)return 0;const t=i==null?void 0:i.getBoundingClientRect();if(e===document.documentElement)return t.top-e.clientTop;const n=e==null?void 0:e.getBoundingClientRect();return t.top-n.top},Xc=(()=>{let i=0;return()=>++i})(),tb=`.${v}-preview > [data-line]`,en=(i,e)=>+getComputedStyle(i).getPropertyValue(e).replace("px",""),ib=(i,e)=>{const t=Df(()=>{i.removeEventListener("scroll",n),i.addEventListener("scroll",n),e.removeEventListener("scroll",n),e.addEventListener("scroll",n)},50),n=r=>{const s=i.clientHeight,o=e.clientHeight,l=i.scrollHeight,a=e.scrollHeight,h=(l-s)/(a-o);r.target===i?(e.removeEventListener("scroll",n),e.scrollTo({top:i.scrollTop/h}),t()):(i.removeEventListener("scroll",n),i.scrollTo({top:e.scrollTop*h}),t())};return[()=>{t().finally(()=>{i.dispatchEvent(new Event("scroll"))})},()=>{i.removeEventListener("scroll",n),e.removeEventListener("scroll",n)}]},nb=(i,e,t)=>{const{view:n}=t,r=vh(),s=g=>n.lineBlockAt(n.state.doc.line(g+1).from).top,o=g=>n.lineBlockAt(n.state.doc.line(g+1).from).bottom;let l=[],a=[],h=[];const c=()=>{l=[],a=Array.from(e.querySelectorAll(tb)),h=a.map(k=>Number(k.dataset.line));const g=[...h],{lines:b}=n.state.doc;let Q=g.shift()||0,x=g.shift()||b;for(let k=0;k<b;k++)k===x&&(Q=k,x=g.shift()||b),l.push({start:Q,end:x-1})},u=(g,b)=>{let Q=1;for(let x=a.length-1;x-1>=0;x--){const k=a[x],$=a[x-1];if(k.offsetTop+k.offsetHeight>b&&$.offsetTop<b){Q=Number($.dataset.line);break}}for(let x=l.length-1;x>=0;x--){const k=o(l[x].end),$=s(l[x].start);if(k>g&&$<=g){Q=Q<l[x].start?Q:l[x].start;break}}return Q};let d=0,f=0;const p=()=>{var V,E,H;if(f!==0)return!1;d++;const{scrollDOM:g,contentHeight:b}=n;let Q=en(e,"padding-block-start");const x=n.lineBlockAtHeight(g.scrollTop),{number:k}=n.state.doc.lineAt(x.from),$=l[k-1];if(!$)return!1;let C=1;const T=e.querySelector(`[data-line="${$.start}"]`)||((V=e.firstElementChild)==null?void 0:V.firstElementChild),A=e.querySelector(`[data-line="${$.end+1}"]`)||((E=e.lastElementChild)==null?void 0:E.lastElementChild),M=g.scrollHeight-g.clientHeight,B=e.scrollHeight-e.clientHeight;let R=s($.start),D=o($.end),q=T.offsetTop,G=A.offsetTop-q;R===0&&(q=0,T===A?(Q=0,D=b-g.offsetHeight,G=B):G=A.offsetTop),C=(g.scrollTop-R)/(D-R);const I=A==((H=e.lastElementChild)==null?void 0:H.lastElementChild)?A.offsetTop+A.clientHeight:A.offsetTop;if(D>=M||I>B){const se=u(M,B);R=s(se),C=(g.scrollTop-R)/(M-R);const ee=e.querySelector(`[data-line="${se}"]`);R>0&&ee&&(q=ee.offsetTop),G=B-q+en(e,"padding-block-start")}const W=q-Q+G*C;r(e,W,()=>{d--})},m=()=>{var I,W,V,E,H,se;if(d!==0)return;f++;const{scrollDOM:g}=n,b=e.scrollTop,Q=e.scrollHeight,x=g.scrollHeight-g.clientHeight,k=e.scrollHeight-e.clientHeight;let $=(I=e.firstElementChild)==null?void 0:I.firstElementChild,C=(W=e.firstElementChild)==null?void 0:W.lastElementChild;if(h.length>0){let ee=Math.ceil(h[h.length-1]*(b/Q)),oe=h.findLastIndex(ue=>ue<=ee);oe=oe===-1?0:oe,ee=h[oe];for(let ue=oe;ue>=0&&ue<h.length;)if(a[ue].offsetTop>b){if(ue-1>=0){ue--;continue}ee=-1,oe=ue;break}else{if(ue+1<h.length&&a[ue+1].offsetTop<b){ue++;continue}ee=h[ue],oe=ue;break}switch(oe){case-1:{$=(V=e.firstElementChild)==null?void 0:V.firstElementChild,C=a[oe];break}case h.length-1:{$=a[oe],C=(E=e.firstElementChild)==null?void 0:E.lastElementChild;break}default:$=a[oe],C=a[oe+1===a.length?oe:oe+1]}}let T=$===((H=e.firstElementChild)==null?void 0:H.firstElementChild)?0:$.offsetTop-en($,"margin-block-start"),A=C.offsetTop,M=0;const{start:B,end:R}=l[Number($.dataset.line||0)];let D=s(B);const q=s(R+1===n.state.doc.lines?R:R+1);let G=0;if(q>x||C.offsetTop+C.offsetHeight>k){const ee=u(x,k),oe=e.querySelector(`[data-line="${ee}"]`);T=oe?oe.offsetTop-en(oe,"margin-block-start"):T,D=s(ee),M=(b-T)/(k-T),G=x-D}else $===((se=e.firstElementChild)==null?void 0:se.firstElementChild)?($===C&&(A=C.offsetTop+C.offsetHeight+en(C,"margin-block-end")),G=q,M=Math.max(b/A,0)):(M=Math.max((b-T)/(A-T),0),G=q-D);r(i,D+G*M,()=>{f--})},O=g=>{var k;const{scrollDOM:b,contentHeight:Q}=n,x=b.clientHeight;if(Q<=x||e.firstElementChild.clientHeight<=e.clientHeight||n.state.doc.lines<=((k=l[l.length-1])==null?void 0:k.end))return!1;g.target===i?p():m()};return[()=>{c(),i.addEventListener("scroll",O),e.addEventListener("scroll",O),i.dispatchEvent(new Event("scroll"))},()=>{i.removeEventListener("scroll",O),e.removeEventListener("scroll",O)}]},rb={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},Ff=ie({props:rb,setup(i){const e=P("scrollElementRef"),t=P("roorNodeRef"),n=he();le(()=>i.tocItem.active,s=>{s&&i.onActive(i.tocItem,n.value)}),Ee(()=>{i.tocItem.active&&i.onActive(i.tocItem,n.value)});const r=s=>{if(s.stopPropagation(),i.onClick(s,i.tocItem),s.defaultPrevented)return;const o=i.mdHeadingId({text:i.tocItem.text,level:i.tocItem.level,index:i.tocItem.index,currentToken:i.tocItem.currentToken,nextToken:i.tocItem.nextToken}),l=t.value.getElementById(o),a=e.value;if(l&&a){let h=l.offsetParent,c=l.offsetTop;if(a.contains(h))for(;h&&a!=h;)c+=h==null?void 0:h.offsetTop,h=h==null?void 0:h.offsetParent;const u=l.previousElementSibling;let d=0;u||(d=en(l,"margin-block-start")),a==null||a.scrollTo({top:c-i.scrollElementOffsetTop-d,behavior:"smooth"})}};return()=>w("div",{ref:n,class:[`${v}-catalog-link`,i.tocItem.active&&`${v}-catalog-active`],onClick:r},[w("span",{title:i.tocItem.text},[i.tocItem.text]),i.tocItem.children&&i.tocItem.children.length>0&&w("div",{class:`${v}-catalog-wrapper`},[i.tocItem.children.map(s=>w(Ff,{mdHeadingId:i.mdHeadingId,key:`${i.tocItem.text}-link-${s.level}-${s.text}`,tocItem:s,onActive:i.onActive,onClick:i.onClick,scrollElementOffsetTop:i.scrollElementOffsetTop},null))])])}}),sb={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:({text:i})=>i},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},Pn=ie({name:"MdCatalog",props:sb,emits:["onClick","onActive"],setup(i,e){const t=i.editorId,n=`#${t}-preview-wrapper`,r=zt({list:[],show:!1,scrollElement:i.scrollElement||n}),s=qi(),o=he(),l=he(),a=he(),h=he(),c=qi(),u=he({});Me("scrollElementRef",l),Me("roorNodeRef",h);const d=ke(()=>{const x=[];return r.list.forEach((k,$)=>{if(i.catalogMaxDepth&&k.level>i.catalogMaxDepth)return;const{text:C,level:T,line:A}=k,M={level:T,text:C,line:A,index:$+1,active:s.value===k};if(x.length===0)x.push(M);else{let B=x[x.length-1];if(M.level>B.level)for(let R=B.level+1;R<=6;R++){const{children:D}=B;if(!D){B.children=[M];break}if(B=D[D.length-1],M.level<=B.level){D.push(M);break}}else x.push(M)}}),x}),f=()=>{var k;if(r.scrollElement instanceof HTMLElement)return r.scrollElement;let x=document;return(r.scrollElement===n||i.isScrollElementInShadow)&&(x=(k=o.value)==null?void 0:k.getRootNode()),x.querySelector(r.scrollElement)},p=x=>{if(x.length===0)return s.value=void 0,r.list=[],!1;const{activeHead:k,activeIndex:$}=x.reduce((A,M,B)=>{var D;let R=0;if(i.syncWith==="preview"){const q=(D=h.value)==null?void 0:D.getElementById(i.mdHeadingId({text:M.text,level:M.level,index:B+1,currentToken:M.currentToken,nextToken:M.nextToken}));q instanceof HTMLElement&&(R=eb(q,l.value))}else{const q=c.value;if(q){const G=q.lineBlockAt(q.state.doc.line(M.line+1).from).top,I=q.scrollDOM.scrollTop;R=G-I}}return R<i.offsetTop&&R>A.minTop?{activeHead:M,activeIndex:B,minTop:R}:A},{activeHead:x[0],activeIndex:0,minTop:Number.MIN_SAFE_INTEGER});let C=k;const{catalogMaxDepth:T}=i;if(T&&C.level>T){for(let A=$;A>=0;A--){const M=x[A];if(M.level<=T){C=M;break}}if(C.level>T){const A=x.find(M=>M.level<=T);A&&(C=A)}}s.value=C,r.list=x},m=(x,k)=>{var $;u.value.top=k.offsetTop+en(k,"padding-block-start")+"px",($=i.onActive)==null||$.call(i,x,k),e.emit("onActive",x,k)},O=()=>{p(r.list)},g=x=>{var k,$,C;if((k=a.value)==null||k.removeEventListener("scroll",O),i.syncWith==="editor")a.value=($=c.value)==null?void 0:$.scrollDOM;else{const T=f();l.value=T,a.value=T===document.documentElement?document:T}p(x),(C=a.value)==null||C.addEventListener("scroll",O)},b=x=>{c.value=x};le([()=>i.syncWith,c,()=>i.catalogMaxDepth],()=>{g(r.list)}),Ee(()=>{h.value=o.value.getRootNode(),X.on(t,{name:Cr,callback:g}),X.on(t,{name:go,callback:b}),X.emit(t,Wf),X.emit(t,Gf)}),$i(()=>{var x;X.remove(t,Cr,g),X.remove(t,go,b),(x=a.value)==null||x.removeEventListener("scroll",O)});const Q=(x,k)=>{var $;($=i.onClick)==null||$.call(i,x,k),e.emit("onClick",x,k)};return()=>w("div",{class:[`${v}-catalog`,i.theme==="dark"&&`${v}-catalog-dark`,i.class||""],ref:o},[d.value.length>0&&w(ds,null,[w("div",{class:`${v}-catalog-indicator`,style:u.value},null),w("div",{class:`${v}-catalog-container`},[d.value.map(x=>w(Ff,{mdHeadingId:i.mdHeadingId,tocItem:x,key:`link-${x.level}-${x.text}`,onActive:m,onClick:Q,scrollElementOffsetTop:i.scrollElementOffsetTop},null))])])])}});Pn.install=i=>(i.component(Pn.name,Pn),i);async function Uf(i){if(typeof i=="string"){if(window.isSecureContext&&navigator.clipboard)return await navigator.clipboard.writeText(i);{const e=document.createElement("textarea");let t=!1;if(e.value=i,e.style.position="fixed",e.style.opacity=0,e.style.zIndex="-10000",e.style.top="-10000",document.body.appendChild(e),e.select(),t=document.execCommand("copy"),document.body.removeChild(e),t)return;throw new Error('Failed to copy content via "execCommand"!')}}}const ob={copy:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy ${v}-icon"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,"collapse-tips":`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-chevron-left ${v}-icon"><circle cx="12" cy="12" r="10"/><path d="m14 16-4-4 4-4"/></svg>`,pin:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pin ${v}-icon"><path d="M12 17v5"/><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"/></svg>`,"pin-off":`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pin-off ${v}-icon"><path d="M12 17v5"/><path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89"/><path d="m2 2 20 20"/><path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11"/></svg>`,check:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check ${v}-icon"><path d="M20 6 9 17l-5-5"/></svg>`},Kt=(i,e)=>typeof e[i]=="string"?e[i]:ob[i],Ic=(i,e)=>{const t=n=>{const r=i.parentElement||document.body,s=r.offsetWidth,o=r.offsetHeight,{clientWidth:l,clientHeight:a}=document.documentElement,h=n.offsetX,c=n.offsetY,u=f=>{let p=f.x+document.body.scrollLeft-document.body.clientLeft-h,m=f.y+document.body.scrollTop-document.body.clientTop-c;p=p<1?1:p<l-s-1?p:l-s-1,m=m<1?1:m<a-o-1?m:a-o-1,e?e(p,m):(r.style.left=`${p}px`,r.style.top=`${m}px`)};document.addEventListener("mousemove",u);const d=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d)};document.addEventListener("mouseup",d)};return i.addEventListener("mousedown",t),()=>{i.removeEventListener("mousedown",t)}},Tt=(i,e,t="")=>{var r;const n=document.getElementById(e.id);if(n)t!==""&&(Reflect.get(window,t)?(r=e.onload)==null||r.call(n,new Event("load")):e.onload&&n.addEventListener("load",e.onload));else{const s={...e};s.onload=null;const o=ab(i,s);e.onload&&o.addEventListener("load",e.onload),document.head.appendChild(o)}},lb=(i,e)=>{var t;(t=document.getElementById(e.id))==null||t.remove(),Tt(i,e)},ab=(i,e)=>{const t=document.createElement(i);return Object.keys(e).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t},hb=(i,e)=>{const t=new Map;return i==null||i.forEach(n=>{let r=n.querySelector(`.${v}-mermaid-action`);r?r.querySelector(`.${v}-mermaid-copy`)||r.insertAdjacentHTML("beforeend",`<span class="${v}-mermaid-copy">${Kt("copy",e.customIcon)}</span>`):(n.insertAdjacentHTML("beforeend",`<div class="${v}-mermaid-action"><span class="${v}-mermaid-copy">${Kt("copy",e.customIcon)}</span></div>`),r=n.querySelector(`.${v}-mermaid-action`));const s=r.querySelector(`.${v}-mermaid-copy`);let o=-1;const l=()=>{clearTimeout(o),Uf(n.dataset.content||"").then(()=>{s.innerHTML=Kt("check",e.customIcon)}).catch(()=>{s.innerHTML=Kt("copy",e.customIcon)}).finally(()=>{o=window.setTimeout(()=>{s.innerHTML=Kt("copy",e.customIcon)},1500)})};s.addEventListener("click",l),t.set(n,{removeClick:()=>{s.removeEventListener("click",l)}})}),()=>{t.forEach(({removeClick:n})=>{n==null||n()}),t.clear()}},cb=(()=>{const i=e=>{if(!e)return()=>{};const t=e.firstChild;let n=1,r=0,s=0,o=!1,l,a,h,c=1;const u=()=>{t.style.transform=`translate(${r}px, ${s}px) scale(${n})`},d=x=>{x.touches.length===1?(o=!0,l=x.touches[0].clientX-r,a=x.touches[0].clientY-s):x.touches.length===2&&(h=Math.hypot(x.touches[0].clientX-x.touches[1].clientX,x.touches[0].clientY-x.touches[1].clientY),c=n)},f=x=>{if(x.preventDefault(),o&&x.touches.length===1)r=x.touches[0].clientX-l,s=x.touches[0].clientY-a,u();else if(x.touches.length===2){const k=Math.hypot(x.touches[0].clientX-x.touches[1].clientX,x.touches[0].clientY-x.touches[1].clientY)/h,$=n;n=c*(1+(k-1));const C=(x.touches[0].clientX+x.touches[1].clientX)/2,T=(x.touches[0].clientY+x.touches[1].clientY)/2,A=t.getBoundingClientRect(),M=(C-A.left)/$,B=(T-A.top)/$;r-=M*(n-$),s-=B*(n-$),u()}},p=()=>{o=!1},m=x=>{x.preventDefault();const k=.02,$=n;x.deltaY<0?n+=k:n=Math.max(.1,n-k);const C=t.getBoundingClientRect(),T=x.clientX-C.left,A=x.clientY-C.top;r-=T/$*(n-$),s-=A/$*(n-$),u()},O=x=>{o=!0,l=x.clientX-r,a=x.clientY-s},g=x=>{o&&(r=x.clientX-l,s=x.clientY-a,u())},b=()=>{o=!1},Q=()=>{o=!1};return e.addEventListener("touchstart",d,{passive:!1}),e.addEventListener("touchmove",f,{passive:!1}),e.addEventListener("touchend",p),e.addEventListener("wheel",m,{passive:!1}),e.addEventListener("mousedown",O),e.addEventListener("mousemove",g),e.addEventListener("mouseup",b),e.addEventListener("mouseleave",Q),()=>{e.removeEventListener("touchstart",d),e.removeEventListener("touchmove",f),e.removeEventListener("touchend",p),e.removeEventListener("wheel",m),e.removeEventListener("mousedown",O),e.removeEventListener("mousemove",g),e.removeEventListener("mouseup",b),e.removeEventListener("mouseleave",Q)}};return(e,t)=>{const n=new Map;return e==null||e.forEach(r=>{let s=r.querySelector(`.${v}-mermaid-action`);s?s.querySelector(`.${v}-mermaid-zoom`)||s.insertAdjacentHTML("beforeend",`<span class="${v}-mermaid-zoom">${Kt("pin-off",t.customIcon)}</span>`):(r.insertAdjacentHTML("beforeend",`<div class="${v}-mermaid-action"><span class="${v}-mermaid-zoom">${Kt("pin-off",t.customIcon)}</span></div>`),s=r.querySelector(`.${v}-mermaid-action`));const o=s.querySelector(`.${v}-mermaid-zoom`),l=()=>{const a=n.get(r);if(a!=null&&a.removeEvent)a.removeEvent(),r.removeAttribute("data-grab"),n.set(r,{removeClick:a.removeClick}),o.innerHTML=Kt("pin-off",t.customIcon);else{const h=i(r);r.setAttribute("data-grab",""),n.set(r,{removeEvent:h,removeClick:a==null?void 0:a.removeClick}),o.innerHTML=Kt("pin",t.customIcon)}};o.addEventListener("click",l),n.set(r,{removeClick:()=>o.removeEventListener("click",l)})}),()=>{n.forEach(({removeEvent:r,removeClick:s})=>{r==null||r(),s==null||s()}),n.clear()}}})(),zc=new Set([!0,!1,"alt","title"]);function Hf(i,e){return(Array.isArray(i)?i:[]).filter(([t])=>t!==e)}function Kf(i,e){i&&i.attrs&&(i.attrs=Hf(i.attrs,e))}function ub(i,e){if(!zc.has(i))throw new TypeError(`figcaption must be one of: ${[...zc]}.`);if(i==="alt")return e.content;const t=e.attrs.find(([n])=>n==="title");return Array.isArray(t)&&t[1]?(Kf(e,"title"),t[1]):void 0}function db(i,e){e=e||{},i.core.ruler.before("linkify","image_figures",function(t){let n=1;for(let r=1,s=t.tokens.length;r<s-1;++r){const o=t.tokens[r];if(o.type!=="inline"||!o.children||o.children.length!==1&&o.children.length!==3||o.children.length===1&&o.children[0].type!=="image")continue;if(o.children.length===3){const[h,c,u]=o.children;if(h.type!=="link_open"||c.type!=="image"||u.type!=="link_close")continue}if(r!==0&&t.tokens[r-1].type!=="paragraph_open"||r!==s-1&&t.tokens[r+1].type!=="paragraph_close")continue;const l=t.tokens[r-1];let a;if(l.type="figure_open",l.tag="figure",t.tokens[r+1].type="figure_close",t.tokens[r+1].tag="figure",e.dataType&&t.tokens[r-1].attrPush(["data-type","image"]),e.link&&o.children.length===1){[a]=o.children;const h=new t.Token("link_open","a",1);h.attrPush(["href",a.attrGet("src")]),o.children.unshift(h),o.children.push(new t.Token("link_close","a",-1))}if(a=o.children.length===1?o.children[0]:o.children[1],e.figcaption){const h=ub(e.figcaption,a);if(h){const[c]=i.parseInline(h,t.env);o.children.push(new t.Token("figcaption_open","figcaption",1)),o.children.push(...c.children),o.children.push(new t.Token("figcaption_close","figcaption",-1)),a.attrs&&(a.attrs=Hf(a.attrs,"title"))}}if(e.copyAttrs&&a.attrs){const h=e.copyAttrs===!0?"":e.copyAttrs;l.attrs=a.attrs.filter(([c])=>c.match(h)).map(c=>Array.from(c))}if(e.tabindex&&(t.tokens[r-1].attrPush(["tabindex",n]),n++),e.lazy&&(a.attrs.some(([h])=>h==="loading")||a.attrs.push(["loading","lazy"])),e.async&&(a.attrs.some(([h])=>h==="decoding")||a.attrs.push(["decoding","async"])),e.classes&&typeof e.classes=="string"){let h=!1;for(let c=0,u=a.attrs.length;c<u&&!h;c++){const d=a.attrs[c];d[0]==="class"&&(d[1]=`${d[1]} ${e.classes}`,h=!0)}h||a.attrs.push(["class",e.classes])}if(e.removeSrc){const h=a.attrs.find(([c])=>c==="src");a.attrs.push(["data-src",h[1]]),Kf(a,"src")}}})}const fb=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function pb(i,e){const t=i.posMax,n=i.pos;if(i.src.charCodeAt(n)!==126||e||n+2>=t)return!1;i.pos=n+1;let r=!1;for(;i.pos<t;){if(i.src.charCodeAt(i.pos)===126){r=!0;break}i.md.inline.skipToken(i)}if(!r||n+1===i.pos)return i.pos=n,!1;const s=i.src.slice(n+1,i.pos);if(s.match(/(^|[^\\])(\\\\)*\s/))return i.pos=n,!1;i.posMax=i.pos,i.pos=n+1;const o=i.push("sub_open","sub",1);o.markup="~";const l=i.push("text","",0);l.content=s.replace(fb,"$1");const a=i.push("sub_close","sub",-1);return a.markup="~",i.pos=i.posMax+1,i.posMax=t,!0}function mb(i){i.inline.ruler.after("emphasis","sub",pb)}const Ob=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function gb(i,e){const t=i.posMax,n=i.pos;if(i.src.charCodeAt(n)!==94||e||n+2>=t)return!1;i.pos=n+1;let r=!1;for(;i.pos<t;){if(i.src.charCodeAt(i.pos)===94){r=!0;break}i.md.inline.skipToken(i)}if(!r||n+1===i.pos)return i.pos=n,!1;const s=i.src.slice(n+1,i.pos);if(s.match(/(^|[^\\])(\\\\)*\s/))return i.pos=n,!1;i.posMax=i.pos,i.pos=n+1;const o=i.push("sup_open","sup",1);o.markup="^";const l=i.push("text","",0);l.content=s.replace(Ob,"$1");const a=i.push("sup_close","sup",-1);return a.markup="^",i.pos=i.posMax+1,i.posMax=t,!0}function bb(i){i.inline.ruler.after("emphasis","sup",gb)}var vb=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jf=new Set,ma=typeof process=="object"&&process?process:{},ep=(i,e,t,n)=>{typeof ma.emitWarning=="function"?ma.emitWarning(i,e,t,n):console.error(`[${t}] ${e}: ${i}`)},bo=globalThis.AbortController,Vc=globalThis.AbortSignal,If;if(typeof bo>"u"){Vc=class{constructor(){ve(this,"onabort");ve(this,"_onabort",[]);ve(this,"reason");ve(this,"aborted",!1)}addEventListener(t,n){this._onabort.push(n)}},bo=class{constructor(){ve(this,"signal",new Vc);e()}abort(t){var n,r;if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(let s of this.signal._onabort)s(t);(r=(n=this.signal).onabort)==null||r.call(n,t)}}};let i=((If=ma.env)==null?void 0:If.LRU_CACHE_IGNORE_AC_WARNING)!=="1",e=()=>{i&&(i=!1,ep("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var yb=i=>!Jf.has(i),_i=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),tp=i=>_i(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?Js:null:null,Js=class extends Array{constructor(e){super(e),this.fill(0)}},pi,Xn,kb=(pi=class{constructor(e,t){ve(this,"heap");ve(this,"length");if(!S(pi,Xn))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){let t=tp(e);if(!t)return[];ne(pi,Xn,!0);let n=new pi(e,t);return ne(pi,Xn,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Xn=new WeakMap,pe(pi,Xn,!1),pi),zf,Vf,Rt,yt,jt,ln,Wt,In,zn,Yt,qe,Nt,Ve,Ae,ce,nt,kt,Je,We,Gt,Ye,Ft,Ut,St,xt,Ht,zi,rt,Vn,N,Oa,an,yi,cs,wt,ip,hn,Dn,us,Ei,Li,ga,eo,to,Ce,ba,Sr,Ri,va,Bn,Sb=(Bn=class{constructor(e){pe(this,N);pe(this,Rt);pe(this,yt);pe(this,jt);pe(this,ln);pe(this,Wt);pe(this,In);pe(this,zn);pe(this,Yt);ve(this,"ttl");ve(this,"ttlResolution");ve(this,"ttlAutopurge");ve(this,"updateAgeOnGet");ve(this,"updateAgeOnHas");ve(this,"allowStale");ve(this,"noDisposeOnSet");ve(this,"noUpdateTTL");ve(this,"maxEntrySize");ve(this,"sizeCalculation");ve(this,"noDeleteOnFetchRejection");ve(this,"noDeleteOnStaleGet");ve(this,"allowStaleOnFetchAbort");ve(this,"allowStaleOnFetchRejection");ve(this,"ignoreFetchAbort");pe(this,qe);pe(this,Nt);pe(this,Ve);pe(this,Ae);pe(this,ce);pe(this,nt);pe(this,kt);pe(this,Je);pe(this,We);pe(this,Gt);pe(this,Ye);pe(this,Ft);pe(this,Ut);pe(this,St);pe(this,xt);pe(this,Ht);pe(this,zi);pe(this,rt);pe(this,Vn);pe(this,an,()=>{});pe(this,yi,()=>{});pe(this,cs,()=>{});pe(this,wt,()=>!1);pe(this,hn,e=>{});pe(this,Dn,(e,t,n)=>{});pe(this,us,(e,t,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ve(this,zf,"LRUCache");let{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:a,dispose:h,onInsert:c,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:O,fetchMethod:g,memoMethod:b,noDeleteOnFetchRejection:Q,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:$,ignoreFetchAbort:C,perf:T}=e;if(T!==void 0&&typeof(T==null?void 0:T.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(ne(this,Yt,T??vb),t!==0&&!_i(t))throw new TypeError("max option must be a nonnegative integer");let A=t?tp(t):Array;if(!A)throw new Error("invalid max value: "+t);if(ne(this,Rt,t),ne(this,yt,p),this.maxEntrySize=m||S(this,yt),this.sizeCalculation=O,this.sizeCalculation){if(!S(this,yt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(ne(this,zn,b),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ne(this,In,g),ne(this,zi,!!g),ne(this,Ve,new Map),ne(this,Ae,new Array(t).fill(void 0)),ne(this,ce,new Array(t).fill(void 0)),ne(this,nt,new A(t)),ne(this,kt,new A(t)),ne(this,Je,0),ne(this,We,0),ne(this,Gt,kb.create(t)),ne(this,qe,0),ne(this,Nt,0),typeof h=="function"&&ne(this,jt,h),typeof c=="function"&&ne(this,ln,c),typeof u=="function"?(ne(this,Wt,u),ne(this,Ye,[])):(ne(this,Wt,void 0),ne(this,Ye,void 0)),ne(this,Ht,!!S(this,jt)),ne(this,Vn,!!S(this,ln)),ne(this,rt,!!S(this,Wt)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!Q,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!$,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(S(this,yt)!==0&&!_i(S(this,yt)))throw new TypeError("maxSize must be a positive integer if specified");if(!_i(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");K(this,N,ip).call(this)}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=_i(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!_i(this.ttl))throw new TypeError("ttl must be a positive integer if specified");K(this,N,Oa).call(this)}if(S(this,Rt)===0&&this.ttl===0&&S(this,yt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Rt)&&!S(this,yt)){let M="LRU_CACHE_UNBOUNDED";yb(M)&&(Jf.add(M),ep("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,Bn))}}get perf(){return S(this,Yt)}static unsafeExposeInternals(e){return{starts:S(e,Ut),ttls:S(e,St),autopurgeTimers:S(e,xt),sizes:S(e,Ft),keyMap:S(e,Ve),keyList:S(e,Ae),valList:S(e,ce),next:S(e,nt),prev:S(e,kt),get head(){return S(e,Je)},get tail(){return S(e,We)},free:S(e,Gt),isBackgroundFetch:t=>{var n;return K(n=e,N,Ce).call(n,t)},backgroundFetch:(t,n,r,s)=>{var o;return K(o=e,N,to).call(o,t,n,r,s)},moveToTail:t=>{var n;return K(n=e,N,Sr).call(n,t)},indexes:t=>{var n;return K(n=e,N,Ei).call(n,t)},rindexes:t=>{var n;return K(n=e,N,Li).call(n,t)},isStale:t=>{var n;return S(n=e,wt).call(n,t)}}}get max(){return S(this,Rt)}get maxSize(){return S(this,yt)}get calculatedSize(){return S(this,Nt)}get size(){return S(this,qe)}get fetchMethod(){return S(this,In)}get memoMethod(){return S(this,zn)}get dispose(){return S(this,jt)}get onInsert(){return S(this,ln)}get disposeAfter(){return S(this,Wt)}getRemainingTTL(e){return S(this,Ve).has(e)?1/0:0}*entries(){for(let e of K(this,N,Ei).call(this))S(this,ce)[e]!==void 0&&S(this,Ae)[e]!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield[S(this,Ae)[e],S(this,ce)[e]])}*rentries(){for(let e of K(this,N,Li).call(this))S(this,ce)[e]!==void 0&&S(this,Ae)[e]!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield[S(this,Ae)[e],S(this,ce)[e]])}*keys(){for(let e of K(this,N,Ei).call(this)){let t=S(this,Ae)[e];t!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield t)}}*rkeys(){for(let e of K(this,N,Li).call(this)){let t=S(this,Ae)[e];t!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield t)}}*values(){for(let e of K(this,N,Ei).call(this))S(this,ce)[e]!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield S(this,ce)[e])}*rvalues(){for(let e of K(this,N,Li).call(this))S(this,ce)[e]!==void 0&&!K(this,N,Ce).call(this,S(this,ce)[e])&&(yield S(this,ce)[e])}[(Vf=Symbol.iterator,zf=Symbol.toStringTag,Vf)](){return this.entries()}find(e,t={}){for(let n of K(this,N,Ei).call(this)){let r=S(this,ce)[n],s=K(this,N,Ce).call(this,r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,S(this,Ae)[n],this))return this.get(S(this,Ae)[n],t)}}forEach(e,t=this){for(let n of K(this,N,Ei).call(this)){let r=S(this,ce)[n],s=K(this,N,Ce).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,S(this,Ae)[n],this)}}rforEach(e,t=this){for(let n of K(this,N,Li).call(this)){let r=S(this,ce)[n],s=K(this,N,Ce).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,S(this,Ae)[n],this)}}purgeStale(){let e=!1;for(let t of K(this,N,Li).call(this,{allowStale:!0}))S(this,wt).call(this,t)&&(K(this,N,Ri).call(this,S(this,Ae)[t],"expire"),e=!0);return e}info(e){let t=S(this,Ve).get(e);if(t===void 0)return;let n=S(this,ce)[t],r=K(this,N,Ce).call(this,n)?n.__staleWhileFetching:n;if(r===void 0)return;let s={value:r};if(S(this,St)&&S(this,Ut)){let o=S(this,St)[t],l=S(this,Ut)[t];if(o&&l){let a=o-(S(this,Yt).now()-l);s.ttl=a,s.start=Date.now()}}return S(this,Ft)&&(s.size=S(this,Ft)[t]),s}dump(){let e=[];for(let t of K(this,N,Ei).call(this,{allowStale:!0})){let n=S(this,Ae)[t],r=S(this,ce)[t],s=K(this,N,Ce).call(this,r)?r.__staleWhileFetching:r;if(s===void 0||n===void 0)continue;let o={value:s};if(S(this,St)&&S(this,Ut)){o.ttl=S(this,St)[t];let l=S(this,Yt).now()-S(this,Ut)[t];o.start=Math.floor(Date.now()-l)}S(this,Ft)&&(o.size=S(this,Ft)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let r=Date.now()-n.start;n.start=S(this,Yt).now()-r}this.set(t,n.value,n)}}set(e,t,n={}){var d,f,p,m,O,g,b;if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:a}=n,{noUpdateTTL:h=this.noUpdateTTL}=n,c=S(this,us).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),K(this,N,Ri).call(this,e,"set"),this;let u=S(this,qe)===0?void 0:S(this,Ve).get(e);if(u===void 0)u=S(this,qe)===0?S(this,We):S(this,Gt).length!==0?S(this,Gt).pop():S(this,qe)===S(this,Rt)?K(this,N,eo).call(this,!1):S(this,qe),S(this,Ae)[u]=e,S(this,ce)[u]=t,S(this,Ve).set(e,u),S(this,nt)[S(this,We)]=u,S(this,kt)[u]=S(this,We),ne(this,We,u),xs(this,qe)._++,S(this,Dn).call(this,u,c,a),a&&(a.set="add"),h=!1,S(this,Vn)&&((d=S(this,ln))==null||d.call(this,t,e,"add"));else{K(this,N,Sr).call(this,u);let Q=S(this,ce)[u];if(t!==Q){if(S(this,zi)&&K(this,N,Ce).call(this,Q)){Q.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:x}=Q;x!==void 0&&!o&&(S(this,Ht)&&((f=S(this,jt))==null||f.call(this,x,e,"set")),S(this,rt)&&((p=S(this,Ye))==null||p.push([x,e,"set"])))}else o||(S(this,Ht)&&((m=S(this,jt))==null||m.call(this,Q,e,"set")),S(this,rt)&&((O=S(this,Ye))==null||O.push([Q,e,"set"])));if(S(this,hn).call(this,u),S(this,Dn).call(this,u,c,a),S(this,ce)[u]=t,a){a.set="replace";let x=Q&&K(this,N,Ce).call(this,Q)?Q.__staleWhileFetching:Q;x!==void 0&&(a.oldValue=x)}}else a&&(a.set="update");S(this,Vn)&&((g=this.onInsert)==null||g.call(this,t,e,t===Q?"update":"replace"))}if(r!==0&&!S(this,St)&&K(this,N,Oa).call(this),S(this,St)&&(h||S(this,cs).call(this,u,r,s),a&&S(this,yi).call(this,a,u)),!o&&S(this,rt)&&S(this,Ye)){let Q=S(this,Ye),x;for(;x=Q==null?void 0:Q.shift();)(b=S(this,Wt))==null||b.call(this,...x)}return this}pop(){var e;try{for(;S(this,qe);){let t=S(this,ce)[S(this,Je)];if(K(this,N,eo).call(this,!0),K(this,N,Ce).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(S(this,rt)&&S(this,Ye)){let t=S(this,Ye),n;for(;n=t==null?void 0:t.shift();)(e=S(this,Wt))==null||e.call(this,...n)}}}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,s=S(this,Ve).get(e);if(s!==void 0){let o=S(this,ce)[s];if(K(this,N,Ce).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(S(this,wt).call(this,s))r&&(r.has="stale",S(this,yi).call(this,r,s));else return n&&S(this,an).call(this,s),r&&(r.has="hit",S(this,yi).call(this,r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=S(this,Ve).get(e);if(r===void 0||!n&&S(this,wt).call(this,r))return;let s=S(this,ce)[r];return K(this,N,Ce).call(this,s)?s.__staleWhileFetching:s}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:a=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:O=!1,status:g,signal:b}=t;if(!S(this,zi))return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:g});let Q={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:l,size:a,sizeCalculation:h,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:b},x=S(this,Ve).get(e);if(x===void 0){g&&(g.fetch="miss");let k=K(this,N,to).call(this,e,x,Q,m);return k.__returned=k}else{let k=S(this,ce)[x];if(K(this,N,Ce).call(this,k)){let A=n&&k.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",A&&(g.returnedStale=!0)),A?k.__staleWhileFetching:k.__returned=k}let $=S(this,wt).call(this,x);if(!O&&!$)return g&&(g.fetch="hit"),K(this,N,Sr).call(this,x),r&&S(this,an).call(this,x),g&&S(this,yi).call(this,g,x),k;let C=K(this,N,to).call(this,e,x,Q,m),T=C.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=$?"stale":"refresh",T&&$&&(g.returnedStale=!0)),T?C.__staleWhileFetching:C.__returned=C}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=S(this,zn);if(!n)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,l=this.get(e,o);if(!s&&l!==void 0)return l;let a=n(e,l,{options:o,context:r});return this.set(e,a,o),a}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,l=S(this,Ve).get(e);if(l!==void 0){let a=S(this,ce)[l],h=K(this,N,Ce).call(this,a);return o&&S(this,yi).call(this,o,l),S(this,wt).call(this,l)?(o&&(o.get="stale"),h?(o&&n&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?a.__staleWhileFetching:void 0):(s||K(this,N,Ri).call(this,e,"expire"),o&&n&&(o.returnedStale=!0),n?a:void 0)):(o&&(o.get="hit"),h?a.__staleWhileFetching:(K(this,N,Sr).call(this,l),r&&S(this,an).call(this,l),a))}else o&&(o.get="miss")}delete(e){return K(this,N,Ri).call(this,e,"delete")}clear(){return K(this,N,va).call(this,"delete")}},Rt=new WeakMap,yt=new WeakMap,jt=new WeakMap,ln=new WeakMap,Wt=new WeakMap,In=new WeakMap,zn=new WeakMap,Yt=new WeakMap,qe=new WeakMap,Nt=new WeakMap,Ve=new WeakMap,Ae=new WeakMap,ce=new WeakMap,nt=new WeakMap,kt=new WeakMap,Je=new WeakMap,We=new WeakMap,Gt=new WeakMap,Ye=new WeakMap,Ft=new WeakMap,Ut=new WeakMap,St=new WeakMap,xt=new WeakMap,Ht=new WeakMap,zi=new WeakMap,rt=new WeakMap,Vn=new WeakMap,N=new WeakSet,Oa=function(){let e=new Js(S(this,Rt)),t=new Js(S(this,Rt));ne(this,St,e),ne(this,Ut,t);let n=this.ttlAutopurge?new Array(S(this,Rt)):void 0;ne(this,xt,n),ne(this,cs,(l,a,h=S(this,Yt).now())=>{t[l]=a!==0?h:0,e[l]=a,r(l,a)}),ne(this,an,l=>{t[l]=e[l]!==0?S(this,Yt).now():0,r(l,e[l])});let r=this.ttlAutopurge?(l,a)=>{if(n!=null&&n[l]&&(clearTimeout(n[l]),n[l]=void 0),a&&a!==0&&n){let h=setTimeout(()=>{S(this,wt).call(this,l)&&K(this,N,Ri).call(this,S(this,Ae)[l],"expire")},a+1);h.unref&&h.unref(),n[l]=h}}:()=>{};ne(this,yi,(l,a)=>{if(e[a]){let h=e[a],c=t[a];if(!h||!c)return;l.ttl=h,l.start=c,l.now=s||o();let u=l.now-c;l.remainingTTL=h-u}});let s=0,o=()=>{let l=S(this,Yt).now();if(this.ttlResolution>0){s=l;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return l};this.getRemainingTTL=l=>{let a=S(this,Ve).get(l);if(a===void 0)return 0;let h=e[a],c=t[a];if(!h||!c)return 1/0;let u=(s||o())-c;return h-u},ne(this,wt,l=>{let a=t[l],h=e[l];return!!h&&!!a&&(s||o())-a>h})},an=new WeakMap,yi=new WeakMap,cs=new WeakMap,wt=new WeakMap,ip=function(){let e=new Js(S(this,Rt));ne(this,Nt,0),ne(this,Ft,e),ne(this,hn,t=>{ne(this,Nt,S(this,Nt)-e[t]),e[t]=0}),ne(this,us,(t,n,r,s)=>{if(K(this,N,Ce).call(this,n))return 0;if(!_i(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(n,t),!_i(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),ne(this,Dn,(t,n,r)=>{if(e[t]=n,S(this,yt)){let s=S(this,yt)-e[t];for(;S(this,Nt)>s;)K(this,N,eo).call(this,!0)}ne(this,Nt,S(this,Nt)+e[t]),r&&(r.entrySize=n,r.totalCalculatedSize=S(this,Nt))})},hn=new WeakMap,Dn=new WeakMap,us=new WeakMap,Ei=function*({allowStale:e=this.allowStale}={}){if(S(this,qe))for(let t=S(this,We);!(!K(this,N,ga).call(this,t)||((e||!S(this,wt).call(this,t))&&(yield t),t===S(this,Je)));)t=S(this,kt)[t]},Li=function*({allowStale:e=this.allowStale}={}){if(S(this,qe))for(let t=S(this,Je);!(!K(this,N,ga).call(this,t)||((e||!S(this,wt).call(this,t))&&(yield t),t===S(this,We)));)t=S(this,nt)[t]},ga=function(e){return e!==void 0&&S(this,Ve).get(S(this,Ae)[e])===e},eo=function(e){var s,o,l;let t=S(this,Je),n=S(this,Ae)[t],r=S(this,ce)[t];return S(this,zi)&&K(this,N,Ce).call(this,r)?r.__abortController.abort(new Error("evicted")):(S(this,Ht)||S(this,rt))&&(S(this,Ht)&&((s=S(this,jt))==null||s.call(this,r,n,"evict")),S(this,rt)&&((o=S(this,Ye))==null||o.push([r,n,"evict"]))),S(this,hn).call(this,t),(l=S(this,xt))!=null&&l[t]&&(clearTimeout(S(this,xt)[t]),S(this,xt)[t]=void 0),e&&(S(this,Ae)[t]=void 0,S(this,ce)[t]=void 0,S(this,Gt).push(t)),S(this,qe)===1?(ne(this,Je,ne(this,We,0)),S(this,Gt).length=0):ne(this,Je,S(this,nt)[t]),S(this,Ve).delete(n),xs(this,qe)._--,t},to=function(e,t,n,r){let s=t===void 0?void 0:S(this,ce)[t];if(K(this,N,Ce).call(this,s))return s;let o=new bo,{signal:l}=n;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let a={signal:o.signal,options:n,context:r},h=(m,O=!1)=>{let{aborted:g}=o.signal,b=n.ignoreFetchAbort&&m!==void 0,Q=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(g&&!O?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,b&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),g&&!b&&!O)return u(o.signal.reason,Q);let x=f,k=S(this,ce)[t];return(k===f||b&&O&&k===void 0)&&(m===void 0?x.__staleWhileFetching!==void 0?S(this,ce)[t]=x.__staleWhileFetching:K(this,N,Ri).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,m,a.options))),m},c=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),u(m,!1)),u=(m,O)=>{let{aborted:g}=o.signal,b=g&&n.allowStaleOnFetchAbort,Q=b||n.allowStaleOnFetchRejection,x=Q||n.noDeleteOnFetchRejection,k=f;if(S(this,ce)[t]===f&&(!x||!O&&k.__staleWhileFetching===void 0?K(this,N,Ri).call(this,e,"fetch"):b||(S(this,ce)[t]=k.__staleWhileFetching)),Q)return n.status&&k.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw m},d=(m,O)=>{var b;let g=(b=S(this,In))==null?void 0:b.call(this,e,s,a);g&&g instanceof Promise&&g.then(Q=>m(Q===void 0?void 0:Q),O),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=Q=>h(Q,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(h,c),p=Object.assign(f,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,p,{...a.options,status:void 0}),t=S(this,Ve).get(e)):S(this,ce)[t]=p,p},Ce=function(e){if(!S(this,zi))return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof bo},ba=function(e,t){S(this,kt)[t]=e,S(this,nt)[e]=t},Sr=function(e){e!==S(this,We)&&(e===S(this,Je)?ne(this,Je,S(this,nt)[e]):K(this,N,ba).call(this,S(this,kt)[e],S(this,nt)[e]),K(this,N,ba).call(this,S(this,We),e),ne(this,We,e))},Ri=function(e,t){var r,s,o,l,a,h;let n=!1;if(S(this,qe)!==0){let c=S(this,Ve).get(e);if(c!==void 0)if((r=S(this,xt))!=null&&r[c]&&(clearTimeout((s=S(this,xt))==null?void 0:s[c]),S(this,xt)[c]=void 0),n=!0,S(this,qe)===1)K(this,N,va).call(this,t);else{S(this,hn).call(this,c);let u=S(this,ce)[c];if(K(this,N,Ce).call(this,u)?u.__abortController.abort(new Error("deleted")):(S(this,Ht)||S(this,rt))&&(S(this,Ht)&&((o=S(this,jt))==null||o.call(this,u,e,t)),S(this,rt)&&((l=S(this,Ye))==null||l.push([u,e,t]))),S(this,Ve).delete(e),S(this,Ae)[c]=void 0,S(this,ce)[c]=void 0,c===S(this,We))ne(this,We,S(this,kt)[c]);else if(c===S(this,Je))ne(this,Je,S(this,nt)[c]);else{let d=S(this,kt)[c];S(this,nt)[d]=S(this,nt)[c];let f=S(this,nt)[c];S(this,kt)[f]=S(this,kt)[c]}xs(this,qe)._--,S(this,Gt).push(c)}}if(S(this,rt)&&((a=S(this,Ye))!=null&&a.length)){let c=S(this,Ye),u;for(;u=c==null?void 0:c.shift();)(h=S(this,Wt))==null||h.call(this,...u)}return n},va=function(e){var t,n,r,s;for(let o of K(this,N,Li).call(this,{allowStale:!0})){let l=S(this,ce)[o];if(K(this,N,Ce).call(this,l))l.__abortController.abort(new Error("deleted"));else{let a=S(this,Ae)[o];S(this,Ht)&&((t=S(this,jt))==null||t.call(this,l,a,e)),S(this,rt)&&((n=S(this,Ye))==null||n.push([l,a,e]))}}if(S(this,Ve).clear(),S(this,ce).fill(void 0),S(this,Ae).fill(void 0),S(this,St)&&S(this,Ut)){S(this,St).fill(0),S(this,Ut).fill(0);for(let o of S(this,xt)??[])o!==void 0&&clearTimeout(o);(r=S(this,xt))==null||r.fill(void 0)}if(S(this,Ft)&&S(this,Ft).fill(0),ne(this,Je,0),ne(this,We,0),S(this,Gt).length=0,ne(this,Nt,0),ne(this,qe,0),S(this,rt)&&S(this,Ye)){let o=S(this,Ye),l;for(;l=o==null?void 0:o.shift();)(s=S(this,Wt))==null||s.call(this,...l)}},Bn);/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */var Ki=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Qs=function(e){return e.tagName==="IMG"},xb=function(e){return NodeList.prototype.isPrototypeOf(e)},io=function(e){return e&&e.nodeType===1},Dc=function(e){var t=e.currentSrc||e.src;return t.substr(-4).toLowerCase()===".svg"},Bc=function(e){try{return Array.isArray(e)?e.filter(Qs):xb(e)?[].slice.call(e).filter(Qs):io(e)?[e].filter(Qs):typeof e=="string"?[].slice.call(document.querySelectorAll(e)).filter(Qs):[]}catch{throw new TypeError(`The provided selector is invalid.
|
|
4
|
+
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
5
|
+
See: https://github.com/francoischalifour/medium-zoom`)}},wb=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t},Qb=function(e){var t=e.getBoundingClientRect(),n=t.top,r=t.left,s=t.width,o=t.height,l=e.cloneNode(),a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return l.removeAttribute("id"),l.style.position="absolute",l.style.top=n+a+"px",l.style.left=r+h+"px",l.style.width=s+"px",l.style.height=o+"px",l.style.transform="",l},vn=function(e,t){var n=Ki({bubbles:!1,cancelable:!1,detail:void 0},t);if(typeof window.CustomEvent=="function")return new CustomEvent(e,n);var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r},$b=function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(R){function D(){}R(D,D)},r=function(R){var D=R.target;if(D===A){p();return}Q.indexOf(D)!==-1&&m({target:D})},s=function(){if(!(k||!T.original)){var R=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs($-R)>C.scrollOffset&&setTimeout(p,150)}},o=function(R){var D=R.key||R.keyCode;(D==="Escape"||D==="Esc"||D===27)&&p()},l=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=R;if(R.background&&(A.style.background=R.background),R.container&&R.container instanceof Object&&(D.container=Ki({},C.container,R.container)),R.template){var q=io(R.template)?R.template:document.querySelector(R.template);D.template=q}return C=Ki({},C,D),Q.forEach(function(G){G.dispatchEvent(vn("medium-zoom:update",{detail:{zoom:M}}))}),M},a=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i(Ki({},C,R))},h=function(){for(var R=arguments.length,D=Array(R),q=0;q<R;q++)D[q]=arguments[q];var G=D.reduce(function(I,W){return[].concat(I,Bc(W))},[]);return G.filter(function(I){return Q.indexOf(I)===-1}).forEach(function(I){Q.push(I),I.classList.add("medium-zoom-image")}),x.forEach(function(I){var W=I.type,V=I.listener,E=I.options;G.forEach(function(H){H.addEventListener(W,V,E)})}),M},c=function(){for(var R=arguments.length,D=Array(R),q=0;q<R;q++)D[q]=arguments[q];T.zoomed&&p();var G=D.length>0?D.reduce(function(I,W){return[].concat(I,Bc(W))},[]):Q;return G.forEach(function(I){I.classList.remove("medium-zoom-image"),I.dispatchEvent(vn("medium-zoom:detach",{detail:{zoom:M}}))}),Q=Q.filter(function(I){return G.indexOf(I)===-1}),M},u=function(R,D){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Q.forEach(function(G){G.addEventListener("medium-zoom:"+R,D,q)}),x.push({type:"medium-zoom:"+R,listener:D,options:q}),M},d=function(R,D){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Q.forEach(function(G){G.removeEventListener("medium-zoom:"+R,D,q)}),x=x.filter(function(G){return!(G.type==="medium-zoom:"+R&&G.listener.toString()===D.toString())}),M},f=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=R.target,q=function(){var I={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},W=void 0,V=void 0;if(C.container)if(C.container instanceof Object)I=Ki({},I,C.container),W=I.width-I.left-I.right-C.margin*2,V=I.height-I.top-I.bottom-C.margin*2;else{var E=io(C.container)?C.container:document.querySelector(C.container),H=E.getBoundingClientRect(),se=H.width,ee=H.height,oe=H.left,ue=H.top;I=Ki({},I,{width:se,height:ee,left:oe,top:ue})}W=W||I.width-C.margin*2,V=V||I.height-C.margin*2;var $e=T.zoomedHd||T.original,Re=Dc($e)?W:$e.naturalWidth||W,Lt=Dc($e)?V:$e.naturalHeight||V,gi=$e.getBoundingClientRect(),Ss=gi.top,x0=gi.left,fl=gi.width,pl=gi.height,w0=Math.min(Math.max(fl,Re),W)/fl,Q0=Math.min(Math.max(pl,Lt),V)/pl,ml=Math.min(w0,Q0),$0=(-x0+(W-fl)/2+C.margin+I.left)/ml,P0=(-Ss+(V-pl)/2+C.margin+I.top)/ml,Tc="scale("+ml+") translate3d("+$0+"px, "+P0+"px, 0)";T.zoomed.style.transform=Tc,T.zoomedHd&&(T.zoomedHd.style.transform=Tc)};return new n(function(G){if(D&&Q.indexOf(D)===-1){G(M);return}var I=function se(){k=!1,T.zoomed.removeEventListener("transitionend",se),T.original.dispatchEvent(vn("medium-zoom:opened",{detail:{zoom:M}})),G(M)};if(T.zoomed){G(M);return}if(D)T.original=D;else if(Q.length>0){var W=Q;T.original=W[0]}else{G(M);return}if(T.original.dispatchEvent(vn("medium-zoom:open",{detail:{zoom:M}})),$=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,k=!0,T.zoomed=Qb(T.original),document.body.appendChild(A),C.template){var V=io(C.template)?C.template:document.querySelector(C.template);T.template=document.createElement("div"),T.template.appendChild(V.content.cloneNode(!0)),document.body.appendChild(T.template)}if(T.original.parentElement&&T.original.parentElement.tagName==="PICTURE"&&T.original.currentSrc&&(T.zoomed.src=T.original.currentSrc),document.body.appendChild(T.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),T.original.classList.add("medium-zoom-image--hidden"),T.zoomed.classList.add("medium-zoom-image--opened"),T.zoomed.addEventListener("click",p),T.zoomed.addEventListener("transitionend",I),T.original.getAttribute("data-zoom-src")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("srcset"),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.removeAttribute("loading"),T.zoomedHd.src=T.zoomed.getAttribute("data-zoom-src"),T.zoomedHd.onerror=function(){clearInterval(E),console.warn("Unable to reach the zoom image target "+T.zoomedHd.src),T.zoomedHd=null,q()};var E=setInterval(function(){T.zoomedHd.complete&&(clearInterval(E),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",p),document.body.appendChild(T.zoomedHd),q())},10)}else if(T.original.hasAttribute("srcset")){T.zoomedHd=T.zoomed.cloneNode(),T.zoomedHd.removeAttribute("sizes"),T.zoomedHd.removeAttribute("loading");var H=T.zoomedHd.addEventListener("load",function(){T.zoomedHd.removeEventListener("load",H),T.zoomedHd.classList.add("medium-zoom-image--opened"),T.zoomedHd.addEventListener("click",p),document.body.appendChild(T.zoomedHd),q()})}else q()})},p=function(){return new n(function(R){if(k||!T.original){R(M);return}var D=function q(){T.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(T.zoomed),T.zoomedHd&&document.body.removeChild(T.zoomedHd),document.body.removeChild(A),T.zoomed.classList.remove("medium-zoom-image--opened"),T.template&&document.body.removeChild(T.template),k=!1,T.zoomed.removeEventListener("transitionend",q),T.original.dispatchEvent(vn("medium-zoom:closed",{detail:{zoom:M}})),T.original=null,T.zoomed=null,T.zoomedHd=null,T.template=null,R(M)};k=!0,document.body.classList.remove("medium-zoom--opened"),T.zoomed.style.transform="",T.zoomedHd&&(T.zoomedHd.style.transform=""),T.template&&(T.template.style.transition="opacity 150ms",T.template.style.opacity=0),T.original.dispatchEvent(vn("medium-zoom:close",{detail:{zoom:M}})),T.zoomed.addEventListener("transitionend",D)})},m=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=R.target;return T.original?p():f({target:D})},O=function(){return C},g=function(){return Q},b=function(){return T.original},Q=[],x=[],k=!1,$=0,C=t,T={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(e)==="[object Object]"?C=e:(e||typeof e=="string")&&h(e),C=Ki({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},C);var A=wb(C.background);document.addEventListener("click",r),document.addEventListener("keyup",o),document.addEventListener("scroll",s),window.addEventListener("resize",p);var M={open:f,close:p,toggle:m,update:l,clone:a,attach:h,detach:c,on:u,off:d,getOptions:O,getImages:g,getZoomedImage:b};return M};function Pb(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}}var Tb=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Pb(Tb);const lt={hljs:`${v}-hljs`,hlcss:`${v}-hlCss`,prettier:`${v}-prettier`,prettierMD:`${v}-prettierMD`,cropperjs:`${v}-cropper`,croppercss:`${v}-cropperCss`,screenfull:`${v}-screenfull`,mermaidM:`${v}-mermaid-m`,mermaid:`${v}-mermaid`,katexjs:`${v}-katex`,katexcss:`${v}-katexCss`,echarts:`${v}-echarts`},Cb=(i,e,t)=>{const{editorId:n}=t,r=zt({buildFinished:!1,html:""});le(()=>i.modelValue,()=>{r.buildFinished=!1}),Ee(()=>{X.on(n,{name:Ks,callback(s){r.buildFinished=!0,r.html=s}}),X.on(n,{name:Ho,callback(){const s=new Promise(o=>{if(r.buildFinished)o(r.html);else{const l=a=>{o(a),X.remove(n,Ks,l)};X.on(n,{name:Ks,callback:l})}});i.onSave?i.onSave(i.modelValue,s):e.emit("onSave",i.modelValue,s)}})})},np=(i,{editorId:e,rootRef:t,setting:n})=>{const r=ze.editorExtensions.highlight,s=ze.editorExtensionsAttrs.highlight;Me("editorId",e),Me("rootRef",t),Me("theme",ke(()=>i.theme)),Me("language",ke(()=>i.language)),Me("highlight",ke(()=>{const{js:l}=r,a={...pa,...r.css},{js:h,css:c={}}=s||{},u=i.codeStyleReverse&&i.codeStyleReverseList.includes(i.previewTheme)?"dark":i.theme,d=a[i.codeTheme]?a[i.codeTheme][u]:pa.atom[u],f=a[i.codeTheme]&&c[i.codeTheme]?c[i.codeTheme][u]:c.atom?c.atom[u]:{};return{js:{src:l,...h},css:{href:d,...f}}})),Me("showCodeRowNumber",i.showCodeRowNumber);const o=ke(()=>{const l={...Oo,...ze.editorConfig.languageUserDefined};return Uo(kr(Oo["en-US"]),l[i.language]||{})});return Me("usedLanguageText",o),Me("previewTheme",ke(()=>i.previewTheme)),Me("customIcon",ke(()=>i.customIcon)),Me("setting",ke(()=>n?{...n}:{preview:!0,htmlPreview:!1,previewOnly:!1,pageFullscreen:!1,fullscreen:!1})),{editorId:e}},Ab=(i,e)=>(Me("tabWidth",i.tabWidth),Me("disabled",ke(()=>i.disabled)),Me("showToolbarName",ke(()=>i.showToolbarName)),Me("noUploadImg",i.noUploadImg),Me("tableShape",ke(()=>i.tableShape)),Me("noPrettier",i.noPrettier),Me("codeTheme",ke(()=>i.codeTheme)),Me("updateSetting",e.updateSetting),Me("catalogVisible",ke(()=>e.catalogVisible.value)),Me("defToolbars",e.defToolbars),Me("floatingToolbars",ke(()=>i.floatingToolbars)),np(i,e)),_b=i=>{const{noPrettier:e,noUploadImg:t}=i,{editorExtensions:n,editorExtensionsAttrs:r}=ze,s=e||n.prettier.prettierInstance,o=e||n.prettier.parserMarkdownInstance,l=t||n.cropper.instance;Ee(()=>{if(!l){const{js:a={},css:h={}}=r.cropper||{};Tt("link",{...h,rel:"stylesheet",href:n.cropper.css,id:lt.croppercss}),Tt("script",{...a,src:n.cropper.js,id:lt.cropperjs})}if(!s){const{standaloneJs:a={}}=r.prettier||{};Tt("script",{...a,src:n.prettier.standaloneJs,id:lt.prettier})}if(!o){const{parserMarkdownJs:a={}}=r.prettier||{};Tt("script",{...a,src:n.prettier.parserMarkdownJs,id:lt.prettierMD})}})},Eb=(i,e,t)=>{const{editorId:n}=t;Ee(()=>{X.on(n,{name:Oi,callback:r=>{var s;(s=i.onError)==null||s.call(i,r),e.emit("onError",r)}})})},Lb=(i,e,t)=>{const{editorId:n}=t,r=zt({pageFullscreen:i.pageFullscreen,fullscreen:!1,preview:i.preview,htmlPreview:i.preview?!1:i.htmlPreview,previewOnly:!1}),s=zt({...r}),o=(h,c)=>{const u=c===void 0?!r[h]:c;switch(h){case"preview":{r.htmlPreview=!1,r.previewOnly=!1;break}case"htmlPreview":{r.preview=!1,r.previewOnly=!1;break}case"previewOnly":{u?!r.preview&&!r.htmlPreview&&(r.preview=!0):(s.preview||(r.preview=!1),s.htmlPreview||(r.htmlPreview=!1));break}}s[h]=u,r[h]=u};let l="";const a=()=>{r.pageFullscreen||r.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=l};return le(()=>[r.pageFullscreen,r.fullscreen],a),Ee(()=>{X.on(n,{name:Ko,callback(h,c){const u=d=>{X.emit(n,re,"image",{desc:"",urls:d}),c==null||c()};i.onUploadImg?i.onUploadImg(h,u):e.emit("onUploadImg",h,u)}}),l=document.body.style.overflow,a()}),[r,o]},Rb=(i,e)=>{const{editorId:t}=e,n=he(!1);return Ee(()=>{X.on(t,{name:Sh,callback:r=>{r===void 0?n.value=!n.value:n.value=r}})}),n},Mb=(i,e,t)=>{const{editorId:n,catalogVisible:r,setting:s,updateSetting:o,codeRef:l}=t;le(()=>s.pageFullscreen,h=>{X.emit(n,_c,h)}),le(()=>s.fullscreen,h=>{X.emit(n,Ec,h)}),le(()=>s.preview,h=>{X.emit(n,Lc,h)}),le(()=>s.previewOnly,h=>{X.emit(n,Rc,h)}),le(()=>s.htmlPreview,h=>{X.emit(n,Mc,h)}),le(r,h=>{X.emit(n,Zc,h)});const a={on(h,c){switch(h){case"pageFullscreen":{X.on(n,{name:_c,callback(u){c(u)}});break}case"fullscreen":{X.on(n,{name:Ec,callback(u){c(u)}});break}case"preview":{X.on(n,{name:Lc,callback(u){c(u)}});break}case"previewOnly":{X.on(n,{name:Rc,callback(u){c(u)}});break}case"htmlPreview":{X.on(n,{name:Mc,callback(u){c(u)}});break}case"catalog":{X.on(n,{name:Zc,callback(u){c(u)}});break}}},togglePageFullscreen(h){o("pageFullscreen",h)},toggleFullscreen(h){X.emit(n,Bf,h)},togglePreview(h){o("preview",h)},togglePreviewOnly(h){o("previewOnly",h)},toggleHtmlPreview(h){o("htmlPreview",h)},toggleCatalog(h){X.emit(n,Sh,h)},triggerSave(){X.emit(n,Ho)},insert(h){X.emit(n,re,"universal",{generate:h})},focus(h){var c;(c=l.value)==null||c.focus(h)},rerender(){X.emit(n,xh)},getSelectedText(){var h;return(h=l.value)==null?void 0:h.getSelectedText()},resetHistory(){var h;(h=l.value)==null||h.resetHistory()},domEventHandlers(h){X.emit(n,Yf,h)},execCommand(h){X.emit(n,re,h)},getEditorView(){var h;return(h=l.value)==null?void 0:h.getEditorView()}};e.expose(a)},rp=i=>{const e=A0();return i.id||i.editorId||`${v}-${e}`},Zb=(i,e,t)=>{const n=P("editorId"),r=P("rootRef"),s=P("usedLanguageText"),o=P("setting"),l=()=>{r.value.querySelectorAll(`#${n} .${v}-preview .${v}-code`).forEach(c=>{let u=-1;const d=c.querySelector(`.${v}-copy-button:not([data-processed])`);d&&(d.onclick=f=>{f.preventDefault(),clearTimeout(u);const p=(c.querySelector("input:checked + pre code")||c.querySelector("pre code")).textContent,{text:m,successTips:O,failTips:g}=s.value.copyCode;let b=O;Uf(i.formatCopiedText(p||"")).catch(()=>{b=g}).finally(()=>{d.dataset.isIcon?d.dataset.tips=b:d.innerHTML=b,u=window.setTimeout(()=>{d.dataset.isIcon?d.dataset.tips=m:d.innerHTML=m},1500)})},d.setAttribute("data-processed","true"))})},a=()=>{Dt(l)},h=c=>{c&&Dt(l)};le([e,t],a),le(()=>o.value.preview,h),le(()=>o.value.htmlPreview,h),Ee(l)},Xb=i=>{const e=P("editorId"),t=P("theme"),n=P("rootRef"),{editorExtensions:r,editorExtensionsAttrs:s}=ze;let o=r.echarts.instance;const l=qi(-1),a=()=>{!i.noEcharts&&o&&(l.value=l.value+1)};le(()=>t.value,()=>{a()}),Ee(()=>{var m;if(i.noEcharts||o)return;const p=r.echarts.js;Tt("script",{...(m=s.echarts)==null?void 0:m.js,src:p,id:lt.echarts,onload(){o=window.echarts,a()}},"echarts")});let h=[],c=[],u=[];const d=(p=!1)=>{if(!h.length){p&&(c.forEach(b=>{var Q;(Q=b.dispose)==null||Q.call(b)}),u.forEach(b=>{var Q;(Q=b.disconnect)==null||Q.call(b)}),c=[],u=[]);return}const m=[],O=[],g=[];h.forEach((b,Q)=>{var $,C;const x=c[Q],k=u[Q];if(p||!b||!b.isConnected||n!=null&&n.value&&!n.value.contains(b)){($=x==null?void 0:x.dispose)==null||$.call(x),(C=k==null?void 0:k.disconnect)==null||C.call(k);return}m.push(b),x&&O.push(x),k&&g.push(k)}),h=m,c=O,u=g},f=()=>{d(),!i.noEcharts&&o&&Array.from(n.value.querySelectorAll(`#${e} div.${v}-echarts:not([data-processed])`)).forEach(p=>{if(p.dataset.closed==="false")return!1;try{const m=new Function(`return ${p.innerText}`)(),O=o.init(p,t.value);O.setOption(m),p.setAttribute("data-processed",""),h.push(p),c.push(O);const g=new ResizeObserver(()=>{O.resize()});g.observe(p),u.push(g)}catch(m){X.emit(e,Oi,{name:"echarts",message:m==null?void 0:m.message,error:m})}})};return $i(()=>{d(!0)}),{reRenderEcharts:l,replaceEcharts:f}},Ib=i=>{const e=P("highlight"),t=qi(ze.editorExtensions.highlight.instance);return Ee(()=>{i.noHighlight||t.value||(Tt("link",{...e.value.css,rel:"stylesheet",id:lt.hlcss}),Tt("script",{...e.value.js,id:lt.hljs,onload(){t.value=window.hljs}},"hljs"))}),le(()=>e.value.css,()=>{i.noHighlight||ze.editorExtensions.highlight.instance||lb("link",{...e.value.css,rel:"stylesheet",id:lt.hlcss})}),t},zb=i=>{const e=qi(ze.editorExtensions.katex.instance);return Ee(()=>{var r,s;if(i.noKatex||e.value)return;const{editorExtensions:t,editorExtensionsAttrs:n}=ze;Tt("script",{...(r=n.katex)==null?void 0:r.js,src:t.katex.js,id:lt.katexjs,onload(){e.value=window.katex}},"katex"),Tt("link",{...(s=n.katex)==null?void 0:s.css,rel:"stylesheet",href:t.katex.css,id:lt.katexcss})}),e},no=new Sb({max:1e3,ttl:6e5}),Vb=i=>{const e=P("editorId"),t=P("theme"),n=P("rootRef"),{editorExtensions:r,editorExtensionsAttrs:s,mermaidConfig:o}=ze;let l=r.mermaid.instance;const a=qi(-1),h=()=>{if(!i.noMermaid&&l){const c=t.value==="dark"?{startOnLoad:!1,theme:"dark"}:{startOnLoad:!1,theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#ffffff",primaryTextColor:"#1f2329",primaryBorderColor:"#b7c0cc",secondaryColor:"#f7f8fa",tertiaryColor:"#f7f8fa",lineColor:"#596273",edgeLabelBackground:"#ffffff",clusterBkg:"#ffffff",clusterBorder:"#b7c0cc"}};l.initialize(o(c)),a.value=a.value+1}};return le(()=>t.value,()=>{no.clear(),h()}),Ee(()=>{var u,d;if(i.noMermaid||l)return;const c=r.mermaid.js;/\.mjs/.test(c)?(Tt("link",{...(u=s.mermaid)==null?void 0:u.js,rel:"modulepreload",href:c,id:lt.mermaidM}),import(c).then(f=>{l=f.default,h()}).catch(f=>{X.emit(e,Oi,{name:"mermaid",message:`Failed to load mermaid module: ${f.message}`,error:f})})):Tt("script",{...(d=s.mermaid)==null?void 0:d.js,src:c,id:lt.mermaid,onload(){l=window.mermaid,h()}},"mermaid")}),{reRenderRef:a,replaceMermaid:async()=>{if(!i.noMermaid&&l){const c=n.value.querySelectorAll(`div.${v}-mermaid`),u=document.createElement("div"),d=document.body.offsetWidth>1366?document.body.offsetWidth:1366,f=document.body.offsetHeight>768?document.body.offsetHeight:768;u.style.width=d+"px",u.style.height=f+"px",u.style.position="fixed",u.style.zIndex="-10000",u.style.top="-10000";let p=c.length;p>0&&document.body.appendChild(u),await Promise.allSettled(Array.from(c).map(m=>(async O=>{var Q;if(O.dataset.closed==="false")return!1;const g=O.innerText;let b=no.get(g);if(!b){const x=da();let k={svg:""};try{k=await l.render(x,g,u),b=await i.sanitizeMermaid(k.svg);const $=document.createElement("p");$.className=`${v}-mermaid`,$.setAttribute("data-processed",""),$.setAttribute("data-content",g),$.innerHTML=b,(Q=$.children[0])==null||Q.removeAttribute("height"),no.set(g,$.innerHTML),O.dataset.line!==void 0&&($.dataset.line=O.dataset.line),O.replaceWith($)}catch($){X.emit(e,Oi,{name:"mermaid",message:$.message,error:$})}--p===0&&u.remove()}})(m)))}}}},Db=(i,e)=>{e=e||{};const t=3,n=e.marker||"!",r=n.charCodeAt(0),s=n.length;let o="",l="";const a=(c,u,d,f,p)=>{const m=c[u];return m.type==="admonition_open"?c[u].attrPush(["class",`${v}-admonition ${v}-admonition-${m.info}`]):m.type==="admonition_title_open"&&c[u].attrPush(["class",`${v}-admonition-title`]),p.renderToken(c,u,d)},h=c=>{const u=c.trim().split(" ",2);l="",o=u[0],u.length>1&&(l=c.substring(o.length+2))};i.block.ruler.before("code","admonition",(c,u,d,f)=>{let p,m,O,g=!1,b=c.bMarks[u]+c.tShift[u],Q=c.eMarks[u];if(r!==c.src.charCodeAt(b))return!1;for(p=b+1;p<=Q&&n[(p-b)%s]===c.src[p];p++);const x=Math.floor((p-b)/s);if(x!==t)return!1;p-=(p-b)%s;const k=c.src.slice(b,p),$=c.src.slice(p,Q);if(h($),f)return!0;for(m=u;m++,!(m>=d||(b=c.bMarks[m]+c.tShift[m],Q=c.eMarks[m],b<Q&&c.sCount[m]<c.blkIndent));)if(r===c.src.charCodeAt(b)&&!(c.sCount[m]-c.blkIndent>=4)){for(p=b+1;p<=Q&&n[(p-b)%s]===c.src[p];p++);if(!(Math.floor((p-b)/s)<x)&&(p-=(p-b)%s,p=c.skipSpaces(p),!(p<Q))){g=!0;break}}const C=c.parentType,T=c.lineMax;return c.parentType="root",c.lineMax=m,O=c.push("admonition_open","div",1),O.markup=k,O.block=!0,O.info=o,O.map=[u,m],l&&(O=c.push("admonition_title_open","p",1),O.markup=k+" "+o,O.map=[u,m],O=c.push("inline","",0),O.content=l,O.map=[u,c.line-1],O.children=[],O=c.push("admonition_title_close","p",-1),O.markup=k+" "+o),c.md.block.tokenize(c,u+1,m),O=c.push("admonition_close","div",-1),O.markup=c.src.slice(b,p),O.block=!0,c.parentType=C,c.lineMax=T,c.line=m+(g?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),i.renderer.rules.admonition_open=a,i.renderer.rules.admonition_title_open=a,i.renderer.rules.admonition_title_close=a,i.renderer.rules.admonition_close=a},ya=(i,e)=>{const t=i.attrs?i.attrs.slice():[];return e.forEach(n=>{const r=i.attrIndex(n[0]);r<0?t.push(n):(t[r]=t[r].slice(),t[r][1]+=` ${n[1]}`)}),t},Bb=(i,e)=>{const t=i.renderer.rules.fence,n=i.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,s=/::(open|close)/,o=u=>u.info?n(u.info).trim():"",l=u=>{const d=o(u),[f=null,p=""]=(r.exec(d)||[]).slice(1);return[f,p]},a=u=>{const d=o(u);return d?d.split(/(\s+)/g)[0]:""},h=u=>{const d=u.info.match(s)||[],f=d[1]==="open"||d[1]!=="close"&&e.codeFoldable&&u.content.trim().split(`
|
|
6
|
+
`).length<e.autoFoldThreshold,p=d[1]||e.codeFoldable?"details":"div",m=d[1]||e.codeFoldable?"summary":"div";return{open:f,tagContainer:p,tagHeader:m}},c=(u,d,f,p,m)=>{var W;if(u[d].hidden)return"";const O=(W=e.usedLanguageTextRef.value)==null?void 0:W.copyCode.text,g=e.customIconRef.value.copy||O,b=!!e.customIconRef.value.copy,Q=`<span class="${v}-collapse-tips">${Kt("collapse-tips",e.customIconRef.value)}</span>`,[x]=l(u[d]);if(x===null){const{open:V,tagContainer:E,tagHeader:H}=h(u[d]),se=[["class",`${v}-code`]];V&&se.push(["open",""]);const ee={attrs:ya(u[d],se)};u[d].info=u[d].info.replace(s,"");const oe=t(u,d,f,p,m);return`
|
|
7
|
+
<${E} ${m.renderAttrs(ee)}>
|
|
8
|
+
<${H} class="${v}-code-head">
|
|
9
|
+
<div class="${v}-code-flag"><span></span><span></span><span></span></div>
|
|
10
|
+
<div class="${v}-code-action">
|
|
11
|
+
<span class="${v}-code-lang">${i.utils.escapeHtml(u[d].info.trim())}</span>
|
|
12
|
+
<span class="${v}-copy-button" data-tips="${O}"${b?" data-is-icon=true":""}>${g}</span>
|
|
13
|
+
${e.extraTools instanceof Function?e.extraTools({lang:u[d].info.trim()}):e.extraTools||""}
|
|
14
|
+
${E==="details"?Q:""}
|
|
15
|
+
</div>
|
|
16
|
+
</${H}>
|
|
17
|
+
${oe}
|
|
18
|
+
</${E}>
|
|
19
|
+
`}let k,$,C,T,A="",M="",B="";const{open:R,tagContainer:D,tagHeader:q}=h(u[d]),G=[["class",`${v}-code`]];R&&G.push(["open",""]);const I={attrs:ya(u[d],G)};for(let V=d;V<u.length&&(k=u[V],[$,C]=l(k),$===x);V++){k.info=k.info.replace(r,"").replace(s,""),k.hidden=!0;const E=`${v}-codetab-${e.editorId}-${d}-${V-d}`;T=V-d>0?"":"checked",A+=`
|
|
20
|
+
<li>
|
|
21
|
+
<input
|
|
22
|
+
type="radio"
|
|
23
|
+
id="label-${v}-codetab-label-1-${e.editorId}-${d}-${V-d}"
|
|
24
|
+
name="${v}-codetab-label-${e.editorId}-${d}"
|
|
25
|
+
class="${E}"
|
|
26
|
+
${T}
|
|
27
|
+
>
|
|
28
|
+
<label
|
|
29
|
+
for="label-${v}-codetab-label-1-${e.editorId}-${d}-${V-d}"
|
|
30
|
+
onclick="this.getRootNode().querySelectorAll('.${E}').forEach(e => e.click())"
|
|
31
|
+
>
|
|
32
|
+
${i.utils.escapeHtml(C||a(k))}
|
|
33
|
+
</label>
|
|
34
|
+
</li>`,M+=`
|
|
35
|
+
<div role="tabpanel">
|
|
36
|
+
<input
|
|
37
|
+
type="radio"
|
|
38
|
+
name="${v}-codetab-pre-${e.editorId}-${d}"
|
|
39
|
+
class="${E}"
|
|
40
|
+
${T}
|
|
41
|
+
role="presentation">
|
|
42
|
+
${t(u,V,f,p,m)}
|
|
43
|
+
</div>`,B+=`
|
|
44
|
+
<input
|
|
45
|
+
type="radio"
|
|
46
|
+
name="${v}-codetab-lang-${e.editorId}-${d}"
|
|
47
|
+
class="${E}"
|
|
48
|
+
${T}
|
|
49
|
+
role="presentation">
|
|
50
|
+
<span class=${v}-code-lang role="note">${i.utils.escapeHtml(a(k))}</span>`}return`
|
|
51
|
+
<${D} ${m.renderAttrs(I)}>
|
|
52
|
+
<${q} class="${v}-code-head">
|
|
53
|
+
<div class="${v}-code-flag">
|
|
54
|
+
<ul class="${v}-codetab-label" role="tablist">${A}</ul>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="${v}-code-action">
|
|
57
|
+
<span class="${v}-codetab-lang">${B}</span>
|
|
58
|
+
<span class="${v}-copy-button" data-tips="${O}"${b?" data-is-icon=true":""}>${g}</span>
|
|
59
|
+
${e.extraTools instanceof Function?e.extraTools({lang:u[d].info.trim()}):e.extraTools||""}
|
|
60
|
+
${D==="details"?Q:""}
|
|
61
|
+
</div>
|
|
62
|
+
</${q}>
|
|
63
|
+
${M}
|
|
64
|
+
</${D}>
|
|
65
|
+
`};i.renderer.rules.fence=c,i.renderer.rules.code_block=c},qb=(i,e)=>{const t=i.renderer.rules.fence.bind(i.renderer.rules);i.renderer.rules.fence=(n,r,s,o,l)=>{var c,u;const a=n[r],h=a.content.trim();if(a.info==="echarts"){if(a.attrSet("class",`${v}-echarts`),a.attrSet("data-echarts-theme",e.themeRef.value),a.map&&a.level===0){const d=a.map[1]-1,f=!!((u=(c=o.srcLines[d])==null?void 0:c.trim())!=null&&u.startsWith("```"));a.attrSet("data-closed",`${f}`),a.attrSet("data-line",String(a.map[0]))}return`<div ${l.renderAttrs(a)} style="width: 100%; aspect-ratio: 4 / 3;">${i.utils.escapeHtml(h)}</div>`}return t(n,r,s,o,l)}},jb=(i,e)=>{i.renderer.rules.heading_open=(t,n)=>{var l;const r=t[n],s=((l=t[n+1].children)==null?void 0:l.reduce((a,h)=>a+(["text","code_inline","math_inline"].includes(h.type)&&h.content||""),""))||"",o=r.markup.length;return e.headsRef.value.push({text:s,level:o,line:r.map[0],currentToken:r,nextToken:t[n+1]}),r.map&&r.level===0&&r.attrSet("id",e.mdHeadingId({text:s,level:o,index:e.headsRef.value.length,currentToken:r,nextToken:t[n+1]})),i.renderer.renderToken(t,n,e)},i.renderer.rules.heading_close=(t,n,r,s,o)=>o.renderToken(t,n,r)},qc={block:[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}],inline:[{open:"$$",close:"$$"},{open:"$",close:"$"},{open:"\\[",close:"\\]"},{open:"\\(",close:"\\)"}]},Wb=i=>(e,t)=>{const n=i.delimiters;for(const r of n){if(!e.src.startsWith(r.open,e.pos))continue;const s=e.pos+r.open.length;let o=s;for(;(o=e.src.indexOf(r.close,o))!==-1;){let l=0,a=o-1;for(;a>=0&&e.src[a]==="\\";)l++,a--;if(l%2===0)break;o+=r.close.length}if(o!==-1){if(o-s===0)return t||(e.pending+=r.open+r.close),e.pos=o+r.close.length,!0;if(!t){const l=e.push("math_inline","math",0);l.markup=r.open,l.content=e.src.slice(s,o)}return e.pos=o+r.close.length,!0}}return!1},Yb=i=>(e,t,n,r)=>{const s=i.delimiters,o=e.bMarks[t]+e.tShift[t],l=e.eMarks[t],a=(h,c,u)=>{e.line=c;const d=e.push("math_block","math",0);return d.block=!0,d.content=h,d.map=[t,e.line],d.markup=u,!0};for(const h of s){const c=o;if(e.src.slice(c,c+h.open.length)!==h.open)continue;const u=c+h.open.length,d=e.src.slice(u,l).trim(),f=d==="",p=d===h.close,m=d.endsWith(h.close);if(!f&&!p&&!m)continue;if(r)return!0;if(p)return a("",t+1,h.open);if(!f&&m){const x=d.slice(0,-h.close.length);return a(x,t+1,h.open)}let O=t+1,g=!1,b="";for(;O<n;O++){const x=e.bMarks[O]+e.tShift[O],k=e.eMarks[O];if(x<k&&e.tShift[O]<e.blkIndent)break;if(e.src.slice(x,k).trim().endsWith(h.close)){const $=e.src.slice(0,k).lastIndexOf(h.close);b=e.src.slice(x,$),g=!0;break}}if(!g)continue;const Q=e.getLines(t+1,O,e.tShift[t],!0)+(b.trim()?b:"");return a(Q,O+1,h.open)}return!1},Nb=(i,{katexRef:e,inlineDelimiters:t,blockDelimiters:n})=>{const r=(l,a,h,c,u=!1)=>{const d={attrs:ya(l,[["class",a]])},f=c.renderAttrs(d);if(!e.value)return`<${h} ${f}>${l.content}</${h}>`;const p=e.value.renderToString(l.content,ze.katexConfig({throwOnError:!1,displayMode:u}));return`<${h} ${f} data-processed>${p}</${h}>`},s=(l,a,h,c,u)=>r(l[a],`${v}-katex-inline`,"span",u),o=(l,a,h,c,u)=>r(l[a],`${v}-katex-block`,"p",u,!0);i.inline.ruler.before("escape","math_inline",Wb({delimiters:t||qc.inline})),i.block.ruler.after("blockquote","math_block",Yb({delimiters:n||qc.block}),{alt:["paragraph","reference","blockquote","list"]}),i.renderer.rules.math_inline=s,i.renderer.rules.math_block=o},Gb=(i,e)=>{const t=i.renderer.rules.fence.bind(i.renderer.rules);i.renderer.rules.fence=(n,r,s,o,l)=>{var c,u;const a=n[r],h=a.content.trim();if(a.info==="mermaid"){if(a.attrSet("class",`${v}-mermaid`),a.attrSet("data-mermaid-theme",e.themeRef.value),a.map&&a.level===0){const f=a.map[1]-1,p=!!((u=(c=o.srcLines[f])==null?void 0:c.trim())!=null&&u.startsWith("```"));a.attrSet("data-closed",`${p}`),a.attrSet("data-line",String(a.map[0]))}const d=no.get(h);return d?(a.attrSet("data-processed",""),a.attrSet("data-content",h),`<p ${l.renderAttrs(a)}>${d}</p>`):`<div ${l.renderAttrs(a)}>${i.utils.escapeHtml(h)}</div>`}return t(n,r,s,o,l)}},jc=(i,e,t)=>{const n=i.attrIndex(e),r=[e,t];n<0?i.attrPush(r):(i.attrs=i.attrs||[],i.attrs[n]=r)},Fb=i=>i.type==="inline",Ub=i=>i.type==="paragraph_open",Hb=i=>i.type==="list_item_open",Kb=i=>i.content.indexOf("[ ] ")===0||i.content.indexOf("[x] ")===0||i.content.indexOf("[X] ")===0,Jb=(i,e)=>Fb(i[e])&&Ub(i[e-1])&&Hb(i[e-2])&&Kb(i[e]),ev=(i,e)=>{const t=i[e].level-1;for(let n=e-1;n>=0;n--)if(i[n].level===t)return n;return-1},tv=i=>{const e=new i("html_inline","",0);return e.content="<label>",e},iv=i=>{const e=new i("html_inline","",0);return e.content="</label>",e},nv=(i,e,t)=>{const n=new t("html_inline","",0);return n.content='<label class="task-list-item-label" for="'+e+'">'+i+"</label>",n.attrs=[["for",e]],n},rv=(i,e,t)=>{const n=new e("html_inline","",0),r=t.enabled?" ":' disabled="" ';return i.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':(i.content.indexOf("[x] ")===0||i.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">'),n},sv=(i,e,t)=>{if(i.children=i.children||[],i.children.unshift(rv(i,e,t)),i.children[1].content=i.children[1].content.slice(3),i.content=i.content.slice(3),t.label)if(t.labelAfter){i.children.pop();const n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);i.children[0].content=i.children[0].content.slice(0,-1)+' id="'+n+'">',i.children.push(nv(i.content,n,e))}else i.children.unshift(tv(e)),i.children.push(iv(e))},ov=(i,e={})=>{i.core.ruler.after("inline","github-task-lists",t=>{const n=t.tokens;for(let r=2;r<n.length;r++)Jb(n,r)&&(sv(n[r],t.Token,e),jc(n[r-2],"class","task-list-item"+(e.enabled?" enabled":" ")),jc(n[ev(n,r-2)],"class","contains-task-list"))})},lv=i=>{i.core.ruler.push("init-line-number",e=>(e.tokens.forEach(t=>{t.map&&(t.attrs||(t.attrs=[]),t.attrs.push(["data-line",t.map[0].toString()]))}),!0))},av=(i,e)=>{const{editorConfig:t,markdownItConfig:n,markdownItPlugins:r,editorExtensions:s}=ze,o=P("editorId"),l=P("language"),a=P("usedLanguageText"),h=P("showCodeRowNumber"),c=P("theme"),u=P("customIcon"),d=P("rootRef"),f=P("setting"),p=he([]),m=Ib(i),O=zb(i),{reRenderRef:g,replaceMermaid:b}=Vb(i),{reRenderEcharts:Q,replaceEcharts:x}=Xb(i),k=R0({html:!0,breaks:!0,linkify:!0});n(k,{editorId:o});const $=[{type:"image",plugin:db,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:Db,options:{}},{type:"taskList",plugin:ov,options:{}},{type:"heading",plugin:jb,options:{mdHeadingId:i.mdHeadingId,headsRef:p}},{type:"code",plugin:Bb,options:{editorId:o,usedLanguageTextRef:a,codeFoldable:i.codeFoldable,autoFoldThreshold:i.autoFoldThreshold,customIconRef:u}},{type:"sub",plugin:mb,options:{}},{type:"sup",plugin:bb,options:{}}];i.noKatex||$.push({type:"katex",plugin:Nb,options:{katexRef:O}}),i.noMermaid||$.push({type:"mermaid",plugin:Gb,options:{themeRef:c}}),i.noEcharts||$.push({type:"echarts",plugin:qb,options:{themeRef:c}}),r($,{editorId:o}).forEach(W=>{k.use(W.plugin,W.options)});const C=k.options.highlight;k.set({highlight:(W,V,E)=>{if(C){const ee=C(W,V,E);if(ee)return ee}let H;!i.noHighlight&&m.value?m.value.getLanguage(V)?H=m.value.highlight(W,{language:V,ignoreIllegals:!0}).value:H=m.value.highlightAuto(W).value:H=k.utils.escapeHtml(W);const se=h?J0(H.replace(/^\n+|\n+$/g,""),W.replace(/^\n+|\n+$/g,"")):`<span class="${v}-code-block">${H.replace(/^\n+|\n+$/g,"")}</span>`;return`<pre><code class="language-${V}" language=${V}>${se}</code></pre>`}}),lv(k);const T=he(`_article-key_${da()}`),A=he(i.sanitize(k.render(i.modelValue,{srcLines:i.modelValue.split(`
|
|
66
|
+
`)})));let M=()=>{},B=()=>{};const R=()=>{var V,E;const W=(V=d.value)==null?void 0:V.querySelectorAll(`#${o} p.${v}-mermaid:not([data-closed=false])`);B(),B=hb(W,{customIcon:u.value}),(E=s.mermaid)!=null&&E.enableZoom&&(M(),M=cb(W,{customIcon:u.value}))},D=()=>{X.emit(o,Ks,A.value),i.onHtmlChanged(A.value),i.onGetCatalog(p.value),X.emit(o,Cr,p.value),Dt(()=>{b().then(R),x()})},q=()=>{p.value=[],A.value=i.sanitize(k.render(i.modelValue,{srcLines:i.modelValue.split(`
|
|
67
|
+
`)}))},G=ke(()=>(i.noKatex||!!O.value)&&(i.noHighlight||!!m.value));let I=-1;return le([ua(i,"modelValue"),G,g,l],()=>{I=window.setTimeout(()=>{q()},e?0:t.renderDelay)}),le(()=>f.value.preview,()=>{f.value.preview&&Dt(()=>{b().then(R),x(),X.emit(o,Cr,p.value)})}),le([A,Q],()=>{D()}),Ee(D),Ee(()=>{X.on(o,{name:Wf,callback(){X.emit(o,Cr,p.value)}}),X.on(o,{name:xh,callback:()=>{T.value=`_article-key_${da()}`,q()}})}),$i(()=>{M(),B(),clearTimeout(I)}),{html:A,key:T}},hv=(i,e)=>{const t=P("editorId"),n=P("setting"),{noImgZoomIn:r}=i,s=Df(()=>{const o=document.querySelectorAll(`#${t}-preview img:not(.not-zoom):not(.medium-zoom-image)`);o.length!==0&&$b(o,{background:"#00000073"})});Ee(async()=>{!r&&n.value.preview&&await s()}),le([e,()=>n.value.preview],async()=>{!r&&n.value.preview&&await s()})},Wc={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},cv=(i,e)=>{const t=P("editorId"),n=P("rootRef");let r=()=>{};const s=()=>{if(!n.value)return!1;const o=n.value.querySelectorAll(".task-list-item.enabled"),l=a=>{var p;a.preventDefault();const h=a.target.checked?"unChecked":"checked",c=(p=a.target.parentElement)==null?void 0:p.dataset.line;if(!c)return;const u=Number(c),d=i.modelValue.split(`
|
|
68
|
+
`),f=d[Number(u)].replace(Wc[h].regexp,Wc[h].value);i.previewOnly?(d[Number(u)]=f,i.onChange(d.join(`
|
|
69
|
+
`))):X.emit(t,Nf,u+1,f)};o.forEach(a=>{a.addEventListener("click",l)}),r=()=>{o.forEach(a=>{a.removeEventListener("click",l)})}};$i(()=>{r()}),le([e],()=>{r(),Dt(s)},{immediate:!0})},uv=(i,e,t)=>{const n=P("setting"),r=()=>{Dt(()=>{var o;(o=i.onRemount)==null||o.call(i)})},s=o=>{o&&r()};le([e,t],r),le(()=>n.value.preview,s),le(()=>n.value.htmlPreview,s),Ee(r)},sp={modelValue:{type:String,default:""},onChange:{type:Function,default:()=>{}},onHtmlChanged:{type:Function,default:()=>{}},onGetCatalog:{type:Function,default:()=>{}},mdHeadingId:{type:Function,default:()=>""},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:i=>i},noKatex:{type:Boolean,default:!1},formatCopiedText:{type:Function,default:i=>i},noHighlight:{type:Boolean,default:!1},previewOnly:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean},sanitizeMermaid:{type:Function},codeFoldable:{type:Boolean},autoFoldThreshold:{type:Number},onRemount:{type:Function},noEcharts:{type:Boolean},previewComponent:{type:[Object,Function],default:void 0}},dv={...sp,updateModelValue:{type:Function,default:()=>{}},placeholder:{type:String,default:""},scrollAuto:{type:Boolean},autofocus:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean},onBlur:{type:Function,default:()=>{}},onFocus:{type:Function,default:()=>{}},completions:{type:Array},onInput:{type:Function},onDrop:{type:Function,default:()=>{}},inputBoxWidth:{type:String},oninputBoxWidthChange:{type:Function},transformImgUrl:{type:Function,default:i=>i},catalogLayout:{type:String},catalogMaxDepth:{type:Number}},Yc=i=>{const e=new DOMParser().parseFromString(i,"text/html");return Array.from(e.body.childNodes)},fv=(i,e)=>i.nodeType!==e.nodeType?!1:i.nodeType===Node.TEXT_NODE||i.nodeType===Node.COMMENT_NODE?i.textContent===e.textContent:i.nodeType===Node.ELEMENT_NODE?i.outerHTML===e.outerHTML:i.isEqualNode?i.isEqualNode(e):!1,pv=ie({name:"UpdateOnDemand",props:{id:{type:String,required:!0},class:{type:[String,Array,Object],required:!0},html:{type:String,required:!0}},setup(i){const e=he(),t=i.html,n=(r,s)=>{if(!e.value)return;const o=e.value,l=Array.from(o.childNodes),a=Math.min(r.length,s.length);let h=-1;for(let u=0;u<a;u++)if(!fv(r[u],s[u])){h=u;break}if(h===-1)if(s.length>r.length)h=r.length;else if(r.length>s.length)h=s.length;else return;const c=Math.min(h,l.length);for(let u=l.length-1;u>=c;u--)l[u].remove();for(let u=h;u<r.length;u++)o.appendChild(r[u].cloneNode(!0))};return le(()=>i.html,(r,s)=>{const o=Yc(r),l=Yc(s||"");n(o,l)}),()=>w("div",{id:i.id,class:i.class,innerHTML:t,ref:e},null)}}),op=ie({name:"ContentPreview",props:sp,setup(i){const e=P("editorId"),t=P("setting"),n=P("previewTheme"),r=P("showCodeRowNumber"),{html:s,key:o}=av(i,i.previewOnly);Zb(i,s,o),hv(i,s),cv(i,s),uv(i,s,o);const l=ke(()=>[`${v}-preview`,`${n==null?void 0:n.value}-theme`,r&&`${v}-scrn`].filter(Boolean)),a=()=>{const h=`${e}-preview`;return i.previewComponent?qn(i.previewComponent,{key:o.value,html:s.value,id:h,class:l.value}):w(pv,{key:o.value,html:s.value,id:h,class:l.value},null)};return()=>w(ds,null,[t.value.preview&&(i.previewOnly?a():w("div",{id:`${e}-preview-wrapper`,class:`${v}-preview-wrapper`,key:"content-preview-wrapper"},[a()])),t.value.htmlPreview&&w("div",{id:`${e}-html-wrapper`,class:`${v}-preview-wrapper`,key:"html-preview-wrapper"},[w("div",{class:`${v}-html`},[s.value])])])}}),mv=({text:i})=>i,lp={modelValue:{type:String,default:""},onChange:{type:Function,default:void 0},theme:{type:String,default:"light"},class:{type:String,default:""},language:{type:String,default:"zh-CN"},onHtmlChanged:{type:Function,default:void 0},onGetCatalog:{type:Function,default:void 0},editorId:{type:String,default:void 0},id:{type:String,default:void 0},showCodeRowNumber:{type:Boolean,default:!0},previewTheme:{type:String,default:"default"},style:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:mv},sanitize:{type:Function,default:i=>i},noMermaid:{type:Boolean,default:!1},noKatex:{type:Boolean,default:!1},codeTheme:{type:String,default:"atom"},formatCopiedText:{type:Function,default:i=>i},codeStyleReverse:{type:Boolean,default:!0},codeStyleReverseList:{type:Array,default:["default","mk-cute"]},noHighlight:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean,default:!1},customIcon:{type:Object,default:{}},sanitizeMermaid:{type:Function,default:i=>Promise.resolve(i)},codeFoldable:{type:Boolean,default:!0},autoFoldThreshold:{type:Number,default:30},onRemount:{type:Function,default:void 0},noEcharts:{type:Boolean,default:!1},previewComponent:{type:[Object,Function],default:void 0}},Ov={...lp,onSave:{type:Function,default:void 0},onUploadImg:{type:Function,default:void 0},pageFullscreen:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1},toolbars:{type:Array,default:yh},floatingToolbars:{type:Array,default:[]},toolbarsExclude:{type:Array,default:[]},noPrettier:{type:Boolean,default:!1},tabWidth:{type:Number,default:2},tableShape:{type:Array,default:[6,4]},placeholder:{type:String,default:""},defToolbars:{type:[String,Object],default:void 0},onError:{type:Function,default:void 0},footers:{type:Array,default:kh},scrollAuto:{type:Boolean,default:!0},defFooters:{type:[String,Object],default:void 0},noUploadImg:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},maxLength:{type:Number,default:void 0},autoDetectCode:{type:Boolean,default:!1},onBlur:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},completions:{type:Array,default:void 0},showToolbarName:{type:Boolean,default:!1},onInput:{type:Function,default:void 0},onDrop:{type:Function,default:void 0},inputBoxWidth:{type:String,default:"50%"},oninputBoxWidthChange:{type:Function,default:void 0},transformImgUrl:{type:Function,default:i=>i},catalogLayout:{type:String,default:"fixed"},catalogMaxDepth:{type:Number,default:void 0}},ap=["onHtmlChanged","onGetCatalog","onChange","onRemount","update:modelValue"],gv=[...ap,"onSave","onUploadImg","onError","onBlur","onFocus","onInput","onDrop","oninputBoxWidthChange"],bv=(i,e,t)=>{const{editorId:n}=t,r={rerender(){X.emit(n,xh)}};e.expose(r)},Ar=ie({name:"MdPreview",props:lp,emits:ap,setup(i,e){const{noKatex:t,noMermaid:n,noHighlight:r}=i,s=he(),o=rp(i);np(i,{rootRef:s,editorId:o}),bv(i,e,{editorId:o}),$i(()=>{X.clear(o)});const l=u=>{var d;(d=i.onChange)==null||d.call(i,u),e.emit("onChange",u),e.emit("update:modelValue",u)},a=u=>{var d;(d=i.onHtmlChanged)==null||d.call(i,u),e.emit("onHtmlChanged",u)},h=u=>{var d;(d=i.onGetCatalog)==null||d.call(i,u),e.emit("onGetCatalog",u)},c=()=>{var u;(u=i.onRemount)==null||u.call(i),e.emit("onRemount")};return()=>w("div",{id:o,class:[v,i.class,i.theme==="dark"&&`${v}-dark`,`${v}-previewOnly`],style:i.style,ref:s},[w(op,{modelValue:i.modelValue,onChange:l,onHtmlChanged:a,onGetCatalog:h,mdHeadingId:i.mdHeadingId,noMermaid:n,sanitize:i.sanitize,noKatex:t,formatCopiedText:i.formatCopiedText,noHighlight:r,noImgZoomIn:i.noImgZoomIn,previewOnly:!0,sanitizeMermaid:i.sanitizeMermaid,codeFoldable:i.codeFoldable,autoFoldThreshold:i.autoFoldThreshold,onRemount:c,noEcharts:i.noEcharts,previewComponent:i.previewComponent},null)])}});Ar.install=i=>(i.component(Ar.name,Ar),i);/**
|
|
70
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const Nc=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vv=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),yv=i=>{const e=vv(i);return e.charAt(0).toUpperCase()+e.slice(1)},kv=(...i)=>i.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim(),Gc=i=>i==="";/**
|
|
75
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/var dr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
80
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const Sv=({name:i,iconNode:e,absoluteStrokeWidth:t,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":s,size:o=dr.width,color:l=dr.stroke,...a},{slots:h})=>qn("svg",{...dr,...a,width:o,height:o,stroke:l,"stroke-width":Gc(t)||Gc(n)||t===!0||n===!0?Number(r||s||dr["stroke-width"])*24/Number(o):r||s||dr["stroke-width"],class:kv("lucide",a.class,...i?[`lucide-${Nc(yv(i))}-icon`,`lucide-${Nc(i)}`]:["lucide-icon"])},[...e.map(c=>qn(...c)),...h.default?[h.default()]:[]]);/**
|
|
85
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const ye=(i,e)=>(t,{slots:n,attrs:r})=>qn(Sv,{...r,...t,iconNode:e,name:i},n);/**
|
|
90
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const xv=ye("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
|
|
95
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const wv=ye("chart-area",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",key:"q0gr47"}]]);/**
|
|
100
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const Qv=ye("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
105
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const $v=ye("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);/**
|
|
110
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const Pv=ye("expand",[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]);/**
|
|
115
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Tv=ye("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
120
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const Cv=ye("forward",[["path",{d:"m15 17 5-5-5-5",key:"nf172w"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]);/**
|
|
125
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Av=ye("heading",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]);/**
|
|
130
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const _v=ye("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
135
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const Ev=ye("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
|
|
140
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const Lv=ye("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
145
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Rv=ye("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);/**
|
|
150
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const Mv=ye("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);/**
|
|
155
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Zv=ye("list-tree",[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]);/**
|
|
160
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const Xv=ye("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);/**
|
|
165
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const Iv=ye("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
|
|
170
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const zv=ye("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
|
|
175
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const Vv=ye("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
180
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const Dv=ye("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);/**
|
|
185
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const Bv=ye("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
190
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const qv=ye("shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]);/**
|
|
195
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const Fc=ye("square-code",[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
|
|
200
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const jv=ye("square-sigma",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]]);/**
|
|
205
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const Wv=ye("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
|
|
210
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const Yv=ye("subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/**
|
|
215
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const Nv=ye("superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/**
|
|
220
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const Gv=ye("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
225
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const Fv=ye("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
|
|
230
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const Uv=ye("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
235
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const Hv=ye("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/**
|
|
240
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const Kv=ye("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]);/**
|
|
245
|
+
* @license lucide-vue-next v0.543.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const Jv=ye("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),e1=()=>w("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-github-icon"},[w("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},null),w("path",{d:"M9 18c-4.51 2-5-2-7-2"},null)]),t1={bold:xv,underline:Uv,italic:Ev,"strike-through":Wv,title:Av,sub:Yv,sup:Nv,quote:Vv,"unordered-list":Xv,"ordered-list":Rv,task:Mv,"code-row":$v,code:Fc,link:Lv,image:_v,table:Gv,revoke:Dv,next:Cv,save:Bv,prettier:Fc,minimize:zv,maximize:Iv,"fullscreen-exit":qv,fullscreen:Pv,"preview-only":Kv,preview:Tv,"preview-html":Qv,catalog:Zv,github:e1,mermaid:wv,formula:jv,close:Jv,delete:Fv,upload:Hv},i1=ie({name:`${v}-icon-set`,props:{name:{type:String,default:""}},setup(i){return()=>qn(t1[i.name],{class:`${v}-icon`})}}),be=ie({name:`${v}-icon`,props:{name:{type:String,default:""}},setup(i){const e=P("customIcon");return()=>{const t=e.value[i.name];return typeof t=="object"?typeof t.component=="object"?qn(t.component,t.props):w("span",{innerHTML:t.component},null):w(i1,{name:i.name},null)}}}),n1={title:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String,default:void 0},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},Tn=ie({name:"MdModal",props:n1,emits:["onClose"],setup(i,e){const t=P("theme"),n=P("rootRef"),r=he(i.visible),s=he([`${v}-modal`]),o=he(),l=he(),a=he(),h=qi();let c=()=>{};const u=zt({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{insetInlineStart:"0px",insetBlockStart:"0px"},historyPos:{insetInlineStart:"0px",insetBlockStart:"0px"}}),d=ke(()=>i.isFullscreen?{width:"100%",height:"100%"}:{width:i.width,height:i.height});le(()=>i.isFullscreen,m=>{m?c():Dt(()=>{c=Ic(l.value,(O,g)=>{u.initPos.insetInlineStart=O+"px",u.initPos.insetBlockStart=g+"px"})})}),le(()=>i.visible,m=>{m?(u.maskStyle.zIndex=ze.editorConfig.zIndex+Xc(),u.modalStyle.zIndex=ze.editorConfig.zIndex+Xc(),s.value.push("zoom-in"),r.value=m,Dt(()=>{const O=o.value.offsetWidth/2,g=o.value.offsetHeight/2,b=document.documentElement.clientWidth/2,Q=document.documentElement.clientHeight/2;u.initPos.insetInlineStart=b-O+"px",u.initPos.insetBlockStart=Q-g+"px",i.isFullscreen||(c=Ic(l.value,(x,k)=>{u.initPos.insetInlineStart=x+"px",u.initPos.insetBlockStart=k+"px"}))}),setTimeout(()=>{s.value=s.value.filter(O=>O!=="zoom-in")},140)):(s.value.push("zoom-out"),c(),setTimeout(()=>{s.value=s.value.filter(O=>O!=="zoom-out"),r.value=m},130))});const f=ke(()=>({display:r.value?"block":"none"})),p=ke(()=>{if(typeof i.style=="string"){const m=Object.entries(f.value).map(([O,g])=>`${O}: ${g}`).join("; ");return[i.style,m].join("; ")}else return i.style instanceof Object?{...f.value,...i.style}:f.value});return Ee(()=>{var O;const m=(O=n.value)==null?void 0:O.getRootNode();a.value=m instanceof Document?document.body:m}),()=>{const m=at({ctx:e}),O=at({props:i,ctx:e},"title");return a.value?w(_0,{to:a.value},{default:()=>[w("div",{ref:h,class:`${v}-modal-container`,"data-theme":t.value},[w("div",{class:i.class,style:p.value},[i.showMask&&w("div",{class:`${v}-modal-mask`,style:u.maskStyle,onClick:()=>{var g;(g=i.onClose)==null||g.call(i),e.emit("onClose")}},null),w("div",{class:s.value,style:{...u.modalStyle,...u.initPos,...d.value},ref:o},[w("div",{class:`${v}-modal-header`,ref:l},[O||""]),w("div",{class:`${v}-modal-body`},[m]),w("div",{class:`${v}-modal-func`},[i.showAdjust&&w("div",{class:`${v}-modal-adjust`,onClick:g=>{g.stopPropagation(),i.isFullscreen?u.initPos=u.historyPos:(u.historyPos=u.initPos,u.initPos={insetInlineStart:"0",insetBlockStart:"0"}),i.onAdjust(!i.isFullscreen)}},[w(be,{name:i.isFullscreen?"minimize":"maximize"},null)]),w("div",{class:`${v}-modal-close`,onClick:g=>{var b;g.stopPropagation(),(b=i.onClose)==null||b.call(i),e.emit("onClose")}},[w(be,{name:"close"},null)])])])])])]}):""}}});Tn.install=i=>(i.component(Tn.name,Tn),i);function r1(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!E0(i)}const s1={title:{type:String,default:""},modalTitle:{type:[String,Object],default:""},visible:{type:Boolean,default:void 0},width:{type:String,default:"auto"},height:{type:String,default:"auto"},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:void 0},class:{type:String,default:void 0},style:{type:[Object,String],default:void 0},showMask:{type:Boolean,default:!0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},_r=ie({name:"ModalToolbar",props:s1,emits:["onClick","onClose","onAdjust"],setup(i,e){const t=()=>{var r;(r=i.onClose)==null||r.call(i),e.emit("onClose")},n=r=>{var s;(s=i.onAdjust)==null||s.call(i,r),e.emit("onAdjust",r)};return()=>{const r=at({props:i,ctx:e},"trigger"),s=at({props:i,ctx:e},"modalTitle"),o=at({props:i,ctx:e});return w(ds,null,[w("button",{class:[`${v}-toolbar-item`,i.disabled&&`${v}-disabled`],title:i.title,disabled:i.disabled,onClick:()=>{var l;(l=i.onClick)==null||l.call(i),e.emit("onClick")},type:"button"},[r]),w(Tn,{style:i.style,class:i.class,width:i.width,height:i.height,title:s,visible:i.visible,showMask:i.showMask,onClose:t,showAdjust:i.showAdjust,isFullscreen:i.isFullscreen,onAdjust:n},r1(o)?o:{default:()=>[o]})])}}});_r.install=i=>(i.component(_r.name,_r),i);const o1={title:{type:String,default:""},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},Er=ie({name:"NormalToolbar",props:o1,emits:["onClick"],setup(i,e){return()=>{const t=at({props:i,ctx:e},"trigger"),n=at({props:i,ctx:e});return w("button",{class:[`${v}-toolbar-item`,i.disabled&&`${v}-disabled`],title:i.title,disabled:i.disabled,onClick:r=>{var s;(s=i.onClick)==null||s.call(i,r),e.emit("onClick",r)},type:"button"},[n||t])}}});Er.install=i=>(i.component(Er.name,Er),i);let ka=[],hp=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<i.length;e++)(e%2?hp:ka).push(t=t+i[e])})();function l1(i){if(i<768)return!1;for(let e=0,t=ka.length;;){let n=e+t>>1;if(i<ka[n])t=n;else if(i>=hp[n])e=n+1;else return!0;if(e==t)return!1}}function Uc(i){return i>=127462&&i<=127487}const Hc=8205;function a1(i,e,t=!0,n=!0){return(t?cp:h1)(i,e,n)}function cp(i,e,t){if(e==i.length)return e;e&&up(i.charCodeAt(e))&&dp(i.charCodeAt(e-1))&&e--;let n=gl(i,e);for(e+=Kc(n);e<i.length;){let r=gl(i,e);if(n==Hc||r==Hc||t&&l1(r))e+=Kc(r),n=r;else if(Uc(r)){let s=0,o=e-2;for(;o>=0&&Uc(gl(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function h1(i,e,t){for(;e>0;){let n=cp(i,e-2,t);if(n<e)return n;e--}return 0}function gl(i,e){let t=i.charCodeAt(e);if(!dp(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return up(n)?(t-55296<<10)+(n-56320)+65536:t}function up(i){return i>=56320&&i<57344}function dp(i){return i>=55296&&i<56320}function Kc(i){return i<65536?1:2}class ge{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=jn(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ai.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=jn(this,e,t);let n=[];return this.decompose(e,t,n,0),ai.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Lr(this),s=new Lr(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new Lr(this,e)}iterRange(e,t=this.length){return new fp(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new pp(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ge.empty:e.length<=32?new Ie(e):ai.from(Ie.split(e,[]))}}class Ie extends ge{constructor(e,t=c1(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new u1(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new Ie(Jc(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=ro(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new Ie(l,o.length+s.length));else{let a=l.length>>1;n.push(new Ie(l.slice(0,a)),new Ie(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof Ie))return super.replace(e,t,n);[e,t]=jn(this,e,t);let r=ro(this.text,ro(n.text,Jc(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new Ie(r,s):ai.from(Ie.split(r,[]),s)}sliceString(e,t=this.length,n=`
|
|
250
|
+
`){[e,t]=jn(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new Ie(n,r)),n=[],r=-1);return r>-1&&t.push(new Ie(n,r)),t}}class ai extends ge{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?n.push(l):l.decompose(e-o,t-o,n,h)}o=a+1}}replace(e,t,n){if([e,t]=jn(this,e,t),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,n),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new ai(c,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
251
|
+
`){[e,t]=jn(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ai))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let f of e)n+=f.lines;if(n<32){let f=[];for(let p of e)p.flatten(f);return new Ie(f,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function u(f){let p;if(f.lines>s&&f instanceof ai)for(let m of f.children)u(m);else f.lines>o&&(a>o||!a)?(d(),l.push(f)):f instanceof Ie&&a&&(p=c[c.length-1])instanceof Ie&&f.lines+p.lines<=32?(a+=f.lines,h+=f.length+1,c[c.length-1]=new Ie(p.text.concat(f.text),p.length+1+f.length)):(a+f.lines>r&&d(),a+=f.lines,h+=f.length+1,c.push(f))}function d(){a!=0&&(l.push(c.length==1?c[0]:ai.from(c,h)),h=-1,a=c.length=0)}for(let f of e)u(f);return d(),l.length==1?l[0]:new ai(l,t)}}ge.empty=new Ie([""],0);function c1(i){let e=-1;for(let t of i)e+=t.length+1;return e}function ro(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s<i.length&&r<=n;s++){let l=i[s],a=r+l.length;a>=t&&(a>n&&(l=l.slice(0,n-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function Jc(i,e,t){return ro(i,[""],e,t)}class Lr{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Ie?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Ie?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
252
|
+
`,this;e--}else if(r instanceof Ie){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ie?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class fp{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Lr(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class pp{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ge.prototype[Symbol.iterator]=function(){return this.iter()},Lr.prototype[Symbol.iterator]=fp.prototype[Symbol.iterator]=pp.prototype[Symbol.iterator]=function(){return this});let u1=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function jn(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Fe(i,e,t=!0,n=!0){return a1(i,e,t,n)}function d1(i){return i>=56320&&i<57344}function f1(i){return i>=55296&&i<56320}function Mi(i,e){let t=i.charCodeAt(e);if(!f1(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return d1(n)?(t-55296<<10)+(n-56320)+65536:t}function mp(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function tn(i){return i<65536?1:2}const Sa=/\r\n?|\n/;var ot=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(ot||(ot={}));class mi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,t=!1){xa(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new mi(e)}composeDesc(e){return this.empty?e:e.empty?this:Op(this,e)}mapDesc(e,t=!1){return e.empty?this:wa(this,e,t)}mapPos(e,t=-1,n=ot.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=r+l;if(a<0){if(h>e)return s+(e-r);s+=l}else{if(n!=ot.Simple&&h>=e&&(n==ot.TrackDel&&r<e&&h>e||n==ot.TrackBefore&&r<e||n==ot.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new mi(e)}static create(e){return new mi(e)}}class je extends mi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return xa(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return wa(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(ge.empty);n.push(o?e.slice(s,s+o):ge.empty)}s+=o}return new je(t,n)}compose(e){return this.empty?e:e.empty?this:Op(this,e,!0)}map(e,t=!1){return e.empty?this:wa(this,e,t,!0)}iterChanges(e,t=!1){xa(this,e,t)}get desc(){return mi.create(this.sections)}filter(e){let t=[],n=[],r=[],s=new jr(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,a-l);et(r,c,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;et(t,c,u),u>0&&Vi(n,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l<h;){if(s.done)break e;let c=Math.min(s.len,h-l);et(t,c,-1),et(r,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),l+=c}}return{changes:new je(t,n),filtered:mi.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;o<t&&et(r,t-o,-1);let u=new je(r,s);l=l?l.compose(u.map(l)):u,r=[],s=[],o=0}function h(c){if(Array.isArray(c))for(let u of c)h(u);else if(c instanceof je){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:u,to:d=u,insert:f}=c;if(u>d||u<0||d>t)throw new RangeError(`Invalid change range ${u} to ${d} (in doc of length ${t})`);let p=f?typeof f=="string"?ge.of(f.split(n||Sa)):f:ge.empty,m=p.length;if(u==d&&m==0)return;u<o&&a(),u>o&&et(r,u-o,-1),et(r,d-u,m),Vi(s,r,p),o=d}}return h(e),a(!l),l}static empty(e){return new je(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<r;)n.push(ge.empty);n[r]=ge.of(s.slice(1)),t.push(s[0],n[r].length)}}}return new je(t,n)}static createSet(e,t){return new je(e,t)}}function et(i,e,t,n=!1){if(e==0&&t<=0)return;let r=i.length-2;r>=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Vi(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<n;)i.push(ge.empty);i.push(t)}}function xa(i,e,t){let n=i.inserted;for(let r=0,s=0,o=0;o<i.sections.length;){let l=i.sections[o++],a=i.sections[o++];if(a<0)r+=l,s+=l;else{let h=r,c=s,u=ge.empty;for(;h+=l,c+=a,a&&n&&(u=u.append(n[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,h,s,c,u),r=h,s=c}}}function wa(i,e,t,n=!1){let r=[],s=n?[]:null,o=new jr(i),l=new jr(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);et(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(et(r,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(et(r,0,o.ins),s&&Vi(s,r,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let u=Math.min(c,l.len);h+=u,c-=u,l.forward(u)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;et(r,h,a<o.i?o.ins:0),s&&a<o.i&&Vi(s,r,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return s?je.createSet(r,s):mi.create(r);throw new Error("Mismatched change set lengths")}}}function Op(i,e,t=!1){let n=[],r=t?[]:null,s=new jr(i),o=new jr(e);for(let l=!1;;){if(s.done&&o.done)return r?je.createSet(n,r):mi.create(n);if(s.ins==0)et(n,s.len,0,l),s.next();else if(o.len==0&&!o.done)et(n,0,o.ins,l),r&&Vi(r,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),h=n.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;et(n,a,c,l),r&&c&&Vi(r,n,o.text)}else o.ins==-1?(et(n,s.off?0:s.len,a,l),r&&Vi(r,n,s.textBit(a))):(et(n,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Vi(r,n,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||n.length>h),s.forward2(a),o.forward(a)}}}}class jr{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?ge.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?ge.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class sn{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new sn(n,r,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Z.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Z.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Z.range(e.anchor,e.head)}static create(e,t,n){return new sn(e,t,n)}}class Z{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Z.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Z([this.main],0)}addRange(e,t=!0){return Z.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,Z.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Z(e.ranges.map(t=>sn.fromJSON(t)),e.main)}static single(e,t=e){return new Z([Z.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return Z.normalized(e.slice(),t);n=s.to}return new Z(e,t)}static cursor(e,t=0,n,r){return sn.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,s){let o=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=t&&(s=t<e?1:-1),t<e?sn.create(t,e,48|o):sn.create(e,t,(s?s<0?8:16:0)|o)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?Z.range(a,l):Z.range(l,a))}}return new Z(e,t)}}function gp(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let wh=0;class te{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=wh++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new te(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Qh),!!e.static,e.enables)}of(e){return new so([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new so(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new so(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function Qh(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class so{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=wh++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?h=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||c.push(e[u.id]);return{create(u){return u.values[o]=n(u),1},update(u,d){if(a&&d.docChanged||h&&(d.docChanged||d.selection)||Qa(u,c)){let f=n(u);if(l?!eu(f,u.values[o],r):!r(f,u.values[o]))return u.values[o]=f,1}return 0},reconfigure:(u,d)=>{let f,p=d.config.address[s];if(p!=null){let m=yo(d,p);if(this.dependencies.every(O=>O instanceof te?d.facet(O)===u.facet(O):O instanceof Ot?d.field(O,!1)==u.field(O,!1):!0)||(l?eu(f=n(u),m,r):r(f=n(u),m)))return u.values[o]=m,0}else f=n(u);return u.values[o]=f,1}}}}function eu(i,e,t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!t(i[n],e[n]))return!1;return!0}function Qa(i,e){let t=!1;for(let n of e)Rr(i,n)&1&&(t=!0);return t}function p1(i,e,t){let n=t.map(a=>i[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let h=[];for(let c=0;c<n.length;c++){let u=yo(a,n[c]);if(r[c]==2)for(let d of u)h.push(d);else h.push(u)}return e.combine(h)}return{create(a){for(let h of n)Rr(a,h);return a.values[o]=l(a),1},update(a,h){if(!Qa(a,s))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=Qa(a,n),u=h.config.facets[e.id],d=h.facet(e);if(u&&!c&&Qh(t,u))return a.values[o]=d,0;let f=l(a);return e.compare(f,d)?(a.values[o]=d,0):(a.values[o]=f,1)}}}const $s=te.define({static:!0});class Ot{constructor(e,t,n,r,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new Ot(wh++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet($s).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet($s),o=r.facet($s),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,$s.of({field:this,create:e})]}get extension(){return this}}const nn={lowest:4,low:3,default:2,high:1,highest:0};function fr(i){return e=>new bp(e,i)}const Pi={highest:fr(nn.highest),high:fr(nn.high),default:fr(nn.default),low:fr(nn.low),lowest:fr(nn.lowest)};class bp{constructor(e,t){this.inner=e,this.prec=t}}class hi{of(e){return new $a(this,e)}reconfigure(e){return hi.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class $a{constructor(e,t){this.compartment=e,this.inner=t}}class vo{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let d of m1(e,t,o))d instanceof Ot?r.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],h=[];for(let d of r)l[d.id]=h.length<<1,h.push(f=>d.slot(f));let c=n==null?void 0:n.config.facets;for(let d in s){let f=s[d],p=f[0].facet,m=c&&c[d]||[];if(f.every(O=>O.type==0))if(l[p.id]=a.length<<1|1,Qh(m,f))a.push(n.facet(p));else{let O=p.combine(f.map(g=>g.value));a.push(n&&p.compare(O,n.facet(p))?n.facet(p):O)}else{for(let O of f)O.type==0?(l[O.id]=a.length<<1|1,a.push(O.value)):(l[O.id]=h.length<<1,h.push(g=>O.dynamicSlot(g)));l[p.id]=h.length<<1,h.push(O=>p1(O,p,f))}}let u=h.map(d=>d(l));return new vo(e,o,u,l,a,s)}}function m1(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=n[a].indexOf(o);h>-1&&n[a].splice(h,1),o instanceof $a&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof $a){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof bp)s(o.inner,o.prec);else if(o instanceof Ot)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof so)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,nn.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(i,nn.default),n.reduce((o,l)=>o.concat(l))}function Rr(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function yo(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const vp=te.define(),Pa=te.define({combine:i=>i.some(e=>e),static:!0}),yp=te.define({combine:i=>i.length?i[0]:void 0,static:!0}),kp=te.define(),Sp=te.define(),xp=te.define(),wp=te.define({combine:i=>i.length?i[0]:!1});class Ti{constructor(e,t){this.type=e,this.value=t}static define(){return new O1}}class O1{of(e){return new Ti(this,e)}}class g1{constructor(e){this.map=e}of(e){return new de(this,e)}}class de{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new de(this.type,t)}is(e){return this.type==e}static define(e={}){return new g1(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}de.reconfigure=de.define();de.appendConfig=de.define();class De{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&gp(n,t.newLength),s.some(l=>l.type==De.time)||(this.annotations=s.concat(De.time.of(Date.now())))}static create(e,t,n,r,s,o){return new De(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(De.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}De.time=Ti.define();De.userEvent=Ti.define();De.addToHistory=Ti.define();De.remote=Ti.define();function b1(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n<i.length&&(r==e.length||e[r]>=i[n]))s=i[n++],o=i[n++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Qp(i,e,t){var n;let r,s,o;return t?(r=e.changes,s=je.empty(e.changes.length),o=i.changes.compose(e.changes)):(r=e.changes.map(i.changes),s=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(n=i.selection)===null||n===void 0?void 0:n.map(r),effects:de.mapEffects(i.effects,r).concat(de.mapEffects(e.effects,s)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function Ta(i,e,t){let n=e.selection,r=Cn(e.annotations);return e.userEvent&&(r=r.concat(De.userEvent.of(e.userEvent))),{changes:e.changes instanceof je?e.changes:je.of(e.changes||[],t,i.facet(yp)),selection:n&&(n instanceof Z?n:Z.single(n.anchor,n.head)),effects:Cn(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function $p(i,e,t){let n=Ta(i,e.length?e[0]:{},i.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;n=Qp(n,Ta(i,e[s],o?n.changes.newLength:i.doc.length),o)}let r=De.create(i,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return y1(t?v1(r):r)}function v1(i){let e=i.startState,t=!0;for(let r of e.facet(kp)){let s=r(i);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:b1(t,s))}if(t!==!0){let r,s;if(t===!1)s=i.changes.invertedDesc,r=je.empty(e.doc.length);else{let o=i.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}i=De.create(e,r,i.selection&&i.selection.map(s),de.mapEffects(i.effects,s),i.annotations,i.scrollIntoView)}let n=e.facet(Sp);for(let r=n.length-1;r>=0;r--){let s=n[r](i);s instanceof De?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof De?i=s[0]:i=$p(e,Cn(s),!1)}return i}function y1(i){let e=i.startState,t=e.facet(xp),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Qp(n,Ta(e,s,i.changes.newLength),!0))}return n==i?i:De.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const k1=[];function Cn(i){return i==null?k1:Array.isArray(i)?i:[i]}var Ke=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(Ke||(Ke={}));const S1=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ca;try{Ca=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function x1(i){if(Ca)return Ca.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||S1.test(t)))return!0}return!1}function w1(i){return e=>{if(!/\S/.test(e))return Ke.Space;if(x1(e))return Ke.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return Ke.Word;return Ke.Other}}class Oe{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Rr(this,l<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return Rr(this,n),yo(this,n)}update(...e){return $p(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:r}=t;for(let l of e.effects)l.is(hi.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,h)=>r.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(de.reconfigure)?(t=null,n=l.value):l.is(de.appendConfig)&&(t=null,n=Cn(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=vo.resolve(n,r,this),s=new Oe(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Pa)?e.newSelection:e.newSelection.asSingle();new Oe(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Z.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Cn(n.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(r);for(let d=0;d<l;d++)s[d]=s[d].map(c);let u=r.mapDesc(h,!0);s.push(a.range.map(u)),r=r.compose(c),o=de.mapEffects(o,c).concat(de.mapEffects(Cn(a.effects),u))}return{changes:r,selection:Z.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof je?e:je.of(e,this.doc.length,this.facet(Oe.lineSeparator))}toText(e){return ge.of(e.split(this.facet(Oe.lineSeparator)||Sa))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Rr(this,t),yo(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ot&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return Oe.create({doc:e.doc,selection:Z.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=vo.resolve(e.extensions||[],new Map),n=e.doc instanceof ge?e.doc:ge.of((e.doc||"").split(t.staticFacet(Oe.lineSeparator)||Sa)),r=e.selection?e.selection instanceof Z?e.selection:Z.single(e.selection.anchor,e.selection.head):Z.single(0);return gp(r,n.length),t.staticFacet(Pa)||(r=r.asSingle()),new Oe(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Oe.tabSize)}get lineBreak(){return this.facet(Oe.lineSeparator)||`
|
|
253
|
+
`}get readOnly(){return this.facet(wp)}phrase(e,...t){for(let n of this.facet(Oe.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(vp))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return w1(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Fe(t,o,!1);if(s(t.slice(a,o))!=Ke.Word)break;o=a}for(;l<r;){let a=Fe(t,l);if(s(t.slice(l,a))!=Ke.Word)break;l=a}return o==l?null:Z.range(o+n,l+n)}}Oe.allowMultipleSelections=Pa;Oe.tabSize=te.define({combine:i=>i.length?i[0]:4});Oe.lineSeparator=yp;Oe.readOnly=wp;Oe.phrases=te.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});Oe.languageData=vp;Oe.changeFilter=kp;Oe.transactionFilter=Sp;Oe.transactionExtender=xp;hi.reconfigure=de.define();function Jo(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class ji{eq(e){return this==e}range(e,t=e){return Aa.create(e,t,this)}}ji.prototype.startSide=ji.prototype.endSide=0;ji.prototype.point=!1;ji.prototype.mapMode=ot.TrackDel;function $h(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}let Aa=class Pp{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Pp(e,t,n)}};function _a(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class Ph{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,h=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,u=this.to[a]+e,d,f;if(c==u){let p=t.mapPos(c,h.startSide,h.mapMode);if(p==null||(d=f=p,h.startSide!=h.endSide&&(f=t.mapPos(c,h.endSide),f<d)))continue}else if(d=t.mapPos(c,h.startSide),f=t.mapPos(u,h.endSide),d>f||d==f&&h.startSide>0&&h.endSide<=0)continue;(f-d||h.endSide-h.startSide)<0||(o<0&&(o=d),h.point&&(l=Math.max(l,f-d)),n.push(h),r.push(d-o),s.push(f-o))}return{mapped:n.length?new Ph(r,s,n,l):null,pos:o}}}class we{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new we(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(_a)),this.isEmpty)return t.length?we.of(t):this;let l=new Tp(this,null,-1).goto(0),a=0,h=[],c=new dn;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let u=t[a++];c.addInner(u.from,u.to,u.value)||h.push(u)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(Aa.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?we.empty:this.nextLayer.update({add:h,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:u}=a.map(l,e);c&&(r=Math.max(r,c.maxPoint),t.push(c),n.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new we(n,t,s||we.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Wr.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Wr.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),l=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=tu(o,l,n),h=new pr(o,a,s),c=new pr(l,a,s);n.iterGaps((u,d,f)=>iu(h,u,c,d,f,r)),n.empty&&n.length==0&&iu(h,0,c,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=tu(s,o),a=new pr(s,l,0).goto(n),h=new pr(o,l,0).goto(n);for(;;){if(a.to!=h.to||!Ea(a.active,h.active)||a.point&&(!h.point||!$h(a.point,h.point)))return!1;if(a.to>r)return!0;a.next(),h.next()}}static spans(e,t,n,r,s=-1){let o=new pr(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,n);if(o.point){let c=o.activeForPoint(o.to),u=o.pointFrom<t?c.length+1:o.point.startSide<0?c.length:Math.min(c.length,a);r.point(l,h,o.point,c,u,o.pointRank),a=Math.min(o.openEnd(h),c.length)}else h>l&&(r.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new dn;for(let r of e instanceof Aa?[e]:t?Q1(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return we.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=we.empty;r=r.nextLayer)t=new we(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}we.empty=new we([],[],null,-1);function Q1(i){if(i.length>1)for(let e=i[0],t=1;t<i.length;t++){let n=i[t];if(_a(e,n)>0)return i.slice().sort(_a);e=n}return i}we.empty.nextLayer=we.empty;class dn{finishChunk(e){this.chunks.push(new Ph(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new dn)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(we.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=we.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function tu(i,e,t){let n=new Map;for(let s of i)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=n.get(s.chunk[o]);l!=null&&(t?t.mapPos(l):l)==s.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+s.chunk[o].length))&&r.add(s.chunk[o])}return r}class Tp{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Wr{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new Tp(o,t,n,s));return r.length==1?r[0]:new Wr(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)bl(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)bl(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),bl(this.heap,0)}}}function bl(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1<i.length&&r.compare(i[n+1])>=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class pr{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Wr.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ps(this.active,e),Ps(this.activeTo,e),Ps(this.activeRank,e),this.minActive=nu(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Ts(this.active,t,n),Ts(this.activeTo,t,r),Ts(this.activeRank,t,s),e&&Ts(e,t,this.cursor.from),this.minActive=nu(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Ps(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function iu(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e,h=!!s.boundChange;for(let c=!1;;){let u=i.to+a-t.to,d=u||i.endSide-t.endSide,f=d<0?i.to+a:t.to,p=Math.min(f,o);if(i.point||t.point?(i.point&&t.point&&$h(i.point,t.point)&&Ea(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,p,i.point,t.point),c=!1):(c&&s.boundChange(l),p>l&&!Ea(i.active,t.active)&&s.compareRange(l,p,i.active,t.active),h&&p<o&&(u||i.openEnd(f)!=t.openEnd(f))&&(c=!0)),f>o)break;l=f,d<=0&&i.next(),d>=0&&t.next()}}function Ea(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t]&&!$h(i[t],e[t]))return!1;return!0}function Ps(i,e){for(let t=e,n=i.length-1;t<n;t++)i[t]=i[t+1];i.pop()}function Ts(i,e,t){for(let n=i.length-1;n>=e;n--)i[n+1]=i[n];i[e]=t}function nu(i,e){let t=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||i[r].endSide-i[t].endSide)<0&&(t=r,n=e[r]);return t}function wi(i,e,t=i.length){let n=0;for(let r=0;r<t&&r<i.length;)i.charCodeAt(r)==9?(n+=e-n%e,r++):(n++,r=Fe(i,r));return n}function $1(i,e,t,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=Fe(i,r)}return i.length}const La="ͼ",ru=typeof Symbol>"u"?"__"+La:Symbol.for(La),Ra=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),su=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Wi{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,h){let c=[],u=/^@(\w+)\b/.exec(o[0]),d=u&&u[1]=="keyframes";if(u&&l==null)return a.push(o[0]+";");for(let f in l){let p=l[f];if(/&/.test(f))s(f.split(/,\s*/).map(m=>o.map(O=>m.replace(/&/,O))).reduce((m,O)=>m.concat(O)),p,a);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+f+") should be a primitive value.");s(r(f),p,c,d)}else p!=null&&c.push(f.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||d)&&a.push((n&&!u&&!h?o.map(n):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
254
|
+
`)}static newName(){let e=su[ru]||1;return su[ru]=e+1,La+e.toString(36)}static mount(e,t,n){let r=e[Ra],s=n&&n.nonce;r?s&&r.setNonce(s):r=new P1(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let ou=new Map;class P1{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=ou.get(n);if(s)return e[Ra]=s;this.sheet=new r.CSSStyleSheet,ou.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ra]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let h=0;h<l.rules.length;h++)n.insertRule(l.rules[h],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
255
|
+
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Yi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},T1=typeof navigator<"u"&&/Mac/.test(navigator.platform),C1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var He=0;He<10;He++)Yi[48+He]=Yi[96+He]=String(He);for(var He=1;He<=24;He++)Yi[He+111]="F"+He;for(var He=65;He<=90;He++)Yi[He]=String.fromCharCode(He+32),Yr[He]=String.fromCharCode(He);for(var vl in Yi)Yr.hasOwnProperty(vl)||(Yr[vl]=Yi[vl]);function A1(i){var e=T1&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||C1&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Yr:Yi)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ne(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;e<arguments.length;e++)Cp(i,arguments[e]);return i}function Cp(i,e){if(typeof e=="string")i.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)i.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Cp(i,e[t]);else throw new RangeError("Unsupported child node: "+e)}let st=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ma=typeof document<"u"?document:{documentElement:{style:{}}};const Za=/Edge\/(\d+)/.exec(st.userAgent),Ap=/MSIE \d/.test(st.userAgent),Xa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(st.userAgent),el=!!(Ap||Xa||Za),lu=!el&&/gecko\/(\d+)/i.test(st.userAgent),yl=!el&&/Chrome\/(\d+)/.exec(st.userAgent),_1="webkitFontSmoothing"in Ma.documentElement.style,Ia=!el&&/Apple Computer/.test(st.vendor),au=Ia&&(/Mobile\/\w+/.test(st.userAgent)||st.maxTouchPoints>2);var F={mac:au||/Mac/.test(st.platform),windows:/Win/.test(st.platform),linux:/Linux|X11/.test(st.platform),ie:el,ie_version:Ap?Ma.documentMode||6:Xa?+Xa[1]:Za?+Za[1]:0,gecko:lu,gecko_version:lu?+(/Firefox\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,chrome:!!yl,chrome_version:yl?+yl[1]:0,ios:au,android:/Android\b/.test(st.userAgent),webkit_version:_1?+(/\bAppleWebKit\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,safari:Ia,safari_version:Ia?+(/\bVersion\/(\d+(\.\d+)?)/.exec(st.userAgent)||[0,0])[1]:0,tabSize:Ma.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Th(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const ko=Object.create(null);function Ch(i,e,t){if(i==e)return!0;i||(i=ko),e||(e=ko);let n=Object.keys(i),r=Object.keys(e);if(n.length-0!=r.length-0)return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function E1(i,e){for(let t=i.attributes.length-1;t>=0;t--){let n=i.attributes[t].name;e[n]==null&&i.removeAttribute(n)}for(let t in e){let n=e[t];t=="style"?i.style.cssText=n:i.getAttribute(t)!=n&&i.setAttribute(t,n)}}function hu(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function L1(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let n=i.attributes[t];e[n.name]=n.value}return e}class bn{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ht=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(ht||(ht={}));class xe extends ji{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new fs(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new fn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=_p(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new fn(e,n,r,t,e.widget||null,!0)}static line(e){return new ps(e)}static set(e,t=!1){return we.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}xe.none=we.empty;class fs extends xe{constructor(e){let{start:t,end:n}=_p(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Th(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ko}eq(e){return this==e||e instanceof fs&&this.tagName==e.tagName&&Ch(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}fs.prototype.point=!1;class ps extends xe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ps&&this.spec.class==e.spec.class&&Ch(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ps.prototype.mapMode=ot.TrackBefore;ps.prototype.point=!0;class fn extends xe{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?ot.TrackBefore:ot.TrackAfter:ot.TrackDel}get type(){return this.startSide!=this.endSide?ht.WidgetRange:this.startSide<=0?ht.WidgetBefore:ht.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof fn&&R1(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}fn.prototype.point=!0;function _p(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function R1(i,e){return i==e||!!(i&&e&&i.compare(e))}function An(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class Nr extends ji{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof Nr&&this.tagName==e.tagName&&Ch(this.attributes,e.attributes)}static create(e){return new Nr(e.tagName,e.attributes||ko)}static set(e,t=!1){return we.of(e,t)}}Nr.prototype.startSide=Nr.prototype.endSide=-1;function Gr(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function za(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function Mr(i,e){if(!e.anchorNode)return!1;try{return za(i,e.anchorNode)}catch{return!1}}function Zr(i){return i.nodeType==3?Ur(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Xr(i,e,t,n){return t?cu(i,e,t,n,-1)||cu(i,e,t,n,1):!1}function Ni(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function So(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function cu(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Qi(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Ni(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Qi(i):0}else return!1}}function Qi(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Fr(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function M1(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Ep(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Z1(i,e,t,n,r,s,o,l){let a=i.ownerDocument,h=a.defaultView||window;for(let c=i,u=!1;c&&!u;)if(c.nodeType==1){let d,f=c==a.body,p=1,m=1;if(f)d=M1(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let b=c.getBoundingClientRect();({scaleX:p,scaleY:m}=Ep(c,b)),d={left:b.left,right:b.left+c.clientWidth*p,top:b.top,bottom:b.top+c.clientHeight*m}}let O=0,g=0;if(r=="nearest")e.top<d.top?(g=e.top-(d.top+o),t>0&&e.bottom>d.bottom+g&&(g=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(g=e.bottom-d.bottom+o,t<0&&e.top-g<d.top&&(g=e.top-(d.top+o)));else{let b=e.bottom-e.top,Q=d.bottom-d.top;g=(r=="center"&&b<=Q?e.top+b/2-Q/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-Q+o)-d.top}if(n=="nearest"?e.left<d.left?(O=e.left-(d.left+s),t>0&&e.right>d.right+O&&(O=e.right-d.right+s)):e.right>d.right&&(O=e.right-d.right+s,t<0&&e.left<d.left+O&&(O=e.left-(d.left+s))):O=(n=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:n=="start"==l?e.left-s:e.right-(d.right-d.left)+s)-d.left,O||g)if(f)h.scrollBy(O,g);else{let b=0,Q=0;if(g){let x=c.scrollTop;c.scrollTop+=g/m,Q=(c.scrollTop-x)*m}if(O){let x=c.scrollLeft;c.scrollLeft+=O/p,b=(c.scrollLeft-x)*p}e={left:e.left-b,top:e.top-Q,right:e.right-b,bottom:e.bottom-Q},b&&Math.abs(b-O)<1&&(n="nearest"),Q&&Math.abs(Q-g)<1&&(r="nearest")}if(f)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function Lp(i,e=!0){let t=i.ownerDocument,n=null,r=null;for(let s=i.parentNode;s&&!(s==t.body||(!e||n)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class X1{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Qi(t):0),n,Math.min(e.focusOffset,n?Qi(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Ji=null;F.safari&&F.safari_version>=26&&(Ji=!1);function Rp(i){if(i.setActive)return i.setActive();if(Ji)return i.focus(Ji);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Ji==null?{get preventScroll(){return Ji={preventScroll:!0},!0}}:void 0),!Ji){Ji=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],s=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let uu;function Ur(i,e,t=e){let n=uu||(uu=document.createRange());return n.setEnd(i,t),n.setStart(i,e),n}function _n(i,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,i.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,i.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function I1(i){for(;i;){if(i&&(i.nodeType==9||i.nodeType==11&&i.host))return i;i=i.assignedSlot||i.parentNode}return null}function z1(i,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,Qi(t));;)if(n){if(t.nodeType!=1)return!1;let r=t.childNodes[n-1];r.contentEditable=="false"?n--:(t=r,n=Qi(t))}else{if(t==i)return!0;n=Ni(t),t=t.parentNode}}function Mp(i){return i instanceof Window?i.pageYOffset>Math.max(0,i.document.documentElement.scrollHeight-i.innerHeight-4):i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function Zp(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Qi(t)}else if(t.parentNode&&!So(t))n=Ni(t),t=t.parentNode;else return null}}function Xp(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!So(t))n=Ni(t)+1,t=t.parentNode;else return null}}class ei{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ei(e.parentNode,Ni(e),t)}static after(e,t){return new ei(e.parentNode,Ni(e)+1,t)}}var _e=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(_e||(_e={}));const pn=_e.LTR,Ah=_e.RTL;function Ip(i){let e=[];for(let t=0;t<i.length;t++)e.push(1<<+i[t]);return e}const V1=Ip("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),D1=Ip("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Va=Object.create(null),ri=[];for(let i of["()","[]","{}"]){let e=i.charCodeAt(0),t=i.charCodeAt(1);Va[e]=t,Va[t]=-e}function zp(i){return i<=247?V1[i]:1424<=i&&i<=1524?2:1536<=i&&i<=1785?D1[i-1536]:1774<=i&&i<=2220?4:8192<=i&&i<=8204?256:64336<=i&&i<=65023?4:1}const B1=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ui{get dir(){return this.level%2?Ah:pn}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.from<t:l.to>t:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function Vp(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++){let n=i[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!Vp(n.inner,r.inner))return!1}return!0}const Qe=[];function q1(i,e,t,n,r){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,l=s<n.length?n[s].from:t,a=s?256:r;for(let h=o,c=a,u=a;h<l;h++){let d=zp(i.charCodeAt(h));d==512?d=c:d==8&&u==4&&(d=16),Qe[h]=d==4?2:d,d&7&&(u=d),c=d}for(let h=o,c=a,u=a;h<l;h++){let d=Qe[h];if(d==128)h<l-1&&c==Qe[h+1]&&c&24?d=Qe[h]=c:Qe[h]=256;else if(d==64){let f=h+1;for(;f<l&&Qe[f]==64;)f++;let p=h&&c==8||f<t&&Qe[f]==8?u==1?1:8:256;for(let m=h;m<f;m++)Qe[m]=p;h=f-1}else d==8&&u==1&&(Qe[h]=1);c=d,d&7&&(u=d)}}}function j1(i,e,t,n,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=n.length;o++){let h=o?n[o-1].to:e,c=o<n.length?n[o].from:t;for(let u=h,d,f,p;u<c;u++)if(f=Va[d=i.charCodeAt(u)])if(f<0){for(let m=l-3;m>=0;m-=3)if(ri[m+1]==-f){let O=ri[m+2],g=O&2?r:O&4?O&1?s:r:0;g&&(Qe[u]=Qe[ri[m]]=g),l=m;break}}else{if(ri.length==189)break;ri[l++]=u,ri[l++]=d,ri[l++]=a}else if((p=Qe[u])==2||p==1){let m=p==r;a=m?0:1;for(let O=l-3;O>=0;O-=3){let g=ri[O+2];if(g&2)break;if(m)ri[O+2]|=2;else{if(g&4)break;ri[O+2]|=4}}}}}function W1(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=r<t.length?t[r].from:e;for(let a=o;a<l;){let h=Qe[a];if(h==256){let c=a+1;for(;;)if(c==l){if(r==t.length)break;c=t[r++].to,l=r<t.length?t[r].from:e}else if(Qe[c]==256)c++;else break;let u=s==1,d=(c<e?Qe[c]:n)==1,f=u==d?u?1:2:n;for(let p=c,m=r,O=m?t[m-1].to:i;p>a;)p==O&&(p=t[--m].from,O=m?t[m-1].to:i),Qe[--p]=f;a=c}else s=h,a++}}}function Da(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,h=0;a<t;){let c=!0,u=!1;if(h==s.length||a<s[h].from){let m=Qe[a];m!=l&&(c=!1,u=m==16)}let d=!c&&l==1?[]:null,f=c?n:n+1,p=a;e:for(;;)if(h<s.length&&p==s[h].from){if(u)break e;let m=s[h];if(!c)for(let O=m.to,g=h+1;;){if(O==t)break e;if(g<s.length&&s[g].from==O)O=s[g++].to;else{if(Qe[O]==l)break e;break}}if(h++,d)d.push(m);else{m.from>a&&o.push(new ui(a,m.from,f));let O=m.direction==pn!=!(f%2);Ba(i,O?n+1:n,r,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?Qe[p]!=l:Qe[p]==l))break;p++}d?Da(i,a,p,n+1,r,d,o):a<p&&o.push(new ui(a,p,f)),a=p}else for(let a=t,h=s.length;a>e;){let c=!0,u=!1;if(!h||a>s[h-1].to){let m=Qe[a-1];m!=l&&(c=!1,u=m==16)}let d=!c&&l==1?[]:null,f=c?n:n+1,p=a;e:for(;;)if(h&&p==s[h-1].to){if(u)break e;let m=s[--h];if(!c)for(let O=m.from,g=h;;){if(O==e)break e;if(g&&s[g-1].to==O)O=s[--g].from;else{if(Qe[O-1]==l)break e;break}}if(d)d.push(m);else{m.to<a&&o.push(new ui(m.to,a,f));let O=m.direction==pn!=!(f%2);Ba(i,O?n+1:n,r,m.inner,m.from,m.to,o),a=m.from}p=m.from}else{if(p==e||(c?Qe[p-1]!=l:Qe[p-1]==l))break;p--}d?Da(i,p,a,n+1,r,d,o):p<a&&o.push(new ui(p,a,f)),a=p}}function Ba(i,e,t,n,r,s,o){let l=e%2?2:1;q1(i,r,s,n,l),j1(i,r,s,n,l),W1(r,s,n,l),Da(i,r,s,e,t,n,o)}function Y1(i,e,t){if(!i)return[new ui(0,0,e==Ah?1:0)];if(e==pn&&!t.length&&!B1.test(i))return Dp(i.length);if(t.length)for(;i.length>Qe.length;)Qe[Qe.length]=256;let n=[],r=e==pn?0:1;return Ba(i,r,r,t,0,i.length,n),n}function Dp(i){return[new ui(0,i,0)]}let Bp="";function N1(i,e,t,n,r){var s;let o=n.head-i.from,l=ui.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],h=a.side(r,t);if(o==h){let d=l+=r?1:-1;if(d<0||d>=e.length)return null;a=e[l=d],o=a.side(!r,t),h=a.side(r,t)}let c=Fe(i.text,o,a.forward(r,t));(c<a.from||c>a.to)&&(c=h),Bp=i.text.slice(Math.min(o,c),Math.max(o,c));let u=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return u&&c==h&&u.level+(r?0:1)<a.level?Z.cursor(u.side(!r,t)+i.from,u.forward(r,t)?1:-1,u.level):Z.cursor(c+i.from,a.forward(r,t)?-1:1,a.level)}function G1(i,e,t){for(let n=e;n<t;n++){let r=zp(i.charCodeAt(n));if(r==1)return pn;if(r==2||r==4)return Ah}return pn}const qp=te.define(),jp=te.define(),Wp=te.define(),Yp=te.define(),qa=te.define(),Np=te.define(),Gp=te.define(),_h=te.define(),Eh=te.define(),Fp=te.define({combine:i=>i.some(e=>e)}),Up=te.define({combine:i=>i.some(e=>e)}),Hp=te.define();class En{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new En(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new En(Z.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Cs=de.define({map:(i,e)=>i.map(e)}),Kp=de.define();function Ct(i,e,t){let n=i.facet(Yp);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const ki=te.define({combine:i=>i.length?i[0]:!0});let F1=0;const wn=te.define({combine(i){return i.filter((e,t)=>{for(let n=0;n<t;n++)if(i[n].plugin==e.plugin)return!1;return!0})}});class _t{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(wn.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(wn.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new _t(F1++,e,n,r,l=>{let a=[];return o&&a.push(tl.of(h=>{let c=h.plugin(l);return c?o(c):xe.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return _t.define((n,r)=>new e(n,r),t)}}class kl{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Ct(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Ct(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Ct(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Jp=te.define(),Lh=te.define(),tl=te.define(),em=te.define(),Rh=te.define(),ms=te.define(),tm=te.define();function du(i,e){let t=i.state.facet(tm);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return we.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let h=s-e.from,c=o-e.from,u=r;for(let d=l.length-1;d>=0;d--,a--){let f=l[d].spec.bidiIsolate,p;if(f==null&&(f=G1(e.text,h,c)),a>0&&u.length&&(p=u[u.length-1]).to==h&&p.direction==f)p.to=c,u=p.inner;else{let m={from:h,to:c,direction:f,inner:[]};u.push(m),u=m.inner}}}}),r}const im=te.define();function Mh(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(im)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const xr=te.define();class Mt{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new Mt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<t.length?t[s]:1e9,h=Math.min(l,a);if(h==1e9)break;let c=h+o,u=h,d=c;for(;;)if(s<t.length&&t[s]<=u){let f=t[s+1];s+=2,u=Math.max(u,f);for(let p=r;p<e.length&&e[p].fromB<=u;p++)o=e[p].toA-e[p].toB;d=Math.max(d,f+o)}else if(r<e.length&&e[r].fromB<=u){let f=e[r++];u=Math.max(u,f.toB),d=Math.max(d,f.toA),o=f.toA-f.toB}else break;n.push(new Mt(c,d,h,u))}return n}}class xo{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=je.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new Mt(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new xo(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const U1=[];class Xe{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return U1}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&E1(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=Ni(this.dom),r=this.length?e>0:t>0;return new ei(this.parent.dom,n+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof nl)return e;return null}static get(e){return e.cmTile}}class il extends Xe{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,s=(e==null?void 0:e.node)==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=n?n.nextSibling:t.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==t)for(;r&&r!=l.dom;)r=fu(r);else t.insertBefore(l.dom,r);n=l.dom}for(r=n?n.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=fu(r);this.length=o}}function fu(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class nl extends il{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Xe.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,s=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&s++,r=t.pop()}else{let o=n.children[r++];if(o instanceof Si)t.push(r),n=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(a<e||e==h&&(t<-1?l.length:l.covers(1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,r=e-a),(h>e||e==a&&(t>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!n&&!s)throw new Error("No tile at position "+e);return n&&t<0||!s?{tile:n,offset:r}:{tile:s,offset:o}}}class Si extends il{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new Si(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Wn extends il{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new Wn(t||document.createElement("div"),e);return(!t||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,s=-1,o=null,l=-1;function a(c,u){for(let d=0,f=0;d<c.children.length&&f<=u;d++){let p=c.children[d],m=f+p.length;m>=u&&(p.isComposite()?a(p,u-f):(!o||o.isHidden&&(t>0||n&&K1(o,p)))&&(m>u||p.flags&32)?(o=p,l=u-f):(f<u||p.flags&16&&!p.isHidden)&&(r=p,s=u-f)),f=m}}a(this,e);let h=(t<0?r:o)||r||o;return h?{tile:h,offset:h==r?s:l}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):H1(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:r,offset:s}=n;if(this.dom.contains(r.dom))return r.isText()?new ei(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let o=n.tile.parent,l=!1;for(let a of o.children){if(l)return new ei(a.dom,0);a==n.tile&&(l=!0)}}return new ei(this.dom,0)}}function H1(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=Zr(e);return t[t.length-1]||null}function K1(i,e){let t=i.coordsIn(0,1),n=e.coordsIn(0,1);return t&&n&&n.top<t.bottom}class ft extends il{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new ft(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class on extends Xe{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?F.chrome||F.gecko||(e?(r--,o=1):s<n&&(s++,o=-1)):t<0?r--:s<n&&s++;let l=Ur(this.dom,r,s).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return F.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Fr(a,o<0):a||null}static of(e,t){let n=new on(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class mn extends Xe{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Fr(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return Fr(o,!l)}}get overrideDOMText(){if(!this.length)return ge.empty;let{root:e}=this;if(!e)return ge.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new mn(s,n,e,r)}}class wo extends Xe{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return ge.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class J1{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;n&&n.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],h=a.breakAfter;(t>0?a.length<=e:a.length<e)&&(!n||n.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!h,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,n&&a.isComposite()&&n.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);n&&n.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class ey{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class ty{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var s;this.flushBuffer();let o=this.ensureMarks(t,n),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new on(l.dom,l.text+e);a.parent=o}else o.append(r||on.of(e,(s=this.cache.find(on))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Sl(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let l=t.marks.length-1;l>=0;l--){let a=t.marks[l],h=r.lastChild;if(h instanceof ft&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(Sl(a.dom)),r=h;else{if(this.cache.reused.get(a)){let u=Xe.get(a.dom);u&&u.setDOM(Sl(a.dom))}let c=ft.of(a.mark,a.dom);r.append(c),r=c}this.cache.reused.set(a,2)}let s=Xe.get(e.text);s&&this.cache.reused.set(s,2);let o=new on(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,n);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=nm);let r=Wn.start(e,t||((n=this.cache.find(Wn))===null||n===void 0?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(t>0&&(l=r.lastChild)&&l instanceof ft&&l.mark.eq(o))r=l,t--;else{let a=ft.of(o,(n=this.cache.find(ft,h=>h.mark.eq(o)))===null||n===void 0?void 0:n.dom);r.append(a),r=a,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!pu(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(F.ios&&pu(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(xl,0,32)||new mn(xl.toDOM(),0,xl,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new ey(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof Si&&r.wrapper.eq(n.wrapper))t=r;else{let s=Si.of(n.wrapper,(e=this.cache.find(Si,o=>o.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(wo,void 0,1);return n&&(n.flags=t),n||new wo(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class iy{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const Qo=[mn,Wn,on,ft,wo,Si,nl];for(let i=0;i<Qo.length;i++)Qo[i].bucket=i;class ny{constructor(e){this.view=e,this.buckets=Qo.map(()=>[]),this.index=Qo.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=s.length-1;l>=0;l--){let a=(l+o)%s.length,h=s[a];if((!t||t(h))&&!this.reused.has(h))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(h,n),h}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==t&&(l.flags&497)==n?(this.reused.set(l,1),l):(this.reused.set(l,2),new mn(l.dom,t,e,l.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class ry{constructor(e,t,n,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new ny(e),this.text=new iy(e.state.doc),this.builder=new ty(this.cache,new nl(e,e.contentDOM),we.iter(n)),this.cache.reused.set(t,2),this.old=new J1(t),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let h=a-r;this.preserve(h,!o,!l),r=a,s+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,l.toA),this.emit(t.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=ly(this.old),s=this.openMarks;this.old.advance(e,n?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l<o.length?mn.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof wo)this.cache.add(o);else if(o instanceof ft)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof ft&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof ft&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,s=0,o=we.spans(this.decorations,e,t,{point:(l,a,h,c,u,d)=>{if(h instanceof fn){if(this.disallowBlockEffectsFor[d]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=c.length,u>c.length)r.continueWidget(a-l);else{let f=h.widget||(h.block?Yn.block:Yn.inline),p=sy(h),m=this.cache.findWidget(f,a-l,p)||mn.of(f,this.view,a-l,p);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(m)):(r.ensureLine(n),r.addInlineWidget(m,c,u))}n=null}else n=oy(n,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let u=l;u<a;){let d=this.text.next(Math.min(512,a-u));d==null?(r.addLineStartIfNotCovered(n),r.addBreak(),u++):(r.ensureLine(n),r.addText(d,h,u==l?c:h.length),u+=d.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>s,this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let s=Xe.get(r);if(r==this.view.contentDOM)break;s instanceof ft?t.push(s):s!=null&&s.isLine()?n=s:s instanceof Si||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new Wn(r,nm):n||t.push(ft.of(new fs({tagName:r.nodeName.toLowerCase(),attributes:L1(r)}),r)))}return{line:n,marks:t}}}function pu(i,e){let t=n=>{for(let r of n.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(i)}function sy(i){let e=i.isReplace?(i.startSide<0?64:0)|(i.endSide>0?128:0):i.startSide>0?32:16;return i.block&&(e|=256),e}const nm={class:"cm-line"};function oy(i,e){let t=e.spec.attributes,n=e.spec.class;return!t&&!n||(i||(i={class:"cm-line"}),t&&Th(t,i),n&&(i.class+=" "+n)),i}function ly(i){let e=[];for(let t=i.parents.length;t>1;t--){let n=t==i.parents.length?i.tile:i.parents[t].tile;n instanceof ft&&e.push(n.mark)}return e}function Sl(i){let e=Xe.get(i);return e&&e.setDOM(i.cloneNode()),i}class Yn extends bn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Yn.inline=new Yn("span");Yn.block=new Yn("div");const xl=new class extends bn{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class mu{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=xe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new nl(e,e.contentDOM),this.updateInner([new Mt(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:u})=>u<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Oy(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?hy(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:u}=this.hasComposition;n=new Mt(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(F.ie||F.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=dy(o,this.decorations,e.changes);a.length&&(n=Mt.extendWithRanges(n,a));let h=py(l,this.blockWrappers,e.changes);return h.length&&(n=Mt.extendWithRanges(n,h)),s&&!n.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let o=this.tile,l=new ry(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Xe.get(t.text)&&l.cache.reused.set(Xe.get(t.text),2),this.tile=l.run(e,t),ja(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=F.chrome||F.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||n.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof wl&&r.push(s.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Kp)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,s=r==n,o=!s&&!(this.view.state.facet(ki)||n.tabIndex>-1)&&Mr(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(s||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),F.gecko&&a.empty&&!this.hasComposition&&ay(h)){let d=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(d,h.node.childNodes[h.offset]||null)),h=c=new ei(d,0),l=!0}let u=this.view.observer.selectionRange;(l||!u.focusNode||(!Xr(h.node,h.offset,u.anchorNode,u.anchorOffset)||!Xr(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{F.android&&F.chrome&&n.contains(u.focusNode)&&my(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let d=Gr(this.view.root);if(d)if(a.empty){if(F.gecko){let f=cy(h.node,h.offset);if(f&&f!=3){let p=(f==1?Zp:Xp)(h.node,h.offset);p&&(h=new ei(p.node,p.offset))}}d.collapse(h.node,h.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(h.node,h.offset);try{d.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),f.setEnd(c.node,c.offset),f.setStart(h.node,h.offset),d.removeAllRanges(),d.addRange(f)}o&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new ei(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new ei(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Xr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Gr(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,s)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let s;if(e==n.dom)s=n.dom.childNodes[t];else{let o=Qi(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==n.dom.firstChild)return r;for(;s&&!Xe.get(s);)s=s.nextSibling;if(!s)return r+n.length;for(let o=0,l=r;;o++){let a=n.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return n.isText()?e==n.dom?r+t:r+(t?n.length:0):r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(s=!0)}else{let u=c+h.length;if(c<=e&&(n=h,r=e-c,s=u<e),u>=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!n&&!o?this.domAtPos(e,t):(s&&o?n=null:a&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(l,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof wl?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=Fe(s.text,o);if(l==o)return null;let a=Ur(s.dom,o,l).getClientRects();for(let h=0;h<a.length;h++){let c=a[h];if(h==a.length-1||c.top<c.bottom&&c.left<c.right)return c}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_e.LTR,h=0,c=(u,d,f)=>{for(let p=0;p<u.children.length&&!(d>r);p++){let m=u.children[p],O=d+m.length,g=m.dom.getBoundingClientRect(),{height:b}=g;if(f&&!p&&(h+=g.top-f.top),m instanceof Si)O>n&&c(m,d,g);else if(d>=n&&(h>0&&t.push(-h),t.push(b+h),h=0,o)){let Q=m.dom.lastChild,x=Q?Zr(Q):[];if(x.length){let k=x[x.length-1],$=a?k.right-g.left:g.right-k.left;$>l&&(l=$,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=O)}}f&&p==u.children.length-1&&(h+=f.bottom-g.bottom),d=O+m.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?_e.RTL:_e.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=Zr(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement("div"),n,r,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=Zr(t.firstChild)[0];n=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(xe.replace({widget:new wl(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return xe.set(e)}updateDeco(){let e=1,t=this.view.state.facet(tl).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Rh).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(we.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(em).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var t;if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Hp))try{if(c(this.view,e.range,e))return!0}catch(u){Ct(this.view.state,u,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,(t=n.assoc)!==null&&t!==void 0?t:n.empty?0:n.head>n.anchor?-1:1),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let o=Mh(this.view),l={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:h}=this.view.scrollDOM;if(Z1(this.view.scrollDOM,l,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==_e.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=n=>n.isWidget()||n.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){ja(this.tile)}}function ja(i,e){let t=e==null?void 0:e.get(i);if(t!=1){t==null&&i.destroy();for(let n of i.children)ja(n,e)}}function ay(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function rm(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=Zp(t.focusNode,t.focusOffset),r=Xp(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=Xe.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let a=Xe.get(n.node);!a||a.isText()&&a.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function hy(i,e,t){let n=rm(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||i.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc;return{range:new Mt(a.mapPos(s),a.mapPos(o),s,o),text:r}}function cy(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e<i.childNodes.length&&i.childNodes[e].contentEditable=="false"?2:0)}let uy=class{constructor(){this.changes=[]}compareRange(e,t){An(e,t,this.changes)}comparePoint(e,t){An(e,t,this.changes)}boundChange(e){An(e,e,this.changes)}};function dy(i,e,t){let n=new uy;return we.compare(i,e,t,n),n.changes}class fy{constructor(){this.changes=[]}compareRange(e,t){An(e,t,this.changes)}comparePoint(){}boundChange(e){An(e,e,this.changes)}}function py(i,e,t){let n=new fy;return we.compare(i,e,t,n),n.changes}function my(i,e){for(let t=i;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Oy(i,e){let t=!1;return e&&i.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}class wl extends bn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function gy(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return Z.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=Fe(r.text,s,!1):l=Fe(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let h=Fe(r.text,o,!1);if(n(r.text.slice(h,o))!=a)break;o=h}for(;l<r.length;){let h=Fe(r.text,l);if(n(r.text.slice(l,h))!=a)break;l=h}return Z.range(o+r.from,l+r.from)}function by(i,e,t,n,r){let s=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+$1(o,s,i.state.tabSize)}function Wa(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==ht.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function vy(i,e,t,n){let r=Wa(i,e.head,e.assoc||-1),s=!n||r.type!=ht.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==_e.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return Z.cursor(a,t?-1:1)}return Z.cursor(t?r.to:r.from,t?-1:1)}function Ou(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let h=N1(r,s,o,l,t),c=Bp;if(!h){if(r.number==(t?i.state.doc.lines:1))return l;c=`
|
|
256
|
+
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),h=i.visualLineSide(r,!t)}if(a){if(!a(c))return l}else{if(!n)return h;a=n(c)}l=h}}function yy(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==Ke.Space&&(r=o),r==o}}function ky(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return Z.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),h=i.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=i.documentTop;if(h)o==null&&(o=h.left-a.left),l=s<0?h.top:h.bottom;else{let p=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+c}let u=a.left+o,d=i.viewState.heightOracle.textHeight>>1,f=n??d;for(let p=0;;p+=d){let m=l+(f+p)*s,O=Ya(i,{x:u,y:m},!1,s);if(t?m>a.bottom:m<a.top)return Z.cursor(O.pos,O.assoc);let g=i.coordsAtPos(O.pos,O.assoc),b=g?(g.top+g.bottom)/2:0;if(!g||(t?b>l:b<l))return Z.cursor(O.pos,O.assoc,void 0,o)}}function Ir(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||t||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function sm(i,e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=Ir(i,r.from,0);o!=r.from&&(s=Z.cursor(o,-1))}else{let o=Ir(i,r.from,-1),l=Ir(i,r.to,1);(o!=r.from||l!=r.to)&&(s=Z.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?Z.create(t,e.mainIndex):e}function Ql(i,e,t){let n=Ir(i.state.facet(ms).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:Z.cursor(n,n<t.from?1:-1)}class ci{constructor(e,t){this.pos=e,this.assoc=t}}function Ya(i,e,t,n){let r=i.contentDOM.getBoundingClientRect(),s=r.top+i.viewState.paddingTop,{x:o,y:l}=e,a=l-s,h;for(;;){if(a<0)return new ci(0,1);if(a>i.viewState.docHeight)return new ci(i.state.doc.length,-1);if(h=i.elementAtHeight(a),n==null)break;if(h.type==ht.Text){if(n<0?h.to<i.viewport.from:h.from>i.viewport.to)break;let d=i.docView.coordsAt(n<0?h.from:h.to,n>0?-1:1);if(d&&(n<0?d.top<=a+s:d.bottom>=a+s))break}let u=i.viewState.heightOracle.textHeight/2;a=n>0?h.bottom+u:h.top-u}if(i.viewport.from>=h.to||i.viewport.to<=h.from){if(t)return null;if(h.type==ht.Text){let u=by(i,r,h,o,l);return new ci(u,u==h.from?1:-1)}}if(h.type!=ht.Text)return a<(h.top+h.bottom)/2?new ci(h.from,1):new ci(h.to,-1);let c=i.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=i.docView.lineAt(h.from,-2)),new Sy(i,o,l,i.textDirectionAt(h.from)).scanTile(c,h.from)}class Sy{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[ui.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[ui.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,s=new Set,o=this.bidiIn(e[0],e[r]),l,a,h=-1,c=1e9,u;e:for(;n<r;){let f=r-n,p=n+r>>1;t:if(s.has(p)){let O=n+Math.floor(Math.random()*f);for(let g=0;g<f;g++){if(!s.has(O)){p=O;break t}O++,O==r&&(O=n)}break e}s.add(p);let m=t(p);if(m)for(let O=0;O<m.length;O++){let g=m[O],b=0;if(!(g.width==0&&m.length>1)){if(g.bottom<this.y)(!l||l.bottom<g.bottom)&&(l=g),b=1;else if(g.top>this.y)(!a||a.top>g.top)&&(a=g),b=-1;else{let Q=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,x=Math.abs(Q);x<c&&(h=p,c=x,u=g),Q&&(b=Q<0==(this.baseDir==_e.LTR)?-1:1)}b==-1&&(!o||this.baseDirAt(e[p],1))?r=p:b==1&&(!o||this.baseDirAt(e[p+1],-1))&&(n=p+1)}}}if(!u){let f=l&&(!a||this.y-l.bottom<a.top-this.y)?l:a;return this.y=(f.top+f.bottom)/2,this.scan(e,t)}let d=(o?this.dirAt(e[h],1):this.baseDir)==_e.LTR;return{i:h,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let s=0;s<e.length;s=Fe(e.text,s))n.push(t+s);n.push(t+e.length);let r=this.scan(n,s=>{let o=n[s]-t,l=n[s+1]-t;return Ur(e.dom,o,l).getClientRects()});return r.after?new ci(n[r.i+1],-1):new ci(n[r.i],1)}scanTile(e,t){if(!e.length)return new ci(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let n=[t];for(let l=0,a=t;l<e.children.length;l++)n.push(a+=e.children[l].length);let r=this.scan(n,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Ur(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=n[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new ci(n[r.i+1],-1):new ci(o,1)}}const kn="";class xy{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Oe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=kn}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=Xe.get(r),l=r.nextSibling;if(l==t){o!=null&&o.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let a=Xe.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:So(r))||So(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!Qy(l,t)&&this.lineBreak(),r=l}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){let t=Xe.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(wy(e,n.node,n.offset)?t:0))}}function wy(i,e,t){for(;;){if(!e||t<Qi(e))return!1;if(e==i)return!0;t=Ni(e)+1,e=e.parentNode}}function Qy(i,e){let t;for(;!(i==e||!i);i=i.nextSibling){let n=Xe.get(i);if(!(n!=null&&n.isWidget()))return!1;n&&(t||(t=[])).push(n)}if(t)for(let n of t){let r=n.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class gu{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class $y{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=om(e.docView.tile,t,n,0))){let a=s||o?[]:Ty(e),h=new xy(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Cy(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!za(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!za(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((F.ios||F.chrome)&&l.main.empty&&h!=c&&(u.from>0||u.to<e.state.doc.length)){let d=Math.min(h,c),f=Math.max(h,c),p=u.from-d,m=u.to-f;(p==0||p==1||d==0)&&(m==0||m==-1||f==e.state.doc.length)&&(h=0,c=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(Z.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(h,-1),f=0;d&&(f=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=Z.create([Z.cursor(h,f)])}else this.newSel=Z.single(c,h)}}}function om(i,e,t,n){if(i.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,h=n,c=n;a<i.children.length;a++){let u=i.children[a],d=h+u.length;if(h<e&&d>t)return om(u,e,t,h);if(d>=e&&r==-1&&(r=a,s=h),h>t&&u.dom.parentNode==i.dom){o=a,l=c;break}c=d,h=d+u.breakAfter}return{from:s,to:l<0?n+i.length:l,startDOM:(r?i.children[r-1].dom.nextSibling:null)||i.dom.firstChild,endDOM:o<i.children.length&&o>=0?i.children[o].dom:null}}else return i.isText()?{from:n,to:n+i.length,startDOM:i.dom,endDOM:i.dom.nextSibling}:null}function lm(i,e){let t,{newSel:n}=e,{state:r}=i,s=r.selection.main,o=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=s.from,c=null;(o===8||F.android&&e.text.length<a-l)&&(h=s.to,c="end");let u=r.doc.sliceString(l,a,kn),d,f;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||u!=e.text)&&u.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&u.slice(s.to-l)==e.text.slice(d=e.text.length-(u.length-(s.to-l)))?t={from:s.from,to:s.to,insert:ge.of(e.text.slice(s.from-l,d).split(kn))}:(f=am(u,e.text,h-l,c))&&(F.chrome&&o==13&&f.toB==f.from+2&&e.text.slice(f.from,f.toB)==kn+kn&&f.toB--,t={from:l+f.from,to:l+f.toA,insert:ge.of(e.text.slice(f.from,f.toB).split(kn))})}else n&&(!i.hasFocus&&r.facet(ki)||$o(n,s))&&(n=null);if(!t&&!n)return!1;if((F.mac||F.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=Z.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:ge.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&i.docView.lineHasWidget(s.to)&&i.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:r.toText(i.inputState.insertingText)}:F.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
|
257
|
+
`&&i.lineWrapping&&(n&&(n=Z.single(n.main.anchor-1,n.main.head-1)),t={from:s.from,to:s.to,insert:ge.of([" "])}),t)return Zh(i,t,n,o);if(n&&!$o(n,s)){let l=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(l=!0),a=i.inputState.lastSelectionOrigin,a=="select.pointer"&&(n=sm(r.facet(ms).map(h=>h(i)),n))),i.dispatch({selection:n,scrollIntoView:l,userEvent:a}),!0}else return!1}function Zh(i,e,t,n=-1){if(F.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(F.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&_n(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&_n(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&_n(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Py(i,e,t));return i.state.facet(Np).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Py(i,e,t){let n,r=i.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,h=a<0?s.from:s.to,c=Ir(r.facet(ms).map(u=>u(i)),h,a);e.from==c&&(o=c)}if(o>-1)n={changes:e,selection:Z.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+h))}else{let a=r.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),u,d=t&&rm(i,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);u={from:d.from,to:d.to-p}}else u=i.state.doc.lineAt(s.head);let f=s.to-e.to;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:h||p.map(a)};let m=p.to-f,O=m-c.length;if(i.state.sliceDoc(O,m)!=c||m>=u.from&&O<=u.to)return{range:p};let g=r.changes({from:O,to:m,insert:e.insert}),b=p.to-s.to;return{changes:g,range:h?Z.range(Math.max(0,h.anchor+b),Math.max(0,h.head+b)):p.map(g)}})}else n={changes:a,selection:h&&r.selection.replaceRange(h)}}let l="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,l+=".compose",i.inputState.compositionFirstChange&&(l+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function am(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function Ty(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new gu(t,n)),(r!=t||s!=n)&&e.push(new gu(r,s))),e}function Cy(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?Z.single(t+e,n+e):null}function $o(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}class Ay{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,F.safari&&e.contentDOM.addEventListener("input",()=>null),F.gecko&&Wy(e.contentDOM.ownerDocument)}handleEvent(e){!Iy(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=_y(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&cm.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),F.android&&F.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return F.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=hm.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||Ey.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,_n(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:F.safari&&!F.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bu(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Ct(t.state,r)}}}function _y(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(bu(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(bu(n.value,a))}}for(let n in ti)t(n).handlers.push(ti[n]);for(let n in mt)t(n).observers.push(mt[n]);return e}const hm=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ey="dthko",cm=[16,17,18,20,91,92,224,225],As=6;function _s(i){return Math.max(0,i)*.7+8}function Ly(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class Ry{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Lp(e.contentDOM),this.atoms=e.state.facet(ms).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Oe.allowMultipleSelections)&&My(e,t),this.dragging=Xy(e,t)&&fm(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Ly(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Mh(this.view);e.clientX-a.left<=r+As?t=-_s(r-e.clientX):e.clientX+a.right>=o-As&&(t=_s(e.clientX-o)),e.clientY-a.top<=s+As?n=-_s(s-e.clientY):e.clientY+a.bottom>=l-As&&(n=_s(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=sm(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function My(i,e){let t=i.state.facet(qp);return t.length?t[0](e):F.mac?e.metaKey:e.ctrlKey}function Zy(i,e){let t=i.state.facet(jp);return t.length?t[0](e):F.mac?!e.altKey:!e.ctrlKey}function Xy(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=Gr(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Iy(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=Xe.get(t))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const ti=Object.create(null),mt=Object.create(null),um=F.ie&&F.ie_version<15||F.ios&&F.webkit_version<604;function zy(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),dm(i,t.value)},50)}function rl(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function dm(i,e){e=rl(i.state,_h,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Na!=null&&t.selection.ranges.every(a=>a.empty)&&Na==s.toString()){let a=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let u=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:u},range:Z.cursor(h.from+u.length)}})}else o?n=t.changeByRange(a=>{let h=s.line(r++);return{changes:{from:a.from,to:a.to,insert:h.text},range:Z.cursor(a.from+h.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}mt.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};mt.wheel=mt.mousewheel=i=>{i.inputState.lastWheelEvent=Date.now()};ti.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);mt.touchstart=(i,e)=>{let t=i.inputState,n=e.targetTouches[0];t.lastTouchTime=Date.now(),n&&(t.lastTouchX=n.clientX,t.lastTouchY=n.clientY),t.setSelectionOrigin("select.pointer")};mt.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};ti.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Wp))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Dy(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Ry(i,e,t,n)),n&&i.observer.ignore(()=>{Rp(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function vu(i,e,t,n){if(n==1)return Z.cursor(e,t);if(n==2)return gy(i.state,e,t);{let r=i.docView.lineAt(e,t),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<i.state.doc.length&&l==s.to&&l++,Z.range(o,l)}}const Vy=F.ie&&F.ie_version<=11;let yu=null,ku=0,Su=0;function fm(i){if(!Vy)return i.detail;let e=yu,t=Su;return yu=i,Su=Date.now(),ku=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(ku+1)%3:1}function Dy(i,e){let t=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=fm(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=i.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,c=vu(i,a.pos,a.assoc,n);if(t.pos!=a.pos&&!o){let u=vu(i,t.pos,t.assoc,n),d=Math.min(u.from,c.from),f=Math.max(u.to,c.to);c=d<c.from?Z.range(d,f,c.assoc):Z.range(f,d,c.assoc)}return o?r.replaceRange(r.main.extend(c.from,c.to,c.assoc)):l&&n==1&&r.ranges.length>1&&(h=By(r,a.pos))?h:l?r.addRange(c):Z.create([c])}}}function By(i,e){for(let t=0;t<i.ranges.length;t++){let{from:n,to:r}=i.ranges[t];if(n<=e&&r>=e)return Z.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}ti.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=Z.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",rl(i.state,Eh,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ti.dragend=i=>(i.inputState.draggedContent=null,!1);function xu(i,e,t,n){if(t=rl(i.state,_h,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&Zy(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}ti.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&xu(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return xu(i,e,n,!0),!0}return!1};ti.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=um?null:e.clipboardData;return t?(dm(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(zy(i),!1)};function qy(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function jy(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:rl(i,Eh,e.join(i.lineBreak)),ranges:t,linewise:n}}let Na=null;ti.copy=ti.cut=(i,e)=>{if(!Mr(i.contentDOM,i.observer.selectionRange))return!1;let{text:t,ranges:n,linewise:r}=jy(i.state);if(!t&&!r)return!1;Na=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=um?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(qy(i,t),!1)};const pm=Ti.define();function mm(i,e){let t=[];for(let n of i.facet(Gp)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:pm.of(!0)}):null}function Om(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=mm(i.state,e);t?i.dispatch(t):i.update([])}},10)}mt.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),Om(i)};mt.blur=i=>{i.observer.clearSelectionRange(),Om(i)};mt.compositionstart=mt.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};mt.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,F.chrome&&F.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};mt.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};ti.beforeinput=(i,e)=>{var t,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),h=i.posAtDOM(l.endContainer,l.endOffset);return Zh(i,{from:a,to:h,insert:i.state.toText(s)},null),!0}}let r;if(F.chrome&&F.android&&(r=hm.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return F.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),F.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>mt.compositionend(i,e),20),!1};const wu=new Set;function Wy(i){wu.has(i)||(wu.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const Qu=["pre-wrap","normal","pre-line","break-spaces"];let Nn=!1;function $u(){Nn=!1}class Yy{constructor(e){this.lineWrapping=e,this.doc=ge.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Qu.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,s,o){let l=Qu.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let h=0;h<o.length;h++){let c=o[h];c<0?h++:this.heightSamples[Math.floor(c*10)]=!0}}return a}}class Ny{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Jt{constructor(e,t,n,r,s){this.from=e,this.length=t,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?ht.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof fn?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Jt(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Te=function(i){return i[i.ByPos=0]="ByPos",i[i.ByHeight=1]="ByHeight",i[i.ByPosNoHeight=2]="ByPosNoHeight",i}(Te||(Te={}));const oo=.001;class ct{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>oo&&(Nn=!0),this.height=e)}replace(e,t,n){return ct.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:u}=r[l],d=s.lineAt(a,Te.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=h?d:s.lineAt(h,Te.ByPosNoHeight,n,0,0);for(u+=f.to-h,h=f.to;l>0&&d.from<=r[l-1].toA;)a=r[l-1].fromA,c=r[l-1].fromB,l--,a<d.from&&(d=s.lineAt(a,Te.ByPosNoHeight,n,0,0));c+=d.from-a,a=d.from;let p=Xh.build(n.setDoc(o),e,c,u);s=Po(s,s.replace(a,h,p))}return s.updateHeight(n,0)}static empty(){return new Qt(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,r=0,s=0;for(;;)if(t==n)if(r>s*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[t++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new Fy(ct.of(e.slice(0,t)),o,ct.of(e.slice(n)))}}function Po(i,e){return i==e?i:(i.constructor!=e.constructor&&(Nn=!0),e)}ct.prototype.size=1;const Gy=xe.replace({});class gm extends ct{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Jt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Jt(r,0,n,this.spaceAbove,Gy):this.mainBlock(n,r)}lineAt(e,t,n,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,n,r,s).join(o):o}forEachLine(e,t,n,r,s,o){e<=s+this.length&&t>=s&&o(this.lineAt(0,Te.ByPos,n,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qt extends gm{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Jt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof Qt||r instanceof Ue&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ue?r=new Qt(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ct.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ue extends ct{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),c=t.doc.lineAt(h),u=l+c.length*a,d=Math.max(n,e-u/2);return new Jt(c.from,c.length,d,u,0)}else{let h=Math.max(0,Math.min(o-s,Math.floor((e-n)/l))),{from:c,length:u}=t.doc.line(s+h);return new Jt(c,u,n+l*h,l,0)}}lineAt(e,t,n,r,s){if(t==Te.ByHeight)return this.blockAt(e,n,r,s);if(t==Te.ByPosNoHeight){let{from:f,to:p}=n.doc.lineAt(e);return new Jt(f,p-f,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(n,s),h=n.doc.lineAt(e),c=l+h.length*a,u=h.number-o,d=r+l*u+a*(h.from-s-u);return new Jt(h.from,h.length,Math.max(r,Math.min(d,r+this.height-c)),c,0)}forEachLine(e,t,n,r,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(n,s);for(let c=e,u=r;c<=t;){let d=n.doc.lineAt(c);if(c==e){let p=d.number-l;u+=a*p+h*(e-s-p)}let f=a+h*d.length;o(new Jt(d.from,d.length,u,f,0)),u+=f,c=d.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let s=n[n.length-1];s instanceof Ue?n[n.length-1]=new Ue(s.length+r):n.push(null,new Ue(r-1))}if(e>0){let s=n[0];s instanceof Ue?n[0]=new Ue(e+s.length):n.unshift(new Ue(e-1),null)}return ct.of(n)}decomposeLeft(e,t){t.push(new Ue(e-1),null)}decomposeRight(e,t){t.push(null,new Ue(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new Ue(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let u=r.heights[r.index++],d=0;u<0&&(d=-u,u=r.heights[r.index++]),a==-1?a=u:Math.abs(u-a)>=oo&&(a=-2);let f=new Qt(c,u,d);f.outdated=!1,o.push(f),l+=c+1}l<=s&&o.push(null,new Ue(s-l).updateHeight(e,l));let h=ct.of(o);return(a<0||Math.abs(h.height-this.height)>=oo||Math.abs(a-this.heightMetrics(e,t).perLine)>=oo)&&(Nn=!0),Po(this,h)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Fy extends ct{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,n,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=t==Te.ByHeight?e<o:e<l,h=a?this.left.lineAt(e,t,n,r,s):this.right.lineAt(e,t,n,o,l);if(this.break||(a?h.to<l:h.from>l))return h;let c=t==Te.ByPosNoHeight?Te.ByPosNoHeight:Te.ByPos;return a?h.join(this.right.lineAt(l,c,n,o,l)):this.left.lineAt(l,c,n,r,s).join(h)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,s,o),t>=a&&this.right.forEachLine(e,t,n,l,a,o);else{let h=this.lineAt(a,Te.ByPos,n,r,s);e<h.from&&this.left.forEachLine(e,h.from-1,n,r,s,o),h.to>=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&Pu(s,o-1),t<this.length){let l=s.length;this.decomposeRight(t,s),Pu(s,l)}return ct.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ct.of(this.break?[e,null,t]:[e,t]):(this.left=Po(this.left,e),this.right=Po(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Pu(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Ue&&(n=i[e+1])instanceof Ue&&i.splice(e-1,3,new Ue(t.length+1+n.length))}const Uy=5;class Xh{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Qt?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Qt(n-this.pos,-1,0)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new gm(o,r,n)):(o||s||r>=Uy)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Qt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Ue(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Qt)return e;let t=new Qt(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Qt)&&!this.isCovered?this.nodes.push(new Qt(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof Qt&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let s=new Xh(n,e);return we.spans(t,n,r,s,0),s.finish(n)}}function Hy(i,e,t){let n=new Ky;return we.compare(i,e,t,n,0),n.changes}class Ky{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&An(e,t,this.changes,5)}}function Jy(i,e){let t=i.getBoundingClientRect(),n=i.ownerDocument,r=n.defaultView||window,s=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(r.innerHeight,t.bottom);for(let h=i.parentNode;h&&h!=n.body;)if(h.nodeType==1){let c=h,u=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&u.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),l=Math.max(l,d.top),a=Math.min(h==i.parentNode?r.innerHeight:a,d.bottom)}h=u.position=="absolute"||u.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function ek(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function tk(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class $l{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return xe.replace({widget:new ik(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class ik extends bn{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Tu{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Cu,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=_e.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Lh).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Yy(n),this.stateDeco=Au(t),this.heightMap=ct.empty().applyChanges(this.stateDeco,ge.empty,this.heightOracle.setDoc(t.doc),[new Mt(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=xe.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Es(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Cu:new Ih(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(wr(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Au(this.state);let r=e.changedRanges,s=Mt.extendWithRanges(r,Hy(n,this.stateDeco,e?e.changes:je.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);$u(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Nn)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Up)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?_e.RTL:_e.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:k,scaleY:$}=Ep(t,l);(k>.005&&Math.abs(this.scaleX-k)>.005||$>.005&&Math.abs(this.scaleY-$)>.005)&&(this.scaleX=k,this.scaleY=$,h|=16,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let f=Lp(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Mp(this.scrollParent||e.win);let m=(this.printing?tk:Jy)(t,this.paddingTop),O=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(a=!0)),!this.inView&&!this.scrollTarget&&!ek(e.dom))return 0;let Q=l.width;if((this.contentDOMWidth!=Q||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(Q-this.contentDOMWidth)>r.charWidth){let{lineHeight:$,charWidth:C,textHeight:T}=e.docView.measureTextSize();o=$>0&&r.refresh(s,$,C,T,Math.max(5,Q/C),k),o&&(e.docView.minWidth=0,h|=16)}O>0&&g>0?c=Math.max(O,g):O<0&&g<0&&(c=Math.min(O,g)),$u();for(let $ of this.viewports){let C=$.from==this.viewport.from?k:e.docView.measureVisibleLineHeights($);this.heightMap=(o?ct.empty().applyChanges(this.stateDeco,ge.empty,this.heightOracle,[new Mt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Ny($.from,C))}Nn&&(h|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Es(r.lineAt(o-n*1e3,Te.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,Te.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(h<a.from||h>a.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=r.lineAt(h,Te.ByPos,s,0,0),d;t.y=="center"?d=(u.top+u.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h<a.from?d=u.top:d=u.bottom-c,a=new Es(r.lineAt(d-1e3/2,Te.ByHeight,s,0,0).from,r.lineAt(d+c+1e3/2,Te.ByHeight,s,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Es(this.heightMap.lineAt(n,Te.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Te.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Te.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,Te.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new $l(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=_e.LTR&&!n)return[];let l=[],a=(c,u,d,f)=>{if(u-c<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let g of m)if(g>c&&g<u){a(c,g-10,d,f),a(g+10,u,d,f);return}let O=rk(e,g=>g.from>=d.from&&g.to<=d.to&&Math.abs(g.from-c)<s&&Math.abs(g.to-u)<s&&!m.some(b=>g.from<b&&g.to>b));if(!O){if(u<d.to&&t&&n&&t.visibleRanges.some(Q=>Q.from<=u&&Q.to>=u)){let Q=t.moveToLineBoundary(Z.cursor(u),!1,!0).head;Q>c&&(u=Q)}let g=this.gapSize(d,c,u,f),b=n||g<2e6?g:2e6;O=new $l(c,u,g,b)}l.push(O)},h=c=>{if(c.length<o||c.type!=ht.Text)return;let u=nk(c.from,c.to,this.stateDeco);if(u.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,f,p;if(n){let m=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,O,g;if(d!=null){let b=Rs(u,d),Q=((this.visibleBottom-this.visibleTop)/2+m)/c.height;O=b-Q,g=b+Q}else O=(this.visibleTop-c.top-m)/c.height,g=(this.visibleBottom-c.top+m)/c.height;f=Ls(u,O),p=Ls(u,g)}else{let m=u.total*this.heightOracle.charWidth,O=r*this.heightOracle.charWidth,g=0;if(m>2e6)for(let $ of e)$.from>=c.from&&$.from<c.to&&$.size!=$.displaySize&&$.from*this.heightOracle.charWidth+g<this.pixelViewport.left&&(g=$.size-$.displaySize);let b=this.pixelViewport.left+g,Q=this.pixelViewport.right+g,x,k;if(d!=null){let $=Rs(u,d),C=((Q-b)/2+O)/m;x=$-C,k=$+C}else x=(b-O)/m,k=(Q+O)/m;f=Ls(u,x),p=Ls(u,k)}f>c.from&&a(c.from,f,c,u),p<c.to&&a(p,c.to,c,u)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(h):h(c);return l}gapSize(e,t,n,r){let s=Rs(r,n)-Rs(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){$l.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=xe.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];we.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let o=this.visibleRanges[s],l=n[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||wr(this.heightMap.lineAt(e,Te.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||wr(this.heightMap.lineAt(this.scaler.fromDOM(e),Te.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return wr(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Es{constructor(e,t){this.from=e,this.to=t}}function nk(i,e,t){let n=[],r=i,s=0;return we.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function Ls({total:i,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Rs(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function rk(i,e){for(let t of i)if(e(t))return t}const Cu={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function Au(i){let e=i.facet(tl).filter(n=>typeof n!="function"),t=i.facet(Rh).filter(n=>typeof n!="function");return t.length&&e.push(we.join(t)),e}class Ih{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let h=t.lineAt(l,Te.ByPos,e,0,0).top,c=t.lineAt(a,Te.ByPos,e,0,0).bottom;return r+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof Ih?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function wr(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Jt(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>wr(r,e)):i._content)}const Ms=te.define({combine:i=>i.join(" ")}),Ga=te.define({combine:i=>i.indexOf(!0)>-1}),Fa=Wi.newName(),bm=Wi.newName(),vm=Wi.newName(),ym={"&light":"."+bm,"&dark":"."+vm};function Ua(i,e,t){return new Wi(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const sk=Ua("."+Fa,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ym),ok={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Pl=F.ie&&F.ie_version<=11;class lk{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new X1,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(F.ie&&F.ie_version<=11||F.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&F.android&&e.constructor.EDIT_CONTEXT!==!1&&!(F.chrome&&F.chrome_version<126)&&(this.editContext=new hk(e),e.state.facet(ki)&&(e.contentDOM.editContext=this.editContext.editContext)),Pl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(ki)?n.root.activeElement!=this.dom:!Mr(this.dom,r))return;let s=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(F.ie&&F.ie_version<=11||F.android&&F.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Xr(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Gr(e.root);if(!t)return!1;let n=F.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&ak(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Mr(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&z1(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,ok),Pl&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Pl&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&_n(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Mr(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new $y(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=lm(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!$o(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let n=_u(t,e.previousSibling||e.target.previousSibling,-1),r=_u(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ki)!=e.state.facet(ki)&&(e.view.contentDOM.editContext=e.state.facet(ki)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function _u(i,e,t){for(;e;){let n=Xe.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Eu(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor,1);return Xr(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function ak(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Eu(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?Eu(i,t):null}class hk{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>n.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let c=am(e.state.sliceDoc(l,a),n.text,(h?r.from:r.to)-l,h?"end":null);if(!c){let d=Z.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));$o(d,r)||e.dispatch({selection:d,userEvent:"select"});return}let u={from:c.from+l,to:c.toA+l,insert:ge.of(n.text.slice(c.from,c.toB).split(`
|
|
258
|
+
`))};if((F.mac||F.android)&&u.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(u={from:l,to:a,insert:ge.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let d=this.to-this.from+(u.to-u.from+u.insert.length);Zh(e,u,Z.single(this.toEditorPos(n.selectionStart,d),this.toEditorPos(n.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a<h){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(xe.mark({attributes:{style:c}}).range(a,h))}}}e.dispatch({effects:Kp.of(xe.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=Gr(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,h)=>{if(n)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class U{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||I1(e.parent)||document,this.viewState=new Tu(this,e.state||Oe.create(e)),e.scrollTo&&e.scrollTo.is(Cs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(wn).map(r=>new kl(r));for(let r of this.plugins)r.update(this);this.observer=new lk(this),this.inputState=new Ay(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mu(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof De?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(d=>d.annotation(pm))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=mm(s,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(Oe.phrases)!=this.state.facet(Oe.phrases))return this.setState(s);r=xo.create(this,s,e),r.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(u&&(u=u.map(d.changes)),d.scrollIntoView){let{main:f}=d.state.selection;u=new En(f.empty?f:Z.cursor(f.head,f.head>f.anchor?-1:1))}for(let f of d.effects)f.is(Cs)&&(u=f.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=To.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(xr)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Ms)!=r.state.facet(Ms)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let d of this.state.facet(qa))try{d(r)}catch(f){Ct(this.state,f,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!lm(this,c)&&h.force&&_n(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new Tu(this,e),this.plugins=e.facet(wn).map(n=>new kl(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new mu(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(wn),n=e.state.facet(wn);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new kl(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(n){Ct(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Mp(n||this.win))s=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(r);s=f.from,o=f.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(f=>{try{return f.read(this)}catch(p){return Ct(this.state,p),Lu}}),u=xo.create(this,this.state,[]),d=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let f=0;f<h.length;f++)if(c[f]!=Lu)try{let p=h[f];p.write&&p.write(c[f],this)}catch(p){Ct(this.state,p)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((p>1||p<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,n?n.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(qa))l(t)}get themeClasses(){return Fa+" "+(this.state.facet(Ga)?vm:bm)+" "+this.state.facet(Ms)}updateAttrs(){let e=Ru(this,Jp,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ki)?"true":"false",class:"cm-content",style:`${F.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ru(this,Lh,t);let n=this.observer.ignore(()=>{let r=hu(this.contentDOM,this.contentAttrs,t),s=hu(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(U.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(xr);let e=this.state.facet(U.cspNonce);Wi.mount(this.root,this.styleModules.concat(sk).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Ql(this,e,Ou(this,e,t,n))}moveByGroup(e,t){return Ql(this,e,Ou(this,e,t,n=>yy(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return Z.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return vy(this,e,t,n)}moveVertically(e,t,n){return Ql(this,e,ky(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Ya(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ya(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ui.find(s,e-r.from,-1,t)];return Fr(n,o.dir==_e.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Fp)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ck)return Dp(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Vp(s.isolates,n=du(this,e))))return s.order;n||(n=du(this,e));let r=Y1(e.text,t,n);return this.bidiCache.push(new To(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||F.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Rp(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Cs.of(new En(typeof e=="number"?Z.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Cs.of(new En(Z.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return _t.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return _t.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Wi.newName(),r=[Ms.of(n),xr.of(Ua(`.${n}`,e))];return t&&t.dark&&r.push(Ga.of(!0)),r}static baseTheme(e){return Pi.lowest(xr.of(Ua("."+Fa,e,ym)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&Xe.get(n)||Xe.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}U.styleModule=xr;U.inputHandler=Np;U.clipboardInputFilter=_h;U.clipboardOutputFilter=Eh;U.scrollHandler=Hp;U.focusChangeEffect=Gp;U.perLineTextDirection=Fp;U.exceptionSink=Yp;U.updateListener=qa;U.editable=ki;U.mouseSelectionStyle=Wp;U.dragMovesSelection=jp;U.clickAddsSelectionRange=qp;U.decorations=tl;U.blockWrappers=em;U.outerDecorations=Rh;U.atomicRanges=ms;U.bidiIsolatedRanges=tm;U.scrollMargins=im;U.darkTheme=Ga;U.cspNonce=te.define({combine:i=>i.length?i[0]:""});U.contentAttributes=Lh;U.editorAttributes=Jp;U.lineWrapping=U.contentAttributes.of({class:"cm-lineWrapping"});U.announce=de.define();const ck=4096,Lu={};class To{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:_e.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&n.push(new To(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function Ru(i,e,t){for(let n=i.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&Th(o,t)}return t}const uk=F.mac?"mac":F.windows?"win":F.linux?"linux":"key";function dk(i,e){const t=i.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let a=0;a<t.length-1;++a){const h=t[a];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),l&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Zs(i,e,t){return e.altKey&&(i="Alt-"+i),e.ctrlKey&&(i="Ctrl-"+i),e.metaKey&&(i="Meta-"+i),t!==!1&&e.shiftKey&&(i="Shift-"+i),i}const fk=Pi.default(U.domEventHandlers({keydown(i,e){return Sm(km(e.state),i,e,"editor")}})),Os=te.define({enables:fk}),Mu=new WeakMap;function km(i){let e=i.facet(Os),t=Mu.get(e);return t||Mu.set(e,t=Ok(e.reduce((n,r)=>n.concat(r),[]))),t}function pk(i,e,t){return Sm(km(i.state),e,i,t)}let Ii=null;const mk=4e3;function Ok(i,e=uk){let t=Object.create(null),n=Object.create(null),r=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,h,c)=>{var u,d;let f=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(g=>dk(g,e));for(let g=1;g<p.length;g++){let b=p.slice(0,g).join(" ");r(b,!0),f[b]||(f[b]={preventDefault:!0,stopPropagation:!1,run:[Q=>{let x=Ii={view:Q,prefix:b,scope:o};return setTimeout(()=>{Ii==x&&(Ii=null)},mk),!0}]})}let m=p.join(" ");r(m,!1);let O=f[m]||(f[m]={preventDefault:!1,stopPropagation:!1,run:((d=(u=f._any)===null||u===void 0?void 0:u.run)===null||d===void 0?void 0:d.slice())||[]});a&&O.run.push(a),h&&(O.preventDefault=!0),c&&(O.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:u}=o;for(let d in c)c[d].run.push(f=>u(f,Ha))}let a=o[e]||o.key;if(a)for(let h of l)s(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Ha=null;function Sm(i,e,t,n){Ha=e;let r=A1(e),s=Mi(r,0),o=tn(s)==r.length&&r!=" ",l="",a=!1,h=!1,c=!1;Ii&&Ii.view==t&&Ii.scope==n&&(l=Ii.prefix+" ",cm.indexOf(e.keyCode)<0&&(h=!0,Ii=null));let u=new Set,d=O=>{if(O){for(let g of O.run)if(!u.has(g)&&(u.add(g),g(t)))return O.stopPropagation&&(c=!0),!0;O.preventDefault&&(O.stopPropagation&&(c=!0),h=!0)}return!1},f=i[n],p,m;return f&&(d(f[l+Zs(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(F.windows&&e.ctrlKey&&e.altKey)&&!(F.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Yi[e.keyCode])&&p!=r?(d(f[l+Zs(p,e,!0)])||e.shiftKey&&(m=Yr[e.keyCode])!=r&&m!=p&&d(f[l+Zs(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&d(f[l+Zs(r,e,!0)])&&(a=!0),!a&&d(f._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Ha=null,a}class cn{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=xm(e);return[new cn(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return gk(e,t,n)}}function xm(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==_e.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function Zu(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=i.posAtCoords({x:s.left+1,y:o}),a=i.posAtCoords({x:s.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function gk(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==_e.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=xm(i),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),u=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=l.right-(c?parseInt(c.paddingRight):0),f=Wa(i,n,1),p=Wa(i,r,-1),m=f.type==ht.Text?f:null,O=p.type==ht.Text?p:null;if(m&&(i.lineWrapping||f.widgetLineBreaks)&&(m=Zu(i,n,1,m)),O&&(i.lineWrapping||p.widgetLineBreaks)&&(O=Zu(i,r,-1,O)),m&&O&&m.from==O.from&&m.to==O.to)return b(Q(t.from,t.to,m));{let k=m?Q(t.from,null,m):x(f,!1),$=O?Q(null,t.to,O):x(p,!0),C=[];return(m||f).to<(O||p).from-(m&&O?1:0)||f.widgetLineBreaks>1&&k.bottom+i.defaultLineHeight/2<$.top?C.push(g(u,k.bottom,d,$.top)):k.bottom<$.top&&i.elementAtHeight((k.bottom+$.top)/2).type==ht.Text&&(k.bottom=$.top=(k.bottom+$.top)/2),b(k).concat(C).concat(b($))}function g(k,$,C,T){return new cn(e,k-a.left,$-a.top,Math.max(0,C-k),T-$)}function b({top:k,bottom:$,horizontal:C}){let T=[];for(let A=0;A<C.length;A+=2)T.push(g(C[A],k,C[A+1],$));return T}function Q(k,$,C){let T=1e9,A=-1e9,M=[];function B(q,G,I,W,V){let E=i.coordsAtPos(q,q==C.to?-2:2),H=i.coordsAtPos(I,I==C.from?2:-2);!E||!H||(T=Math.min(E.top,H.top,T),A=Math.max(E.bottom,H.bottom,A),V==_e.LTR?M.push(s&&G?u:E.left,s&&W?d:H.right):M.push(!s&&W?u:H.left,!s&&G?d:E.right))}let R=k??C.from,D=$??C.to;for(let q of i.visibleRanges)if(q.to>R&&q.from<D)for(let G=Math.max(q.from,R),I=Math.min(q.to,D);;){let W=i.state.doc.lineAt(G);for(let V of i.bidiSpans(W)){let E=V.from+W.from,H=V.to+W.from;if(E>=I)break;H>G&&B(Math.max(E,G),k==null&&E<=R,Math.min(H,I),$==null&&H>=D,V.dir)}if(G=W.to+1,G>=I)break}return M.length==0&&B(R,k==null,D,$==null,i.textDirection),{top:T,bottom:A,horizontal:M}}function x(k,$){let C=l.top+($?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function bk(i,e){return i.constructor==e.constructor&&i.eq(e)}class vk{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(lo)!=e.state.facet(lo)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(lo);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,n)=>!bk(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,F.safari&&F.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const lo=te.define();function wm(i){return[_t.define(e=>new vk(e,i)),lo.of(i)]}const Gn=te.define({combine(i){return Jo(i,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function yk(i={}){return[Gn.of(i),kk,Sk,xk,Up.of(!0)]}function Qm(i){return i.startState.facet(Gn)!=i.state.facet(Gn)}const kk=wm({above:!0,markers(i){let{state:e}=i,t=e.facet(Gn),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor&&!(s&&F.ios&&t.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:Z.cursor(r.head,r.assoc);for(let a of cn.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Qm(i);return t&&Xu(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){Xu(e.state,i)},class:"cm-cursorLayer"});function Xu(i,e){e.style.animationDuration=i.facet(Gn).cursorBlinkRate+"ms"}const Sk=wm({above:!1,markers(i){let e=[],{main:t,ranges:n}=i.state.selection;for(let r of n)if(!r.empty)for(let s of cn.forRange(i,"cm-selectionBackground",r))e.push(s);if(F.ios&&!t.empty&&i.state.facet(Gn).iosSelectionHandles){for(let r of cn.forRange(i,"cm-selectionHandle cm-selectionHandle-start",Z.cursor(t.from,1)))e.push(r);for(let r of cn.forRange(i,"cm-selectionHandle cm-selectionHandle-end",Z.cursor(t.to,1)))e.push(r)}return e},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Qm(i)},class:"cm-selectionLayer"}),xk=Pi.highest(U.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));class wk extends bn{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Zr(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=Fr(t[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function Qk(i){let e=_t.fromClass(class{constructor(t){this.view=t,this.placeholder=i?xe.set([xe.widget({widget:new wk(i),side:1}).range(0)]):xe.none}get decorations(){return this.view.state.doc.length?xe.none:this.placeholder}},{decorations:t=>t.decorations});return typeof i=="string"?[e,U.contentAttributes.of({"aria-placeholder":i})]:e}const Xs="-10000px";class $k{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,t){var n;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<s.length;a++){let h=s[a],c=-1;if(h){for(let u=0;u<this.tooltips.length;u++){let d=this.tooltips[u];d&&d.create==h.create&&(c=u)}if(c<0)o[a]=this.createTooltipView(h,a?o[a-1]:null),l&&(l[a]=!!h.above);else{let u=o[a]=this.tooltipViews[c];l&&(l[a]=t[c]),u.update&&u.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(n=a.destroy)===null||n===void 0||n.call(a));return t&&(l.forEach((a,h)=>t[h]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function Pk(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Tl=te.define({combine:i=>{var e,t,n;return{position:F.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||Pk}}}),Iu=new WeakMap,$m=_t.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(Tl);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new $k(i,zh,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(Tl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Xs,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(F.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(i=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=Mh(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Tl).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:n,scaleX:r,scaleY:s}=i,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:c}=h,u=i.pos[l],d=i.size[l];if(!u||a.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){c.style.top=Xs;continue}let f=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=d.right-d.left,O=(e=Iu.get(h))!==null&&e!==void 0?e:d.bottom-d.top,g=h.offset||Ck,b=this.view.textDirection==_e.LTR,Q=d.width>n.right-n.left?b?n.left:n.right-d.width:b?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),x=this.above[l];!a.strictSide&&(x?u.top-O-p-g.y<n.top:u.bottom+O+p+g.y>n.bottom)&&x==n.bottom-u.bottom>u.top-n.top&&(x=this.above[l]=!x);let k=(x?u.top-n.top:n.bottom-u.bottom)-p;if(k<O&&h.resize!==!1){if(k<this.view.defaultLineHeight){c.style.top=Xs;continue}Iu.set(h,O),c.style.height=(O=k)/s+"px"}else c.style.height&&(c.style.height="");let $=x?u.top-O-p-g.y:u.bottom+p+g.y,C=Q+m;if(h.overlap!==!0)for(let T of o)T.left<C&&T.right>Q&&T.top<$+O&&T.bottom>$&&($=x?T.top-O-2-p:T.bottom+p+2);if(this.position=="absolute"?(c.style.top=($-i.parent.top)/s+"px",zu(c,(Q-i.parent.left)/r)):(c.style.top=$/s+"px",zu(c,Q/r)),f){let T=u.left+(b?g.x:-g.x)-(Q+14-7);f.style.left=T/r+"px"}h.overlap!==!0&&o.push({left:Q,top:$,right:C,bottom:$+O}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),h.positioned&&h.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=Xs}},{eventObservers:{scroll(){this.maybeMeasure()}}});function zu(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}const Tk=U.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ck={x:0,y:0},zh=te.define({enables:[$m,Tk]});function Pm(i,e){let t=i.plugin($m);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const Vu=te.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Tm(i,e){let t=i.plugin(Cm),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const Cm=_t.fromClass(class{constructor(i){this.input=i.state.facet(Co),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(Vu);this.top=new Is(i,!0,e.topContainer),this.bottom=new Is(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(Vu);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Is(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Is(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Co);if(t!=this.input){let n=t.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of n){let h=this.specs.indexOf(a),c;h<0?(c=a(i.view),l.push(c)):(c=this.panels[h],c.update&&c.update(i)),r.push(c),(c.top?s:o).push(c)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>U.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Is{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Du(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Du(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Du(i){let e=i.nextSibling;return i.remove(),e}const Co=te.define({enables:Cm});function Ak(i,e){let t,n=new Promise(o=>t=o),r=o=>_k(o,e,t);i.state.field(Cl,!1)?i.dispatch({effects:Am.of(r)}):i.dispatch({effects:de.appendConfig.of(Cl.init(()=>[r]))});let s=_m.of(r);return{close:s,result:n.then(o=>((i.win.queueMicrotask||(a=>i.win.setTimeout(a,10)))(()=>{i.state.field(Cl).indexOf(r)>-1&&i.dispatch({effects:s})}),o))}}const Cl=Ot.define({create(){return[]},update(i,e){for(let t of e.effects)t.is(Am)?i=[t.value].concat(i):t.is(_m)&&(i=i.filter(n=>n!=t.value));return i},provide:i=>Co.computeN([i],e=>e.field(i))}),Am=de.define(),_m=de.define();function _k(i,e,t){let n=e.content?e.content(i,()=>o(null)):null;if(!n){if(n=Ne("form"),e.input){let l=Ne("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(Ne("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(Ne("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l<r.length;l++){let a=r[l];a.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let s=Ne("div",n,Ne("button",{onclick:()=>o(null),"aria-label":i.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&i.focus(),t(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class Fn extends ji{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Fn.prototype.elementClass="";Fn.prototype.toDOM=void 0;Fn.prototype.mapMode=ot.TrackBefore;Fn.prototype.startSide=Fn.prototype.endSide=-1;Fn.prototype.point=!0;const Em=1024;let Ek=0;class Zt{constructor(e,t){this.from=e,this.to=t}}class ae{constructor(e={}){this.id=Ek++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Be.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ae.closedBy=new ae({deserialize:i=>i.split(" ")});ae.openedBy=new ae({deserialize:i=>i.split(" ")});ae.group=new ae({deserialize:i=>i.split(" ")});ae.isolate=new ae({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});ae.contextHash=new ae({perNode:!0});ae.lookAhead=new ae({perNode:!0});ae.mounted=new ae({perNode:!0});class Ln{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[ae.mounted.id]}}const Lk=Object.create(null);class Be{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Lk,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Be(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ae.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(ae.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Be.none=new Be("",Object.create(null),0,8);class sr{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let s of e){let o=s(n);if(o){r||(r=Object.assign({},n.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}t.push(r?new Be(n.name,r,n.id,n.flags):n)}return new sr(t)}}const zs=new WeakMap,Bu=new WeakMap;var Se;(function(i){i[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays",i[i.EnterBracketed=16]="EnterBracketed"})(Se||(Se={}));class fe{constructor(e,t,n,r,s){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Ln.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let r=n.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Ao(this.topNode,e)}cursorAt(e,t=0,n=0){let r=zs.get(this)||this.topNode,s=new Ao(r);return s.moveTo(e,t),zs.set(this,s._tree),s}get topNode(){return new tt(this,0,0,null)}resolve(e,t=0){let n=Hr(zs.get(this)||this.topNode,e,t,!1);return zs.set(this,n),n}resolveInner(e,t=0){let n=Hr(Bu.get(this)||this.topNode,e,t,!0);return Bu.set(this,n),n}resolveStack(e,t=0){return Zk(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&Se.IncludeAnonymous)>0;for(let a=this.cursor(o|Se.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Bh(Be.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new fe(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new fe(Be.none,t,n,r)))}static build(e){return Xk(e)}}fe.empty=new fe(Be.none,[],[],0);class Vh{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Vh(this.buffer,this.index)}}class Gi{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Be.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,n,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(Lm(s,r,o[a+1],o[a+2])&&(l=a,n>0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){s[a++]=r[l++],s[a++]=r[l++]-n;let h=s[a++]=r[l++]-n;s[a++]=r[l++]-e,o=Math.max(o,h)}return new Gi(s,o,this.set)}}function Lm(i,e,t,n){switch(i){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Hr(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to<e);){let o=!n&&i instanceof tt&&i.index<0?null:i.parent;if(!o)return i;i=o}let s=n?0:Se.IgnoreOverlays;if(n)for(let o=i,l=o.parent;l;o=l,l=o.parent)o instanceof tt&&o.index<0&&((r=l.enter(e,t,s))===null||r===void 0?void 0:r.from)!=o.from&&(i=l);for(;;){let o=i.enter(e,t,s);if(!o)return i;i=o}}class Rm{cursor(e=0){return new Ao(this,e)}getChild(e,t=null,n=null){let r=qu(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return qu(this,e,t,n)}resolve(e,t=0){return Hr(this,e,t,!1)}resolveInner(e,t=0){return Hr(this,e,t,!0)}matchContext(e){return Ka(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(n=t,t=r.prevSibling):t=r}return n}get node(){return this}get next(){return this.parent}}class tt extends Rm{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],u=a[e]+o.from,d;if(!(!(s&Se.EnterBracketed&&c instanceof fe&&(d=Ln.get(c))&&!d.overlay&&d.bracketed&&n>=u&&n<=u+c.length)&&!Lm(r,n,u,u+c.length))){if(c instanceof Gi){if(s&Se.ExcludeBuffers)continue;let f=c.findChild(0,c.buffer.length,t,n-u,r);if(f>-1)return new di(new Rk(o,c,e,u),null,f)}else if(s&Se.IncludeAnonymous||!c.type.isAnonymous||Dh(c)){let f;if(!(s&Se.IgnoreMounts)&&(f=Ln.get(c))&&!f.overlay)return new tt(f.tree,u,e,o);let p=new tt(c,u,e,o);return s&Se.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&Se.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&Se.IgnoreOverlays)&&(r=Ln.get(this._tree))&&r.overlay){let s=e-this.from,o=n&Se.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l<s)&&(t<0||o?a>=s:a>s))return new tt(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function qu(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Ka(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class Rk{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class di extends Rm{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new di(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&Se.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new di(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new di(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new di(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new fe(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Mm(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;s<i.length;s++){let o=i[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let n=t instanceof tt&&t.index<0?null:t.parent,r=i.slice();return n?r[e]=n:r.splice(e,1),new Mk(r,t)}class Mk{constructor(e,t){this.heads=e,this.node=t}get next(){return Mm(this.heads)}}function Zk(i,e,t){let n=i.resolveInner(e,t),r=null;for(let s=n instanceof tt?n:n.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[n])).push(o.resolve(e,t)),s=o}else{let o=Ln.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new tt(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Hr(l,e,t,!1))}}return r?Mm(r):n}class Ao{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Se.EnterBracketed,e instanceof tt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof tt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Se.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Se.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Se.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&Se.IncludeAnonymous||l instanceof Gi||!l.type.isAnonymous||Dh(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r<this.stack.length;r++)t=new di(this.buffer,t,this.stack[r]);return this.bufferNode=new di(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Ka(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Ka(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function Dh(i){return i.children.some(e=>e instanceof Gi||!e.type.isAnonymous||Dh(e))}function Xk(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=Em,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new Vh(t,t.length):t,a=n.types,h=0,c=0;function u(k,$,C,T,A,M){let{id:B,start:R,end:D,size:q}=l,G=c,I=h;if(q<0)if(l.next(),q==-1){let se=s[B];C.push(se),T.push(R-k);return}else if(q==-3){h=B;return}else if(q==-4){c=B;return}else throw new RangeError(`Unrecognized record size: ${q}`);let W=a[B],V,E,H=R-k;if(D-R<=r&&(E=O(l.pos-$,A))){let se=new Uint16Array(E.size-E.skip),ee=l.pos-E.size,oe=se.length;for(;l.pos>ee;)oe=g(E.start,se,oe);V=new Gi(se,D-E.start,n),H=E.start-k}else{let se=l.pos-q;l.next();let ee=[],oe=[],ue=B>=o?B:-1,$e=0,Re=D;for(;l.pos>se;)ue>=0&&l.id==ue&&l.size>=0?(l.end<=Re-r&&(p(ee,oe,R,$e,l.end,Re,ue,G,I),$e=ee.length,Re=l.end),l.next()):M>2500?d(R,se,ee,oe):u(R,se,ee,oe,ue,M+1);if(ue>=0&&$e>0&&$e<ee.length&&p(ee,oe,R,$e,R,Re,ue,G,I),ee.reverse(),oe.reverse(),ue>-1&&$e>0){let Lt=f(W,I);V=Bh(W,ee,oe,0,ee.length,0,D-R,Lt,Lt)}else V=m(W,ee,oe,D-R,G-D,I)}C.push(V),T.push(H)}function d(k,$,C,T){let A=[],M=0,B=-1;for(;l.pos>$;){let{id:R,start:D,end:q,size:G}=l;if(G>4)l.next();else{if(B>-1&&D<B)break;B<0&&(B=q-r),A.push(R,D,q),M++,l.next()}}if(M){let R=new Uint16Array(M*4),D=A[A.length-2];for(let q=A.length-3,G=0;q>=0;q-=3)R[G++]=A[q],R[G++]=A[q+1]-D,R[G++]=A[q+2]-D,R[G++]=G;C.push(new Gi(R,A[2]-D,n)),T.push(D-k)}}function f(k,$){return(C,T,A)=>{let M=0,B=C.length-1,R,D;if(B>=0&&(R=C[B])instanceof fe){if(!B&&R.type==k&&R.length==A)return R;(D=R.prop(ae.lookAhead))&&(M=T[B]+R.length+D)}return m(k,C,T,A,M,$)}}function p(k,$,C,T,A,M,B,R,D){let q=[],G=[];for(;k.length>T;)q.push(k.pop()),G.push($.pop()+C-A);k.push(m(n.types[B],q,G,M-A,R-M,D)),$.push(A-C)}function m(k,$,C,T,A,M,B){if(M){let R=[ae.contextHash,M];B=B?[R].concat(B):[R]}if(A>25){let R=[ae.lookAhead,A];B=B?[R].concat(B):[R]}return new fe(k,$,C,T,B)}function O(k,$){let C=l.fork(),T=0,A=0,M=0,B=C.end-r,R={size:0,start:0,skip:0};e:for(let D=C.pos-k;C.pos>D;){let q=C.size;if(C.id==$&&q>=0){R.size=T,R.start=A,R.skip=M,M+=4,T+=4,C.next();continue}let G=C.pos-q;if(q<0||G<D||C.start<B)break;let I=C.id>=o?4:0,W=C.start;for(C.next();C.pos>G;){if(C.size<0)if(C.size==-3||C.size==-4)I+=4;else break e;else C.id>=o&&(I+=4);C.next()}A=W,T+=q,M+=I}return($<0||T==k)&&(R.size=T,R.start=A,R.skip=M),R.size>4?R:void 0}function g(k,$,C){let{id:T,start:A,end:M,size:B}=l;if(l.next(),B>=0&&T<o){let R=C;if(B>4){let D=l.pos-(B-4);for(;l.pos>D;)C=g(k,$,C)}$[--C]=R,$[--C]=M-k,$[--C]=A-k,$[--C]=T}else B==-3?h=T:B==-4&&(c=T);return C}let b=[],Q=[];for(;l.pos>0;)u(i.start||0,i.bufferStart||0,b,Q,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:b.length?Q[0]+b[0].length:0;return new fe(a[i.topID],b.reverse(),Q.reverse(),x)}const ju=new WeakMap;function ao(i,e){if(!i.isAnonymous||e instanceof Gi||e.type!=i)return 1;let t=ju.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof fe)){t=1;break}t+=ao(i,n)}ju.set(e,t)}return t}function Bh(i,e,t,n,r,s,o,l,a){let h=0;for(let p=n;p<r;p++)h+=ao(i,e[p]);let c=Math.ceil(h*1.5/8),u=[],d=[];function f(p,m,O,g,b){for(let Q=O;Q<g;){let x=Q,k=m[Q],$=ao(i,p[Q]);for(Q++;Q<g;Q++){let C=ao(i,p[Q]);if($+C>=c)break;$+=C}if(Q==x+1){if($>c){let C=p[x];f(C.children,C.positions,0,C.children.length,m[x]+b);continue}u.push(p[x])}else{let C=m[Q-1]+p[Q-1].length-k;u.push(Bh(i,p,m,x,Q,k,C,null,a))}d.push(k+b-s)}}return f(e,t,n,r,0),(l||a)(u,d,o)}class Zm{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof di?this.setBuffer(e.context.buffer,e.index,t):e instanceof tt&&this.map.set(e.tree,t)}get(e){return e instanceof di?this.getBuffer(e.context.buffer,e.index):e instanceof tt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class xi{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new xi(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,u=c?c.fromA:1e9;if(u-a>=n)for(;o&&o.from<u;){let d=o;if(a>=d.from||u<=d.to||h){let f=Math.max(d.from,a)-h,p=Math.min(d.to,u)-h;d=f>=p?null:new xi(f,p,d.tree,d.offset+h,l>0,!!c)}if(d&&r.push(d),o.to>u)break;o=s<e.length?e[s++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return r}}class sl{startParse(e,t,n){return typeof e=="string"&&(e=new Ik(e)),n=n?n.length?n.map(r=>new Zt(r.from,r.to)):[new Zt(0,0)]:[new Zt(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class Ik{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Xm(i){return(e,t,n,r)=>new Vk(e,i,t,n,r)}class Wu{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function Yu(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class zk{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Ja=new ae({perNode:!0});class Vk{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new fe(n.type,n.children,n.positions,n.length,n.propValues.concat([[Ja,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[ae.mounted.id]=new Ln(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new qk(this.fragments),t=null,n=null,r=new Ao(new tt(this.baseTree,this.ranges[0].from,0,null),Se.IncludeAnonymous|Se.IgnoreMounts);e:for(let s,o;;){let l=!0,a;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let u=c.from+h.pos,d=c.to+h.pos;u>=r.from&&d<=r.to&&!t.ranges.some(f=>f.from<d&&f.to>u)&&t.ranges.push({from:u,to:d})}}l=!1}else if(n&&(o=Dk(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(Bk(r),t&&t.depth++,n&&n.depth++);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new zk(s.parser,s.overlay,h,this.inner.length,r.from,!!s.bracketed,r.tree,t);else{let c=Fu(this.ranges,s.overlay||(r.from<r.to?[new Zt(r.from,r.to)]:[]));c.length&&Yu(c),(c.length||!s.overlay)&&this.inner.push(new Wu(s.parser,c.length?s.parser.startParse(this.input,Uu(h,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(u=>new Zt(u.from-r.from,u.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Zt(r.from,r.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=Fu(this.ranges,t.ranges);h.length&&(Yu(h),this.inner.splice(t.index,0,new Wu(t.parser,t.parser.startParse(this.input,Uu(t.mounts,h),h),t.ranges.map(c=>new Zt(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Dk(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Nu(i,e,t,n,r,s){if(e<t){let o=i.buffer[e+1];n.push(i.slice(e,t,o)),r.push(o-s)}}function Bk(i){let{node:e}=i,t=[],n=e.context.buffer;do t.push(i.index),i.parent();while(!i.tree);let r=i.tree,s=r.children.indexOf(n),o=r.children[s],l=o.buffer,a=[s];function h(c,u,d,f,p,m){let O=t[m],g=[],b=[];Nu(o,c,O,g,b,f);let Q=l[O+1],x=l[O+2];a.push(g.length);let k=m?h(O+4,l[O+3],o.set.types[l[O]],Q,x-Q,m-1):e.toTree();return g.push(k),b.push(Q-f),Nu(o,l[O+3],u,g,b,f),new fe(d,g,b,p)}r.children[s]=h(0,l.length,Be.none,0,o.length,t.length-1);for(let c of a){let u=i.tree.children[c],d=i.tree.positions[c];i.yield(new tt(u,d+i.from,c,i._tree))}}class Gu{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Se.IncludeAnonymous|Se.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)t.to>=e&&t.enter(n,1,Se.IgnoreOverlays|Se.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof fe)t=t.children[0];else break}return!1}}let qk=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Ja))!==null&&t!==void 0?t:n.to,this.inner=new Gu(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ja))!==null&&e!==void 0?e:t.to,this.inner=new Gu(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(ae.mounted);if(o&&o.parser==t)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Fu(i,e){let t=null,n=e;for(let r=1,s=0;r<i.length;r++){let o=i[r-1].to,l=i[r].from;for(;s<n.length;s++){let a=n[s];if(a.from>=l)break;a.to<=o||(t||(n=t=e.slice()),a.from<o?(t[s]=new Zt(a.from,o),a.to>l&&t.splice(s+1,0,new Zt(l,a.to))):a.to>l?t[s--]=new Zt(l,a.to):t.splice(s--,1))}}return n}function jk(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,u=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let d=Math.max(a,t),f=Math.min(c,u,n);d<f&&h.push(new Zt(d,f))}if(a=Math.min(c,u),a==1e9)break;c==a&&(o?(o=!1,r++):o=!0),u==a&&(l?(l=!1,s++):l=!0)}return h}function Uu(i,e){let t=[];for(let{pos:n,mount:r,frag:s}of i){let o=n+(r.overlay?r.overlay[0].from:0),l=o+r.tree.length,a=Math.max(s.from,o),h=Math.min(s.to,l);if(r.overlay){let c=r.overlay.map(d=>new Zt(d.from+n,d.to+n)),u=jk(e,c,a,h);for(let d=0,f=a;;d++){let p=d==u.length,m=p?h:u[d].from;if(m>f&&t.push(new xi(f,m,r.tree,-o,s.from>=f||s.openStart,s.to<=m||s.openEnd)),p)break;f=u[d].to}}else t.push(new xi(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}let Wk=0;class Pt{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Wk++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Pt&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Pt(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new _o(e);return n=>n.modified.indexOf(t)>-1?n:_o.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}}let Yk=0;class _o{constructor(e){this.name=e,this.instances=[],this.id=Yk++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&Nk(t,l.modified));if(n)return n;let r=[],s=new Pt(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=Gk(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(_o.get(l,a));return s}}function Nk(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function Gk(i){let e=[[]];for(let t=0;t<i.length;t++)for(let n=0,r=e.length;n<r;n++)e.push(e[n].concat(i[t]));return e.sort((t,n)=>n.length-t.length)}function or(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let u=0;;){if(l=="..."&&u>0&&u+3==r.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!d)throw new RangeError("Invalid path: "+r);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),u+=d[0].length,u==r.length)break;let f=r[u++];if(u==r.length&&f=="!"){o=0;break}if(f!="/")throw new RangeError("Invalid path: "+r);l=r.slice(u)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Kr(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return Im.add(e)}const Im=new ae({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Kr(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Kr{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Kr.empty=new Kr([],2,null);function zm(i,e){let t=Object.create(null);for(let s of i)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:n,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function Fk(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function Uk(i,e,t,n=0,r=i.length){let s=new Hk(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class Hk{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(f=>!f.scope||f.scope(o)));let h=r,c=Kk(e)||Kr.empty,u=Fk(s,c.tags);if(u&&(h&&(h+=" "),h+=u,c.mode==1&&(r+=(r?" ":"")+u)),this.startSpan(Math.max(t,l),h),c.opaque)return;let d=e.tree&&e.tree.prop(ae.mounted);if(d&&d.overlay){let f=e.node.enter(d.overlay[0].from+l,1),p=this.highlighters.filter(O=>!O.scope||O.scope(d.tree.type)),m=e.firstChild();for(let O=0,g=l;;O++){let b=O<d.overlay.length?d.overlay[O]:null,Q=b?b.from+l:a,x=Math.max(t,g),k=Math.min(n,Q);if(x<k&&m)for(;e.from<k&&(this.highlightRange(e,x,k,r,s),this.startSpan(Math.min(k,e.to),h),!(e.to>=Q||!e.nextSibling())););if(!b||Q>n)break;g=b.to+l,g>t&&(this.highlightRange(f.cursor(),Math.max(t,b.from+l),Math.min(n,g),"",p),this.startSpan(Math.min(n,g),h))}m&&e.parent()}else if(e.firstChild()){d&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function Kk(i){let e=i.type.prop(Im);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const Y=Pt.define,Vs=Y(),Zi=Y(),Hu=Y(Zi),Ku=Y(Zi),Xi=Y(),Ds=Y(Xi),Al=Y(Xi),li=Y(),Ui=Y(li),si=Y(),oi=Y(),eh=Y(),mr=Y(eh),Bs=Y(),y={comment:Vs,lineComment:Y(Vs),blockComment:Y(Vs),docComment:Y(Vs),name:Zi,variableName:Y(Zi),typeName:Hu,tagName:Y(Hu),propertyName:Ku,attributeName:Y(Ku),className:Y(Zi),labelName:Y(Zi),namespace:Y(Zi),macroName:Y(Zi),literal:Xi,string:Ds,docString:Y(Ds),character:Y(Ds),attributeValue:Y(Ds),number:Al,integer:Y(Al),float:Y(Al),bool:Y(Xi),regexp:Y(Xi),escape:Y(Xi),color:Y(Xi),url:Y(Xi),keyword:si,self:Y(si),null:Y(si),atom:Y(si),unit:Y(si),modifier:Y(si),operatorKeyword:Y(si),controlKeyword:Y(si),definitionKeyword:Y(si),moduleKeyword:Y(si),operator:oi,derefOperator:Y(oi),arithmeticOperator:Y(oi),logicOperator:Y(oi),bitwiseOperator:Y(oi),compareOperator:Y(oi),updateOperator:Y(oi),definitionOperator:Y(oi),typeOperator:Y(oi),controlOperator:Y(oi),punctuation:eh,separator:Y(eh),bracket:mr,angleBracket:Y(mr),squareBracket:Y(mr),paren:Y(mr),brace:Y(mr),content:li,heading:Ui,heading1:Y(Ui),heading2:Y(Ui),heading3:Y(Ui),heading4:Y(Ui),heading5:Y(Ui),heading6:Y(Ui),contentSeparator:Y(li),list:Y(li),quote:Y(li),emphasis:Y(li),strong:Y(li),link:Y(li),monospace:Y(li),strikethrough:Y(li),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Bs,documentMeta:Y(Bs),annotation:Y(Bs),processingInstruction:Y(Bs),definition:Pt.defineModifier("definition"),constant:Pt.defineModifier("constant"),function:Pt.defineModifier("function"),standard:Pt.defineModifier("standard"),local:Pt.defineModifier("local"),special:Pt.defineModifier("special")};for(let i in y){let e=y[i];e instanceof Pt&&(e.name=i)}zm([{tag:y.link,class:"tok-link"},{tag:y.heading,class:"tok-heading"},{tag:y.emphasis,class:"tok-emphasis"},{tag:y.strong,class:"tok-strong"},{tag:y.keyword,class:"tok-keyword"},{tag:y.atom,class:"tok-atom"},{tag:y.bool,class:"tok-bool"},{tag:y.url,class:"tok-url"},{tag:y.labelName,class:"tok-labelName"},{tag:y.inserted,class:"tok-inserted"},{tag:y.deleted,class:"tok-deleted"},{tag:y.literal,class:"tok-literal"},{tag:y.string,class:"tok-string"},{tag:y.number,class:"tok-number"},{tag:[y.regexp,y.escape,y.special(y.string)],class:"tok-string2"},{tag:y.variableName,class:"tok-variableName"},{tag:y.local(y.variableName),class:"tok-variableName tok-local"},{tag:y.definition(y.variableName),class:"tok-variableName tok-definition"},{tag:y.special(y.variableName),class:"tok-variableName2"},{tag:y.definition(y.propertyName),class:"tok-propertyName tok-definition"},{tag:y.typeName,class:"tok-typeName"},{tag:y.namespace,class:"tok-namespace"},{tag:y.className,class:"tok-className"},{tag:y.macroName,class:"tok-macroName"},{tag:y.propertyName,class:"tok-propertyName"},{tag:y.operator,class:"tok-operator"},{tag:y.comment,class:"tok-comment"},{tag:y.meta,class:"tok-meta"},{tag:y.invalid,class:"tok-invalid"},{tag:y.punctuation,class:"tok-punctuation"}]);var _l;const Di=new ae;function ol(i){return te.define({combine:i?e=>e.concat(i):void 0})}const qh=new ae;class At{constructor(e,t,n=[],r=""){this.data=e,this.name=r,Oe.prototype.hasOwnProperty("tree")||Object.defineProperty(Oe.prototype,"tree",{get(){return Ze(this)}}),this.parser=t,this.extension=[Kn.of(this),Oe.languageData.of((s,o,l)=>{let a=Ju(s,o,l),h=a.type.prop(Di);if(!h)return[];let c=s.facet(h),u=a.type.prop(qh);if(u){let d=a.resolve(o-a.from,l);for(let f of u)if(f.test(d,s)){let p=s.facet(f.facet);return f.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Ju(e,t,n).type.prop(Di)==this.data}findRegions(e){let t=e.facet(Kn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(Di)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(ae.mounted);if(l){if(l.tree.prop(Di)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let a=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;a<s.children.length;a++){let h=s.children[a];h instanceof fe&&r(h,s.positions[a]+o)}};return r(Ze(e),0),n}get allowsNesting(){return!0}}At.setState=de.define();function Ju(i,e,t){let n=i.facet(Kn),r=Ze(i).topNode;if(!n||n.allowsNesting)for(let s=r;s;s=s.enter(e,t,Se.ExcludeBuffers|Se.EnterBracketed))s.type.isTop&&(r=s);return r}class Un extends At{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=ol(e.languageData);return new Un(t,e.parser.configure({props:[Di.add(n=>n.isTop?t:void 0)]}),e.name)}configure(e,t){return new Un(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ze(i){let e=i.field(At.state,!1);return e?e.tree:fe.empty}class Jk{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Or=null;class On{constructor(e,t,n=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new On(e,t,[],fe.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Jk(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=fe.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(xi.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xi.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Or;Or=this;try{return e()}finally{Or=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ed(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,u,d)=>a.push({fromA:h,toA:c,fromB:u,toB:d})),n=xi.applyChanges(n,a),r=fe.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),u=e.mapPos(h.to,-1);c<u&&l.push({from:c,to:u})}}}return new On(this.parser,t,n,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:r,to:s}=this.skipped[n];r<e.to&&s>e.from&&(this.fragments=ed(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends sl{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Or;if(a){for(let h of r)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new fe(Be.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Or}}function ed(i,e,t){return xi.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}class Hn{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Hn(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=On.create(e.facet(Kn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Hn(n)}}At.state=Ot.define({create:Hn.init,update(i,e){for(let t of e.effects)if(t.is(At.setState))return t.value;return e.startState.facet(Kn)!=e.state.facet(Kn)?Hn.init(e.state):i.apply(e)}});let Vm=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Vm=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const El=typeof navigator<"u"&&(!((_l=navigator.scheduling)===null||_l===void 0)&&_l.isInputPending)?()=>navigator.scheduling.isInputPending():null,eS=_t.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(At.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(At.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Vm(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,s=n.field(At.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!El?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&n.doc.length>r+1e3,a=s.context.work(()=>El&&El()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:At.setState.of(new Hn(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ct(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Kn=te.define({combine(i){return i.length?i[0]:null},enables:i=>[At.state,eS,U.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]});class Jn{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class _{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new _(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}const tS=te.define(),lr=te.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function gn(i){let e=i.facet(lr);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Eo(i,e){let t="",n=i.tabSize,r=i.facet(lr)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s<e;s++)t+=r;return t}function Dm(i,e){i instanceof Oe&&(i=new ll(i));for(let n of i.state.facet(tS)){let r=n(i,e);if(r!==void 0)return r}let t=Ze(i.state);return t.length>=e?iS(i,t,e):null}class ll{constructor(e,t={}){this.state=e,this.options=t,this.unit=gn(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return wi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ar=new ae;function iS(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Bm(n,i,t)}function Bm(i,e,t){for(let n=i;n;n=n.next){let r=rS(n.node);if(r)return r(jh.create(e,t,n))}return 0}function nS(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function rS(i){let e=i.type.prop(ar);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(ae.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>qm(o,!0,1,void 0,s&&!nS(o)?r.from:void 0)}return i.parent==null?sS:null}function sS(){return 0}class jh extends ll{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new jh(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(oS(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Bm(this.context.next,this.base,this.pos)}}function oS(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function lS(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function aS({closing:i,align:e=!0,units:t=1}){return n=>qm(n,e,t,i)}function qm(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==i.pos+o,a=e?lS(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}const hS=i=>i.baseIndent;function ho({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const cS=te.define(),gs=new ae;function jm(i){let e=i.firstChild,t=i.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?i.to:t.from}:null}class bs{constructor(e,t){this.specs=e;let n;function r(l){let a=Wi.newName();return(n||(n=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof At?l=>l.prop(Di)==o.data:o?l=>l==o:void 0,this.style=zm(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new Wi(n):null,this.themeType=t.themeType}static define(e,t){return new bs(e,t||{})}}const th=te.define(),uS=te.define({combine(i){return i.length?[i[0]]:null}});function Ll(i){let e=i.facet(th);return e.length?e:i.facet(uS)}function Wm(i,e){let t=[fS],n;return i instanceof bs&&(i.module&&t.push(U.styleModule.of(i.module)),n=i.themeType),n?t.push(th.computeN([U.darkTheme],r=>r.facet(U.darkTheme)==(n=="dark")?[i]:[])):t.push(th.of(i)),t}class dS{constructor(e){this.markCache=Object.create(null),this.tree=Ze(e.state),this.decorations=this.buildDeco(e,Ll(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Ze(e.state),n=Ll(e.state),r=n!=Ll(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return xe.none;let n=new dn;for(let{from:r,to:s}of e.visibleRanges)Uk(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=xe.mark({class:a})))},r,s);return n.finish()}}const fS=Pi.high(_t.fromClass(dS,{decorations:i=>i.decorations})),pS=1e4,mS="()[]{}",Ym=new ae;function ih(i,e,t){let n=i.prop(e<0?ae.openedBy:ae.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function nh(i){let e=i.type.prop(Ym);return e?e(i.node):i}function Qn(i,e,t,n={}){let r=n.maxScanDistance||pS,s=n.brackets||mS,o=Ze(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ih(a.type,t,s);if(h&&a.from<a.to){let c=nh(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return OS(i,e,t,a,c,h,s)}}return gS(i,e,t,o,l.type,r,s)}function OS(i,e,t,n,r,s,o){let l=n.parent,a={from:r.from,to:r.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let u=nh(c);return{start:a,end:u?{from:u.from,to:u.to}:void 0,matched:!0}}else if(ih(c.type,t,o))h++;else if(ih(c.type,-t,o)){if(h==0){let u=nh(c);return{start:a,end:u&&u.from<u.to?{from:u.from,to:u.to}:void 0,matched:!1}}h--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function gS(i,e,t,n,r,s,o){let l=t<0?i.sliceDoc(e-1,e):i.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=i.doc.iterRange(e,t>0?i.doc.length:0),u=0;for(let d=0;!c.next().done&&d<=s;){let f=c.value;t<0&&(d+=f.length);let p=e+d*t;for(let m=t>0?0:f.length-1,O=t>0?f.length:-1;m!=O;m+=t){let g=o.indexOf(f[m]);if(!(g<0||n.resolveInner(p+m,1).type!=r))if(g%2==0==t>0)u++;else{if(u==1)return{start:h,end:{from:p+m,to:p+m+1},matched:g>>1==a>>1};u--}}t>0&&(d+=f.length)}return c.done?{start:h,matched:!1}:null}function td(i,e,t,n=0,r=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=r;for(let o=n;o<e;o++)i.charCodeAt(o)==9?s+=t-s%t:s++;return s}class Nm{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=td(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:td(this.string,null,this.tabSize)}match(e,t,n){if(typeof e=="string"){let r=o=>n?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function bS(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||vS,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||Nh,mergeTokens:i.mergeTokens!==!1}}function vS(i){if(typeof i!="object")return i;let e={};for(let t in i){let n=i[t];e[t]=n instanceof Array?n.slice():n}return e}const id=new WeakMap;class Wh extends At{constructor(e){let t=ol(e.languageData),n=bS(e),r,s=new class extends sl{createParse(o,l,a){return new kS(r,o,l,a)}};super(t,s,[],e.name),this.topNode=wS(t,this),r=this,this.streamParser=n,this.stateAfter=new ae({perNode:!0}),this.tokenTable=e.tokenTable?new Hm(n.tokenTable):xS}static define(e){return new Wh(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=id.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=Yh(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let a=e.state.doc.lineAt(s),h=Math.min(e.pos,a.to);if(a.length){let c=n?n(a.from):-1,u=new Nm(a.text,e.state.tabSize,e.unit,c<0?void 0:c);for(;u.pos<h-a.from;)Fm(this.streamParser.token,u,o)}else this.streamParser.blankLine(o,e.unit);if(h==e.pos)break;s=a.to+1}let l=e.lineAt(e.pos);return n&&t==null&&id.set(e.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}}function Yh(i,e,t,n,r){let s=t>=n&&t+e.length<=r&&e.prop(i.stateAfter);if(s)return{state:i.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof fe&&a<r&&Yh(i,l,a,n,r);if(h)return h}return null}function Gm(i,e,t,n,r){if(r&&t<=0&&n>=e.length)return e;!r&&t==0&&e.type==i.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(o<n&&l instanceof fe){if(!(a=Gm(i,l,t-o,n-o,r)))break;return r?new fe(e.type,e.children.slice(0,s).concat(a),e.positions.slice(0,s+1),o+a.length):a}}return null}function yS(i,e,t,n,r){for(let s of e){let o=s.from+(s.openStart?25:0),l=s.to-(s.openEnd?25:0),a=o<=t&&l>t&&Yh(i,s.tree,0-s.offset,t,l),h;if(a&&a.pos<=n&&(h=Gm(i,s.tree,t+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:h}}return{state:i.streamParser.startState(r?gn(r):4),tree:fe.empty}}let kS=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=On.get(),o=r[0].from,{state:l,tree:a}=yS(e,n,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);s&&this.parsedPos<s.viewport.from-1e5&&r.some(h=>h.from<=s.viewport.from&&h.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(gn(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=On.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
259
|
+
`&&(t="");else{let n=t.indexOf(`
|
|
260
|
+
`);n>-1&&(t=t.slice(0,n))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,n=o+l.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,s),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new Nm(t,e?e.state.tabSize:4,e?gn(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Fm(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=fe.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:SS,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new fe(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new fe(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Fm(i,e,t){e.start=e.pos;for(let n=0;n<10;n++){let r=i(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const Nh=Object.create(null),Jr=[Be.none],SS=new sr(Jr),nd=[],rd=Object.create(null),Um=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Um[i]=Km(Nh,e);class Hm{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Um)}resolve(e){return e?this.table[e]||(this.table[e]=Km(this.extra,e)):0}}const xS=new Hm(Nh);function Rl(i,e){nd.indexOf(i)>-1||(nd.push(i),console.warn(e))}function Km(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=i[h]||y[h];c?typeof c=="function"?a.length?a=a.map(c):Rl(h,`Modifier ${h} used at start of tag`):a.length?Rl(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Rl(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(l=>l.id),s=rd[r];if(s)return s.id;let o=rd[r]=Be.define({id:Jr.length,name:n,props:[or({[n]:t})]});return Jr.push(o),o.id}function wS(i,e){let t=Be.define({id:Jr.length,name:"Document",props:[Di.add(()=>i),ar.add(()=>n=>e.getIndent(n))],top:!0});return Jr.push(t),t}_e.RTL,_e.LTR;const QS=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Fh(i.state,t.from);return n.line?$S(i):n.block?TS(i):!1};function Gh(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}const $S=Gh(_S,0),PS=Gh(Jm,0),TS=Gh((i,e)=>Jm(i,e,AS(e)),0);function Fh(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const gr=50;function CS(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-gr,n),o=i.sliceDoc(r,r+gr),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,u;r-n<=2*gr?c=u=i.sliceDoc(n,r):(c=i.sliceDoc(n,n+gr),u=i.sliceDoc(r-gr,r));let d=/^\s*/.exec(c)[0].length,f=/\s*$/.exec(u)[0].length,p=u.length-f-t.length;return c.slice(d,d+e.length)==e&&u.slice(p,p+t.length)==t?{open:{pos:n+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:r-f-t.length,margin:/\s/.test(u.charAt(p-1))?1:0}}:null}function AS(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function Jm(i,e,t=e.selection.ranges){let n=t.map(s=>Fh(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>CS(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=n[o],{open:h,close:c}=l;s.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:s}}return null}function _S(i,e,t=e.selection.ranges){let n=[],r=-1;e:for(let{from:s,to:o}of t){let l=n.length,a=1e9,h;for(let c=s;c<=o;){let u=e.doc.lineAt(c);if(h==null&&(h=Fh(e,u.from).line,!h))continue e;if(u.from>r&&(s==o||o>u.from)){r=u.from;let d=/^\s*/.exec(u.text)[0].length,f=d==u.length,p=u.text.slice(d,d+h.length)==h?d:-1;d<u.text.length&&d<a&&(a=d),n.push({line:u,comment:p,token:h,indent:d,empty:f,single:!1})}c=u.to+1}if(a<1e9)for(let c=l;c<n.length;c++)n[c].indent<n[c].line.text.length&&(n[c].indent=a);n.length==l+1&&(n[l].single=!0)}if(i!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:h,empty:c,single:u}of n)(u||!c)&&s.push({from:l.from+h,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,s.push({from:h,to:c})}return{changes:s}}return null}const rh=Ti.define(),ES=Ti.define(),LS=te.define(),eO=te.define({combine(i){return Jo(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),tO=Ot.define({create(){return fi.empty},update(i,e){let t=e.state.facet(eO),n=e.annotation(rh);if(n){let a=pt.fromTransaction(e,n.selection),h=n.side,c=h==0?i.undone:i.done;return a?c=Ro(c,c.length,t.minDepth,a):c=nO(c,e.startState.selection),new fi(h==0?n.rest:c,h==0?c:n.rest)}let r=e.annotation(ES);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(De.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=pt.fromTransaction(e),o=e.annotation(De.time),l=e.annotation(De.userEvent);return s?i=i.addChanges(s,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new fi(i.done.map(pt.fromJSON),i.undone.map(pt.fromJSON))}});function sd(i={}){return[tO,eO.of(i),U.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Uh:e.inputType=="historyRedo"?Lo:null;return n?(e.preventDefault(),n(t)):!1}})]}function al(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(tO,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}const Uh=al(0,!1),Lo=al(1,!1),RS=al(0,!0),MS=al(1,!0);class pt{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new pt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new pt(e.changes&&je.fromJSON(e.changes),[],e.mapped&&mi.fromJSON(e.mapped),e.startSelection&&Z.fromJSON(e.startSelection),e.selectionsAfter.map(Z.fromJSON))}static fromTransaction(e,t){let n=Xt;for(let r of e.startState.facet(LS)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new pt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Xt)}static selection(e){return new pt(void 0,Xt,void 0,void 0,e)}}function Ro(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function ZS(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<t.length;){let h=t[a++],c=t[a++];l>=h&&o<=c&&(n=!0)}}),n}function XS(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function iO(i,e){return i.length?e.length?i.concat(e):i:e}const Xt=[],IS=200;function nO(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-IS));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ro(i,i.length-1,1e9,t.setSelAfter(n)))}else return[pt.selection([e])]}function zS(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Ml(i,e){if(!i.length)return i;let t=i.length,n=Xt;for(;t;){let r=VS(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[pt.selection(n)]:Xt}function VS(i,e,t){let n=iO(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):Xt,t);if(!i.changes)return pt.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new pt(r,de.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}const DS=/^(input\.type|delete)($|\.)/;class fi{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new fi(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||DS.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,ZS(l.changes,e.changes))||n=="input.type.compose")?o=Ro(o,o.length-1,r.minDepth,new pt(e.changes.compose(l.changes),iO(de.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Xt)):o=Ro(o,o.length,r.minDepth,e),new fi(o,Xt,t,n)}addSelection(e,t,n,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Xt;return s.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&XS(s[s.length-1],e)?this:new fi(nO(this.done,e),this.undone,t,n)}addMapping(e){return new fi(Ml(this.done,e),Ml(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(n&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:rh.of({side:e,rest:zS(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Xt:r.slice(0,r.length-1);return s.mapped&&(l=Ml(l,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:rh.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}fi.empty=new fi(Xt,Xt);const BS=[{key:"Mod-z",run:Uh,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Lo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Lo,preventDefault:!0},{key:"Mod-u",run:RS,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:MS,preventDefault:!0}];function hr(i,e){return Z.create(i.ranges.map(e),i.mainIndex)}function ii(i,e){return i.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function ni({state:i,dispatch:e},t){let n=hr(i.selection,t);return n.eq(i.selection,!0)?!1:(e(ii(i,n)),!0)}function hl(i,e){return Z.cursor(e?i.to:i.from)}function rO(i,e){return ni(i,t=>t.empty?i.moveByChar(t,e):hl(t,e))}function it(i){return i.textDirectionAt(i.state.selection.main.head)==_e.LTR}const sO=i=>rO(i,!it(i)),oO=i=>rO(i,it(i));function lO(i,e){return ni(i,t=>t.empty?i.moveByGroup(t,e):hl(t,e))}const qS=i=>lO(i,!it(i)),jS=i=>lO(i,it(i));function WS(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function cl(i,e,t){let n=Ze(i).resolveInner(e.head),r=t?ae.closedBy:ae.openedBy;for(let a=e.head;;){let h=t?n.childAfter(a):n.childBefore(a);if(!h)break;WS(i,h,r)?n=h:a=t?h.to:h.from}let s=n.type.prop(r),o,l;return s&&(o=t?Qn(i,n.from,1):Qn(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,Z.cursor(l,t?-1:1)}const YS=i=>ni(i,e=>cl(i.state,e,!it(i))),NS=i=>ni(i,e=>cl(i.state,e,it(i)));function aO(i,e){return ni(i,t=>{if(!t.empty)return hl(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}const hO=i=>aO(i,!1),cO=i=>aO(i,!0);function uO(i){let e=i.scrollDOM.clientHeight<i.scrollDOM.scrollHeight-2,t=0,n=0,r;if(e){for(let s of i.state.facet(U.scrollMargins)){let o=s(i);o!=null&&o.top&&(t=Math.max(o==null?void 0:o.top,t)),o!=null&&o.bottom&&(n=Math.max(o==null?void 0:o.bottom,n))}r=i.scrollDOM.clientHeight-t-n}else r=(i.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:n,selfScroll:e,height:Math.max(i.defaultLineHeight,r-5)}}function dO(i,e){let t=uO(i),{state:n}=i,r=hr(n.selection,o=>o.empty?i.moveVertically(o,e,t.height):hl(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottom<h&&(s=U.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return i.dispatch(ii(n,r),{effects:s}),!0}const od=i=>dO(i,!1),sh=i=>dO(i,!0);function Fi(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=Z.cursor(n.from+s))}return r}const GS=i=>ni(i,e=>Fi(i,e,!0)),FS=i=>ni(i,e=>Fi(i,e,!1)),US=i=>ni(i,e=>Fi(i,e,!it(i))),HS=i=>ni(i,e=>Fi(i,e,it(i))),KS=i=>ni(i,e=>Z.cursor(i.lineBlockAt(e.head).from,1)),JS=i=>ni(i,e=>Z.cursor(i.lineBlockAt(e.head).to,-1));function ex(i,e,t){let n=!1,r=hr(i.selection,s=>{let o=Qn(i,s.head,-1)||Qn(i,s.head,1)||s.head>0&&Qn(i,s.head-1,1)||s.head<i.doc.length&&Qn(i,s.head+1,-1);if(!o||!o.end)return s;n=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return Z.cursor(l)});return n?(e(ii(i,r)),!0):!1}const tx=({state:i,dispatch:e})=>ex(i,e);function Bt(i,e){let t=hr(i.state.selection,n=>{let r=e(n);return Z.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return t.eq(i.state.selection)?!1:(i.dispatch(ii(i.state,t)),!0)}function fO(i,e){return Bt(i,t=>i.moveByChar(t,e))}const pO=i=>fO(i,!it(i)),mO=i=>fO(i,it(i));function OO(i,e){return Bt(i,t=>i.moveByGroup(t,e))}const ix=i=>OO(i,!it(i)),nx=i=>OO(i,it(i)),rx=i=>Bt(i,e=>cl(i.state,e,!it(i))),sx=i=>Bt(i,e=>cl(i.state,e,it(i)));function gO(i,e){return Bt(i,t=>i.moveVertically(t,e))}const bO=i=>gO(i,!1),vO=i=>gO(i,!0);function yO(i,e){return Bt(i,t=>i.moveVertically(t,e,uO(i).height))}const ld=i=>yO(i,!1),ad=i=>yO(i,!0),ox=i=>Bt(i,e=>Fi(i,e,!0)),lx=i=>Bt(i,e=>Fi(i,e,!1)),ax=i=>Bt(i,e=>Fi(i,e,!it(i))),hx=i=>Bt(i,e=>Fi(i,e,it(i))),cx=i=>Bt(i,e=>Z.cursor(i.lineBlockAt(e.head).from)),ux=i=>Bt(i,e=>Z.cursor(i.lineBlockAt(e.head).to)),hd=({state:i,dispatch:e})=>(e(ii(i,{anchor:0})),!0),cd=({state:i,dispatch:e})=>(e(ii(i,{anchor:i.doc.length})),!0),ud=({state:i,dispatch:e})=>(e(ii(i,{anchor:i.selection.main.anchor,head:0})),!0),dd=({state:i,dispatch:e})=>(e(ii(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),dx=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),fx=({state:i,dispatch:e})=>{let t=ul(i).map(({from:n,to:r})=>Z.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:Z.create(t),userEvent:"select"})),!0},px=({state:i,dispatch:e})=>{let t=hr(i.selection,n=>{let r=Ze(i),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return Z.range(l.to,l.from)}return n});return t.eq(i.selection)?!1:(e(ii(i,t)),!0)};function kO(i,e){let{state:t}=i,n=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to<i.state.doc.length:o.from>0)for(let l=s;;){let a=i.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(h=>h.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==n.ranges.length?!1:(i.dispatch(ii(t,Z.create(r,r.length-1))),!0)}const mx=i=>kO(i,!1),Ox=i=>kO(i,!0),gx=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=Z.create([t.main]):t.main.empty||(n=Z.create([Z.cursor(t.main.head)])),n?(e(ii(i,n)),!0):!1};function vs(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(t="delete.backward",a=qs(i,a,!1)):a>o&&(t="delete.forward",a=qs(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=qs(i,o,!1),l=qs(i,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:Z.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(i.dispatch(n.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?U.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function qs(i,e,t){if(i instanceof U)for(let n of i.state.facet(U.atomicRanges).map(r=>r(i)))n.between(e,e,(r,s)=>{r<e&&s>e&&(e=t?s:r)});return e}const SO=(i,e,t)=>vs(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),l,a;if(t&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let h=wi(l,s.tabSize),c=h%gn(s)||gn(s);for(let u=0;u<c&&l[l.length-1-u]==" ";u++)r--;a=r}else a=Fe(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=Fe(o.text,a-o.from,!1,!1)+o.from);return a}),oh=i=>SO(i,!1,!0),xO=i=>SO(i,!0,!1),wO=(i,e)=>vs(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let a=Fe(s.text,n-s.from,e)+s.from,h=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||n!=t.head)&&(l=c),n=a}return n}),QO=i=>wO(i,!1),bx=i=>wO(i,!0),vx=i=>vs(i,e=>{let t=i.lineBlockAt(e.head).to;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),yx=i=>vs(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),kx=i=>vs(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),Sx=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:ge.of(["",""])},range:Z.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},xx=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:Fe(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Fe(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:i.doc.slice(r,l).append(i.doc.slice(o,r))},range:Z.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ul(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function $O(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of ul(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let a of s.ranges)r.push(Z.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let a of s.ranges)r.push(Z.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:Z.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}const wx=({state:i,dispatch:e})=>$O(i,e,!1),Qx=({state:i,dispatch:e})=>$O(i,e,!0);function PO(i,e,t){if(i.readOnly)return!1;let n=[];for(let s of ul(i))t?n.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):n.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});let r=i.changes(n);return e(i.update({changes:r,selection:i.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const $x=({state:i,dispatch:e})=>PO(i,e,!1),Px=({state:i,dispatch:e})=>PO(i,e,!0),TO=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(ul(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),n=hr(e.selection,r=>{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),l=i.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Tx(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Ze(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(ae.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const fd=CO(!1),Cx=CO(!0);function CO(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!i&&s==o&&Tx(e,s);i&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new ll(e,{simulateBreak:s,simulateDoubleBreak:!!a}),c=Dm(h,s);for(c==null&&(c=wi(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let u=["",Eo(e,c)];return a&&u.push(Eo(e,h.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:ge.of(u)},range:Z.cursor(s+1+u[1].length)}});return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Hh(i,e){let t=-1;return i.changeByRange(n=>{let r=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,r,n),t=l.number),o=l.to+1}let s=i.changes(r);return{changes:r,range:Z.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const Ax=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new ll(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=Hh(i,(s,o,l)=>{let a=Dm(n,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let h=/^\s*/.exec(s.text)[0],c=Eo(i,a);(h!=c||l.from<s.from+h.length)&&(t[s.from]=a,o.push({from:s.from,to:s.from+h.length,insert:c}))});return r.changes.empty||e(i.update(r,{userEvent:"indent"})),!0},AO=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Hh(i,(t,n)=>{n.push({from:t.from,insert:i.facet(lr)})}),{userEvent:"input.indent"})),!0),_O=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Hh(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=wi(r,i.tabSize),o=0,l=Eo(i,Math.max(0,s-gn(i)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),_x=i=>(i.setTabFocusMode(),!0),Ex=[{key:"Ctrl-b",run:sO,shift:pO,preventDefault:!0},{key:"Ctrl-f",run:oO,shift:mO},{key:"Ctrl-p",run:hO,shift:bO},{key:"Ctrl-n",run:cO,shift:vO},{key:"Ctrl-a",run:KS,shift:cx},{key:"Ctrl-e",run:JS,shift:ux},{key:"Ctrl-d",run:xO},{key:"Ctrl-h",run:oh},{key:"Ctrl-k",run:vx},{key:"Ctrl-Alt-h",run:QO},{key:"Ctrl-o",run:Sx},{key:"Ctrl-t",run:xx},{key:"Ctrl-v",run:sh}],Lx=[{key:"ArrowLeft",run:sO,shift:pO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qS,shift:ix,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:US,shift:ax,preventDefault:!0},{key:"ArrowRight",run:oO,shift:mO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:jS,shift:nx,preventDefault:!0},{mac:"Cmd-ArrowRight",run:HS,shift:hx,preventDefault:!0},{key:"ArrowUp",run:hO,shift:bO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:hd,shift:ud},{mac:"Ctrl-ArrowUp",run:od,shift:ld},{key:"ArrowDown",run:cO,shift:vO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cd,shift:dd},{mac:"Ctrl-ArrowDown",run:sh,shift:ad},{key:"PageUp",run:od,shift:ld},{key:"PageDown",run:sh,shift:ad},{key:"Home",run:FS,shift:lx,preventDefault:!0},{key:"Mod-Home",run:hd,shift:ud},{key:"End",run:GS,shift:ox,preventDefault:!0},{key:"Mod-End",run:cd,shift:dd},{key:"Enter",run:fd,shift:fd},{key:"Mod-a",run:dx},{key:"Backspace",run:oh,shift:oh,preventDefault:!0},{key:"Delete",run:xO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:QO,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:bx,preventDefault:!0},{mac:"Mod-Backspace",run:yx,preventDefault:!0},{mac:"Mod-Delete",run:kx,preventDefault:!0}].concat(Ex.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Rx=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:YS,shift:rx},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:NS,shift:sx},{key:"Alt-ArrowUp",run:wx},{key:"Shift-Alt-ArrowUp",run:$x},{key:"Alt-ArrowDown",run:Qx},{key:"Shift-Alt-ArrowDown",run:Px},{key:"Mod-Alt-ArrowUp",run:mx},{key:"Mod-Alt-ArrowDown",run:Ox},{key:"Escape",run:gx},{key:"Mod-Enter",run:Cx},{key:"Alt-l",mac:"Ctrl-l",run:fx},{key:"Mod-i",run:px,preventDefault:!0},{key:"Mod-[",run:_O},{key:"Mod-]",run:AO},{key:"Mod-Alt-\\",run:Ax},{key:"Shift-Mod-k",run:TO},{key:"Shift-Mod-\\",run:tx},{key:"Mod-/",run:QS},{key:"Alt-A",run:PS},{key:"Ctrl-m",mac:"Shift-Alt-m",run:_x}].concat(Lx),Mx={key:"Tab",run:AO,shift:_O};class Kh{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Ze(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(LO(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function pd(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Zx(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;s<r.length;s++)t[r[s]]=!0}let n=pd(e)+pd(t)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function EO(i){let e=i.map(r=>typeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:Zx(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function Xx(i,e){return t=>{for(let n=Ze(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}class md{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function un(i){return i.selection.main.from}function LO(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}const Jh=Ti.define();function Ix(i,e,t,n){let{main:r}=i.selection,s=t-r.from,o=n-r.from;return{...i.changeByRange(l=>{if(l!=r&&t!=n&&i.sliceDoc(l.from+s,l.from+o)!=i.sliceDoc(t,n))return{range:l};let a=i.toText(e);return{changes:{from:l.from+s,to:n==r.from?l.to:l.from+o,insert:a},range:Z.cursor(l.from+s+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Od=new WeakMap;function zx(i){if(!Array.isArray(i))return i;let e=Od.get(i);return e||Od.set(i,e=EO(i)),e}const Mo=de.define(),es=de.define();class Vx{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Mi(e,t),r=tn(n);this.chars.push(n);let s=e.slice(t,t+r),o=s.toUpperCase();this.folded.push(Mi(o==s?s.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:s,byWord:o}=this;if(t.length==1){let b=Mi(e,0),Q=tn(b),x=Q==e.length?0:-100;if(b!=t[0])if(b==n[0])x+=-200;else return null;return this.ret(x,[0,Q])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,h=0;if(l<0){for(let b=0,Q=Math.min(e.length,200);b<Q&&h<a;){let x=Mi(e,b);(x==t[h]||x==n[h])&&(r[h++]=b),b+=tn(x)}if(h<a)return null}let c=0,u=0,d=!1,f=0,p=-1,m=-1,O=/[a-z]/.test(e),g=!0;for(let b=0,Q=Math.min(e.length,200),x=0;b<Q&&u<a;){let k=Mi(e,b);l<0&&(c<a&&k==t[c]&&(s[c++]=b),f<a&&(k==t[f]||k==n[f]?(f==0&&(p=b),m=b+1,f++):f=0));let $,C=k<255?k>=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:($=mp(k))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!b||C==1&&O||x==0&&C!=0)&&(t[u]==k||n[u]==k&&(d=!0)?o[u++]=b:o.length&&(g=!1)),x=C,b+=tn(k)}return u==a&&o[0]==0&&g?this.result(-100+(d?-200:0),o,e):f==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):f==a?this.ret(-900-e.length,[p,m]):u==a?this.result(-100+(d?-200:0)+-700+(g?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let o of t){let l=o+(this.astral?tn(Mi(n,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-n.length,r)}}class Dx{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Ge=te.define({combine(i){return Jo(i,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Bx,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>gd(e(n),t(n)),optionClass:(e,t)=>n=>gd(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function gd(i,e){return i?e?i+" "+e:i:e}function Bx(i,e,t,n,r,s){let o=i.textDirection==_e.RTL,l=o,a=!1,h="top",c,u,d=e.left-r.left,f=r.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(l&&d<Math.min(p,f)?l=!1:!l&&f<Math.min(p,d)&&(l=!0),p<=(l?d:f))c=Math.max(r.top,Math.min(t.top,r.bottom-m))-e.top,u=Math.min(400,l?d:f);else{a=!0,u=Math.min(400,(o?e.right:r.right-e.left)-30);let b=r.bottom-e.bottom;b>=m||b>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let O=(e.bottom-e.top)/s.offsetHeight,g=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/O}px; max-width: ${u/g}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}const ec=de.define();function qx(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;h<s.length;){let c=s[h++],u=s[h++];c>a&&o.appendChild(document.createTextNode(l.slice(a,c)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(l.slice(c,u))),d.className="cm-completionMatchedText",a=u}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(t){if(!t.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=t.detail,n},position:80}),e.sort((t,n)=>t.position-n.position).map(t=>t.render)}function Zl(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}class jx{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,l=e.state.facet(Ge);this.optionContent=qx(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Zl(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,u;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(u=/-(\d+)$/.exec(c.id))&&+u[1]<h.length){this.applyCompletion(e,h[+u[1]]),a.preventDefault();return}if(a.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&a.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&a.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:ec.of(c)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(Ge).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:es.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=Zl(s.length,o,e.state.facet(Ge).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Zl(t.options.length,t.selected,this.view.state.facet(Ge).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>Ct(this.view.state,l,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return t&&Yx(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(Ge).positionInfo(this.view,t,r,n,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",o=>{o.target==r&&o.preventDefault()});let s=null;for(let o=n.from;o<n.to;o++){let{completion:l,match:a}=e[o],{section:h}=l;if(h){let d=typeof h=="string"?h:h.name;if(d!=s&&(o>n.from||n.from==0))if(s=d,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let f=r.appendChild(document.createElement("completion-section"));f.textContent=d}}const c=r.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let d of this.optionContent){let f=d(l,this.view.state,this.view,a);f&&c.appendChild(f)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Wx(i,e){return t=>new jx(t,i,e)}function Yx(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.top<t.top?i.scrollTop-=(t.top-n.top)/r:n.bottom>t.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function bd(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function Nx(i,e){let t=[],n=null,r=null,s=c=>{t.push(c);let{section:u}=c.completion;if(u){n||(n=[]);let d=typeof u=="string"?u:u.name;n.some(f=>f.name==d)||n.push(typeof u=="string"?{name:d}:u)}},o=e.facet(Ge);for(let c of i)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let d of c.result.options)s(new md(d,c.source,u?u(d):[],1e9-t.length));else{let d=e.sliceDoc(c.from,c.to),f,p=o.filterStrict?new Dx(d):new Vx(d);for(let m of c.result.options)if(f=p.match(m.label)){let O=m.displayLabel?u?u(m,f.matched):[]:f.matched,g=f.score+(m.boost||0);if(s(new md(m,c.source,O,g)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:b}=m.section;r||(r=Object.create(null)),r[b]=Math.max(g,r[b]||-1e9)}}}}if(n){let c=Object.create(null),u=0,d=(f,p)=>(f.rank==="dynamic"&&p.rank==="dynamic"?r[p.name]-r[f.name]:0)||(typeof f.rank=="number"?f.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(f.name<p.name?-1:1);for(let f of n.sort(d))u-=1e5,c[f.name]=u;for(let f of t){let{section:p}=f.completion;p&&(f.score+=c[typeof p=="string"?p:p.name])}}let l=[],a=null,h=o.compareCompletions;for(let c of t.sort((u,d)=>d.score-u.score||h(u.completion,d.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?l.push(c):bd(c.completion)>bd(a)&&(l[l.length-1]=c),a=c.completion}return l}class $n{constructor(e,t,n,r,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new $n(this.options,vd(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,s,o){if(r&&!o&&e.some(h=>h.isPending))return r.setDisabled();let l=Nx(e,t);if(!l.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let a=t.facet(Ge).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let h=r.options[r.selected].completion;for(let c=0;c<l.length;c++)if(l[c].completion==h){a=c;break}}return new $n(l,vd(n,a),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:Jx,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new $n(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new $n(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Zo{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Zo(Hx,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Ge),s=(n.override||t.languageDataAt("autocomplete",un(t)).map(zx)).map(a=>(this.active.find(c=>c.source==a)||new It(a,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,h)=>a==this.active[h])&&(s=this.active);let o=this.open,l=e.effects.some(a=>a.is(tc));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!Gx(s,this.active)||l?o=$n.build(s,t,this.id,o,n,l):o&&o.disabled&&!s.some(a=>a.isPending)&&(o=null),!o&&s.every(a=>!a.isPending)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new It(a.source,0):a));for(let a of e.effects)a.is(ec)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new Zo(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Fx:Ux}}function Gx(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t<i.length&&!i[t].hasResult();)t++;for(;n<e.length&&!e[n].hasResult();)n++;let r=t==i.length,s=n==e.length;if(r||s)return r==s;if(i[t++].result!=e[n++].result)return!1}}const Fx={"aria-autocomplete":"list"},Ux={};function vd(i,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":i};return e>-1&&(t["aria-activedescendant"]=i+"-"+e),t}const Hx=[];function RO(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(Jh);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}class It{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=RO(e,t),r=this;(n&8||n&16&&this.touches(e))&&(r=new It(r.source,0)),n&4&&r.state==0&&(r=new It(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(Mo))r=new It(r.source,1,s.value);else if(s.is(es))r=new It(r.source,0);else if(s.is(tc))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(un(e.state))}}class Rn extends It{constructor(e,t,n,r,s,o){super(e,3,t),this.limit=n,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=un(e.state);if(l>o||!r||t&2&&(un(e.startState)==this.from||l<this.limit))return new It(this.source,t&4?1:0);let a=e.changes.mapPos(this.limit);return Kx(r.validFor,e.state,s,o)?new Rn(this.source,this.explicit,a,r,s,o):r.update&&(r=r.update(r,s,o,new Kh(e.state,l,!1)))?new Rn(this.source,this.explicit,a,r,r.from,(n=r.to)!==null&&n!==void 0?n:un(e.state)):new It(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Rn(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new It(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Kx(i,e,t,n){if(!i)return!1;let r=e.sliceDoc(t,n);return typeof i=="function"?i(r,t,n,e):LO(i,!0).test(r)}const tc=de.define({map(i,e){return i.map(t=>t.map(e))}}),dt=Ot.define({create(){return Zo.start()},update(i,e){return i.update(e)},provide:i=>[zh.from(i,e=>e.tooltip),U.contentAttributes.from(i,e=>e.attrs)]});function ic(i,e){const t=e.completion.apply||e.completion.label;let n=i.state.field(dt).active.find(r=>r.source==e.source);return n instanceof Rn?(typeof t=="string"?i.dispatch({...Ix(i.state,t,n.from,n.to),annotations:Jh.of(e.completion)}):t(i,e.completion,n.from,n.to),!0):!1}const Jx=Wx(dt,ic);function js(i,e="option"){return t=>{let n=t.state.field(dt,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<t.state.facet(Ge).interactionDelay)return!1;let r=1,s;e=="page"&&(s=Pm(t,n.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,l=n.open.selected>-1?n.open.selected+r*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:ec.of(l)}),!0}}const ew=i=>{let e=i.state.field(dt,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<i.state.facet(Ge).interactionDelay?!1:ic(i,e.open.options[e.open.selected])},Xl=i=>i.state.field(dt,!1)?(i.dispatch({effects:Mo.of(!0)}),!0):!1,tw=i=>{let e=i.state.field(dt,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:es.of(null)}),!0)};class iw{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const nw=50,rw=1e3,sw=_t.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(dt).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(dt),t=i.state.facet(Ge);if(!i.selectionSet&&!i.docChanged&&i.startState.field(dt)==e)return;let n=i.transactions.some(s=>{let o=RO(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(n||o.context.abortOnDocChange&&i.docChanged||o.updates.length+i.transactions.length>nw&&Date.now()-o.time>rw){for(let l of o.context.abortListeners)try{l()}catch(a){Ct(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(o=>o.is(Mo)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of i.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(dt);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ge).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=un(e),n=new Kh(e,t,i.explicit,this.view),r=new iw(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:es.of(null)}),Ct(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ge).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ge),n=this.view.state.field(dt);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let l=un(s.updates.length?s.updates[0].startState:this.view.state),a=Math.min(l,s.done.from+(s.active.explicit?0:1)),h=new Rn(s.active.source,s.active.explicit,a,s.done,s.done.from,(i=s.done.to)!==null&&i!==void 0?i:l);for(let c of s.updates)h=h.update(c,t);if(h.hasResult()){e.push(h);continue}}let o=n.active.find(l=>l.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new It(s.active.source,0);for(let a of s.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:tc.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(dt,!1);if(e&&e.tooltip&&this.view.state.facet(Ge).closeOnBlur){let t=e.open&&Pm(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:es.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Mo.of(!1)}),20),this.composing=0}}}),ow=typeof navigator=="object"&&/Win/.test(navigator.platform),lw=Pi.highest(U.domEventHandlers({keydown(i,e){let t=e.state.field(dt,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(ow&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&ic(e,n),!1}})),MO=U.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class aw{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}}class nc{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,ot.TrackDel),n=e.mapPos(this.to,1,ot.TrackDel);return t==null||n==null?null:new nc(this.field,t,n)}}class rc{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(n.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let u=0;u<c;u++)h+=e.facet(lr);r.push(t+h.length-c),a=h+a.slice(c)}n.push(a),t+=a.length+1}let l=this.fieldPositions.map(a=>new nc(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||"",h=-1,c=a.replace(/\\[{}]/g,u=>u[1]);for(let u=0;u<t.length;u++)(l!=null?t[u].seq==l:c&&t[u].name==c)&&(h=u);if(h<0){let u=0;for(;u<t.length&&(l==null||t[u].seq!=null&&t[u].seq<l);)u++;t.splice(u,0,{seq:l,name:c}),h=u;for(let d of r)d.field>=h&&d.field++}for(let u of r)if(u.line==n.length&&u.from>s.index){let d=s[2]?3+(s[1]||"").length:2;u.from-=d,u.to-=d}r.push(new aw(h,n.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,a,h)=>{for(let c of r)c.line==n.length&&c.from>h&&(c.from--,c.to--);return a}),n.push(o)}return new rc(n,r)}}let hw=xe.widget({widget:new class extends bn{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),cw=xe.mark({class:"cm-snippetField"});class cr{constructor(e,t){this.ranges=e,this.active=t,this.deco=xe.set(e.map(n=>(n.from==n.to?hw:cw).range(n.from,n.to)),!0)}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new cr(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}}const ys=de.define({map(i,e){return i&&i.map(e)}}),uw=de.define(),ts=Ot.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(ys))return t.value;if(t.is(uw)&&i)return new cr(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>U.decorations.from(i,e=>e?e.deco:xe.none)});function sc(i,e){return Z.create(i.filter(t=>t.field==e).map(t=>Z.range(t.from,t.to)))}function dw(i){let e=rc.parse(i);return(t,n,r,s)=>{let{text:o,ranges:l}=e.instantiate(t.state,r),{main:a}=t.state.selection,h={changes:{from:r,to:s==a.from?a.to:s,insert:ge.of(o)},scrollIntoView:!0,annotations:n?[Jh.of(n),De.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=sc(l,0)),l.some(c=>c.field>0)){let c=new cr(l,0),u=h.effects=[ys.of(c)];t.state.field(ts,!1)===void 0&&u.push(de.appendConfig.of([ts,gw,bw,MO]))}t.dispatch(t.state.update(h))}}function ZO(i){return({state:e,dispatch:t})=>{let n=e.field(ts,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:sc(n.ranges,r),effects:ys.of(s?null:new cr(n.ranges,r)),scrollIntoView:!0})),!0}}const fw=({state:i,dispatch:e})=>i.field(ts,!1)?(e(i.update({effects:ys.of(null)})),!0):!1,pw=ZO(1),mw=ZO(-1),Ow=[{key:"Tab",run:pw,shift:mw},{key:"Escape",run:fw}],yd=te.define({combine(i){return i.length?i[0]:Ow}}),gw=Pi.highest(Os.compute([yd],i=>i.facet(yd)));function ut(i,e){return{...e,apply:dw(i)}}const bw=U.domEventHandlers({mousedown(i,e){let t=e.state.field(ts,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:sc(t.ranges,r.field),effects:ys.of(t.ranges.some(s=>s.field>r.field)?new cr(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),XO=new class extends ji{};XO.startSide=1;XO.endSide=-1;function vw(i={}){return[lw,dt,Ge.of(i),sw,kw,MO]}const yw=[{key:"Ctrl-Space",run:Xl},{mac:"Alt-`",run:Xl},{mac:"Alt-i",run:Xl},{key:"Escape",run:tw},{key:"ArrowDown",run:js(!0)},{key:"ArrowUp",run:js(!1)},{key:"PageDown",run:js(!0,"page")},{key:"PageUp",run:js(!1,"page")},{key:"Enter",run:ew}],kw=Pi.highest(Os.computeN([Ge],i=>i.facet(Ge).defaultKeymap?[yw]:[]));class Xo{static create(e,t,n,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new Xo(e,t,n,o,s,[],[])}constructor(e,t,n,r,s,o,l){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[ae.contextHash,r]]}addChild(e,t){e.prop(ae.contextHash)!=this.hash&&(e=new fe(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new fe(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new fe(Be.none,r,s,o,this.hashProp)})}}var j;(function(i){i[i.Document=1]="Document",i[i.CodeBlock=2]="CodeBlock",i[i.FencedCode=3]="FencedCode",i[i.Blockquote=4]="Blockquote",i[i.HorizontalRule=5]="HorizontalRule",i[i.BulletList=6]="BulletList",i[i.OrderedList=7]="OrderedList",i[i.ListItem=8]="ListItem",i[i.ATXHeading1=9]="ATXHeading1",i[i.ATXHeading2=10]="ATXHeading2",i[i.ATXHeading3=11]="ATXHeading3",i[i.ATXHeading4=12]="ATXHeading4",i[i.ATXHeading5=13]="ATXHeading5",i[i.ATXHeading6=14]="ATXHeading6",i[i.SetextHeading1=15]="SetextHeading1",i[i.SetextHeading2=16]="SetextHeading2",i[i.HTMLBlock=17]="HTMLBlock",i[i.LinkReference=18]="LinkReference",i[i.Paragraph=19]="Paragraph",i[i.CommentBlock=20]="CommentBlock",i[i.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",i[i.Escape=22]="Escape",i[i.Entity=23]="Entity",i[i.HardBreak=24]="HardBreak",i[i.Emphasis=25]="Emphasis",i[i.StrongEmphasis=26]="StrongEmphasis",i[i.Link=27]="Link",i[i.Image=28]="Image",i[i.InlineCode=29]="InlineCode",i[i.HTMLTag=30]="HTMLTag",i[i.Comment=31]="Comment",i[i.ProcessingInstruction=32]="ProcessingInstruction",i[i.Autolink=33]="Autolink",i[i.HeaderMark=34]="HeaderMark",i[i.QuoteMark=35]="QuoteMark",i[i.ListMark=36]="ListMark",i[i.LinkMark=37]="LinkMark",i[i.EmphasisMark=38]="EmphasisMark",i[i.CodeMark=39]="CodeMark",i[i.CodeText=40]="CodeText",i[i.CodeInfo=41]="CodeInfo",i[i.LinkTitle=42]="LinkTitle",i[i.LinkLabel=43]="LinkLabel",i[i.URL=44]="URL"})(j||(j={}));class Sw{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class xw{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return zr(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function kd(i,e,t){if(t.pos==t.text.length||i!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let n=(i.type==j.OrderedList?ac:lc)(t,e,!1);return n>0&&(i.type!=j.BulletList||oc(t,e,!1)<0)&&t.text.charCodeAt(t.pos+n-1)==i.value}const IO={[j.Blockquote](i,e,t){return t.next!=62?!1:(t.markers.push(me(j.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(qt(t.text.charCodeAt(t.pos+1))?2:1)),i.end=e.lineStart+t.text.length,!0)},[j.ListItem](i,e,t){return t.indent<t.baseIndent+i.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+i.value),!0)},[j.OrderedList]:kd,[j.BulletList]:kd,[j.Document](){return!0}};function qt(i){return i==32||i==9||i==10||i==13}function zr(i,e=0){for(;e<i.length&&qt(i.charCodeAt(e));)e++;return e}function Sd(i,e,t){for(;e>t&&qt(i.charCodeAt(e-1));)e--;return e}function zO(i){if(i.next!=96&&i.next!=126)return-1;let e=i.pos+1;for(;e<i.text.length&&i.text.charCodeAt(e)==i.next;)e++;if(e<i.pos+3)return-1;if(i.next==96){for(let t=e;t<i.text.length;t++)if(i.text.charCodeAt(t)==96)return-1}return e}function VO(i){return i.next!=62?-1:i.text.charCodeAt(i.pos+1)==32?2:1}function oc(i,e,t){if(i.next!=42&&i.next!=45&&i.next!=95)return-1;let n=1;for(let r=i.pos+1;r<i.text.length;r++){let s=i.text.charCodeAt(r);if(s==i.next)n++;else if(!qt(s))return-1}return t&&i.next==45&&qO(i)>-1&&i.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(NO.SetextHeading)>-1||n<3?-1:1}function DO(i,e){for(let t=i.stack.length-1;t>=0;t--)if(i.stack[t].type==e)return!0;return!1}function lc(i,e,t){return(i.next==45||i.next==43||i.next==42)&&(i.pos==i.text.length-1||qt(i.text.charCodeAt(i.pos+1)))&&(!t||DO(e,j.BulletList)||i.skipSpace(i.pos+2)<i.text.length)?1:-1}function ac(i,e,t){let n=i.pos,r=i.next;for(;r>=48&&r<=57;){n++;if(n==i.text.length)return-1;r=i.text.charCodeAt(n)}return n==i.pos||n>i.pos+9||r!=46&&r!=41||n<i.text.length-1&&!qt(i.text.charCodeAt(n+1))||t&&!DO(e,j.OrderedList)&&(i.skipSpace(n+1)==i.text.length||n>i.pos+1||i.next!=49)?-1:n+1-i.pos}function BO(i){if(i.next!=35)return-1;let e=i.pos+1;for(;e<i.text.length&&i.text.charCodeAt(e)==35;)e++;if(e<i.text.length&&i.text.charCodeAt(e)!=32)return-1;let t=e-i.pos;return t>6?-1:t}function qO(i){if(i.next!=45&&i.next!=61||i.indent>=i.baseIndent+4)return-1;let e=i.pos+1;for(;e<i.text.length&&i.text.charCodeAt(e)==i.next;)e++;let t=e;for(;e<i.text.length&&qt(i.text.charCodeAt(e));)e++;return e==i.text.length?t:-1}const lh=/^[ \t]*$/,jO=/-->/,WO=/\?>/,ah=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,jO],[/^\s*<\?/,WO],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,lh],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,lh]];function YO(i,e,t){if(i.next!=60)return-1;let n=i.text.slice(i.pos);for(let r=0,s=ah.length-(t?1:0);r<s;r++)if(ah[r][0].test(n))return r;return-1}function xd(i,e){let t=i.countIndent(e,i.pos,i.indent),n=i.countIndent(i.skipSpace(e),e,t);return n>=t+5?t+1:n}function Ci(i,e,t){let n=i.length-1;n>=0&&i[n].to==e&&i[n].type==j.CodeText?i[n].to=t:i.push(me(j.CodeText,e,t))}const Ws={LinkReference:void 0,IndentedCode(i,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let n=e.findColumn(t),r=i.lineStart+n,s=i.lineStart+e.text.length,o=[],l=[];for(Ci(o,r,s);i.nextLine()&&e.depth>=i.stack.length;)if(e.pos==e.text.length){Ci(l,i.lineStart-1,i.lineStart);for(let a of e.markers)l.push(a)}else{if(e.indent<t)break;{if(l.length){for(let h of l)h.type==j.CodeText?Ci(o,h.from,h.to):o.push(h);l=[]}Ci(o,i.lineStart-1,i.lineStart);for(let h of e.markers)o.push(h);s=i.lineStart+e.text.length;let a=i.lineStart+e.findColumn(e.baseIndent+4);a<s&&Ci(o,a,s)}}return l.length&&(l=l.filter(a=>a.type!=j.CodeText),l.length&&(e.markers=l.concat(e.markers))),i.addNode(i.buffer.writeElements(o,-r).finish(j.CodeBlock,s-r),r),!0},FencedCode(i,e){let t=zO(e);if(t<0)return!1;let n=i.lineStart+e.pos,r=e.next,s=t-e.pos,o=e.skipSpace(t),l=Sd(e.text,e.text.length,o),a=[me(j.CodeMark,n,n+s)];o<l&&a.push(me(j.CodeInfo,i.lineStart+o,i.lineStart+l));for(let h=!0,c=!0,u=!1;i.nextLine()&&e.depth>=i.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==r;)d++;if(d-e.pos>=s&&e.skipSpace(d)==e.text.length){for(let f of e.markers)a.push(f);c&&u&&Ci(a,i.lineStart-1,i.lineStart),a.push(me(j.CodeMark,i.lineStart+e.pos,i.lineStart+d)),i.nextLine();break}else{u=!0,h||(Ci(a,i.lineStart-1,i.lineStart),c=!1);for(let m of e.markers)a.push(m);let f=i.lineStart+e.basePos,p=i.lineStart+e.text.length;f<p&&(Ci(a,f,p),c=!1)}}return i.addNode(i.buffer.writeElements(a,-n).finish(j.FencedCode,i.prevLineEnd()-n),n),!0},Blockquote(i,e){let t=VO(e);return t<0?!1:(i.startContext(j.Blockquote,e.pos),i.addNode(j.QuoteMark,i.lineStart+e.pos,i.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(i,e){if(oc(e,i,!1)<0)return!1;let t=i.lineStart+e.pos;return i.nextLine(),i.addNode(j.HorizontalRule,t),!0},BulletList(i,e){let t=lc(e,i,!1);if(t<0)return!1;i.block.type!=j.BulletList&&i.startContext(j.BulletList,e.basePos,e.next);let n=xd(e,e.pos+1);return i.startContext(j.ListItem,e.basePos,n-e.baseIndent),i.addNode(j.ListMark,i.lineStart+e.pos,i.lineStart+e.pos+t),e.moveBaseColumn(n),null},OrderedList(i,e){let t=ac(e,i,!1);if(t<0)return!1;i.block.type!=j.OrderedList&&i.startContext(j.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let n=xd(e,e.pos+t);return i.startContext(j.ListItem,e.basePos,n-e.baseIndent),i.addNode(j.ListMark,i.lineStart+e.pos,i.lineStart+e.pos+t),e.moveBaseColumn(n),null},ATXHeading(i,e){let t=BO(e);if(t<0)return!1;let n=e.pos,r=i.lineStart+n,s=Sd(e.text,e.text.length,n),o=s;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==n||!qt(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=i.buffer.write(j.HeaderMark,0,t).writeElements(i.parser.parseInline(e.text.slice(n+t+1,o),r+t+1),-r);o<e.text.length&&l.write(j.HeaderMark,o-n,s-n);let a=l.finish(j.ATXHeading1-1+t,e.text.length-n);return i.nextLine(),i.addNode(a,r),!0},HTMLBlock(i,e){let t=YO(e,i,!1);if(t<0)return!1;let n=i.lineStart+e.pos,r=ah[t][1],s=[],o=r!=lh;for(;!r.test(e.text)&&i.nextLine();){if(e.depth<i.stack.length){o=!1;break}for(let h of e.markers)s.push(h)}o&&i.nextLine();let l=r==jO?j.CommentBlock:r==WO?j.ProcessingInstructionBlock:j.HTMLBlock,a=i.prevLineEnd();return i.addNode(i.buffer.writeElements(s,-n).finish(l,a-n),n),!0},SetextHeading:void 0};class ww{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
261
|
+
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&zr(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,me(j.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(ig(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(me(j.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(eg(e,zr(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=zr(e,this.pos),n=0;if(t>this.pos){let r=tg(e,t,this.start);if(r){let s=Il(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Il(e,this.pos)),n>0&&n<e.length?n:-1}else return Il(e,this.pos)}}}function Il(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!qt(t))return-1}return e}class Qw{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:qO(t),s=t.next;if(r<0)return!1;let o=me(j.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,me(s==61?j.SetextHeading1:j.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const NO={LinkReference(i,e){return e.content.charCodeAt(0)==91?new ww(e):null},SetextHeading(){return new Qw}},$w=[(i,e)=>BO(e)>=0,(i,e)=>zO(e)>=0,(i,e)=>VO(e)>=0,(i,e)=>lc(e,i,!0)>=0,(i,e)=>ac(e,i,!0)>=0,(i,e)=>oc(e,i,!0)>=0,(i,e)=>YO(e,i,!0)>=0],Pw={text:"",end:0};class Tw{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new xw,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=Xo.create(j.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new _w(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new Sw(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
262
|
+
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=ng(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Pw;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[r-1].to-n)+o,n=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+j[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
263
|
+
`?"":t;else{let r=t.indexOf(`
|
|
264
|
+
`);n=r<0?t:t.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=Xo.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new fe(this.parser.nodeSet.types[e],er,er,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(ch(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?GO(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t=ch(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(j.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?me(this.parser.getNodeType(e),t,n,r):new HO(e,t)}get buffer(){return new UO(this.parser.nodeSet)}}function GO(i,e,t,n,r){let s=i[e].to,o=[],l=[],a=t.from+n;function h(c,u){for(;u?c>=s:c>s;){let d=i[e+1].from-s;n+=d,c+=d,e++,s=i[e].to}}for(let c=t.firstChild;c;c=c.nextSibling){h(c.from+n,!0);let u=c.from+n,d,f=r.get(c.tree);f?d=f:c.to+n>s?(d=GO(i,e,c,n,r),h(c.to+n,!1)):d=c.toTree(),o.push(d),l.push(u-a)}return h(t.to+n,!1),new fe(t.type,o,l,t.to+n-a,t.tree?t.tree.propValues:void 0)}class dl extends sl{constructor(e,t,n,r,s,o,l,a,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=h,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,t,n){let r=new Tw(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=hh(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),h=this.inlineNames.slice(),c=this.endLeafBlock.slice(),u=this.wrappers;if(br(t.defineNodes)){r=Object.assign({},r);let d=n.types.slice(),f;for(let p of t.defineNodes){let{name:m,block:O,composite:g,style:b}=typeof p=="string"?{name:p}:p;if(d.some(k=>k.name==m))continue;g&&(r[d.length]=(k,$,C)=>g($,C,k.value));let Q=d.length,x=g?["Block","BlockContext"]:O?Q>=j.ATXHeading1&&Q<=j.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;d.push(Be.define({id:Q,name:m,props:x&&[[ae.group,x]]})),b&&(f||(f={}),Array.isArray(b)||b instanceof Pt?f[m]=b:Object.assign(f,b))}n=new sr(d),f&&(n=n.extend(or(f)))}if(br(t.props)&&(n=n.extend(...t.props)),br(t.remove))for(let d of t.remove){let f=this.blockNames.indexOf(d),p=this.inlineNames.indexOf(d);f>-1&&(s[f]=o[f]=void 0),p>-1&&(a[p]=void 0)}if(br(t.parseBlock))for(let d of t.parseBlock){let f=l.indexOf(d.name);if(f>-1)s[f]=d.parse,o[f]=d.leaf;else{let p=d.before?Ys(l,d.before):d.after?Ys(l,d.after)+1:l.length-1;s.splice(p,0,d.parse),o.splice(p,0,d.leaf),l.splice(p,0,d.name)}d.endLeaf&&c.push(d.endLeaf)}if(br(t.parseInline))for(let d of t.parseInline){let f=h.indexOf(d.name);if(f>-1)a[f]=d.parse;else{let p=d.before?Ys(h,d.before):d.after?Ys(h,d.after)+1:h.length-1;a.splice(p,0,d.parse),h.splice(p,0,d.name)}}return t.wrap&&(u=u.concat(t.wrap)),new dl(n,s,o,l,c,r,a,h,u)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new hc(this,e,t);e:for(let r=t;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.resolveMarkers(0)}}function br(i){return i!=null&&i.length>0}function hh(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=hh(i[0]);if(i.length==1)return e;let t=hh(i.slice(1));if(!t||!e)return e||t;let n=(o,l)=>(o||er).concat(l||er),r=e.wrap,s=t.wrap;return{props:n(e.props,t.props),defineNodes:n(e.defineNodes,t.defineNodes),parseBlock:n(e.parseBlock,t.parseBlock),parseInline:n(e.parseInline,t.parseInline),remove:n(e.remove,t.remove),wrap:r?s?(o,l,a,h)=>r(s(o,l,a,h),l,a,h):r:s}}function Ys(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let FO=[Be.none];for(let i=1,e;e=j[i];i++)FO[i]=Be.define({id:i,name:e,props:i>=j.Escape?[]:[[ae.group,i in IO?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const er=[];class UO{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return fe.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let is=class{constructor(e,t,n,r=er){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new UO(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class HO{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return er}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function me(i,e,t,n){return new is(i,e,t,n)}const KO={resolve:"Emphasis",mark:"EmphasisMark"},JO={resolve:"Emphasis",mark:"EmphasisMark"},rn={},Io={};class $t{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}const wd="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let ns=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ns=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const zl={Escape(i,e,t){if(e!=92||t==i.end-1)return-1;let n=i.char(t+1);for(let r=0;r<wd.length;r++)if(wd.charCodeAt(r)==n)return i.append(me(j.Escape,t,t+2));return-1},Entity(i,e,t){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(i.slice(t+1,t+31));return n?i.append(me(j.Entity,t,t+1+n[0].length)):-1},InlineCode(i,e,t){if(e!=96||t&&i.char(t-1)==96)return-1;let n=t+1;for(;n<i.end&&i.char(n)==96;)n++;let r=n-t,s=0;for(;n<i.end;n++)if(i.char(n)==96){if(s++,s==r&&i.char(n+1)!=96)return i.append(me(j.InlineCode,t,n+1,[me(j.CodeMark,t,t+r),me(j.CodeMark,n+1-r,n+1)]))}else s=0;return-1},HTMLTag(i,e,t){if(e!=60||t==i.end-1)return-1;let n=i.slice(t+1,i.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(r)return i.append(me(j.Autolink,t,t+1+r[0].length,[me(j.LinkMark,t,t+1),me(j.URL,t+1,t+r[0].length),me(j.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(s)return i.append(me(j.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(me(j.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?i.append(me(j.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let n=t+1;for(;i.char(n)==e;)n++;let r=i.slice(t-1,t),s=i.slice(n,n+1),o=ns.test(r),l=ns.test(s),a=/\s|^$/.test(r),h=/\s|^$/.test(s),c=!h&&(!l||a||o),u=!a&&(!o||h||l),d=c&&(e==42||!u||o),f=u&&(e==42||!c||l);return i.append(new $t(e==95?KO:JO,t,n,(d?1:0)|(f?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(me(j.HardBreak,t,t+2));if(e==32){let n=t+1;for(;i.char(n)==32;)n++;if(i.char(n)==10&&n>=t+2)return i.append(me(j.HardBreak,t,n+1))}return-1},Link(i,e,t){return e==91?i.append(new $t(rn,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new $t(Io,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let n=i.parts.length-1;n>=0;n--){let r=i.parts[n];if(r instanceof $t&&(r.type==rn||r.type==Io)){if(!r.side||i.skipSpace(r.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[n]=null,-1;let s=i.takeContent(n),o=i.parts[n]=Cw(i,s,r.type==rn?j.Link:j.Image,r.from,t+1);if(r.type==rn)for(let l=0;l<n;l++){let a=i.parts[l];a instanceof $t&&a.type==rn&&(a.side=0)}return o.to}}return-1}};function Cw(i,e,t,n,r){let{text:s}=i,o=i.char(r),l=r;if(e.unshift(me(j.LinkMark,n,n+(t==j.Image?2:1))),e.push(me(j.LinkMark,r-1,r)),o==40){let a=i.skipSpace(r+1),h=eg(s,a-i.offset,i.offset),c;h&&(a=i.skipSpace(h.to),a!=h.to&&(c=tg(s,a-i.offset,i.offset),c&&(a=i.skipSpace(c.to)))),i.char(a)==41&&(e.push(me(j.LinkMark,r,r+1)),l=a+1,h&&e.push(h),c&&e.push(c),e.push(me(j.LinkMark,a,l)))}else if(o==91){let a=ig(s,r-i.offset,i.offset,!1);a&&(e.push(a),l=a.to)}return me(t,n,l,e)}function eg(i,e,t){if(i.charCodeAt(e)==60){for(let r=e+1;r<i.length;r++){let s=i.charCodeAt(r);if(s==62)return me(j.URL,e+t,r+1+t);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let o=!1;s<i.length;s++){let l=i.charCodeAt(s);if(qt(l))break;if(o)o=!1;else if(l==40)r++;else if(l==41){if(!r)break;r--}else l==92&&(o=!0)}return s>e?me(j.URL,e+t,s+t):s==i.length?null:!1}}function tg(i,e,t){let n=i.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s<i.length;s++){let l=i.charCodeAt(s);if(o)o=!1;else{if(l==r)return me(j.LinkTitle,e+t,s+1+t);l==92&&(o=!0)}}return null}function ig(i,e,t,n){for(let r=!1,s=e+1,o=Math.min(i.length,s+999);s<o;s++){let l=i.charCodeAt(s);if(r)r=!1;else{if(l==93)return n?!1:me(j.LinkLabel,e+t,s+1+t);if(n&&!qt(l)&&(n=!1),l==91)return!1;l==92&&(r=!0)}}return null}class hc{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new $t(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof $t&&(t.type==rn||t.type==Io))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let r=this.parts[n];if(!(r instanceof $t&&r.type.resolve&&r.side&2))continue;let s=r.type==KO||r.type==JO,o=r.to-r.from,l,a=n-1;for(;a>=e;a--){let m=this.parts[a];if(m instanceof $t&&m.side&1&&m.type==r.type&&!(s&&(r.side&1||m.side&2)&&(m.to-m.from+o)%3==0&&((m.to-m.from)%3||o%3))){l=m;break}}if(!l)continue;let h=r.type.resolve,c=[],u=l.from,d=r.to;if(s){let m=Math.min(2,l.to-l.from,o);u=l.to-m,d=r.from+m,h=m==1?"Emphasis":"StrongEmphasis"}l.type.mark&&c.push(this.elt(l.type.mark,u,l.to));for(let m=a+1;m<n;m++)this.parts[m]instanceof is&&c.push(this.parts[m]),this.parts[m]=null;r.type.mark&&c.push(this.elt(r.type.mark,r.from,d));let f=this.elt(h,u,d,c);this.parts[a]=s&&l.from!=u?new $t(l.type,l.from,u,l.side):null,(this.parts[n]=s&&r.to!=d?new $t(r.type,d,r.to,r.side):null)?this.parts.splice(n,0,f):this.parts[n]=f}let t=[];for(let n=e;n<this.parts.length;n++){let r=this.parts[n];r instanceof is&&t.push(r)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof $t&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof $t?t:null}skipSpace(e){return zr(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e=="string"?me(this.parser.getNodeType(e),t,n,r):new HO(e,t)}}hc.linkStart=rn;hc.imageStart=Io;function ch(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),n=0;for(let r of e){for(;n<t.length&&t[n].to<r.to;)n++;if(n<t.length&&t[n].from<r.from){let s=t[n];s instanceof is&&(t[n]=new is(s.type,s.from,s.to,ch(s.children,[r])))}else t.splice(n++,0,r)}return t}const Aw=[j.CodeBlock,j.ListItem,j.OrderedList,j.BulletList];let _w=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
265
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ae.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,h=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=ng(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let u=new fe(e.parser.nodeSet.types[j.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(u,t.tree),e.addNode(u,c)}if(t.type.is("Block")&&(Aw.indexOf(t.type.id)<0?(o=t.to-n,l=e.block.children.length):(o=a,l=h),a=t.to-n,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function ng(i,e){let t=i;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<i&&(t-=s-r)}return t}const Ew=or({"Blockquote/...":y.quote,HorizontalRule:y.contentSeparator,"ATXHeading1/... SetextHeading1/...":y.heading1,"ATXHeading2/... SetextHeading2/...":y.heading2,"ATXHeading3/...":y.heading3,"ATXHeading4/...":y.heading4,"ATXHeading5/...":y.heading5,"ATXHeading6/...":y.heading6,"Comment CommentBlock":y.comment,Escape:y.escape,Entity:y.character,"Emphasis/...":y.emphasis,"StrongEmphasis/...":y.strong,"Link/... Image/...":y.link,"OrderedList/... BulletList/...":y.list,"BlockQuote/...":y.quote,"InlineCode CodeText":y.monospace,"URL Autolink":y.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":y.processingInstruction,"CodeInfo LinkLabel":y.labelName,LinkTitle:y.string,Paragraph:y.content}),Lw=new dl(new sr(FO).extend(Ew),Object.keys(Ws).map(i=>Ws[i]),Object.keys(Ws).map(i=>NO[i]),Object.keys(Ws),$w,IO,Object.keys(zl).map(i=>zl[i]),Object.keys(zl),[]);function Rw(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function Mw(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Xm((r,s)=>{let o=r.type.id;if(e&&(o==j.CodeBlock||o==j.FencedCode)){let l="";if(o==j.FencedCode){let h=r.node.getChild(j.CodeInfo);h&&(l=s.read(h.from,h.to))}let a=e(l);if(a)return{parser:a,overlay:h=>h.type.id==j.CodeText,bracketed:o==j.FencedCode}}else if(t&&(o==j.HTMLBlock||o==j.HTMLTag||o==j.CommentBlock))return{parser:t,overlay:Rw(r.node,r.from,r.to)};return null})}}const Zw={resolve:"Strikethrough",mark:"StrikethroughMark"},Xw={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":y.strikethrough}},{name:"StrikethroughMark",style:y.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=ns.test(n),a=ns.test(r);return i.addDelimiter(Zw,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function Vr(i,e,t=0,n,r=0){let s=0,o=!0,l=-1,a=-1,h=!1,c=()=>{n.push(i.elt("TableCell",r+l,r+a,i.parser.parseInline(e.slice(l,a),r+l)))};for(let u=t;u<e.length;u++){let d=e.charCodeAt(u);d==124&&!h?((!o||l>-1)&&s++,o=!1,n&&(l>-1&&c(),n.push(i.elt("TableDelimiter",u+r,u+r+1))),l=a=-1):(h||d!=32&&d!=9)&&(l<0&&(l=u),a=u+1),h=!h&&d==92}return l>-1&&(s++,n&&c()),s}function Qd(i,e){for(let t=e;t<i.length;t++){let n=i.charCodeAt(t);if(n==124)return!0;n==92&&t++}return!1}const rg=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class $d{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&rg.test(r=t.text.slice(t.pos))){let s=[];Vr(e,n.content,0,s,n.start)==Vr(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];Vr(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const Iw={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":y.heading}},"TableRow",{name:"TableCell",style:y.content},{name:"TableDelimiter",style:y.processingInstruction}],parseBlock:[{name:"Table",leaf(i,e){return Qd(e.content,0)?new $d:null},endLeaf(i,e,t){if(t.parsers.some(r=>r instanceof $d)||!Qd(e.text,e.basePos))return!1;let n=i.peekLine();return rg.test(n)&&Vr(i,e.text,e.basePos)==Vr(i,n,e.basePos)},before:"SetextHeading"}]};class zw{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Vw={defineNodes:[{name:"Task",block:!0,style:y.list},{name:"TaskMarker",style:y.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new zw:null},after:"SetextHeading"}]},Pd=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Td=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Dw=/[\w-]+\.[\w-]+($|\/)/,Cd=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Ad=/\/[a-zA-Z\d@.]+/gy;function _d(i,e,t,n){let r=0;for(let s=e;s<t;s++)i[s]==n&&r++;return r}function Bw(i,e){Td.lastIndex=e;let t=Td.exec(i);if(!t||Dw.exec(t[0])[0].indexOf("_")>-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&_d(i,e,n,")")>_d(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function Ed(i,e){Cd.lastIndex=e;let t=Cd.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}const qw={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;if(n&&/\w/.test(i.text[n-1]))return-1;Pd.lastIndex=n;let r=Pd.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=Bw(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=Ed(i.text,n):(s=Ed(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(Ad.lastIndex=s,r=Ad.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},jw=[Iw,Vw,Xw,qw];function sg(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let l=s+1;l<n.end;l++){let a=n.char(l);if(a==i)return n.addElement(n.elt(e,s,l+1,o.concat(n.elt(t,l,l+1))));if(a==92&&o.push(n.elt("Escape",l,l+++2)),qt(a))break}return-1}}const Ww={defineNodes:[{name:"Superscript",style:y.special(y.content)},{name:"SuperscriptMark",style:y.processingInstruction}],parseInline:[{name:"Superscript",parse:sg(94,"Superscript","SuperscriptMark")}]},Yw={defineNodes:[{name:"Subscript",style:y.special(y.content)},{name:"SubscriptMark",style:y.processingInstruction}],parseInline:[{name:"Subscript",parse:sg(126,"Subscript","SubscriptMark")}]},Nw={defineNodes:[{name:"Emoji",style:y.character}],parseInline:[{name:"Emoji",parse(i,e,t){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(i.slice(t+1,i.end)))?-1:i.addElement(i.elt("Emoji",t,t+1+n[0].length))}}]};var Ld={};class zo{constructor(e,t,n,r,s,o,l,a,h,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new zo(e,[],t,n,n,0,[],0,r?new Rd(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),n==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(n-1)*3-(e&262144?6:0),h=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-h;c>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=c));let u=a?this.stack[a-1]:0,d=this.bufferBase+this.buffer.length-u;if(r<s.minRepeatTerm||e&131072){let f=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,f,d+4,!0)}if(e&262144)this.state=this.stack[a];else{let f=this.stack[a-3];this.state=s.getGoto(f,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==n)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new zo(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Gw(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(t[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let o=t[s+1];r.some((l,a)=>a&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r<t.length&&n.length<4;r+=2){let s=t[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[r],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Rd(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Rd{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Gw{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Vo{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Vo(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Vo(this.stack,this.pos,this.index)}}function Qr(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n<i.length;){let s=0;for(;;){let o=i.charCodeAt(n++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class co{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Md=new co;class Fw{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Md,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!r)return null;let o=this.ranges[--r];s-=n.from-o.to,n=o}for(;t<0?s>n.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Md,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Mn{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;og(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Mn.prototype.contextual=Mn.prototype.fallback=Mn.prototype.extend=!1;class Do{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Qr(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(og(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Do.prototype.contextual=Mn.prototype.fallback=Mn.prototype.extend=!1;class Et{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function og(i,e,t,n,r,s){let o=0,l=1<<n,{dialect:a}=t.p.parser;e:for(;l&i[o];){let h=i[o+1];for(let f=o+3;f<h;f+=2)if((i[f+1]&l)>0){let p=i[f];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||Uw(p,e.token.value,r,s))){e.acceptToken(p);break}}let c=e.next,u=0,d=i[o+2];if(e.next<0&&d>u&&i[h+d*3-3]==65535){o=i[h+d*3-1];continue e}for(;u<d;){let f=u+d>>1,p=h+f+(f<<1),m=i[p],O=i[p+1]||65536;if(c<m)d=f;else if(c>=O)u=f+1;else{o=i[p+2],e.advance();continue e}}break}}function Zd(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Uw(i,e,t,n){let r=Zd(t,n,e);return r<0||Zd(t,n,i)<r}const gt=typeof process<"u"&&Ld&&/\bparse\b/.test(Ld.LOG);let Vl=null;function Xd(i,e,t){let n=i.cursor(Se.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}class Hw{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Xd(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Xd(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof fe){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(ae.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class Kw{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new co)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;h<s.length;h++){if(!(1<<h&o))continue;let c=s[h],u=this.tokens[h];if(!(n&&!c.fallback)&&((c.contextual||u.start!=e.pos||u.mask!=o||u.context!=l)&&(this.updateCachedToken(u,c,e),u.mask=o,u.context=l),u.lookAhead>u.end+25&&(a=Math.max(u.lookAhead,a)),u.value!=0)){let d=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!c.extend&&(n=u,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new co,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new co,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),n);if(l>=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let h=o.stateSlot(s,a?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=vi(l,h+2);else{r==0&&l[h+1]==2&&(r=this.putAction(vi(l,h+2),t,n,r));break}l[h]==t&&(r=this.putAction(vi(l,h+1),t,n,r))}return r}}class Jw{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Fw(t,r),this.tokens=new Kw(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[zo.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new Hw(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>t)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&tQ(r);if(o)return gt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw gt&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return gt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let l=n[o];for(let a=o+1;a<n.length;a++){let h=n[a];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:s}=this,o=gt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let u=this.fragments.nodeAt(r);u;){let d=this.parser.nodeSet.types[u.type.id]==u.type?s.getGoto(e.state,u.type.id):-1;if(d>-1&&u.length&&(!h||(u.prop(ae.contextHash)||0)==c))return e.useNode(u,d),gt&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(u.type.id)})`),!0;if(!(u instanceof fe)||u.children.length==0||u.positions[0]>0)break;let f=u.children[0];if(f instanceof fe&&u.positions[0]==0)u=f;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),gt&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;h<a.length;){let c=a[h++],u=a[h++],d=a[h++],f=h==a.length||!n,p=f?e:e.split(),m=this.tokens.mainToken;if(p.apply(c,u,m?m.start:p.pos,d),gt&&console.log(o+this.stackID(p)+` (via ${c&65536?`reduce of ${s.getName(c&65535)}`:"shift"} for ${s.getName(u)} @ ${r}${p==e?"":", split"})`),f)return!0;p.pos>r?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Id(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=t[o<<1],h=t[(o<<1)+1],c=gt?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),gt&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let u=l.split(),d=c;for(let f=0;f<10&&u.forceReduce()&&(gt&&console.log(d+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));f++)gt&&(d=this.stackID(u)+" -> ");for(let f of l.recoverByInsert(a))gt&&console.log(c+this.stackID(f)+" (via recover-insert)"),this.advanceFully(f,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),gt&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Id(l,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),fe.build({buffer:Vo.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Vl||(Vl=new WeakMap)).get(e);return t||Vl.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Id(i,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==i.pos&&n.sameState(i)){e[t].score<i.score&&(e[t]=i);return}}e.push(i)}class eQ{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const Dl=i=>i;class lg{constructor(e){this.start=e.start,this.shift=e.shift||Dl,this.reduce=e.reduce||Dl,this.reuse=e.reuse||Dl,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class tr extends sl{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<e.repeatNodeCount;l++)t.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<t.length;l++)r.push([]);function s(l,a,h){r[l].push([a,a.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=ae[a]);for(let h=1;h<l.length;){let c=l[h++];if(c>=0)s(c,a,l[h++]);else{let u=l[h+-c];for(let d=-c;d>0;d--)s(l[h++],a,u);h++}}}this.nodeSet=new sr(t.map((l,a)=>Be.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Em;let o=Qr(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(zd),this.states=Qr(e.states,Uint32Array),this.data=Qr(e.stateData),this.goto=Qr(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Mn(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Jw(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s<h;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=n[s])==65535)if(n[s+1]==1)o=n[s=vi(n,s+2)];else{if(n[s+1]==2)return vi(n,s+2);break}if(o==t||o==0)return vi(n,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vi(this.data,s+2);else break;r=t(vi(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vi(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(tr.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=zd(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!n[s])for(let o=this.dialects[t[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new eQ(e,n,r)}static deserialize(e){return new tr(e)}}function vi(i,e){return i[e]|i[e+1]<<16}function tQ(i){let e=null;for(let t of i){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function zd(i){if(i.external){let e=i.extend?1:0;return(t,n)=>i.external(t,n)<<1|e}return i.get}const iQ=55,nQ=1,rQ=56,sQ=2,oQ=57,lQ=3,Vd=4,aQ=5,cc=6,ag=7,hg=8,cg=9,ug=10,hQ=11,cQ=12,uQ=13,Bl=58,dQ=14,fQ=15,Dd=59,dg=21,pQ=23,fg=24,mQ=25,uh=27,pg=28,OQ=29,gQ=32,bQ=35,vQ=37,yQ=38,kQ=0,SQ=1,xQ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},wQ={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Bd={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function QQ(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}let qd=null,jd=null,Wd=0;function dh(i,e){let t=i.pos+e;if(Wd==t&&jd==i)return qd;let n=i.peek(e),r="";for(;QQ(n);)r+=String.fromCharCode(n),n=i.peek(++e);return jd=i,Wd=t,qd=r?r.toLowerCase():n==$Q||n==PQ?void 0:null}const mg=60,Bo=62,uc=47,$Q=63,PQ=33,TQ=45;function Yd(i,e){this.name=i,this.parent=e}const CQ=[cc,ug,ag,hg,cg],AQ=new lg({start:null,shift(i,e,t,n){return CQ.indexOf(e)>-1?new Yd(dh(n,1)||"",i):i},reduce(i,e){return e==dg&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==cc||r==vQ?new Yd(dh(n,1)||"",i):i},strict:!1}),_Q=new Et((i,e)=>{if(i.next!=mg){i.next<0&&e.context&&i.acceptToken(Bl);return}i.advance();let t=i.next==uc;t&&i.advance();let n=dh(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?fQ:dQ);let r=e.context?e.context.name:null;if(t){if(n==r)return i.acceptToken(hQ);if(r&&wQ[r])return i.acceptToken(Bl,-2);if(e.dialectEnabled(kQ))return i.acceptToken(cQ);for(let s=e.context;s;s=s.parent)if(s.name==n)return;i.acceptToken(uQ)}else{if(n=="script")return i.acceptToken(ag);if(n=="style")return i.acceptToken(hg);if(n=="textarea")return i.acceptToken(cg);if(xQ.hasOwnProperty(n))return i.acceptToken(ug);r&&Bd[r]&&Bd[r][n]?i.acceptToken(Bl,-1):i.acceptToken(cc)}},{contextual:!0}),EQ=new Et(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(Dd);break}if(i.next==TQ)e++;else if(i.next==Bo&&e>=2){t>=3&&i.acceptToken(Dd,-2);break}else e=0;i.advance()}});function LQ(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}const RQ=new Et((i,e)=>{if(i.next==uc&&i.peek(1)==Bo){let t=e.dialectEnabled(SQ)||LQ(e.context);i.acceptToken(t?aQ:Vd,2)}else i.next==Bo&&i.acceptToken(Vd,1)});function dc(i,e,t){let n=2+i.length;return new Et(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==mg||s==1&&r.next==uc||s>=2&&s<n&&r.next==i.charCodeAt(s-2))s++,o++;else if(s==n&&r.next==Bo){l>o?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const MQ=dc("script",iQ,nQ),ZQ=dc("style",rQ,sQ),XQ=dc("textarea",oQ,lQ),IQ=or({"Text RawText IncompleteTag IncompleteCloseTag":y.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":y.angleBracket,TagName:y.tagName,"MismatchedCloseTag/TagName":[y.tagName,y.invalid],AttributeName:y.attributeName,"AttributeValue UnquotedAttributeValue":y.attributeValue,Is:y.definitionOperator,"EntityReference CharacterReference":y.character,Comment:y.blockComment,ProcessingInst:y.processingInstruction,DoctypeDecl:y.documentMeta}),zQ=tr.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOa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^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:AQ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[IQ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;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s!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[MQ,ZQ,XQ,RQ,_Q,EQ,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function Og(i,e){let t=Object.create(null);for(let n of i.getChildren(fg)){let r=n.getChild(mQ),s=n.getChild(uh)||n.getChild(pg);r&&(t[e.read(r.from,r.to)]=s?s.type.id==uh?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function Nd(i,e){let t=i.getChild(pQ);return t?e.read(t.from,t.to):" "}function ql(i,e,t){let n;for(let r of t)if(!r.attrs||r.attrs(n||(n=Og(i.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function gg(i=[],e=[]){let t=[],n=[],r=[],s=[];for(let l of i)(l.tag=="script"?t:l.tag=="style"?n:l.tag=="textarea"?r:s).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return Xm((l,a)=>{let h=l.type.id;if(h==OQ)return ql(l,a,t);if(h==gQ)return ql(l,a,n);if(h==bQ)return ql(l,a,r);if(h==dg&&s.length){let c=l.node,u=c.firstChild,d=u&&Nd(u,a),f;if(d){for(let p of s)if(p.tag==d&&(!p.attrs||p.attrs(f||(f=Og(u,a))))){let m=c.lastChild,O=m.type.id==yQ?m.from:c.to;if(O>u.to)return{parser:p.parser,overlay:[{from:u.to,to:O}]}}}}if(o&&h==fg){let c=l.node,u;if(u=c.firstChild){let d=o[a.read(u.from,u.to)];if(d)for(let f of d){if(f.tagName&&f.tagName!=Nd(c.parent,a))continue;let p=c.lastChild;if(p.type.id==uh){let m=p.from+1,O=p.lastChild,g=p.to-(O&&O.isError?0:1);if(g>m)return{parser:f.parser,overlay:[{from:m,to:g}],bracketed:!0}}else if(p.type.id==pg)return{parser:f.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const VQ=122,Gd=1,DQ=123,BQ=124,bg=2,qQ=125,jQ=3,WQ=4,vg=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],YQ=58,NQ=40,yg=95,GQ=91,uo=45,FQ=46,UQ=35,HQ=37,KQ=38,JQ=92,e$=10,t$=42;function rs(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function fc(i){return i>=48&&i<=57}function Fd(i){return fc(i)||i>=97&&i<=102||i>=65&&i<=70}const kg=(i,e,t)=>(n,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=n;if(rs(a)||a==uo||a==yg||s&&fc(a))!s&&(a!=uo||l>0)&&(s=!0),o===l&&a==uo&&o++,n.advance();else if(a==JQ&&n.peek(1)!=e$){if(n.advance(),Fd(n.next)){do n.advance();while(Fd(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(bg)?e:a==NQ?t:i);break}}},i$=new Et(kg(DQ,bg,BQ)),n$=new Et(kg(qQ,jQ,WQ)),r$=new Et(i=>{if(vg.includes(i.peek(-1))){let{next:e}=i;(rs(e)||e==yg||e==UQ||e==FQ||e==t$||e==GQ||e==YQ&&rs(i.peek(1))||e==uo||e==KQ)&&i.acceptToken(VQ)}}),s$=new Et(i=>{if(!vg.includes(i.peek(-1))){let{next:e}=i;if(e==HQ&&(i.advance(),i.acceptToken(Gd)),rs(e)){do i.advance();while(rs(i.next)||fc(i.next));i.acceptToken(Gd)}}}),o$=or({"AtKeyword import charset namespace keyframes media supports":y.definitionKeyword,"from to selector":y.keyword,NamespaceName:y.namespace,KeyframeName:y.labelName,KeyframeRangeName:y.operatorKeyword,TagName:y.tagName,ClassName:y.className,PseudoClassName:y.constant(y.className),IdName:y.labelName,"FeatureName PropertyName":y.propertyName,AttributeName:y.attributeName,NumberLiteral:y.number,KeywordQuery:y.keyword,UnaryQueryOp:y.operatorKeyword,"CallTag ValueName":y.atom,VariableName:y.variableName,Callee:y.operatorKeyword,Unit:y.unit,"UniversalSelector NestingSelector":y.definitionOperator,"MatchOp CompareOp":y.compareOperator,"ChildOp SiblingOp, LogicOp":y.logicOperator,BinOp:y.arithmeticOperator,Important:y.modifier,Comment:y.blockComment,ColorLiteral:y.color,"ParenthesizedContent StringLiteral":y.string,":":y.punctuation,"PseudoOp #":y.derefOperator,"; ,":y.separator,"( )":y.paren,"[ ]":y.squareBracket,"{ }":y.brace}),l$={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},a$={__proto__:null,or:98,and:98,not:106,only:106,layer:170},h$={__proto__:null,selector:112,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f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[o$],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$K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y%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[r$,s$,i$,n$,1,2,3,4,new Do("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:i=>l$[i]||-1},{term:125,get:i=>a$[i]||-1},{term:4,get:i=>h$[i]||-1},{term:25,get:i=>c$[i]||-1},{term:123,get:i=>u$[i]||-1}],tokenPrec:1963});let jl=null;function Wl(){if(!jl&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));jl=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return jl||[]}const Ud=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),Hd=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),f$=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),p$=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),bi=/^(\w[\w-]*|-\w[\w-]*|)$/,m$=/^-(-[\w-]*)?$/;function O$(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const Kd=new Zm,g$=["Declaration"];function b$(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function Sg(i,e,t){if(e.to-e.from>4096){let n=Kd.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(Se.IncludeAnonymous);if(o.firstChild())do for(let l of Sg(i,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return Kd.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(g$)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}const xg=i=>e=>{let{state:t,pos:n}=e,r=Ze(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:Wl(),validFor:bi};if(r.name=="ValueName")return{from:r.from,options:Hd,validFor:bi};if(r.name=="PseudoClassName")return{from:r.from,options:Ud,validFor:bi};if(i(r)||(e.explicit||s)&&O$(r,t.doc))return{from:i(r)||s?r.from:n,options:Sg(t.doc,b$(r),i),validFor:m$};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:Wl(),validFor:bi};return{from:r.from,options:f$,validFor:bi}}if(r.name=="AtKeyword")return{from:r.from,options:p$,validFor:bi};if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:Ud,validFor:bi}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:Hd,validFor:bi}:o.name=="Block"||o.name=="Styles"?{from:n,options:Wl(),validFor:bi}:null},wg=xg(i=>i.name=="VariableName"),ss=Un.define({name:"css",parser:d$.configure({props:[ar.add({Declaration:ho()}),gs.add({"Block KeyframeList":jm})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Qg(){return new Jn(ss,ss.data.of({autocomplete:wg}))}const v$=Object.freeze(Object.defineProperty({__proto__:null,css:Qg,cssCompletionSource:wg,cssLanguage:ss,defineCSSCompletionSource:xg},Symbol.toStringTag,{value:"Module"})),y$=316,k$=317,Jd=1,S$=2,x$=3,w$=4,Q$=318,$$=320,P$=321,T$=5,C$=6,A$=0,fh=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],$g=125,_$=59,ph=47,E$=42,L$=43,R$=45,M$=60,Z$=44,X$=63,I$=46,z$=91,V$=new lg({start:!1,shift(i,e){return e==T$||e==C$||e==$$?i:e==P$},strict:!1}),D$=new Et((i,e)=>{let{next:t}=i;(t==$g||t==-1||e.context)&&i.acceptToken(Q$)},{contextual:!0,fallback:!0}),B$=new Et((i,e)=>{let{next:t}=i,n;fh.indexOf(t)>-1||t==ph&&((n=i.peek(1))==ph||n==E$)||t!=$g&&t!=_$&&t!=-1&&!e.context&&i.acceptToken(y$)},{contextual:!0}),q$=new Et((i,e)=>{i.next==z$&&!e.context&&i.acceptToken(k$)},{contextual:!0}),j$=new Et((i,e)=>{let{next:t}=i;if(t==L$||t==R$){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Jd);i.acceptToken(n?Jd:S$)}}else t==X$&&i.peek(1)==I$&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(x$))},{contextual:!0});function Yl(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const W$=new Et((i,e)=>{if(i.next!=M$||!e.dialectEnabled(A$)||(i.advance(),i.next==ph))return;let t=0;for(;fh.indexOf(i.next)>-1;)i.advance(),t++;if(Yl(i.next,!0)){for(i.advance(),t++;Yl(i.next,!1);)i.advance(),t++;for(;fh.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==Z$)return;for(let n=0;;n++){if(n==7){if(!Yl(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(w$,-t)}),Y$=or({"get set async static":y.modifier,"for while do if else switch try catch finally return throw break continue default case defer":y.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":y.operatorKeyword,"let var const using function class extends":y.definitionKeyword,"import export from":y.moduleKeyword,"with debugger new":y.keyword,TemplateString:y.special(y.string),super:y.atom,BooleanLiteral:y.bool,this:y.self,null:y.null,Star:y.modifier,VariableName:y.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":y.function(y.variableName),VariableDefinition:y.definition(y.variableName),Label:y.labelName,PropertyName:y.propertyName,PrivatePropertyName:y.special(y.propertyName),"CallExpression/MemberExpression/PropertyName":y.function(y.propertyName),"FunctionDeclaration/VariableDefinition":y.function(y.definition(y.variableName)),"ClassDeclaration/VariableDefinition":y.definition(y.className),"NewExpression/VariableName":y.className,PropertyDefinition:y.definition(y.propertyName),PrivatePropertyDefinition:y.definition(y.special(y.propertyName)),UpdateOp:y.updateOperator,"LineComment Hashbang":y.lineComment,BlockComment:y.blockComment,Number:y.number,String:y.string,Escape:y.escape,ArithOp:y.arithmeticOperator,LogicOp:y.logicOperator,BitOp:y.bitwiseOperator,CompareOp:y.compareOperator,RegExp:y.regexp,Equals:y.definitionOperator,Arrow:y.function(y.punctuation),": Spread":y.punctuation,"( )":y.paren,"[ ]":y.squareBracket,"{ }":y.brace,"InterpolationStart InterpolationEnd":y.special(y.brace),".":y.derefOperator,", ;":y.separator,"@":y.meta,TypeName:y.typeName,TypeDefinition:y.definition(y.typeName),"type enum interface implements namespace module declare":y.definitionKeyword,"abstract global Privacy readonly override":y.modifier,"is keyof unique infer asserts":y.operatorKeyword,JSXAttributeValue:y.attributeValue,JSXText:y.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":y.angleBracket,"JSXIdentifier JSXNameSpacedName":y.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":y.attributeName,"JSXBuiltin/JSXIdentifier":y.standard(y.tagName)}),N$={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},G$={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},F$={__proto__:null,"<":193},U$=tr.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'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Q7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:V$,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Y$],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`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#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[B$,q$,j$,W$,2,3,4,5,6,7,8,9,10,11,12,13,14,D$,new Do("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Do("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>N$[i]||-1},{term:343,get:i=>G$[i]||-1},{term:95,get:i=>F$[i]||-1}],tokenPrec:15201}),pc=[ut("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ut("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ut("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ut("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ut("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ut(`try {
|
|
266
|
+
\${}
|
|
267
|
+
} catch (\${error}) {
|
|
268
|
+
\${}
|
|
269
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),ut("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),ut(`if (\${}) {
|
|
270
|
+
\${}
|
|
271
|
+
} else {
|
|
272
|
+
\${}
|
|
273
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),ut(`class \${name} {
|
|
274
|
+
constructor(\${params}) {
|
|
275
|
+
\${}
|
|
276
|
+
}
|
|
277
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),ut('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ut('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Pg=pc.concat([ut("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ut("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ut("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),ef=new Zm,Tg=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function vr(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const H$=["FunctionDeclaration"],K$={FunctionDeclaration:vr("function"),ClassDeclaration:vr("class"),ClassExpression:()=>!0,EnumDeclaration:vr("constant"),TypeAliasDeclaration:vr("type"),NamespaceDeclaration:vr("namespace"),VariableDefinition(i,e){i.matchContext(H$)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function Cg(i,e){let t=ef.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(Se.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=K$[o.name];if(l&&l(o,s)||Tg.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Cg(i,o.node))n.push(l);return!1}}),ef.set(e,n),n}const qo=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,mc=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Ag(i){let e=Ze(i.state).resolveInner(i.pos,-1);if(mc.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&qo.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)Tg.has(r.name)&&(n=n.concat(Cg(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:qo}}function Nl(i,e,t){var n;let r=[];for(;;){let s=e.firstChild,o;if((s==null?void 0:s.name)=="VariableName")return r.push(i(s)),{path:r.reverse(),name:t};if((s==null?void 0:s.name)=="MemberExpression"&&((n=o=s.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")r.push(i(o)),e=s;else return null}}function _g(i){let e=n=>i.state.doc.sliceString(n.from,n.to),t=Ze(i.state).resolveInner(i.pos,-1);return t.name=="PropertyName"?Nl(e,t.parent,e(t)):(t.name=="."||t.name=="?.")&&t.parent.name=="MemberExpression"?Nl(e,t.parent,""):mc.indexOf(t.name)>-1?null:t.name=="VariableName"||t.to-t.from<20&&qo.test(e(t))?{path:[],name:e(t)}:t.name=="MemberExpression"?Nl(e,t,""):i.explicit?{path:[],name:""}:null}function J$(i,e){let t=i,n=[],r=new Set;for(let s=0;;s++){for(let l of(Object.getOwnPropertyNames||Object.keys)(i)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||r.has(l))continue;r.add(l);let a;try{a=t[l]}catch{continue}n.push({label:l,type:typeof a=="function"?/^[A-Z]/.test(l)?"class":e?"function":"method":e?"variable":"property",boost:-s})}let o=Object.getPrototypeOf(i);if(!o)return n;i=o}}function eP(i){let e=new Map;return t=>{let n=_g(t);if(!n)return null;let r=i;for(let o of n.path)if(r=r[o],!r)return null;let s=e.get(r);return s||e.set(r,s=J$(r,!n.path.length)),{from:t.pos-n.name.length,options:s,validFor:qo}}}const Vt=Un.define({name:"javascript",parser:U$.configure({props:[ar.add({IfStatement:ho({except:/^\s*({|else\b)/}),TryStatement:ho({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:hS,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:aS({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":ho({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),gs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":jm,BlockComment(i){return{from:i.from+2,to:i.to-2}},JSXElement(i){let e=i.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=i.lastChild;return{from:e.to,to:t.type.isError?i.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(i){var e;let t=(e=i.firstChild)===null||e===void 0?void 0:e.nextSibling,n=i.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?i.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Eg={test:i=>/^JSX/.test(i.name),facet:ol({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Oc=Vt.configure({dialect:"ts"},"typescript"),gc=Vt.configure({dialect:"jsx",props:[qh.add(i=>i.isTop?[Eg]:void 0)]}),bc=Vt.configure({dialect:"jsx ts",props:[qh.add(i=>i.isTop?[Eg]:void 0)]},"typescript");let Lg=i=>({label:i,type:"keyword"});const Rg="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Lg),tP=Rg.concat(["declare","implements","private","protected","public"].map(Lg));function Mg(i={}){let e=i.jsx?i.typescript?bc:gc:i.typescript?Oc:Vt,t=i.typescript?Pg.concat(tP):pc.concat(Rg);return new Jn(e,[Vt.data.of({autocomplete:Xx(mc,EO(t))}),Vt.data.of({autocomplete:Ag}),i.jsx?Zg:[]])}function iP(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function tf(i,e,t=i.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}const nP=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Zg=U.inputHandler.of((i,e,t,n,r)=>{if((nP?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!Vt.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,u=Ze(o).resolveInner(c-1,-1),d;if(u.name=="JSXStartTag"&&(u=u.parent),!(o.doc.sliceString(c-1,c)!=n||u.name=="JSXAttributeValue"&&u.to>c)){if(n==">"&&u.name=="JSXFragmentTag")return{range:a,changes:{from:c,insert:"</>"}};if(n=="/"&&u.name=="JSXStartCloseTag"){let f=u.parent,p=f.parent;if(p&&f.from==c-2&&((d=tf(o.doc,p.firstChild,c))||((h=p.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let m=`${d}>`;return{range:Z.cursor(c+m.length,-1),changes:{from:c,insert:m}}}}else if(n==">"){let f=iP(u);if(f&&f.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(c,c+2))&&(d=tf(o.doc,f,c)))return{range:a,changes:{from:c,insert:`</${d}>`}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function rP(i,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},i.getRules().forEach((t,n)=>{var r;!((r=t.meta.docs)===null||r===void 0)&&r.recommended&&(e.rules[n]=2)})),t=>{let{state:n}=t,r=[];for(let{from:s,to:o}of Vt.findRegions(n)){let l=n.doc.lineAt(s),a={line:l.number-1,col:s-l.from,pos:s};for(let h of i.verify(n.sliceDoc(s,o),e))r.push(sP(h,n.doc,a))}return r}}function nf(i,e,t,n){return t.line(i+n.line).from+e+(i==1?n.col-1:-1)}function sP(i,e,t){let n=nf(i.line,i.column,e,t),r={from:n,to:i.endLine!=null&&i.endColumn!=1?nf(i.endLine,i.endColumn,e,t):n,message:i.message,source:i.ruleId?"eslint:"+i.ruleId:"eslint",severity:i.severity==1?"warning":"error"};if(i.fix){let{range:s,text:o}=i.fix,l=s[0]+t.pos-n,a=s[1]+t.pos-n;r.actions=[{name:"fix",apply(h,c){h.dispatch({changes:{from:c+l,to:c+a,insert:o},scrollIntoView:!0})}}]}return r}const Ns=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Zg,completionPath:_g,esLint:rP,javascript:Mg,javascriptLanguage:Vt,jsxLanguage:gc,localCompletionSource:Ag,scopeCompletionSource:eP,snippets:pc,tsxLanguage:bc,typescriptLanguage:Oc,typescriptSnippets:Pg},Symbol.toStringTag,{value:"Module"})),yr=["_blank","_self","_top","_parent"],Gl=["ascii","utf-8","utf-16","latin1","latin1"],Fl=["get","post","put","delete"],Ul=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],bt=["true","false"],J={},oP={a:{attrs:{href:null,ping:null,type:null,media:null,target:yr,hreflang:null}},abbr:J,address:J,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:J,aside:J,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:J,base:{attrs:{href:null,target:yr}},bdi:J,bdo:J,blockquote:{attrs:{cite:null}},body:J,br:J,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Ul,formmethod:Fl,formnovalidate:["novalidate"],formtarget:yr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:J,center:J,cite:J,code:J,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:J,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:J,div:J,dl:J,dt:J,em:J,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:J,figure:J,footer:J,form:{attrs:{action:null,name:null,"accept-charset":Gl,autocomplete:["on","off"],enctype:Ul,method:Fl,novalidate:["novalidate"],target:yr}},h1:J,h2:J,h3:J,h4:J,h5:J,h6:J,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:J,hgroup:J,hr:J,html:{attrs:{manifest:null}},i:J,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Ul,formmethod:Fl,formnovalidate:["novalidate"],formtarget:yr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:J,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:J,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:J,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Gl,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:J,noscript:J,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:J,param:{attrs:{name:null,value:null}},pre:J,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:J,rt:J,ruby:J,samp:J,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Gl}},section:J,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:J,source:{attrs:{src:null,type:null,media:null}},span:J,strong:J,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:J,summary:J,sup:J,table:J,tbody:J,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:J,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:J,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:J,time:{attrs:{datetime:null}},title:J,tr:J,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:J,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:J},Xg={accesskey:null,class:null,contenteditable:bt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:bt,autocorrect:bt,autocapitalize:bt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":bt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":bt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":bt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":bt,"aria-hidden":bt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":bt,"aria-multiselectable":bt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":bt,"aria-relevant":null,"aria-required":bt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ig="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of Ig)Xg[i]=null;class os{constructor(e,t){this.tags={...oP,...e},this.globalAttrs={...Xg,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}os.default=new os;function ir(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}function nr(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function zg(i,e,t){let n=t.tags[ir(i,nr(e))];return(n==null?void 0:n.children)||t.allTags}function vc(i,e){let t=[];for(let n=nr(e);n&&!n.type.isTop;n=nr(n.parent)){let r=ir(i,n);if(r&&n.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(r)}return t}const Vg=/^[:\-\.\w\u00b7-\uffff]*$/;function rf(i,e,t,n,r){let s=/\s*>/.test(i.sliceDoc(r,r+5))?"":">",o=nr(t,t.name=="StartTag"||t.name=="TagName");return{from:n,to:r,options:zg(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(vc(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function sf(i,e,t,n){let r=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:vc(i.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Vg}}function lP(i,e,t,n){let r=[],s=0;for(let o of zg(i.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of vc(i.doc,t))r.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function aP(i,e,t,n,r){let s=nr(t),o=s?e.tags[ir(i.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:a.map(h=>({label:h,type:"property"})),validFor:Vg}}function hP(i,e,t,n,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let h=i.sliceDoc(o.from,o.to),c=e.globalAttrs[h];if(!c){let u=nr(t),d=u?e.tags[ir(i.doc,u)]:null;c=(d==null?void 0:d.attrs)&&d.attrs[h]}if(c){let u=i.sliceDoc(n,r).toLowerCase(),d='"',f='"';/^['"]/.test(u)?(a=u[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",f=i.sliceDoc(r,r+1)==u[0]?"":u[0],u=u.slice(1),n++):a=/^[^\s<>='"]*$/;for(let p of c)l.push({label:p,apply:d+p+f,type:"constant"})}}return{from:n,to:r,options:l,validFor:a}}function Dg(i,e){let{state:t,pos:n}=e,r=Ze(t).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.from<a.to)break;s=r=l,o=a.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?sf(t,r,r.from,n):rf(t,i,r,r.from,n):r.name=="StartTag"||r.name=="IncompleteTag"?rf(t,i,r,n,n):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?sf(t,r,n,n):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?aP(t,i,r,r.name=="AttributeName"?r.from:n,n):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?hP(t,i,r,r.name=="Is"?n:r.from,n):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?lP(t,i,r,n):null}function Bg(i){return Dg(os.default,i)}function qg(i){let{extraTags:e,extraGlobalAttributes:t}=i,n=t||e?new os(e,t):os.default;return r=>Dg(n,r)}const cP=Vt.parser.configure({top:"SingleExpression"}),jg=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:Oc.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:gc.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:bc.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:cP},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:Vt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:ss.parser}],Wg=[{name:"style",parser:ss.parser.configure({top:"Styles"})}].concat(Ig.map(i=>({name:i,parser:Vt.parser}))),Yg=Un.define({name:"html",parser:zQ.configure({props:[ar.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].length<i.node.to)return i.continue();let e=null,t;for(let n=i.node;;){let r=n.lastChild;if(!r||r.name!="Element"||r.to!=n.to)break;e=n=r}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?i.lineIndent(e.from)+i.unit:null}}),gs.add({Element(i){let e=i.firstChild,t=i.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:i.to}}}),Ym.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Dr=Yg.configure({wrap:gg(jg,Wg)});function Ng(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=gg((i.nestedLanguages||[]).concat(jg),(i.nestedAttributes||[]).concat(Wg)));let n=t?Yg.configure({wrap:t,dialect:e}):e?Dr.configure({dialect:e}):Dr;return new Jn(n,[Dr.data.of({autocomplete:qg(i)}),i.autoCloseTags!==!1?Gg:[],Mg().support,Qg().support])}const of=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Gg=U.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!Dr.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h,c,u;let d=o.doc.sliceString(a.from-1,a.to)==n,{head:f}=a,p=Ze(o).resolveInner(f,-1),m;if(d&&n==">"&&p.name=="EndTag"){let O=p.parent;if(((c=(h=O.parent)===null||h===void 0?void 0:h.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=ir(o.doc,O.parent,f))&&!of.has(m)){let g=f+(o.doc.sliceString(f,f+1)===">"?1:0),b=`</${m}>`;return{range:a,changes:{from:f,to:g,insert:b}}}}else if(d&&n=="/"&&p.name=="IncompleteCloseTag"){let O=p.parent;if(p.from==f-2&&((u=O.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(m=ir(o.doc,O,f))&&!of.has(m)){let g=f+(o.doc.sliceString(f,f+1)===">"?1:0),b=`${m}>`;return{range:Z.cursor(f+b.length,-1),changes:{from:f,to:g,insert:b}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),uP=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Gg,html:Ng,htmlCompletionSource:Bg,htmlCompletionSourceWith:qg,htmlLanguage:Dr},Symbol.toStringTag,{value:"Module"})),Fg=ol({commentTokens:{block:{open:"<!--",close:"-->"}}}),Ug=new ae,Hg=Lw.configure({props:[gs.add(i=>!i.is("Block")||i.is("Document")||mh(i)!=null||dP(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Ug.add(mh),ar.add({Document:()=>null}),Di.add({Document:Fg})]});function mh(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function dP(i){return i.name=="OrderedList"||i.name=="BulletList"}function fP(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=mh(n.type))!=null&&r<=e)break;t=n}return t.to}const pP=cS.of((i,e,t)=>{for(let n=Ze(i).resolveInner(t,-1);n&&!(n.from<e);n=n.parent){let r=n.type.prop(Ug);if(r==null)continue;let s=fP(n,r);if(s>t)return{from:t,to:s}}return null});function yc(i){return new At(Fg,i,[],"markdown")}const Kg=yc(Hg),mP=Hg.configure([jw,Yw,Ww,Nw,{props:[gs.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),ls=yc(mP);function OP(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=_.matchLanguageName(i,t,!0),n instanceof _)return n.support?n.support.language.parser:On.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class Hl{constructor(e,t,n,r,s,o,l){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let r=this.to-this.from-n.length-this.spaceAfter.length;r>0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+e0(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Jg(i,e){let t=[],n=[];for(let r=i;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))n.push(new Hl(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let h=o[3],c=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),c-=4),n.push(new Hl(s.parent,a,a+c,o[1],h,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let h=o[4],c=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),c-=4);let u=o[2];o[3]&&(u+=o[3].replace(/[xX]/," ")),n.push(new Hl(s.parent,a,a+c,o[1],h,u,s))}}return n}function e0(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function Kl(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let l=e0(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function kc(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(lr)!=" ")return i;let n=wi(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}const t0=(i={})=>({state:e,dispatch:t})=>{let n=Ze(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!ls.isActiveAt(e,l.from,-1)&&!ls.isActiveAt(e,l.from,1))return s={range:l};let a=l.from,h=r.lineAt(a),c=Jg(n.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-h.from;)c.pop();if(!c.length)return s={range:l};let u=c[c.length-1];if(u.to-u.spaceAfter.length>a-h.from)return s={range:l};let d=a>=u.to-u.spaceAfter.length&&!/\S/.test(h.text.slice(u.to));if(u.item&&d){let g=u.node.firstChild,b=u.node.getChild("ListItem","ListItem");if(g.to>=a||b&&b.to<a||h.from>0&&!/[^\s>]/.test(r.lineAt(h.from-1).text)||i.nonTightLists===!1){let Q=c.length>1?c[c.length-2]:null,x,k="";Q&&Q.item?(x=h.from+Q.from,k=Q.marker(r,1)):x=h.from+(Q?Q.to:0);let $=[{from:x,to:a,insert:k}];return u.node.name=="OrderedList"&&Kl(u.item,r,$,-2),Q&&Q.node.name=="OrderedList"&&Kl(Q.item,r,$),{range:Z.cursor(x+k.length),changes:$}}else{let Q=af(c,e,h);return{range:Z.cursor(a+Q.length+1),changes:{from:h.from,insert:Q+e.lineBreak}}}}if(u.node.name=="Blockquote"&&d&&h.from){let g=r.lineAt(h.from-1),b=/>\s*$/.exec(g.text);if(b&&b.index==u.from){let Q=e.changes([{from:g.from+b.index,to:g.to},{from:h.from+u.from,to:h.to}]);return{range:l.map(Q),changes:Q}}}let f=[];u.node.name=="OrderedList"&&Kl(u.item,r,f);let p=u.item&&u.item.from<h.from,m="";if(!p||/^[\s\d.)\-+*>]*/.exec(h.text)[0].length>=u.to)for(let g=0,b=c.length-1;g<=b;g++)m+=g==b&&!p?c[g].marker(r,1):c[g].blank(g<b?wi(h.text,4,c[g+1].from)-m.length:null);let O=a;for(;O>h.from&&/\s/.test(h.text.charAt(O-h.from-1));)O--;return m=kc(m,e),gP(u.node,e.doc)&&(m=af(c,e,h)+e.lineBreak+m),f.push({from:O,to:a,insert:e.lineBreak+m}),{range:Z.cursor(O+m.length+1),changes:f}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},i0=t0();function lf(i){return i.name=="QuoteMark"||i.name=="ListMark"}function gP(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1)<s.number}function af(i,e,t){let n="";for(let r=0,s=i.length-2;r<=s;r++)n+=i[r].blank(r<s?wi(t.text,4,i[r+1].from)-n.length:null,r<s);return kc(n,e)}function bP(i,e){let t=i.resolveInner(e,-1),n=e;lf(t)&&(n=t.from,t=t.parent);for(let r;r=t.childBefore(n);)if(lf(r))n=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")t=r.lastChild,n=t.to;else break;return t}const n0=({state:i,dispatch:e})=>{let t=Ze(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:l}=i;if(s.empty&&ls.isActiveAt(i,s.from)){let a=l.lineAt(o),h=Jg(bP(t,o),l);if(h.length){let c=h[h.length-1],u=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-a.from>u&&!/\S/.test(a.text.slice(u,o-a.from)))return{range:Z.cursor(a.from+u),changes:{from:a.from+u,to:o}};if(o-a.from==u&&(!c.item||a.from<=c.item.from||!/\S/.test(a.text.slice(0,c.to)))){let d=a.from+c.from;if(c.item&&c.node.from<c.item.from&&/\S/.test(a.text.slice(c.from,c.to))){let f=c.blank(wi(a.text,4,c.to)-wi(a.text,4,c.from));return d==a.from&&(f=kc(f,i)),{range:Z.cursor(d+f.length),changes:{from:d,to:a.from+c.to,insert:f}}}if(d<o)return{range:Z.cursor(d),changes:{from:d,to:o}}}}}return n={range:s}});return n?!1:(e(i.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},r0=[{key:"Enter",run:i0},{key:"Backspace",run:n0}],s0=Ng({matchClosingTags:!1});function o0(i={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:n=!0,base:{parser:r}=Kg,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=s0}=i;if(!(r instanceof dl))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let a=i.extensions?[i.extensions]:[],h=[l.support,pP],c;o&&h.push(l0),t instanceof Jn?(h.push(t.support),c=t.language):t&&(c=t);let u=e||c?OP(e,c):void 0;a.push(Mw({codeParser:u,htmlParser:l.language.parser})),n&&h.push(Pi.high(Os.of(r0)));let d=yc(r.configure(a));return s&&h.push(d.data.of({autocomplete:vP})),new Jn(d,h)}function vP(i){let{state:e,pos:t}=i,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!n)return null;let r=Ze(e).resolveInner(t,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:t-n[0].length,to:t,options:yP(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Jl=null;function yP(){if(Jl)return Jl;let i=Bg(new Kh(Oe.create({extensions:s0}),0,!0));return Jl=i?i.options:[]}const kP=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,l0=U.domEventHandlers({paste:(i,e)=>{var t;let{main:n}=e.state.selection;if(n.empty)return!1;let r=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!ls.isActiveAt(e.state,n.from,1)))return!1;let s=Ze(e.state),o=!1;return s.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||kP.test(l.name))&&(o=!0)},leave:l=>{l.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),SP=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:Kg,deleteMarkupBackward:n0,insertNewlineContinueMarkup:i0,insertNewlineContinueMarkupCommand:t0,markdown:o0,markdownKeymap:r0,markdownLanguage:ls,pasteURLAsLink:l0},Symbol.toStringTag,{value:"Module"}));function z(i){return new Jn(Wh.define(i))}function Ai(i){return L(()=>import("./index-BhWX8AfE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(e=>e.sql({dialect:e[i]}))}const xP=[_.of({name:"C",extensions:["c","h","ino"],load(){return L(()=>import("./index-BqXoPf_D.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.cpp())}}),_.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return L(()=>import("./index-BqXoPf_D.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.cpp())}}),_.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ai("Cassandra")}}),_.of({name:"CSS",extensions:["css"],load(){return L(()=>Promise.resolve().then(()=>v$),void 0).then(i=>i.css())}}),_.of({name:"Go",extensions:["go"],load(){return L(()=>import("./index-yh0ZHIWw.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.go())}}),_.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return L(()=>Promise.resolve().then(()=>uP),void 0).then(i=>i.html())}}),_.of({name:"Java",extensions:["java"],load(){return L(()=>import("./index-CKYk-fkb.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.java())}}),_.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return L(()=>Promise.resolve().then(()=>Ns),void 0).then(i=>i.javascript())}}),_.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return L(()=>import("./index-Bi3XvF_f.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.jinja())}}),_.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return L(()=>import("./index-wqgejMCM.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.json())}}),_.of({name:"JSX",extensions:["jsx"],load(){return L(()=>Promise.resolve().then(()=>Ns),void 0).then(i=>i.javascript({jsx:!0}))}}),_.of({name:"LESS",extensions:["less"],load(){return L(()=>import("./index-CAuTOZSD.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.less())}}),_.of({name:"Liquid",extensions:["liquid"],load(){return L(()=>import("./index-DrlQi03X.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.liquid())}}),_.of({name:"MariaDB SQL",load(){return Ai("MariaSQL")}}),_.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return L(()=>Promise.resolve().then(()=>SP),void 0).then(i=>i.markdown())}}),_.of({name:"MS SQL",load(){return Ai("MSSQL")}}),_.of({name:"MySQL",load(){return Ai("MySQL")}}),_.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return L(()=>import("./index-CXK2Z3_z.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.php())}}),_.of({name:"PLSQL",extensions:["pls"],load(){return Ai("PLSQL")}}),_.of({name:"PostgreSQL",load(){return Ai("PostgreSQL")}}),_.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return L(()=>import("./index-DQkhDeTA.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.python())}}),_.of({name:"Rust",extensions:["rs"],load(){return L(()=>import("./index-DkVb9W_J.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.rust())}}),_.of({name:"Sass",extensions:["sass"],load(){return L(()=>import("./index-CpsfI08O.js"),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.sass({indented:!0}))}}),_.of({name:"SCSS",extensions:["scss"],load(){return L(()=>import("./index-CpsfI08O.js"),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.sass())}}),_.of({name:"SQL",extensions:["sql"],load(){return Ai("StandardSQL")}}),_.of({name:"SQLite",load(){return Ai("SQLite")}}),_.of({name:"TSX",extensions:["tsx"],load(){return L(()=>Promise.resolve().then(()=>Ns),void 0).then(i=>i.javascript({jsx:!0,typescript:!0}))}}),_.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return L(()=>Promise.resolve().then(()=>Ns),void 0).then(i=>i.javascript({typescript:!0}))}}),_.of({name:"WebAssembly",extensions:["wat","wast"],load(){return L(()=>import("./index-CYllQ3Vd.js"),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.wast())}}),_.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return L(()=>import("./index-prTEzzgO.js"),__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.xml())}}),_.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return L(()=>import("./index-BZlHgDSz.js"),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.yaml())}}),_.of({name:"APL",extensions:["dyalog","apl"],load(){return L(()=>import("./apl-B4CMkyY2.js"),[]).then(i=>z(i.apl))}}),_.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return L(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(i=>z(i.asciiArmor))}}),_.of({name:"ASN.1",extensions:["asn","asn1"],load(){return L(()=>import("./asn1-EdZsLKOL.js"),[]).then(i=>z(i.asn1({})))}}),_.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return L(()=>import("./asterisk-B-8jnY81.js"),[]).then(i=>z(i.asterisk))}}),_.of({name:"Brainfuck",extensions:["b","bf"],load(){return L(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(i=>z(i.brainfuck))}}),_.of({name:"Cobol",extensions:["cob","cpy"],load(){return L(()=>import("./cobol-CWcv1MsR.js"),[]).then(i=>z(i.cobol))}}),_.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.csharp))}}),_.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return L(()=>import("./clojure-BMjYHr_A.js"),[]).then(i=>z(i.clojure))}}),_.of({name:"ClojureScript",extensions:["cljs"],load(){return L(()=>import("./clojure-BMjYHr_A.js"),[]).then(i=>z(i.clojure))}}),_.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return L(()=>import("./css-BnMrqG3P.js"),[]).then(i=>z(i.gss))}}),_.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return L(()=>import("./cmake-BQqOBYOt.js"),[]).then(i=>z(i.cmake))}}),_.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return L(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(i=>z(i.coffeeScript))}}),_.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return L(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(i=>z(i.commonLisp))}}),_.of({name:"Cypher",extensions:["cyp","cypher"],load(){return L(()=>import("./cypher-C_CwsFkJ.js"),[]).then(i=>z(i.cypher))}}),_.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return L(()=>import("./python-BuPzkPfP.js"),[]).then(i=>z(i.cython))}}),_.of({name:"Crystal",extensions:["cr"],load(){return L(()=>import("./crystal-SjHAIU92.js"),[]).then(i=>z(i.crystal))}}),_.of({name:"D",extensions:["d"],load(){return L(()=>import("./d-pRatUO7H.js"),[]).then(i=>z(i.d))}}),_.of({name:"Dart",extensions:["dart"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.dart))}}),_.of({name:"diff",extensions:["diff","patch"],load(){return L(()=>import("./diff-DbItnlRl.js"),[]).then(i=>z(i.diff))}}),_.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return L(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([41,42])).then(i=>z(i.dockerFile))}}),_.of({name:"DTD",extensions:["dtd"],load(){return L(()=>import("./dtd-DF_7sFjM.js"),[]).then(i=>z(i.dtd))}}),_.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return L(()=>import("./dylan-DwRh75JA.js"),[]).then(i=>z(i.dylan))}}),_.of({name:"EBNF",load(){return L(()=>import("./ebnf-CDyGwa7X.js"),[]).then(i=>z(i.ebnf))}}),_.of({name:"ECL",extensions:["ecl"],load(){return L(()=>import("./ecl-Cabwm37j.js"),[]).then(i=>z(i.ecl))}}),_.of({name:"edn",extensions:["edn"],load(){return L(()=>import("./clojure-BMjYHr_A.js"),[]).then(i=>z(i.clojure))}}),_.of({name:"Eiffel",extensions:["e"],load(){return L(()=>import("./eiffel-CnydiIhH.js"),[]).then(i=>z(i.eiffel))}}),_.of({name:"Elm",extensions:["elm"],load(){return L(()=>import("./elm-vLlmbW-K.js"),[]).then(i=>z(i.elm))}}),_.of({name:"Erlang",extensions:["erl"],load(){return L(()=>import("./erlang-BNw1qcRV.js"),[]).then(i=>z(i.erlang))}}),_.of({name:"Esper",load(){return L(()=>import("./sql-D0XecflT.js"),[]).then(i=>z(i.esper))}}),_.of({name:"Factor",extensions:["factor"],load(){return L(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([43,42])).then(i=>z(i.factor))}}),_.of({name:"FCL",load(){return L(()=>import("./fcl-Kvtd6kyn.js"),[]).then(i=>z(i.fcl))}}),_.of({name:"Forth",extensions:["forth","fth","4th"],load(){return L(()=>import("./forth-Ffai-XNe.js"),[]).then(i=>z(i.forth))}}),_.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return L(()=>import("./fortran-DYz_wnZ1.js"),[]).then(i=>z(i.fortran))}}),_.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return L(()=>import("./mllike-CXdrOF99.js"),[]).then(i=>z(i.fSharp))}}),_.of({name:"Gas",extensions:["s"],load(){return L(()=>import("./gas-Bneqetm1.js"),[]).then(i=>z(i.gas))}}),_.of({name:"Gherkin",extensions:["feature"],load(){return L(()=>import("./gherkin-heZmZLOM.js"),[]).then(i=>z(i.gherkin))}}),_.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return L(()=>import("./groovy-D9Dt4D0W.js"),[]).then(i=>z(i.groovy))}}),_.of({name:"Haskell",extensions:["hs"],load(){return L(()=>import("./haskell-BWDZoCOh.js"),[]).then(i=>z(i.haskell))}}),_.of({name:"Haxe",extensions:["hx"],load(){return L(()=>import("./haxe-H-WmDvRZ.js"),[]).then(i=>z(i.haxe))}}),_.of({name:"HXML",extensions:["hxml"],load(){return L(()=>import("./haxe-H-WmDvRZ.js"),[]).then(i=>z(i.hxml))}}),_.of({name:"HTTP",load(){return L(()=>import("./http-DBlCnlav.js"),[]).then(i=>z(i.http))}}),_.of({name:"IDL",extensions:["pro"],load(){return L(()=>import("./idl-BEugSyMb.js"),[]).then(i=>z(i.idl))}}),_.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return L(()=>import("./javascript-qCveANmP.js"),[]).then(i=>z(i.jsonld))}}),_.of({name:"Julia",extensions:["jl"],load(){return L(()=>import("./julia-DuME0IfC.js"),[]).then(i=>z(i.julia))}}),_.of({name:"Kotlin",extensions:["kt","kts"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.kotlin))}}),_.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return L(()=>import("./livescript-BwQOo05w.js"),[]).then(i=>z(i.liveScript))}}),_.of({name:"Lua",extensions:["lua"],load(){return L(()=>import("./lua-BgMRiT3U.js"),[]).then(i=>z(i.lua))}}),_.of({name:"mIRC",extensions:["mrc"],load(){return L(()=>import("./mirc-CjQqDB4T.js"),[]).then(i=>z(i.mirc))}}),_.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return L(()=>import("./mathematica-DTrFuWx2.js"),[]).then(i=>z(i.mathematica))}}),_.of({name:"Modelica",extensions:["mo"],load(){return L(()=>import("./modelica-Dc1JOy9r.js"),[]).then(i=>z(i.modelica))}}),_.of({name:"MUMPS",extensions:["mps"],load(){return L(()=>import("./mumps-BT43cFF4.js"),[]).then(i=>z(i.mumps))}}),_.of({name:"Mbox",extensions:["mbox"],load(){return L(()=>import("./mbox-CNhZ1qSd.js"),[]).then(i=>z(i.mbox))}}),_.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return L(()=>import("./nginx-DdIZxoE0.js"),[]).then(i=>z(i.nginx))}}),_.of({name:"NSIS",extensions:["nsh","nsi"],load(){return L(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([44,42])).then(i=>z(i.nsis))}}),_.of({name:"NTriples",extensions:["nt","nq"],load(){return L(()=>import("./ntriples-BfvgReVJ.js"),[]).then(i=>z(i.ntriples))}}),_.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.objectiveC))}}),_.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.objectiveCpp))}}),_.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return L(()=>import("./mllike-CXdrOF99.js"),[]).then(i=>z(i.oCaml))}}),_.of({name:"Octave",extensions:["m"],load(){return L(()=>import("./octave-Ck1zUtKM.js"),[]).then(i=>z(i.octave))}}),_.of({name:"Oz",extensions:["oz"],load(){return L(()=>import("./oz-BzwKVEFT.js"),[]).then(i=>z(i.oz))}}),_.of({name:"Pascal",extensions:["p","pas"],load(){return L(()=>import("./pascal--L3eBynH.js"),[]).then(i=>z(i.pascal))}}),_.of({name:"Perl",extensions:["pl","pm"],load(){return L(()=>import("./perl-CdXCOZ3F.js"),[]).then(i=>z(i.perl))}}),_.of({name:"Pig",extensions:["pig"],load(){return L(()=>import("./pig-CevX1Tat.js"),[]).then(i=>z(i.pig))}}),_.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return L(()=>import("./powershell-CFHJl5sT.js"),[]).then(i=>z(i.powerShell))}}),_.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return L(()=>import("./properties-C78fOPTZ.js"),[]).then(i=>z(i.properties))}}),_.of({name:"ProtoBuf",extensions:["proto"],load(){return L(()=>import("./protobuf-ChK-085T.js"),[]).then(i=>z(i.protobuf))}}),_.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return L(()=>import("./pug-DukmZTjD.js"),__vite__mapDeps([45,46])).then(i=>z(i.pug))}}),_.of({name:"Puppet",extensions:["pp"],load(){return L(()=>import("./puppet-DMA9R1ak.js"),[]).then(i=>z(i.puppet))}}),_.of({name:"Q",extensions:["q"],load(){return L(()=>import("./q-pXgVlZs6.js"),[]).then(i=>z(i.q))}}),_.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return L(()=>import("./r-DUYO_cvP.js"),[]).then(i=>z(i.r))}}),_.of({name:"RPM Changes",load(){return L(()=>import("./rpm-CTu-6PCP.js"),[]).then(i=>z(i.rpmChanges))}}),_.of({name:"RPM Spec",extensions:["spec"],load(){return L(()=>import("./rpm-CTu-6PCP.js"),[]).then(i=>z(i.rpmSpec))}}),_.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return L(()=>import("./ruby-B2Rjki9n.js"),[]).then(i=>z(i.ruby))}}),_.of({name:"SAS",extensions:["sas"],load(){return L(()=>import("./sas-B4kiWyti.js"),[]).then(i=>z(i.sas))}}),_.of({name:"Scala",extensions:["scala"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.scala))}}),_.of({name:"Scheme",extensions:["scm","ss"],load(){return L(()=>import("./scheme-C41bIUwD.js"),[]).then(i=>z(i.scheme))}}),_.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return L(()=>import("./shell-CjFT_Tl9.js"),[]).then(i=>z(i.shell))}}),_.of({name:"Sieve",extensions:["siv","sieve"],load(){return L(()=>import("./sieve-C3Gn_uJK.js"),[]).then(i=>z(i.sieve))}}),_.of({name:"Smalltalk",extensions:["st"],load(){return L(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(i=>z(i.smalltalk))}}),_.of({name:"Solr",load(){return L(()=>import("./solr-DehyRSwq.js"),[]).then(i=>z(i.solr))}}),_.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return L(()=>import("./mllike-CXdrOF99.js"),[]).then(i=>z(i.sml))}}),_.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return L(()=>import("./sparql-DkYu6x3z.js"),[]).then(i=>z(i.sparql))}}),_.of({name:"Spreadsheet",alias:["excel","formula"],load(){return L(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(i=>z(i.spreadsheet))}}),_.of({name:"Squirrel",extensions:["nut"],load(){return L(()=>import("./clike-B9uivgTg.js"),[]).then(i=>z(i.squirrel))}}),_.of({name:"Stylus",extensions:["styl"],load(){return L(()=>import("./stylus-B533Al4x.js"),[]).then(i=>z(i.stylus))}}),_.of({name:"Swift",extensions:["swift"],load(){return L(()=>import("./swift-BzpIVaGY.js"),[]).then(i=>z(i.swift))}}),_.of({name:"sTeX",load(){return L(()=>import("./stex-C3f8Ysf7.js"),[]).then(i=>z(i.stex))}}),_.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return L(()=>import("./stex-C3f8Ysf7.js"),[]).then(i=>z(i.stex))}}),_.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return L(()=>import("./verilog-C6RDOZhf.js"),[]).then(i=>z(i.verilog))}}),_.of({name:"Tcl",extensions:["tcl"],load(){return L(()=>import("./tcl-DVfN8rqt.js"),[]).then(i=>z(i.tcl))}}),_.of({name:"Textile",extensions:["textile"],load(){return L(()=>import("./textile-CnDTJFAw.js"),[]).then(i=>z(i.textile))}}),_.of({name:"TiddlyWiki",load(){return L(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(i=>z(i.tiddlyWiki))}}),_.of({name:"Tiki wiki",load(){return L(()=>import("./tiki-DGYXhP31.js"),[]).then(i=>z(i.tiki))}}),_.of({name:"TOML",extensions:["toml"],load(){return L(()=>import("./toml-Bm5Em-hy.js"),[]).then(i=>z(i.toml))}}),_.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return L(()=>import("./troff-wAsdV37c.js"),[]).then(i=>z(i.troff))}}),_.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return L(()=>import("./ttcn-CfJYG6tj.js"),[]).then(i=>z(i.ttcn))}}),_.of({name:"TTCN_CFG",extensions:["cfg"],load(){return L(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(i=>z(i.ttcnCfg))}}),_.of({name:"Turtle",extensions:["ttl"],load(){return L(()=>import("./turtle-B1tBg_DP.js"),[]).then(i=>z(i.turtle))}}),_.of({name:"Web IDL",extensions:["webidl"],load(){return L(()=>import("./webidl-ZXfAyPTL.js"),[]).then(i=>z(i.webIDL))}}),_.of({name:"VB.NET",extensions:["vb"],load(){return L(()=>import("./vb-CmGdzxic.js"),[]).then(i=>z(i.vb))}}),_.of({name:"VBScript",extensions:["vbs"],load(){return L(()=>import("./vbscript-BuJXcnF6.js"),[]).then(i=>z(i.vbScript))}}),_.of({name:"Velocity",extensions:["vtl"],load(){return L(()=>import("./velocity-D8B20fx6.js"),[]).then(i=>z(i.velocity))}}),_.of({name:"Verilog",extensions:["v"],load(){return L(()=>import("./verilog-C6RDOZhf.js"),[]).then(i=>z(i.verilog))}}),_.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return L(()=>import("./vhdl-lSbBsy5d.js"),[]).then(i=>z(i.vhdl))}}),_.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return L(()=>import("./xquery-CQfU5ijd.js"),[]).then(i=>z(i.xQuery))}}),_.of({name:"Yacas",extensions:["ys"],load(){return L(()=>import("./yacas-BJ4BC0dw.js"),[]).then(i=>z(i.yacas))}}),_.of({name:"Z80",extensions:["z80"],load(){return L(()=>import("./z80-Hz9HOZM7.js"),[]).then(i=>z(i.z80))}}),_.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return L(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(i=>z(i.mscgen))}}),_.of({name:"Xù",extensions:["xu"],load(){return L(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(i=>z(i.xu))}}),_.of({name:"MsGenny",extensions:["msgenny"],load(){return L(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(i=>z(i.msgenny))}}),_.of({name:"Vue",extensions:["vue"],load(){return L(()=>import("./index-DmKHPbIa.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.vue())}}),_.of({name:"Angular Template",load(){return L(()=>import("./index-DWP8iCBp.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(i=>i.angular())}})],hf=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i;class as{constructor(e,t,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?l=>s(hf(l)):hf,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Mi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=mp(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=tn(e);let r=this.normalize(t);if(r.length)for(let s=0,o=n;;s++){let l=r.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(a)return this.value=a,this;break}o==n&&s<t.length&&t.charCodeAt(s)==l&&o++}}}match(e,t,n){let r=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[s+1],to:n}:(this.matches[s]++,l=!0)),l||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(as.prototype[Symbol.iterator]=function(){return this});const a0={from:-1,to:-1,match:/.*/.exec("")},Sc="gm"+(/x/.unicode==null?"":"u");class h0{constructor(e,t,n,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=a0,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new c0(e,t,n,r,s);this.re=new RegExp(t,Sc+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=jo(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=jo(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const ea=new WeakMap;class Zn{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=ea.get(e);if(!r||r.from>=n||r.to<=t){let l=new Zn(t,e.sliceString(t,n));return ea.set(e,l),l}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to<n&&(s+=e.sliceString(r.to,n)),ea.set(e,new Zn(o,s)),new Zn(t,s.slice(t-o,n-o))}}class c0{constructor(e,t,n,r,s){this.text=e,this.to=s,this.done=!1,this.value=a0,this.matchPos=jo(e,r),this.re=new RegExp(t,Sc+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Zn.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=jo(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Zn.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(h0.prototype[Symbol.iterator]=c0.prototype[Symbol.iterator]=function(){return this});function wP(i){try{return new RegExp(i,Sc),!0}catch{return!1}}function jo(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e<t.to&&(n=t.text.charCodeAt(e-t.from))>=56320&&n<57344;)e++;return e}const QP=i=>{let{state:e}=i,t=String(e.doc.lineAt(i.state.selection.main.head).number),{close:n,result:r}=Ak(i,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){i.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,u]=o,d=c?+c.slice(1):0,f=h?+h:l.number;if(h&&u){let O=f/100;a&&(O=O*(a=="-"?-1:1)+l.number/e.doc.lines),f=Math.round(e.doc.lines*O)}else h&&a&&(f=f*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,f))),m=Z.cursor(p.from+Math.max(0,Math.min(d,p.length)));i.dispatch({effects:[n,U.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},$P=({state:i,dispatch:e})=>{let{selection:t}=i,n=Z.create(t.ranges.map(r=>i.wordAt(r.head)||Z.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function PP(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let o=!1,l=new as(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new as(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(s){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const TP=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(s=>s.from===s.to))return $P({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(s=>i.sliceDoc(s.from,s.to)!=n))return!1;let r=PP(i,n);return r?(e(i.update({selection:i.selection.addRange(Z.range(r.from,r.to),!1),effects:U.scrollIntoView(r.to)})),!0):!1},ur=te.define({combine(i){return Jo(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new BP(e),scrollToMatch:e=>U.scrollIntoView(e)})}});class u0{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||wP(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
278
|
+
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new RP(this):new _P(this)}getCursor(e,t=0,n){let r=e.doc?e:Oe.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?xn(this,r,t,n):Sn(this,r,t,n)}}class d0{constructor(e){this.spec=e}}function CP(i,e,t){return(n,r,s,o)=>{if(t&&!t(n,r,s,o))return!1;let l=n>=o&&r<=o+s.length?s.slice(n-o,r-o):e.doc.sliceString(n,r);return i(l,e,n,r)}}function Sn(i,e,t,n){let r;return i.wholeWord&&(r=AP(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(r=CP(i.test,e,r)),new as(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:s=>s.toLowerCase(),r)}function AP(i,e){return(t,n,r,s)=>((s>t||s+r.length<n)&&(s=Math.max(0,t-2),r=i.sliceString(s,Math.min(i.length,n+2))),(e(Wo(r,t-s))!=Ke.Word||e(Yo(r,t-s))!=Ke.Word)&&(e(Yo(r,n-s))!=Ke.Word||e(Wo(r,n-s))!=Ke.Word))}class _P extends d0{constructor(e){super(e)}nextMatch(e,t,n){let r=Sn(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Sn(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),o=Sn(this.spec,e,s,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Sn(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=Sn(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function EP(i,e,t){return(n,r,s)=>(!t||t(n,r,s))&&i(s[0],e,n,r)}function xn(i,e,t,n){let r;return i.wholeWord&&(r=LP(e.charCategorizer(e.selection.main.head))),i.test&&(r=EP(i.test,e,r)),new h0(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:r},t,n)}function Wo(i,e){return i.slice(Fe(i,e,!1),e)}function Yo(i,e){return i.slice(e,Fe(i,e))}function LP(i){return(e,t,n)=>!n[0].length||(i(Wo(n.input,n.index))!=Ke.Word||i(Yo(n.input,n.index))!=Ke.Word)&&(i(Yo(n.input,n.index+n[0].length))!=Ke.Word||i(Wo(n.input,n.index+n[0].length))!=Ke.Word)}class RP extends d0{nextMatch(e,t,n){let r=xn(this.spec,e,n,e.doc.length).next();return r.done&&(r=xn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=xn(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+n.slice(r)}return t})}matchAll(e,t){let n=xn(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=xn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const hs=de.define(),xc=de.define(),Bi=Ot.define({create(i){return new ta(Oh(i).create(),null)},update(i,e){for(let t of e.effects)t.is(hs)?i=new ta(t.value.create(),i.panel):t.is(xc)&&(i=new ta(i.query,t.value?wc:null));return i},provide:i=>Co.from(i,e=>e.panel)});class ta{constructor(e,t){this.query=e,this.panel=t}}const MP=xe.mark({class:"cm-searchMatch"}),ZP=xe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),XP=_t.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Bi))}update(i){let e=i.state.field(Bi);(e!=i.startState.field(Bi)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return xe.none;let{view:t}=this,n=new dn;for(let r=0,s=t.visibleRanges,o=s.length;r<o;r++){let{from:l,to:a}=s[r];for(;r<o-1&&a>s[r+1].from-2*250;)a=s[++r].to;i.highlight(t.state,l,a,(h,c)=>{let u=t.state.selection.ranges.some(d=>d.from==h&&d.to==c);n.add(h,c,u?ZP:MP)})}return n.finish()}},{decorations:i=>i.decorations});function ks(i){return e=>{let t=e.state.field(Bi,!1);return t&&t.query.spec.valid?i(e,t):m0(e)}}const No=ks((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=Z.single(n.from,n.to),s=i.state.facet(ur);return i.dispatch({selection:r,effects:[Qc(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),p0(i),!0}),Go=ks((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=Z.single(r.from,r.to),o=i.state.facet(ur);return i.dispatch({selection:s,effects:[Qc(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),p0(i),!0}),IP=ks((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:Z.create(t.map(n=>Z.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),zP=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let l=new as(i.doc,i.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(o=s.length),s.push(Z.range(l.value.from,l.value.to))}return e(i.update({selection:Z.create(s,o),userEvent:"select.search.matches"})),!0},cf=ks((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=s,l=[],a,h,c=[];o.from==n&&o.to==r&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(U.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+".")));let u=i.state.changes(l);return o&&(a=Z.single(o.from,o.to).map(u),c.push(Qc(i,o)),c.push(t.facet(ur).scrollToMatch(a.main,i))),i.dispatch({changes:u,selection:a,effects:c,userEvent:"input.replace"}),!0}),VP=ks((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:U.announce.of(n),userEvent:"input.replace.all"}),!0});function wc(i){return i.state.facet(ur).createPanel(i)}function Oh(i,e){var t,n,r,s,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=i.facet(ur);return new u0({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:h.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function f0(i){let e=Tm(i,wc);return e&&e.dom.querySelector("[main-field]")}function p0(i){let e=f0(i);e&&e==i.root.activeElement&&e.select()}const m0=i=>{let e=i.state.field(Bi,!1);if(e&&e.panel){let t=f0(i);if(t&&t!=i.root.activeElement){let n=Oh(i.state,e.query.spec);n.valid&&i.dispatch({effects:hs.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[xc.of(!0),e?hs.of(Oh(i.state,e.query.spec)):de.appendConfig.of(jP)]});return!0},O0=i=>{let e=i.state.field(Bi,!1);if(!e||!e.panel)return!1;let t=Tm(i,wc);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:xc.of(!1)}),!0},DP=[{key:"Mod-f",run:m0,scope:"editor search-panel"},{key:"F3",run:No,shift:Go,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:No,shift:Go,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:O0,scope:"editor search-panel"},{key:"Mod-Shift-l",run:zP},{key:"Mod-Alt-g",run:QP},{key:"Mod-d",run:TP,preventDefault:!0}];class BP{constructor(e){this.view=e;let t=this.query=e.state.field(Bi).query.spec;this.commit=this.commit.bind(this),this.searchField=Ne("input",{value:t.search,placeholder:vt(e,"Find"),"aria-label":vt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ne("input",{value:t.replace,placeholder:vt(e,"Replace"),"aria-label":vt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ne("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ne("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ne("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return Ne("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Ne("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>No(e),[vt(e,"next")]),n("prev",()=>Go(e),[vt(e,"previous")]),n("select",()=>IP(e),[vt(e,"all")]),Ne("label",null,[this.caseField,vt(e,"match case")]),Ne("label",null,[this.reField,vt(e,"regexp")]),Ne("label",null,[this.wordField,vt(e,"by word")]),...e.state.readOnly?[]:[Ne("br"),this.replaceField,n("replace",()=>cf(e),[vt(e,"replace")]),n("replaceAll",()=>VP(e),[vt(e,"replace all")])],Ne("button",{name:"close",onclick:()=>O0(e),"aria-label":vt(e,"close"),type:"button"},["×"])])}commit(){let e=new u0({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:hs.of(e)}))}keydown(e){pk(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Go:No)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),cf(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(hs)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ur).top}}function vt(i,e){return i.state.phrase(e)}const Gs=30,Fs=/[\s\.,:;?!]/;function Qc(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-Gs),o=Math.min(r,t+Gs),l=i.state.sliceDoc(s,o);if(s!=n.from){for(let a=0;a<Gs;a++)if(!Fs.test(l[a+1])&&Fs.test(l[a])){l=l.slice(a);break}}if(o!=r){for(let a=l.length-1;a>l.length-Gs;a--)if(!Fs.test(l[a-1])&&Fs.test(l[a])){l=l.slice(0,a);break}}return U.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}const qP=U.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),jP=[Bi,Pi.low(XP),qP],WP=(i,e,t)=>{const n=P("editorId"),r=P("setting");let s=()=>{},o=()=>{};const l=()=>{var d;s();const a=(d=t.value)==null?void 0:d.view.contentDOM.getRootNode(),h=a==null?void 0:a.querySelector(`#${n} .cm-scroller`),c=a==null?void 0:a.querySelector(`[id="${n}-preview-wrapper"]`),u=a==null?void 0:a.querySelector(`[id="${n}-html-wrapper"]`);(c||u)&&([o,s]=(c?nb:ib)(h,c||u,t.value),i.scrollAuto&&o())};le([e,r],()=>{Dt(l)}),le(()=>i.scrollAuto,a=>{a?o():s()}),le(()=>r.value.previewOnly,a=>{a?s():o()}),Ee(l)},ia=async(i,e,t)=>{if(/^h[1-6]$/.test(i))return YP(i,e);if(i==="prettier")return await NP(e,t);switch(i){case"bold":case"underline":case"italic":case"strikeThrough":case"sub":case"sup":case"codeRow":case"katexInline":case"katexBlock":return FP(i,e);case"quote":case"orderedList":case"unorderedList":case"task":return HP(i,e);case"code":return KP(t,e);case"table":return tT(t);case"link":{const n=e.getSelectedText(),{desc:r=n,url:s=""}=t,o=`[${r}](${s})`;return{text:o,options:{select:s==="",deviationStart:o.length-s.length-1,deviationEnd:-1}}}case"image":return eT(t,e);case"flow":case"sequence":case"gantt":case"class":case"state":case"pie":case"relationship":case"journey":return JP(i);case"universal":return iT(e.getSelectedText(),t);default:return{text:"",options:{}}}},YP=(i,e)=>{const t=i.slice(1),n="#".repeat(Number(t)),[r,s,o]=$c(e,{wholeLine:!0});return{text:`${n} ${r}`,options:{deviationStart:n.length+1,replaceStart:s,replaceEnd:o}}},NP=async(i,e)=>{var r,s,o;const t=window.prettier||((r=ze.editorExtensions.prettier)==null?void 0:r.prettierInstance),n=[((s=window.prettierPlugins)==null?void 0:s.markdown)||((o=ze.editorExtensions.prettier)==null?void 0:o.parserMarkdownInstance)];return!t||!n[0]?(X.emit(e.editorId,Oi,{name:"prettier",message:"prettier is undefined"}),{text:i.getValue(),options:{select:!1,replaceAll:!0}}):{text:await t.format(i.getValue(),{parser:"markdown",plugins:n}),options:{select:!1,replaceAll:!0}}},GP={bold:["**","**",2,-2],underline:["<u>","</u>",3,-4],italic:["*","*",1,-1],strikeThrough:["~~","~~",2,-2],sub:["~","~",1,-1],sup:["^","^",1,-1],codeRow:["`","`",1,-1],katexInline:["$","$",1,-1],katexBlock:[`
|
|
279
|
+
$$
|
|
280
|
+
`,`
|
|
281
|
+
$$
|
|
282
|
+
`,4,-4]},FP=(i,e)=>{const t=e.getSelectedText(),[n,r,s,o]=GP[i];return{text:`${n}${t}${r}`,options:{deviationStart:s,deviationEnd:o}}},UP={quote:"> ",unorderedList:"- ",orderedList:1,task:"- [ ] "},HP=(i,e)=>{const[t,n,r]=$c(e,{wholeLine:!0}),s=t.split(`
|
|
283
|
+
`),o=UP[i],l=i==="orderedList"?s.map((c,u)=>`${o+u}. ${c}`):s.map(c=>`${o}${c}`),a=i==="orderedList"?"1. ":o.toString(),h=s.length===1?a.length:0;return{text:l.join(`
|
|
284
|
+
`),options:{deviationStart:h,replaceStart:n,replaceEnd:r}}},KP=(i,e)=>{const[t,n,r]=$c(e),s=i.mode||"language",o=`
|
|
285
|
+
\`\`\`${s}
|
|
286
|
+
${i.text||t||""}
|
|
287
|
+
\`\`\`
|
|
288
|
+
`;return{text:o,options:{deviationStart:4,deviationEnd:4+s.length-o.length,replaceStart:n,replaceEnd:r}}},JP=i=>({text:`
|
|
289
|
+
\`\`\`mermaid
|
|
290
|
+
${{flow:`flowchart TD
|
|
291
|
+
Start --> Stop`,sequence:`sequenceDiagram
|
|
292
|
+
A->>B: hello!
|
|
293
|
+
B-->>A: hi!`,gantt:`gantt
|
|
294
|
+
title Gantt Chart
|
|
295
|
+
dateFormat YYYY-MM-DD`,class:`classDiagram
|
|
296
|
+
class Animal`,state:`stateDiagram-v2
|
|
297
|
+
s1 --> s2`,pie:`pie
|
|
298
|
+
"Dogs" : 386
|
|
299
|
+
"Cats" : 85
|
|
300
|
+
"Rats" : 15`,relationship:`erDiagram
|
|
301
|
+
CAR ||--o{ NAMED-DRIVER : allows`,journey:`journey
|
|
302
|
+
title My Journey`,...ze.editorConfig.mermaidTemplate}[i]}
|
|
303
|
+
\`\`\`
|
|
304
|
+
`,options:{deviationStart:12,deviationEnd:-5}}),eT=(i,e)=>{const t=e.getSelectedText(),{desc:n=t,url:r="",urls:s}=i;let o="";const l=r===""&&(!s||s instanceof Array&&s.length===0);return s instanceof Array?o=s.reduce((a,h)=>{const{url:c="",alt:u="",title:d=""}=typeof h=="object"?h:{url:h};return a+`
|
|
305
|
+
`},""):o=`
|
|
306
|
+
`,{text:o,options:{select:r==="",deviationStart:l?o.length-r.length-2:o.length,deviationEnd:l?-2:0}}},tT=i=>{const{selectedShape:e={x:1,y:1}}=i,{x:t,y:n}=e;let r=`
|
|
307
|
+
| Column`;for(let s=0;s<=n;s++)r+=" |";r+=`
|
|
308
|
+
|`;for(let s=0;s<=n;s++)r+=" - |";for(let s=0;s<=t;s++){r+=`
|
|
309
|
+
|`;for(let o=0;o<=n;o++)r+=" |"}return r+=`
|
|
310
|
+
`,{text:r,options:{deviationStart:3,deviationEnd:10-r.length}}},iT=(i,e)=>{const{generate:t}=e,n=t(i);return{text:n.targetValue,options:{select:n.select??!0,deviationStart:n.deviationStart||0,deviationEnd:n.deviationEnd||0}}},$c=(i,e={wholeLine:!1})=>{const t=i.view.state,n=t.selection.main;if(n.empty){const r=t.doc.lineAt(n.from);return[t.doc.lineAt(n.from).text,r.from,r.to]}else if(e.wholeLine){const r=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);return[t.doc.sliceString(r.from,s.to),r.from,s.to]}return[t.doc.sliceString(n.from,n.to),n.from,n.to]},yn=i=>{const e=new hi;return t=>(e.get(i.state)?i.dispatch({effects:e.reconfigure(t)}):i.dispatch({effects:de.appendConfig.of(e.of(t))}),!0)};class nT{constructor(e){ve(this,"view");ve(this,"maxLength",Number.MAX_SAFE_INTEGER);ve(this,"toggleTabSize");ve(this,"togglePlaceholder");ve(this,"setExtensions");ve(this,"toggleDisabled");ve(this,"toggleReadOnly");ve(this,"toggleMaxlength");this.view=e,this.toggleTabSize=yn(this.view),this.togglePlaceholder=yn(this.view),this.setExtensions=yn(this.view),this.toggleDisabled=yn(this.view),this.toggleReadOnly=yn(this.view),this.toggleMaxlength=yn(this.view)}getValue(){return this.view.state.doc.toString()}setValue(e,t=0,n=this.view.state.doc.length){this.view.dispatch({changes:{from:t,to:n,insert:e}})}getSelectedText(){const{from:e,to:t}=this.view.state.selection.main;return this.view.state.sliceDoc(e,t)}replaceSelectedText(e,t,n){const r={select:!0,deviationStart:0,deviationEnd:0,replaceAll:!1,replaceStart:-1,replaceEnd:-1,...t};try{if(r.replaceAll){if(this.setValue(e),e.length>this.maxLength)throw new Error("The input text is too long");return}if(this.view.state.doc.length-this.getSelectedText().length+e.length>this.maxLength)throw new Error("The input text is too long");const{from:s}=this.view.state.selection.main;r.replaceStart!==-1?this.view.dispatch({changes:{from:r.replaceStart,to:r.replaceEnd,insert:e}}):this.view.dispatch(this.view.state.replaceSelection(e)),r.select&&this.view.dispatch({selection:{anchor:r.replaceStart===-1?s+r.deviationStart:r.replaceStart+r.deviationStart,head:r.replaceStart===-1?s+e.length+r.deviationEnd:r.replaceStart+e.length+r.deviationEnd}}),this.view.focus()}catch(s){if(s.message==="The input text is too long")X.emit(n,Oi,{name:"overlength",message:s.message,data:e});else throw s}}setTabSize(e){this.toggleTabSize([Oe.tabSize.of(e),lr.of(" ".repeat(e))])}setPlaceholder(e){this.togglePlaceholder(Qk(e))}focus(e){if(this.view.focus(),!e)return;let t=0,n=0,r=0;switch(e){case"start":break;case"end":{t=n=r=this.getValue().length;break}default:t=e.rangeAnchor||e.cursorPos,n=e.rangeHead||e.cursorPos,r=e.cursorPos}this.view.dispatch({scrollIntoView:!0,selection:Z.create([Z.range(t,n),Z.cursor(r)],1)})}setDisabled(e){this.toggleDisabled([U.editable.of(!e)])}setReadOnly(e){this.toggleReadOnly([Oe.readOnly.of(e)])}setMaxLength(e){this.maxLength=e,this.toggleMaxlength([Oe.changeFilter.of(t=>t.newDoc.length<=e)])}}const rT=(i,e)=>{if(i===e)return!0;if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0},sT=(i,e)=>{const t=he(e.value);le([e],()=>{(!t.value||!rT(t.value,e.value))&&(t.value=e.value,i())})},Us=(i,e,t,n,r)=>(s,o,l,a)=>{const h=`${i}${e}${t}${n}`,c=l+o.label.length+(r==="title"?t.length:0);s.dispatch({changes:{from:l,to:a,insert:h},selection:Z.create([Z.range(l+o.label.length+(r==="title"?1:-e.length),c),Z.cursor(c)],1)}),s.focus()},uf=i=>(e,t,n,r)=>{const s=i.slice(r-n);e.dispatch(e.state.replaceSelection(`${s} `))},df=i=>{const e=t=>{const n=t.matchBefore(/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/);return n===null||n.from==n.to&&t.explicit?null:{from:n.from,options:[...["h2","h3","h4","h5","h6"].map((r,s)=>{const o=new Array(s+2).fill("#").join("");return{label:o,type:"text",apply:uf(o)}}),...["unchecked","checked"].map(r=>{const s=r==="checked"?"- [x]":"- [ ]";return{label:s,type:"text",apply:uf(s)}}),...[["`",""],["```","language"],["```mermaid\n",""],["```echarts\n",""]].map(r=>({label:`${r[0]}${r[1]}`,type:"text",apply:Us(r[0],r[1],"",r[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col |
|
|
311
|
+
| - | - | - |
|
|
312
|
+
| content | content | content |
|
|
313
|
+
| content | content | content |`},{label:"$",type:"text",apply:Us("$","","","$","type")},{label:"$$",type:"text",apply:Us("$$","",`
|
|
314
|
+
`,`
|
|
315
|
+
$$`,"title")},...["note","abstract","info","tip","success","question","warning","failure","danger","bug","example","quote","hint","caution","error","attention"].map(r=>({label:`!!! ${r}`,type:"text",apply:Us("!!!",` ${r}`," Title",`
|
|
316
|
+
|
|
317
|
+
!!!`,"title")}))]}};return vw({override:i?[e,...i]:[e]})},oT=ie({name:`${v}-divider`,setup(){return()=>w("div",{class:`${v}-divider`},null)}}),lT=ie({name:"ToolbarBold",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.bold,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.bold,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"bold")},type:"button"},[w(be,{name:"bold"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.bold])])}}}),aT=ie({name:"ToolbarCatalog",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=P("catalogVisible");return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,r.value&&`${v}-toolbar-active`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(s=e.value.toolbarTips)==null?void 0:s.catalog,"aria-label":(o=e.value.toolbarTips)==null?void 0:o.catalog,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,Sh)},key:"bar-catalog",type:"button"},[w(be,{name:"catalog"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=e.value.toolbarTips)==null?void 0:l.catalog])])}}}),hT=ie({name:"ToolbarCode",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.code,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.code,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"code")},type:"button"},[w(be,{name:"code"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.code])])}}}),cT=ie({name:"ToolbarCodeRow",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.codeRow,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.codeRow,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"codeRow")},type:"button"},[w(be,{name:"code-row"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.codeRow])])}}}),uT=ie({name:"ToolbarFullscreen",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName"),n=P("setting"),{fullscreenHandler:r}=qT();return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,n.value.fullscreen&&`${v}-toolbar-active`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(s=i.value.toolbarTips)==null?void 0:s.fullscreen,"aria-label":(o=i.value.toolbarTips)==null?void 0:o.fullscreen,disabled:e==null?void 0:e.value,onClick:()=>{r()},type:"button"},[w(be,{name:n.value.fullscreen?"fullscreen-exit":"fullscreen"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=i.value.toolbarTips)==null?void 0:l.fullscreen])])}}}),dT=ie({name:"ToolbarGithub",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName");return()=>{var n,r,s;return w("button",{class:[`${v}-toolbar-item`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(n=i.value.toolbarTips)==null?void 0:n.github,"aria-label":(r=i.value.toolbarTips)==null?void 0:r.github,disabled:e==null?void 0:e.value,onClick:()=>{X0("https://github.com/imzbf/md-editor-v3")},type:"button"},[w(be,{name:"github"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(s=i.value.toolbarTips)==null?void 0:s.github])])}}}),fT=ie({name:"ToolbarHtmlPreview",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName"),n=P("setting"),r=P("updateSetting");return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,n.value.htmlPreview&&`${v}-toolbar-active`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(s=i.value.toolbarTips)==null?void 0:s.htmlPreview,"aria-label":(o=i.value.toolbarTips)==null?void 0:o.htmlPreview,disabled:e==null?void 0:e.value,onClick:()=>{r("htmlPreview")},type:"button"},[w(be,{name:"preview-html"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=i.value.toolbarTips)==null?void 0:l.htmlPreview])])}}}),pT=ie({name:"ToolbarImage",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.image,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.image,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"image")},type:"button"},[w(be,{name:"image"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.image])])}}}),mT={visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},OT=ie({name:`${v}-modal-clip`,props:mT,setup(i){const e=P("usedLanguageText"),t=P("editorId"),n=P("rootRef");let r=ze.editorExtensions.cropper.instance;const s=he(),o=he(),l=he(),a=zt({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let h=null;le(()=>i.visible,()=>{i.visible&&!a.cropperInited&&(r=r||window.Cropper,s.value.onchange=()=>{if(!r){X.emit(t,Oi,{name:"Cropper",message:"Cropper is undefined"});return}const d=s.value.files||[];if(a.imgSelected=!0,(d==null?void 0:d.length)>0){const f=new FileReader;f.onload=p=>{a.imgSrc=p.target.result},f.readAsDataURL(d[0])}})}),le(()=>[a.imgSelected],()=>{l.value.style=""}),le([ua(()=>a.isFullscreen),ua(()=>a.imgSrc)],()=>{a.imgSrc&&Dt(()=>{h==null||h.destroy(),l.value.style="",o.value&&(h=new r(o.value,{viewMode:2,preview:n.value.getRootNode().querySelector(`.${v}-clip-preview-target`)}))})});const c=()=>{h.clear(),h.destroy(),h=null,s.value.value="",a.imgSelected=!1,a.imgSrc=""},u=d=>{a.isFullscreen=d};return()=>{var d;return w(Tn,{class:`${v}-modal-clip`,title:(d=e.value.clipModalTips)==null?void 0:d.title,visible:i.visible,onClose:i.onCancel,showAdjust:!0,isFullscreen:a.isFullscreen,onAdjust:u,width:"668px",height:"421px"},{default:()=>{var f,p,m;return[w("div",{class:`${v}-form-item ${v}-clip`},[w("div",{class:`${v}-clip-main`},[a.imgSelected?w("div",{class:`${v}-clip-cropper`},[w("img",{src:a.imgSrc,ref:o,style:{display:"none"},alt:""},null),w("div",{class:`${v}-clip-delete`,onClick:c},[w(be,{name:"delete"},null)])]):w("div",{class:`${v}-clip-upload`,onClick:()=>{s.value.click()},role:"button",tabindex:"0","aria-label":(f=e.value.imgTitleItem)==null?void 0:f.upload},[w(be,{name:"upload"},null)])]),w("div",{class:`${v}-clip-preview`},[w("div",{class:`${v}-clip-preview-target`,ref:l},null)])]),w("div",{class:`${v}-form-item`},[w("button",{class:`${v}-btn`,type:"button",onClick:()=>{if(h){const O=h.getCroppedCanvas();X.emit(t,Ko,[K0(O.toDataURL("image/png"))],i.onOk),c()}}},[((p=e.value.clipModalTips)==null?void 0:p.buttonUpload)||((m=e.value.linkModalTips)==null?void 0:m.buttonOK)])]),w("input",{ref:s,accept:"image/*",type:"file",multiple:!1,style:{display:"none"},"aria-hidden":"true"},null)]}})}}}),gT={clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},bT=ie({name:`${v}-modals`,props:gT,setup(i){return()=>w(OT,{visible:i.clipVisible,onOk:i.onOk,onCancel:i.onCancel},null)}}),vT=ie({name:"ToolbarImageDropdown",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=`${i}-toolbar-wrapper`,s=he(!1),o=he(!1),l=he(),a=()=>{X.emit(i,Ko,Array.from(l.value.files||[])),l.value.value=""},h=(p,m)=>{t!=null&&t.value||X.emit(i,re,p,m)};Ee(()=>{l.value.addEventListener("change",a)});const c=p=>{s.value=p},u=()=>{o.value=!1},d=p=>{p&&h("image",{desc:p.desc,url:p.url,transform:!0}),o.value=!1},f=ke(()=>{var p,m,O;return w("ul",{class:`${v}-menu`,onClick:()=>{s.value=!1},role:"menu"},[w("li",{class:`${v}-menu-item ${v}-menu-item-image`,onClick:()=>{h("image")},role:"menuitem",tabindex:"0"},[(p=e.value.imgTitleItem)==null?void 0:p.link]),w("li",{class:`${v}-menu-item ${v}-menu-item-image`,onClick:()=>{l.value.click()},role:"menuitem",tabindex:"0"},[(m=e.value.imgTitleItem)==null?void 0:m.upload]),w("li",{class:`${v}-menu-item ${v}-menu-item-image`,onClick:()=>{o.value=!0},role:"menuitem",tabindex:"0"},[(O=e.value.imgTitleItem)==null?void 0:O.clip2upload])])});return()=>{var p;return w(ds,null,[w("label",{for:`${r}_label`,style:{display:"none"},"aria-label":(p=e.value.imgTitleItem)==null?void 0:p.upload},null),w("input",{id:`${r}_label`,ref:l,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),w(rr,{relative:`#${r}`,visible:s.value,onChange:c,disabled:t==null?void 0:t.value,overlay:f.value},{default:()=>{var m,O,g;return[w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(m=e.value.toolbarTips)==null?void 0:m.image,"aria-label":(O=e.value.toolbarTips)==null?void 0:O.image,disabled:t==null?void 0:t.value,type:"button"},[w(be,{name:"image"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(g=e.value.toolbarTips)==null?void 0:g.image])])]}}),w(bT,{clipVisible:o.value,onCancel:u,onOk:d},null)])}}}),yT=ie({name:"ToolbarItalic",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.italic,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.italic,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"italic")},type:"button"},[w(be,{name:"italic"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.italic])])}}}),kT=ie({name:"ToolbarKatex",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=`${i}-toolbar-wrapper`,s=he(!1),o=h=>{t!=null&&t.value||X.emit(i,re,h)},l=h=>{s.value=h},a=ke(()=>{var h,c;return w("ul",{class:`${v}-menu`,onClick:()=>{s.value=!1},role:"menu"},[w("li",{class:`${v}-menu-item ${v}-menu-item-katex`,onClick:()=>{o("katexInline")},role:"menuitem",tabindex:"0"},[(h=e.value.katex)==null?void 0:h.inline]),w("li",{class:`${v}-menu-item ${v}-menu-item-katex`,onClick:()=>{o("katexBlock")},role:"menuitem",tabindex:"0"},[(c=e.value.katex)==null?void 0:c.block])])});return()=>w(rr,{relative:`#${r}`,visible:s.value,onChange:l,disabled:t==null?void 0:t.value,overlay:a.value,key:"bar-katex"},{default:()=>{var h,c,u;return[w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(h=e.value.toolbarTips)==null?void 0:h.katex,"aria-label":(c=e.value.toolbarTips)==null?void 0:c.katex,disabled:t==null?void 0:t.value,type:"button"},[w(be,{name:"formula"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(u=e.value.toolbarTips)==null?void 0:u.katex])])]}})}}),ST=ie({name:"ToolbarLink",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.link,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.link,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"link")},type:"button"},[w(be,{name:"link"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.link])])}}}),xT=ie({name:"ToolbarMermaid",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=`${i}-toolbar-wrapper`,s=he(!1),o=h=>{t!=null&&t.value||X.emit(i,re,h)},l=h=>{s.value=h},a=ke(()=>{var h,c,u,d,f,p,m,O;return w("ul",{class:`${v}-menu`,onClick:()=>{s.value=!1},role:"menu"},[w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("flow")},role:"menuitem",tabindex:"0"},[(h=e.value.mermaid)==null?void 0:h.flow]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("sequence")},role:"menuitem",tabindex:"0"},[(c=e.value.mermaid)==null?void 0:c.sequence]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("gantt")},role:"menuitem",tabindex:"0"},[(u=e.value.mermaid)==null?void 0:u.gantt]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("class")},role:"menuitem",tabindex:"0"},[(d=e.value.mermaid)==null?void 0:d.class]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("state")},role:"menuitem",tabindex:"0"},[(f=e.value.mermaid)==null?void 0:f.state]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("pie")},role:"menuitem",tabindex:"0"},[(p=e.value.mermaid)==null?void 0:p.pie]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("relationship")},role:"menuitem",tabindex:"0"},[(m=e.value.mermaid)==null?void 0:m.relationship]),w("li",{class:`${v}-menu-item ${v}-menu-item-mermaid`,onClick:()=>{o("journey")},role:"menuitem",tabindex:"0"},[(O=e.value.mermaid)==null?void 0:O.journey])])});return()=>w(rr,{relative:`#${r}`,visible:s.value,onChange:l,disabled:t==null?void 0:t.value,overlay:a.value,key:"bar-mermaid"},{default:()=>{var h,c,u;return[w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(h=e.value.toolbarTips)==null?void 0:h.mermaid,"aria-label":(c=e.value.toolbarTips)==null?void 0:c.mermaid,disabled:t==null?void 0:t.value,type:"button"},[w(be,{name:"mermaid"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(u=e.value.toolbarTips)==null?void 0:u.mermaid])])]}})}}),wT=ie({name:"ToolbarNext",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.next,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.next,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,jf)},type:"button"},[w(be,{name:"next"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.next])])}}}),QT=ie({name:"ToolbarOrderedList",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.orderedList,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.orderedList,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"orderedList")},type:"button"},[w(be,{name:"ordered-list"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.orderedList])])}}}),$T=ie({name:"ToolbarPageFullscreen",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName"),n=P("setting"),r=P("updateSetting");return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,n.value.pageFullscreen&&`${v}-toolbar-active`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(s=i.value.toolbarTips)==null?void 0:s.pageFullscreen,"aria-label":(o=i.value.toolbarTips)==null?void 0:o.pageFullscreen,disabled:e==null?void 0:e.value,onClick:()=>{r("pageFullscreen")},type:"button"},[w(be,{name:n.value.pageFullscreen?"minimize":"maximize"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=i.value.toolbarTips)==null?void 0:l.pageFullscreen])])}}}),PT=ie({name:"ToolbarPrettier",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.prettier,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.prettier,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"prettier")},type:"button"},[w(be,{name:"prettier"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.prettier])])}}}),TT=ie({name:"ToolbarPreview",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName"),n=P("setting"),r=P("updateSetting");return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,n.value.preview&&`${v}-toolbar-active`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(s=i.value.toolbarTips)==null?void 0:s.preview,"aria-label":(o=i.value.toolbarTips)==null?void 0:o.preview,disabled:e==null?void 0:e.value,onClick:()=>{r("preview")},type:"button"},[w(be,{name:"preview"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=i.value.toolbarTips)==null?void 0:l.preview])])}}}),CT=ie({name:"ToolbarPreviewOnly",setup(){const i=P("usedLanguageText"),e=P("disabled"),t=P("showToolbarName"),n=P("setting"),r=P("updateSetting");return()=>{var s,o,l;return w("button",{class:[`${v}-toolbar-item`,n.value.previewOnly&&`${v}-toolbar-active`,(e==null?void 0:e.value)&&`${v}-disabled`],title:(s=i.value.toolbarTips)==null?void 0:s.previewOnly,"aria-label":(o=i.value.toolbarTips)==null?void 0:o.previewOnly,disabled:e==null?void 0:e.value,onClick:()=>{r("previewOnly")},type:"button"},[w(be,{name:"preview-only"},null),(t==null?void 0:t.value)&&w("div",{class:`${v}-toolbar-item-name`},[(l=i.value.toolbarTips)==null?void 0:l.previewOnly])])}}}),AT=ie({name:"ToolbarQuote",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.quote,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.quote,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"quote")},type:"button"},[w(be,{name:"quote"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.quote])])}}}),_T=ie({name:"ToolbarRevoke",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.revoke,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.revoke,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,qf)},type:"button"},[w(be,{name:"revoke"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.revoke])])}}}),ET=ie({name:"ToolbarSave",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.save,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.save,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,Ho)},type:"button"},[w(be,{name:"save"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.save])])}}}),LT=ie({name:"ToolbarStrikeThrough",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.strikeThrough,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.strikeThrough,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"strikeThrough")},type:"button"},[w(be,{name:"strike-through"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.strikeThrough])])}}}),RT=ie({name:"ToolbarSub",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.sub,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.sub,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"sub")},type:"button"},[w(be,{name:"sub"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.sub])])}}}),MT=ie({name:"ToolbarSup",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.sup,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.sup,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"sup")},type:"button"},[w(be,{name:"sup"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.sup])])}}}),ZT={tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}},XT=ie({name:"TableShape",props:ZT,setup(i){const e=zt({x:-1,y:-1}),t=ke(()=>JSON.stringify(i.tableShape)),n=()=>{const s=[...JSON.parse(t.value)];return(!s[2]||s[2]<s[0])&&(s[2]=s[0]),(!s[3]||s[3]<s[3])&&(s[3]=s[1]),s},r=he(n());return le([t],()=>{r.value=n()}),()=>w("div",{class:`${v}-table-shape`,onMouseleave:()=>{r.value=n(),e.x=-1,e.y=-1}},[new Array(r.value[1]).fill("").map((s,o)=>w("div",{class:`${v}-table-shape-row`,key:`table-shape-row-${o}`},[new Array(r.value[0]).fill("").map((l,a)=>w("div",{class:`${v}-table-shape-col`,key:`table-shape-col-${a}`,onMouseenter:()=>{e.x=o,e.y=a,a+1===r.value[0]&&a+1<r.value[2]?r.value[0]++:a+2<r.value[0]&&r.value[0]>i.tableShape[0]&&r.value[0]--,o+1===r.value[1]&&o+1<r.value[3]?r.value[1]++:o+2<r.value[1]&&r.value[1]>i.tableShape[1]&&r.value[1]--},onClick:()=>{i.onSelected(e)}},[w("div",{class:[`${v}-table-shape-col-default`,o<=e.x&&a<=e.y&&`${v}-table-shape-col-include`]},null)]))]))])}}),IT=ie({name:"ToolbarTable",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=P("tableShape"),s=`${i}-toolbar-wrapper`,o=he(!1),l=c=>{o.value=c},a=c=>{t!=null&&t.value||X.emit(i,re,"table",{selectedShape:c})},h=ke(()=>w(XT,{tableShape:r.value,onSelected:a},null));return()=>w(rr,{relative:`#${s}`,visible:o.value,onChange:l,disabled:t==null?void 0:t.value,key:"bar-table",overlay:h.value},{default:()=>{var c,u,d;return[w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(c=e.value.toolbarTips)==null?void 0:c.table,"aria-label":(u=e.value.toolbarTips)==null?void 0:u.table,disabled:t==null?void 0:t.value,type:"button"},[w(be,{name:"table"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(d=e.value.toolbarTips)==null?void 0:d.table])])]}})}}),zT=ie({name:"ToolbarTask",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.task,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.task,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"task")},type:"button"},[w(be,{name:"task"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.task])])}}}),VT=ie({name:"ToolbarTitle",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName"),r=`${i}-toolbar-wrapper`,s=he(!1),o=h=>{t!=null&&t.value||X.emit(i,re,h)},l=h=>{s.value=h},a=ke(()=>{var h,c,u,d,f,p;return w("ul",{class:`${v}-menu`,onClick:()=>{s.value=!1},role:"menu"},[w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h1")},role:"menuitem",tabindex:"0"},[(h=e.value.titleItem)==null?void 0:h.h1]),w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h2")},role:"menuitem",tabindex:"0"},[(c=e.value.titleItem)==null?void 0:c.h2]),w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h3")},role:"menuitem",tabindex:"0"},[(u=e.value.titleItem)==null?void 0:u.h3]),w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h4")},role:"menuitem",tabindex:"0"},[(d=e.value.titleItem)==null?void 0:d.h4]),w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h5")},role:"menuitem",tabindex:"0"},[(f=e.value.titleItem)==null?void 0:f.h5]),w("li",{class:`${v}-menu-item ${v}-menu-item-title`,onClick:()=>{o("h6")},role:"menuitem",tabindex:"0"},[(p=e.value.titleItem)==null?void 0:p.h6])])});return()=>w(rr,{relative:`#${r}`,visible:s.value,onChange:l,disabled:t==null?void 0:t.value,overlay:a.value},{default:()=>{var h,c,u;return[w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],disabled:t==null?void 0:t.value,title:(h=e.value.toolbarTips)==null?void 0:h.title,"aria-label":(c=e.value.toolbarTips)==null?void 0:c.title,type:"button"},[w(be,{name:"title"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(u=e.value.toolbarTips)==null?void 0:u.title])])]}})}}),DT=ie({name:"ToolbarUnderline",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.underline,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.underline,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"underline")},type:"button"},[w(be,{name:"underline"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.underline])])}}}),BT=ie({name:"ToolbarUnorderedList",setup(){const i=P("editorId"),e=P("usedLanguageText"),t=P("disabled"),n=P("showToolbarName");return()=>{var r,s,o;return w("button",{class:[`${v}-toolbar-item`,(t==null?void 0:t.value)&&`${v}-disabled`],title:(r=e.value.toolbarTips)==null?void 0:r.unorderedList,"aria-label":(s=e.value.toolbarTips)==null?void 0:s.unorderedList,disabled:t==null?void 0:t.value,onClick:()=>{X.emit(i,re,"unorderedList")},type:"button"},[w(be,{name:"unordered-list"},null),(n==null?void 0:n.value)&&w("div",{class:`${v}-toolbar-item-name`},[(o=e.value.toolbarTips)==null?void 0:o.unorderedList])])}}}),qT=()=>{const i=P("editorId"),e=P("setting"),t=P("updateSetting"),{editorExtensions:n,editorExtensionsAttrs:r}=ze;let s=n.screenfull.instance;const o=he(!1),l=c=>{if(!s){X.emit(i,Oi,{name:"fullscreen",message:"fullscreen is undefined"});return}s.isEnabled?(o.value=!0,(c===void 0?!s.isFullscreen:c)?s.request():s.exit()):console.error("browser does not support screenfull!")},a=()=>{s&&s.isEnabled&&s.on("change",()=>{(o.value||e.value.fullscreen)&&(o.value=!1,t("fullscreen"))})},h=()=>{s=window.screenfull,a()};return Ee(()=>{var c;a(),s||Tt("script",{...(c=r.screenfull)==null?void 0:c.js,src:n.screenfull.js,id:lt.screenfull,onload:h},"screenfull")}),Ee(()=>{X.on(i,{name:Bf,callback:l})}),{fullscreenHandler:l}};let jT=0;const g0=()=>{const i=P("editorId"),e=P("theme"),t=P("previewTheme"),n=P("language"),r=P("disabled"),s=P("noUploadImg"),o=P("noPrettier"),l=P("codeTheme"),a=P("showToolbarName"),h=P("setting"),c=P("defToolbars");return{barRender:u=>{var d,f,p,m,O,g,b,Q,x,k,$,C,T;if(yh.includes(u))switch(u){case"-":return w(oT,{key:`bar-${jT++}`},null);case"bold":return w(lT,{key:"bar-bold"},null);case"underline":return w(DT,{key:"bar-unorderline"},null);case"italic":return w(yT,{key:"bar-italic"},null);case"strikeThrough":return w(LT,{key:"bar-strikeThrough"},null);case"title":return w(VT,{key:"bar-title"},null);case"sub":return w(RT,{key:"bar-sub"},null);case"sup":return w(MT,{key:"bar-sup"},null);case"quote":return w(AT,{key:"bar-quote"},null);case"unorderedList":return w(BT,{key:"bar-unorderedList"},null);case"orderedList":return w(QT,{key:"bar-orderedList"},null);case"task":return w(zT,{key:"bar-task"},null);case"codeRow":return w(cT,{key:"bar-codeRow"},null);case"code":return w(hT,{key:"bar-code"},null);case"link":return w(ST,{key:"bar-link"},null);case"image":return s?w(pT,{key:"bar-image"},null):w(vT,{key:"bar-imageDropdown"},null);case"table":return w(IT,{key:"bar-table"},null);case"revoke":return w(_T,{key:"bar-revoke"},null);case"next":return w(wT,{key:"bar-next"},null);case"save":return w(ET,{key:"bar-save"},null);case"prettier":return!o&&w(PT,{key:"bar-prettier"},null);case"pageFullscreen":return!h.value.fullscreen&&w($T,{key:"bar-pageFullscreen"},null);case"fullscreen":return w(uT,{key:"bar-fullscreen"},null);case"catalog":return w(aT,{key:"bar-catalog"},null);case"preview":return w(TT,{key:"bar-preview"},null);case"previewOnly":return w(CT,{key:"bar-previewOnly"},null);case"htmlPreview":return w(fT,{key:"bar-htmlPreview"},null);case"github":return w(dT,{key:"bar-github"},null);case"mermaid":return w(xT,{key:"bar-mermaid"},null);case"katex":return w(kT,{key:"bar-katex"},null)}else if(c.value instanceof Array){const A=c.value[u];return A?qr(A,{theme:((d=A.props)==null?void 0:d.theme)||e.value,previewTheme:((f=A.props)==null?void 0:f.theme)||t.value,language:((p=A.props)==null?void 0:p.theme)||n.value,codeTheme:((m=A.props)==null?void 0:m.codeTheme)||l.value,disabled:((O=A.props)==null?void 0:O.disabled)||r.value,showToolbarName:((g=A.props)==null?void 0:g.showToolbarName)||a.value,insert(M){X.emit(i,re,"universal",{generate:M})}}):""}else if(((b=c.value)==null?void 0:b.children)instanceof Array){const A=c.value.children[u];return A?qr(A,{theme:((Q=A.props)==null?void 0:Q.theme)||e.value,previewTheme:((x=A.props)==null?void 0:x.theme)||t.value,language:((k=A.props)==null?void 0:k.theme)||n.value,codeTheme:(($=A.props)==null?void 0:$.codeTheme)||l.value,disabled:((C=A.props)==null?void 0:C.disabled)||r.value,showToolbarName:((T=A.props)==null?void 0:T.showToolbarName)||a.value,insert(M){X.emit(i,re,"universal",{generate:M})}}):""}else return""}}},WT=ie({name:"FloatingToolbar",setup(){const i=P("floatingToolbars"),{barRender:e}=g0();return()=>w("div",{class:`${v}-floating-toolbar`},[i.value.map(t=>e(t))])}}),gh=de.define(),YT=Ot.define({create(){return null},update(i,e){for(const t of e.effects)t.is(gh)&&(i=t.value);return i},provide:i=>zh.from(i)}),NT=i=>{let e=null;const t=(s,o)=>{e&&e.kind===o.kind&&e.pos===o.pos||(e=o,s.dispatch({effects:gh.of({pos:o.pos,above:!0,arrow:!0,create:()=>{const l=document.createElement("div"),a=`${v}-floating-toolbar-container`;l.classList.add(a),l.dataset.state="hidden",requestAnimationFrame(()=>{l.dataset.state="visible"});const h=document.createElement("div");l.appendChild(h);const c=L0(WT);return i.privide(c),c.mount(l),{dom:l,destroy:()=>c.unmount()}}})}))},n=s=>{e&&(e=null,s.dispatch({effects:gh.of(null)}))},r=U.updateListener.of(s=>{if(s.selectionSet||s.docChanged){const o=s.state,l=o.selection.main;if(!l.empty)t(s.view,{kind:"selection",pos:l.anchor});else{const a=l.head,h=o.doc.lineAt(a);/^\s*$/.test(h.text)?t(s.view,{kind:"emptyLine",pos:a}):n(s.view)}}});return[YT,r]},GT="#e5c07b",ff="var(--md-color)",FT="#56b6c2",UT="#fff",$r="#3f4a54",pf="#2d8cf0",HT="#2d8cf0",KT="#3f4a54",mf="#d19a66",JT="#c678dd",eC="#f6f6f6",tC="#ceedfa33",Of="var(--md-bk-color)",na="var(--md-bk-color)",iC="#bad5fa",gf="#3f4a54",nC=U.theme({"&":{color:$r,backgroundColor:Of},".cm-content":{caretColor:gf},".cm-cursor, .cm-dropCursor":{borderLeftColor:gf},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:iC},".cm-panels":{backgroundColor:eC,color:$r},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Of,color:$r,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:tC},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:na},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"var(--md-border-color)",borderBottomColor:"var(--md-border-color)"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:na,borderBottomColor:na},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:$r}}}),rC=bs.define([{tag:y.keyword,color:JT},{tag:[y.name,y.deleted,y.character,y.propertyName,y.macroName],color:ff},{tag:[y.function(y.variableName),y.labelName],color:HT},{tag:[y.color,y.constant(y.name),y.standard(y.name)],color:mf},{tag:[y.definition(y.name),y.separator],color:$r},{tag:[y.typeName,y.className,y.number,y.changed,y.annotation,y.modifier,y.self,y.namespace],color:GT},{tag:[y.operator,y.operatorKeyword,y.url,y.escape,y.regexp,y.link,y.special(y.string)],color:FT},{tag:[y.meta,y.comment],color:pf},{tag:y.strong,fontWeight:"bold"},{tag:y.emphasis,fontStyle:"italic"},{tag:y.strikethrough,textDecoration:"line-through"},{tag:y.link,color:pf,textDecoration:"underline"},{tag:y.heading,fontWeight:"bold",color:ff},{tag:[y.atom,y.bool,y.special(y.variableName)],color:mf},{tag:[y.processingInstruction,y.string,y.inserted],color:KT},{tag:y.invalid,color:UT}]),bf=[nC,Wm(rC)],sC="#e5c07b",vf="var(--md-color)",oC="#56b6c2",lC="#ffffff",Pr="var(--md-color)",yf="#e5c07b",aC="#e5c07b",hC="var(--md-color)",kf="#d19a66",cC="#c678dd",uC="#21252b",dC="#2c313a",Sf="var(--md-bk-color)",ra="var(--md-bk-color)",fC="#ceedfa33",xf="#528bff",pC=U.theme({"&":{color:Pr,backgroundColor:Sf},".cm-content":{caretColor:xf},".cm-cursor, .cm-dropCursor":{borderLeftColor:xf},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fC},".cm-panels":{backgroundColor:uC,color:Pr},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Sf,color:Pr,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:dC},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:ra},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"var(--md-border-color)",borderBottomColor:"var(--md-border-color)"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ra,borderBottomColor:ra},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:Pr}}},{dark:!0}),mC=bs.define([{tag:y.keyword,color:cC},{tag:[y.name,y.deleted,y.character,y.propertyName,y.macroName],color:vf},{tag:[y.function(y.variableName),y.labelName],color:aC},{tag:[y.color,y.constant(y.name),y.standard(y.name)],color:kf},{tag:[y.definition(y.name),y.separator],color:Pr},{tag:[y.typeName,y.className,y.number,y.changed,y.annotation,y.modifier,y.self,y.namespace],color:sC},{tag:[y.operator,y.operatorKeyword,y.url,y.escape,y.regexp,y.link,y.special(y.string)],color:oC},{tag:[y.meta,y.comment],color:yf},{tag:y.strong,fontWeight:"bold"},{tag:y.emphasis,fontStyle:"italic"},{tag:y.strikethrough,textDecoration:"line-through"},{tag:y.link,color:yf,textDecoration:"underline"},{tag:y.heading,fontWeight:"bold",color:vf},{tag:[y.atom,y.bool,y.special(y.variableName)],color:kf},{tag:[y.processingInstruction,y.string,y.inserted],color:hC},{tag:y.invalid,color:lC}]),wf=[pC,Wm(mC)],OC=(i,e)=>{const t=P("editorId"),n=r=>{r instanceof Promise?r.then(s=>{X.emit(t,re,"universal",{generate(){return{targetValue:s}}})}).catch(s=>{console.error(s)}):X.emit(t,re,"universal",{generate(){return{targetValue:r}}})};return r=>{var u,d,f;if(!r.clipboardData)return;if(r.clipboardData.files.length>0){const{files:p}=r.clipboardData;X.emit(t,Ko,Array.from(p).filter(m=>/image\/.*/.test(m.type))),r.preventDefault();return}const s=r.clipboardData.getData("text/plain"),o=((u=e.value)==null?void 0:u.view.state.selection.main.to)||0,l=((d=e.value)==null?void 0:d.view.state.doc.lineAt(o).from)||0,a=((f=e.value)==null?void 0:f.view.state.doc.sliceString(l,o))||"",h=/!\[.*\]\(\s*$/.test(a),c=/!\[.*\]\((.*)\s?.*\)/.test(s);if(h){const p=i.transformImgUrl(s);n(p),r.preventDefault();return}else if(c){const p=s.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`,"g"));p?Promise.all(p.map(m=>i.transformImgUrl(m))).then(m=>{n(m.reduce((O,g,b)=>O.replace(p[b],g),s))}).catch(m=>{console.error(m)}):n(s),r.preventDefault();return}if(i.autoDetectCode&&r.clipboardData.types.includes("vscode-editor-data")){const p=JSON.parse(r.clipboardData.getData("vscode-editor-data"));X.emit(t,re,"code",{mode:p.mode,text:r.clipboardData.getData("text/plain")}),r.preventDefault();return}i.maxlength&&s.length+i.modelValue.length>i.maxlength&&X.emit(t,Oi,{name:"overlength",message:"The input text is too long",data:s})}},gC=(i,e)=>[{key:"Ctrl-b",mac:"Cmd-b",run:()=>(X.emit(i,re,"bold"),!0)},{key:"Ctrl-d",mac:"Cmd-d",run:TO,preventDefault:!0},{key:"Ctrl-s",mac:"Cmd-s",run:t=>(X.emit(i,Ho,t.state.doc.toString()),!0),shift:()=>(X.emit(i,re,"strikeThrough"),!0)},{key:"Ctrl-u",mac:"Cmd-u",preventDefault:!0,run:()=>(X.emit(i,re,"underline"),!0),shift:()=>(X.emit(i,re,"unorderedList"),!0)},{key:"Ctrl-i",mac:"Cmd-i",preventDefault:!0,run:()=>(X.emit(i,re,"italic"),!0),shift:()=>(X.emit(i,re,"image"),!0)},{key:"Ctrl-1",mac:"Cmd-1",run:()=>(X.emit(i,re,"h1"),!0)},{key:"Ctrl-2",mac:"Cmd-2",run:()=>(X.emit(i,re,"h2"),!0)},{key:"Ctrl-3",mac:"Cmd-3",run:()=>(X.emit(i,re,"h3"),!0)},{key:"Ctrl-4",mac:"Cmd-4",run:()=>(X.emit(i,re,"h4"),!0)},{key:"Ctrl-5",mac:"Cmd-5",run:()=>(X.emit(i,re,"h5"),!0)},{key:"Ctrl-6",mac:"Cmd-6",run:()=>(X.emit(i,re,"h6"),!0)},{key:"Ctrl-ArrowUp",mac:"Cmd-ArrowUp",run:()=>(X.emit(i,re,"sup"),!0)},{key:"Ctrl-ArrowDown",mac:"Cmd-ArrowDown",run:()=>(X.emit(i,re,"sub"),!0)},{key:"Ctrl-o",mac:"Cmd-o",run:()=>(X.emit(i,re,"orderedList"),!0)},{key:"Ctrl-c",mac:"Cmd-c",shift:()=>(X.emit(i,re,"code"),!0),any(t,n){return(n.ctrlKey||n.metaKey)&&n.altKey&&n.code==="KeyC"?(X.emit(i,re,"codeRow"),!0):!1}},{key:"Ctrl-l",mac:"Cmd-l",run:()=>(X.emit(i,re,"link"),!0)},{key:"Ctrl-f",mac:"Cmd-f",shift:()=>e.noPrettier?!1:(X.emit(i,re,"prettier"),!0)},{any:(t,n)=>(n.ctrlKey||n.metaKey)&&n.altKey&&n.shiftKey&&n.code==="KeyT"?(X.emit(i,re,"table"),!0):!1},...DP],bC=/[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i,vC=/\/\/[^\s<>"'`()]+/i,yC=/data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i,kC=/\/(?!\/)[^\s<>"'`()]+/i,Fo=new RegExp(`(${bC.source}|${vC.source}|${yC.source}|${kC.source})`,"gi"),SC=/[a-z0-9.+-]/i,xC=i=>{const e=[];Fo.lastIndex=0;let t;for(;t=Fo.exec(i);){const n=t.index??0,r=n>0?i[n-1]:"";if(r&&SC.test(r)||r==="<"&&i[n]==="/")continue;const s=n+t[0].length;e.push([n,s])}return e},wC=(i,e,t)=>i.some(n=>n.from===e&&n.to===t),QC=i=>{const e=i.shortenText||(()=>"..."),t=de.define(),n=de.define(),r=(a,h)=>{var d;const c=new dn,u=[];for(let f=1;f<=a.doc.lines;f++){const p=a.doc.line(f),m=p.text;Fo.lastIndex=0;const O=((d=i.findTexts)==null?void 0:d.call(i,{state:a,lineText:m,lineNumber:p.number,lineFrom:p.from,lineTo:p.to,defaultTextRegex:Fo}))??xC(m);for(const g of O){if(!g)continue;const[b,Q]=g;if(typeof b!="number"||typeof Q!="number"||b<0||Q<=b||b>=m.length||Q>m.length)continue;const x=m.slice(b,Q);if(!x||x.length<=i.maxLength)continue;const k=p.from+b,$=p.from+Q;if(wC(h,k,$)){u.push({from:k,to:$});continue}const C=e(x);c.add(k,$,xe.replace({widget:new s(C,x,k,$)}))}}return{deco:c.finish(),expanded:u}};class s extends bn{constructor(h,c,u,d){super(),this.short=h,this.raw=c,this.from=u,this.to=d}toDOM(h){const c=document.createElement("span");return c.textContent=this.short,c.className="cm-short-text",c.title=this.raw,c.style.display="inline",c.style.textDecoration="underline",c.addEventListener("mousedown",u=>{u.preventDefault(),u.stopPropagation(),h.dispatch({selection:Z.cursor(this.from),effects:t.of({from:this.from,to:this.to,expand:!0})}),h.focus()}),c.addEventListener("click",u=>{u.preventDefault()}),c}ignoreEvent(){return!1}eq(h){return this.short===h.short&&this.raw===h.raw&&this.from===h.from&&this.to===h.to}}const o=Ot.define({create(a){return r(a,[])},update(a,h){let c=a.expanded;h.docChanged&&c.length&&(c=c.map(({from:d,to:f})=>({from:h.changes.mapPos(d,1),to:h.changes.mapPos(f,-1)})).filter(({from:d,to:f})=>d<f));let u=c!==a.expanded;for(const d of h.effects)d.is(t)?d.value.expand?c=[{from:d.value.from,to:d.value.to}]:c=c.filter(({from:f,to:p})=>f!==d.value.from||p!==d.value.to):d.is(n)&&c.length>0&&(c=[]);return!u&&c!==a.expanded&&(u=!0),h.docChanged||u?r(h.state,c):a},provide:a=>U.decorations.compute([a],h=>h.field(a).deco)}),l=U.domEventHandlers({mousedown(a,h){const c=h.state.field(o,!1);if(!c||c.expanded.length===0)return!1;const u=a.target;if(u&&h.dom.contains(u)){const d=h.posAtDOM(u,0);if(d!=null&&d!==-1&&c.expanded.some(({from:f,to:p})=>d>=f&&d<=p))return!1}return h.dispatch({effects:n.of(void 0)}),!1}});return[o,l]};U.EDIT_CONTEXT=!1;const b0=i=>i.extension instanceof Function?i.extension(i.options):i.extension,$C=i=>{const e=b0(i);return i.compartment?i.compartment.of(e):e},PC=i=>{const e=P("tabWidth"),t=P("editorId"),n=P("theme"),r=P("previewTheme"),s=P("language"),o=P("usedLanguageText"),l=P("disabled"),a=P("showToolbarName"),h=P("customIcon"),c=P("noUploadImg"),u=P("tableShape"),d=P("noPrettier"),f=P("codeTheme"),p=P("setting"),m=P("updateSetting"),O=P("catalogVisible"),g=P("defToolbars"),b=P("floatingToolbars"),Q=P("rootRef"),x=he(),k=qi(),$=he(!1),C=new hi,T=new hi,A=new hi,M=new hi,B=new hi,R=gC(t,{noPrettier:d}),D=()=>[...R,...Rx,...BS,Mx],q={paste:OC(i,k),blur:i.onBlur,focus:i.onFocus,drop:i.onDrop,compositionstart:()=>{$.value=!0},compositionend:(E,H)=>{$.value=!1,i.updateModelValue(H.state.doc.toString())},input:E=>{i.onInput&&i.onInput(E);const{data:H}=E;i.maxlength&&i.modelValue.length+H.length>i.maxlength&&X.emit(t,Oi,{name:"overlength",message:"The input text is too long",data:H})}},G=NT({privide(E){E.provide("editorId",t),E.provide("theme",n),E.provide("previewTheme",r),E.provide("language",s),E.provide("disabled",l),E.provide("noUploadImg",c),E.provide("tableShape",u),E.provide("noPrettier",d),E.provide("codeTheme",f),E.provide("showToolbarName",a),E.provide("setting",p),E.provide("updateSetting",m),E.provide("usedLanguageText",o),E.provide("catalogVisible",O),E.provide("defToolbars",g),E.provide("tabWidth",e),E.provide("customIcon",h),E.provide("floatingToolbars",b),E.provide("rootRef",Q)}}),I=[{type:"theme",extension:({theme:E})=>E.value==="light"?bf:wf,compartment:C,options:{theme:n}},{type:"updateListener",extension:U.updateListener.of(E=>{E.docChanged&&(i.onChange(E.state.doc.toString()),$.value||i.updateModelValue(E.state.doc.toString()))})},{type:"domEventHandlers",extension:U.domEventHandlers(q),compartment:M},{type:"completions",extension:df(i.completions),compartment:T},{type:"history",extension:sd(),compartment:A}],W=ze.codeMirrorExtensions([{type:"lineWrapping",extension:U.lineWrapping},{type:"keymap",extension:Os.of(D())},{type:"drawSelection",extension:yk()},{type:"markdown",extension:o0({codeLanguages:xP})},{type:"linkShortener",extension:E=>QC(E),options:{maxLength:30}},{type:"floatingToolbar",extension:b.value.length>0?G:[],compartment:B}],{editorId:t,theme:n.value,keyBindings:D()}),V=()=>[...I,...W].map($C);return Ee(()=>{const E=new U({doc:i.modelValue,parent:x.value,extensions:V()}),H=new nT(E);k.value=H,setTimeout(()=>{H.setTabSize(e),H.setDisabled(l.value),H.setReadOnly(i.readonly),i.placeholder&&H.setPlaceholder(i.placeholder),typeof i.maxlength=="number"&&H.setMaxLength(i.maxlength),i.autofocus&&E.focus()},0),X.on(t,{name:qf,callback(){Uh(E)}}),X.on(t,{name:jf,callback(){Lo(E)}}),X.on(t,{name:re,async callback(se,ee={}){var oe,ue;if(se==="image"&&ee.transform){const $e=i.transformImgUrl(ee.url);if($e instanceof Promise)$e.then(async Re=>{var Ss;const{text:Lt,options:gi}=await ia(se,k.value,{...ee,url:Re});(Ss=k.value)==null||Ss.replaceSelectedText(Lt,gi,t)}).catch(Re=>{console.error(Re)});else{const{text:Re,options:Lt}=await ia(se,k.value,{...ee,url:$e});(oe=k.value)==null||oe.replaceSelectedText(Re,Lt,t)}}else{const{text:$e,options:Re}=await ia(se,k.value,ee);(ue=k.value)==null||ue.replaceSelectedText($e,Re,t)}}}),X.on(t,{name:Yf,callback:I0(se=>{var ue;const ee={...q},oe=Object.keys(q);for(const $e in se){const Re=$e;oe.includes(Re)?ee[Re]=(Lt,gi)=>{se[Re](Lt,gi),Lt.defaultPrevented||q[Re](Lt,gi)}:ee[Re]=se[Re]}(ue=k.value)==null||ue.view.dispatch({effects:M.reconfigure(U.domEventHandlers(ee))})})}),X.on(t,{name:Nf,callback:(se,ee)=>{const oe=E.state.doc.line(se);E.dispatch(E.state.update({changes:{from:oe.from,to:oe.to,insert:ee}}))}}),X.on(t,{name:Gf,callback(){X.emit(t,go,E)}}),X.emit(t,go,E)}),le(n,()=>{var E;(E=k.value)==null||E.view.dispatch({effects:C.reconfigure(n.value==="light"?bf:wf)})},{deep:!0}),le(()=>i.completions,()=>{var E;(E=k.value)==null||E.view.dispatch({effects:T.reconfigure(df(i.completions))})},{deep:!0}),le(()=>i.modelValue,()=>{var E,H;((E=k.value)==null?void 0:E.getValue())!==i.modelValue&&((H=k.value)==null||H.setValue(i.modelValue))}),le(()=>i.placeholder,()=>{var E;(E=k.value)==null||E.setPlaceholder(i.placeholder)}),le([l],()=>{var E;(E=k.value)==null||E.setDisabled(l.value)}),le(()=>i.readonly,()=>{var E;(E=k.value)==null||E.setDisabled(i.readonly)}),le(()=>i.maxlength,()=>{var E;i.maxlength&&((E=k.value)==null||E.setMaxLength(i.maxlength))}),sT(()=>{var H,se;const E=W.find(ee=>ee.type==="floatingToolbar");E!=null&&E.compartment&&(b.value.length>0?(H=k.value)==null||H.view.dispatch({effects:E.compartment.reconfigure(b0(E))}):(se=k.value)==null||se.view.dispatch({effects:E.compartment.reconfigure([])}))},b),{inputWrapperRef:x,codeMirrorUt:k,resetHistory(){var E,H;(E=k.value)==null||E.view.dispatch({effects:A.reconfigure([])}),(H=k.value)==null||H.view.dispatch({effects:A.reconfigure(sd())})}}},TC=(i,e,t)=>{const n=P("setting"),r=ke(()=>/px$/.test(`${i.inputBoxWidth}`)?"50%":i.inputBoxWidth),s=zt({resizedWidth:r.value}),o=zt({width:r.value}),l=zt({insetInlineStart:r.value,display:"initial"}),a=u=>{var O,g,b;const d=((O=e.value)==null?void 0:O.offsetWidth)||0,f=((g=e.value)==null?void 0:g.getBoundingClientRect().x)||0;let p=u.x-f;p/d<ws?p=d*ws:p>d-d*ws&&(p=d-d*ws);const m=`${p/d*100}%`;o.width=m,l.insetInlineStart=m,s.resizedWidth=m,(b=i.oninputBoxWidthChange)==null||b.call(i,m)},h=u=>{u.target===t.value&&document.addEventListener("mousemove",a)},c=()=>{document.removeEventListener("mousemove",a)};return le([t],()=>{document.removeEventListener("mousedown",h),document.removeEventListener("mouseup",c),document.addEventListener("mousedown",h),document.addEventListener("mouseup",c)}),Ee(()=>{document.addEventListener("mousedown",h),document.addEventListener("mouseup",c)}),$i(()=>{document.removeEventListener("mousedown",h),document.removeEventListener("mouseup",c)}),le([r],([u])=>{s.resizedWidth=u,o.width=u,l.insetInlineStart=u}),le([()=>n.value.htmlPreview,()=>n.value.preview,()=>n.value.previewOnly],()=>{n.value.previewOnly?(o.width="0%",l.display="none"):!n.value.htmlPreview&&!n.value.preview?(o.width="100%",l.display="none"):(o.width=s.resizedWidth,l.display="initial")},{immediate:!0}),{inputWrapperStyle:o,resizeOperateStyle:l}},CC=()=>{const i=P("editorId"),e=he(!0),t=vh();return{onCatalogActive:(n,r)=>{const s=document.querySelector(`#${i} .${v}-catalog-editor`);if(!r||!e.value||!s)return;const o=r.offsetTop-s.scrollTop;(o>100||o<100)&&t(s,r.offsetTop-100)},onMouseenter:()=>e.value=!1,onMouseleave:()=>e.value=!0}},sa=ie({name:`${V0}CustomScrollbar`,props:{id:{type:String,default:void 0},class:{type:[String,Array],default:void 0},scrollTarget:{type:String,default:void 0},alwaysShowTrack:{type:Boolean,default:!1},onMouseenter:{type:Function,default:()=>{}},onMouseleave:{type:Function,default:()=>{}}},setup(i,{slots:e}){const t=he(null),n=he(null),r=he(null),s=he(null);let o=null,l=null,a=!1,h=0,c=0;const u=()=>{if(!n.value||!t.value||!r.value||!s.value)return;const b=t.value.clientHeight,Q=n.value.scrollHeight,x=n.value.scrollTop;if(Q<=b){r.value.style.display="none",i.alwaysShowTrack||(s.value.style.display="none");return}else r.value.style.display="block",s.value.style.display="block";const k=b/Q,$=Math.max(b*k,20),C=b-$,T=Math.min(x*k,C);r.value.style.height=`${$}px`,r.value.style.top=`${T}px`},d=()=>u(),f=b=>{a=!0,h=b.clientY,c=n.value.scrollTop,document.body.style.userSelect="none"},p=b=>{if(!a||!n.value||!t.value)return;const Q=b.clientY-h,x=n.value.scrollHeight/t.value.clientHeight;n.value.scrollTop=c+Q*x},m=()=>{a=!1,document.body.style.userSelect=""},O=b=>{n.value&&n.value.removeEventListener("scroll",d),n.value=b,n.value?(n.value.addEventListener("scroll",d),u()):s.value&&!i.alwaysShowTrack&&(s.value.style.display="none")},g=()=>{if(!t.value)return;const b=i.scrollTarget?t.value.querySelector(i.scrollTarget):t.value.firstElementChild;O(b)};return Ee(async()=>{var b;await Dt(),g(),o=new MutationObserver(()=>{l&&cancelAnimationFrame(l),l=requestAnimationFrame(()=>{g()})}),o.observe(t.value,{childList:!0,subtree:!0}),window.addEventListener("resize",u),(b=r.value)==null||b.addEventListener("mousedown",f),document.addEventListener("mousemove",p),document.addEventListener("mouseup",m)}),$i(()=>{var b;o==null||o.disconnect(),n.value&&n.value.removeEventListener("scroll",d),window.removeEventListener("resize",u),(b=r.value)==null||b.removeEventListener("mousedown",f),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m)}),()=>{var b;return w("div",{id:i.id,class:[`${v}-custom-scrollbar`,i.class],ref:t,onMouseenter:i.onMouseenter,onMouseleave:i.onMouseleave},[(b=e.default)==null?void 0:b.call(e),w("div",{class:`${v}-custom-scrollbar__track`,ref:s},[w("div",{class:`${v}-custom-scrollbar__thumb`,ref:r},null)])])}}}),AC=vh(),_C={flex:1},EC=ie({name:"MDEditorContent",props:dv,setup(i,e){const t=P("editorId"),n=P("catalogVisible"),r=P("theme"),s=P("setting"),o=he(""),l=he(),a=he(),{inputWrapperRef:h,codeMirrorUt:c,resetHistory:u}=PC(i),{inputWrapperStyle:d,resizeOperateStyle:f}=TC(i,l,a);WP(i,o,c);const{onCatalogActive:p,onMouseenter:m,onMouseleave:O}=CC(),g=(x,k)=>{var $,C;if(!s.value.preview&&k.line!==void 0){x.preventDefault();const T=($=c.value)==null?void 0:$.view;if(T){const A=T.state.doc.line(k.line+1),M=(C=T.lineBlockAt(A.from))==null?void 0:C.top,B=T.scrollDOM;AC(B,M)}}},b=ke(()=>s.value.preview?"preview":"editor"),Q=x=>{o.value=x,i.onHtmlChanged(x)};return e.expose({getSelectedText(){var x;return(x=c.value)==null?void 0:x.getSelectedText()},focus(x){var k;(k=c.value)==null||k.focus(x)},resetHistory:u,getEditorView(){var x;return(x=c.value)==null?void 0:x.view}}),()=>w("div",{class:`${v}-content`},[w("div",{class:`${v}-content-wrapper`,ref:l},[w(sa,{alwaysShowTrack:!0,scrollTarget:`#${t} .cm-scroller`,style:d},{default:()=>[w("div",{class:`${v}-input-wrapper`,ref:h},null)]}),(s.value.htmlPreview||s.value.preview)&&w("div",{class:`${v}-resize-operate`,style:f,ref:a},null),w(sa,{style:_C},{default:()=>[w(op,{modelValue:i.modelValue,onChange:i.onChange,onHtmlChanged:Q,onGetCatalog:i.onGetCatalog,mdHeadingId:i.mdHeadingId,noMermaid:i.noMermaid,sanitize:i.sanitize,noKatex:i.noKatex,formatCopiedText:i.formatCopiedText,noHighlight:i.noHighlight,noImgZoomIn:i.noImgZoomIn,sanitizeMermaid:i.sanitizeMermaid,codeFoldable:i.codeFoldable,autoFoldThreshold:i.autoFoldThreshold,onRemount:i.onRemount,previewComponent:i.previewComponent,noEcharts:i.noEcharts},null)]})]),n.value&&w(sa,{class:`${v}-catalog-${i.catalogLayout}`,onMouseenter:m,onMouseleave:O},{default:()=>[w(Pn,{theme:r.value,class:`${v}-catalog-editor`,editorId:t,mdHeadingId:i.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2,syncWith:b.value,onClick:g,catalogMaxDepth:i.catalogMaxDepth,onActive:p},null)]})])}}),LC=ie({props:{modelValue:{type:String,default:""}},setup(i){const e=P("usedLanguageText");return()=>{var t,n;return w("div",{class:`${v}-footer-item`},[w("label",{class:`${v}-footer-label`},[`${(t=e.value.footer)==null?void 0:t.markdownTotal}:`]),w("span",null,[((n=i.modelValue)==null?void 0:n.length)||0])])}}}),RC={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},MC=ie({name:`${v}-checkbox`,props:RC,setup(i){return()=>w("div",{class:[`${v}-checkbox`,i.checked&&`${v}-checkbox-checked`,i.disabled&&`${v}-disabled`],onClick:()=>{i.disabled||i.onChange(!i.checked)}},null)}}),ZC={scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},XC=ie({props:ZC,setup(i){const e=P("usedLanguageText"),t=P("disabled");return()=>{var n;return w("div",{class:[`${v}-footer-item`,(t==null?void 0:t.value)&&`${v}-disabled`]},[w("label",{class:`${v}-footer-label`,onClick:()=>{t!=null&&t.value||i.onScrollAutoChange(!i.scrollAuto)}},[(n=e==null?void 0:e.value.footer)==null?void 0:n.scrollAuto]),w(MC,{checked:i.scrollAuto,onChange:i.onScrollAutoChange,disabled:t==null?void 0:t.value},null)])}}}),IC={modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},zC=ie({name:"MDEditorFooter",props:IC,setup(i){const e=P("theme"),t=P("language"),n=P("disabled"),r=ke(()=>{const o=i.footers.indexOf("="),l=o===-1?i.footers:i.footers.slice(0,o),a=o===-1?[]:i.footers.slice(o,Number.MAX_SAFE_INTEGER);return[l,a]}),s=o=>{var l,a,h,c,u,d;if(kh.includes(o))switch(o){case"markdownTotal":return w(LC,{modelValue:i.modelValue},null);case"scrollSwitch":return!i.noScrollAuto&&w(XC,{scrollAuto:i.scrollAuto,onScrollAutoChange:i.onScrollAutoChange},null)}else if(i.defFooters instanceof Array){const f=i.defFooters[o];return f?qr(f,{theme:((l=f.props)==null?void 0:l.theme)||e.value,language:((a=f.props)==null?void 0:a.language)||t.value,disabled:((h=f.props)==null?void 0:h.disabled)||(n==null?void 0:n.value)}):""}else if(i.defFooters&&i.defFooters.children instanceof Array){const f=i.defFooters.children[o];return f?qr(f,{theme:((c=f.props)==null?void 0:c.theme)||e.value,language:((u=f.props)==null?void 0:u.language)||t.value,disabled:((d=f.props)==null?void 0:d.disabled)||(n==null?void 0:n.value)}):""}else return""};return()=>{const o=r.value[0].map(a=>s(a)),l=r.value[1].map(a=>s(a));return w("div",{class:`${v}-footer`},[w("div",{class:`${v}-footer-left`},[o]),w("div",{class:`${v}-footer-right`},[l])])}}}),VC={toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]}},DC=ie({name:"MDEditorToolbar",props:VC,setup(i){const e=P("editorId"),t=P("showToolbarName"),n=`${e}-toolbar-wrapper`,r=he(),s=he(),{barRender:o}=g0(),l=ke(()=>{const a=i.toolbars.filter(d=>!i.toolbarsExclude.includes(d)),h=a.indexOf("="),c=h===-1?a:a.slice(0,h+1),u=h===-1?[]:a.slice(h,Number.MAX_SAFE_INTEGER);return[c,u]});return le(()=>i.toolbars,()=>{Dt(()=>{r.value&&z0(r.value)})},{immediate:!0}),()=>{const a=l.value[0].map(c=>o(c)),h=l.value[1].map(c=>o(c));return w(ds,null,[i.toolbars.length>0&&w("div",{class:`${v}-toolbar-wrapper`,ref:r,id:n},[w("div",{class:[`${v}-toolbar`,t.value&&`${v}-stn`]},[w("div",{class:`${v}-toolbar-left`,ref:s},[a]),w("div",{class:`${v}-toolbar-right`},[h])])])])}}}),fo=ie({name:"MdEditorV3",props:Ov,emits:gv,setup(i,e){const{noKatex:t,noMermaid:n,noHighlight:r}=i,s=zt({scrollAuto:i.scrollAuto}),o=he(),l=he(),a=ke(()=>at({props:i,ctx:e},"defToolbars")),h=ke(()=>at({props:i,ctx:e},"defFooters")),c=rp(i),[u,d]=Lb(i,e,{editorId:c}),f=Rb(i,{editorId:c});Cb(i,e,{editorId:c}),_b(i),Eb(i,e,{editorId:c}),Mb(i,e,{editorId:c,catalogVisible:f,setting:u,updateSetting:d,codeRef:l}),Ab(i,{rootRef:o,editorId:c,setting:u,updateSetting:d,catalogVisible:f,defToolbars:a}),$i(()=>{X.clear(c)});const p=A=>{e.emit("update:modelValue",A)},m=A=>{var M;(M=i.onChange)==null||M.call(i,A),e.emit("onChange",A)},O=A=>{var M;(M=i.onHtmlChanged)==null||M.call(i,A),e.emit("onHtmlChanged",A)},g=A=>{var M;(M=i.onGetCatalog)==null||M.call(i,A),e.emit("onGetCatalog",A)},b=A=>{var M;(M=i.onBlur)==null||M.call(i,A),e.emit("onBlur",A)},Q=A=>{var M;(M=i.onFocus)==null||M.call(i,A),e.emit("onFocus",A)},x=A=>{var M;(M=i.onInput)==null||M.call(i,A),e.emit("onInput",A)},k=A=>{var M;(M=i.onDrop)==null||M.call(i,A),e.emit("onDrop",A)},$=A=>{var M;(M=i.oninputBoxWidthChange)==null||M.call(i,A),e.emit("oninputBoxWidthChange",A)},C=()=>{var A;(A=i.onRemount)==null||A.call(i),e.emit("onRemount")},T=A=>{s.scrollAuto=A};return()=>w("div",{id:c,class:[v,i.class,i.theme==="dark"&&`${v}-dark`,u.fullscreen||u.pageFullscreen?`${v}-fullscreen`:""],style:i.style,ref:o},[i.toolbars.length>0&&w(DC,{toolbars:i.toolbars,toolbarsExclude:i.toolbarsExclude},null),w(EC,{ref:l,modelValue:i.modelValue,mdHeadingId:i.mdHeadingId,noMermaid:n,sanitize:i.sanitize,placeholder:i.placeholder,noKatex:t,scrollAuto:s.scrollAuto,formatCopiedText:i.formatCopiedText,autofocus:i.autoFocus,readonly:i.readOnly,maxlength:i.maxLength,autoDetectCode:i.autoDetectCode,noHighlight:r,updateModelValue:p,onChange:m,onHtmlChanged:O,onGetCatalog:g,onBlur:b,onFocus:Q,onInput:x,completions:i.completions,noImgZoomIn:i.noImgZoomIn,onDrop:k,inputBoxWidth:i.inputBoxWidth,oninputBoxWidthChange:$,sanitizeMermaid:i.sanitizeMermaid,transformImgUrl:i.transformImgUrl,codeFoldable:i.codeFoldable,autoFoldThreshold:i.autoFoldThreshold,onRemount:C,catalogLayout:i.catalogLayout,catalogMaxDepth:i.catalogMaxDepth,noEcharts:i.noEcharts,previewComponent:i.previewComponent},null),i.footers.length>0&&w(zC,{modelValue:i.modelValue,footers:i.footers,defFooters:h.value,noScrollAuto:!u.preview&&!u.htmlPreview||u.previewOnly,scrollAuto:s.scrollAuto,onScrollAutoChange:T},null)])}});fo.install=i=>(i.component(fo.name,fo),i.use(Er).use(Tr).use(_r).use(Pn).use(Ar),i);const BC=Oo["zh-CN"],qC=Oo["en-US"];function jC(i,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in i)){const s=Object.getOwnPropertyDescriptor(n,r);s&&Object.defineProperty(i,r,s.get?s:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}const WC={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},po=ie({name:"NormalFooterToolbar",props:WC,emits:["onClick"],setup(i,e){return()=>{const t=at({props:i,ctx:e});return w("div",{class:[`${v}-footer-item`,i.disabled&&`${v}-disabled`],onClick:n=>{var r;i.disabled||((r=i.onClick)==null||r.call(i,n),e.emit("onClick",n))}},[t])}}});po.install=i=>(i.component(po.name,po),i);function YC(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var oa={exports:{}},Le={},la={exports:{}},Hi={},Qf;function v0(){if(Qf)return Hi;Qf=1;function i(){var s={};return s["align-content"]=!1,s["align-items"]=!1,s["align-self"]=!1,s["alignment-adjust"]=!1,s["alignment-baseline"]=!1,s.all=!1,s["anchor-point"]=!1,s.animation=!1,s["animation-delay"]=!1,s["animation-direction"]=!1,s["animation-duration"]=!1,s["animation-fill-mode"]=!1,s["animation-iteration-count"]=!1,s["animation-name"]=!1,s["animation-play-state"]=!1,s["animation-timing-function"]=!1,s.azimuth=!1,s["backface-visibility"]=!1,s.background=!0,s["background-attachment"]=!0,s["background-clip"]=!0,s["background-color"]=!0,s["background-image"]=!0,s["background-origin"]=!0,s["background-position"]=!0,s["background-repeat"]=!0,s["background-size"]=!0,s["baseline-shift"]=!1,s.binding=!1,s.bleed=!1,s["bookmark-label"]=!1,s["bookmark-level"]=!1,s["bookmark-state"]=!1,s.border=!0,s["border-bottom"]=!0,s["border-bottom-color"]=!0,s["border-bottom-left-radius"]=!0,s["border-bottom-right-radius"]=!0,s["border-bottom-style"]=!0,s["border-bottom-width"]=!0,s["border-collapse"]=!0,s["border-color"]=!0,s["border-image"]=!0,s["border-image-outset"]=!0,s["border-image-repeat"]=!0,s["border-image-slice"]=!0,s["border-image-source"]=!0,s["border-image-width"]=!0,s["border-left"]=!0,s["border-left-color"]=!0,s["border-left-style"]=!0,s["border-left-width"]=!0,s["border-radius"]=!0,s["border-right"]=!0,s["border-right-color"]=!0,s["border-right-style"]=!0,s["border-right-width"]=!0,s["border-spacing"]=!0,s["border-style"]=!0,s["border-top"]=!0,s["border-top-color"]=!0,s["border-top-left-radius"]=!0,s["border-top-right-radius"]=!0,s["border-top-style"]=!0,s["border-top-width"]=!0,s["border-width"]=!0,s.bottom=!1,s["box-decoration-break"]=!0,s["box-shadow"]=!0,s["box-sizing"]=!0,s["box-snap"]=!0,s["box-suppress"]=!0,s["break-after"]=!0,s["break-before"]=!0,s["break-inside"]=!0,s["caption-side"]=!1,s.chains=!1,s.clear=!0,s.clip=!1,s["clip-path"]=!1,s["clip-rule"]=!1,s.color=!0,s["color-interpolation-filters"]=!0,s["column-count"]=!1,s["column-fill"]=!1,s["column-gap"]=!1,s["column-rule"]=!1,s["column-rule-color"]=!1,s["column-rule-style"]=!1,s["column-rule-width"]=!1,s["column-span"]=!1,s["column-width"]=!1,s.columns=!1,s.contain=!1,s.content=!1,s["counter-increment"]=!1,s["counter-reset"]=!1,s["counter-set"]=!1,s.crop=!1,s.cue=!1,s["cue-after"]=!1,s["cue-before"]=!1,s.cursor=!1,s.direction=!1,s.display=!0,s["display-inside"]=!0,s["display-list"]=!0,s["display-outside"]=!0,s["dominant-baseline"]=!1,s.elevation=!1,s["empty-cells"]=!1,s.filter=!1,s.flex=!1,s["flex-basis"]=!1,s["flex-direction"]=!1,s["flex-flow"]=!1,s["flex-grow"]=!1,s["flex-shrink"]=!1,s["flex-wrap"]=!1,s.float=!1,s["float-offset"]=!1,s["flood-color"]=!1,s["flood-opacity"]=!1,s["flow-from"]=!1,s["flow-into"]=!1,s.font=!0,s["font-family"]=!0,s["font-feature-settings"]=!0,s["font-kerning"]=!0,s["font-language-override"]=!0,s["font-size"]=!0,s["font-size-adjust"]=!0,s["font-stretch"]=!0,s["font-style"]=!0,s["font-synthesis"]=!0,s["font-variant"]=!0,s["font-variant-alternates"]=!0,s["font-variant-caps"]=!0,s["font-variant-east-asian"]=!0,s["font-variant-ligatures"]=!0,s["font-variant-numeric"]=!0,s["font-variant-position"]=!0,s["font-weight"]=!0,s.grid=!1,s["grid-area"]=!1,s["grid-auto-columns"]=!1,s["grid-auto-flow"]=!1,s["grid-auto-rows"]=!1,s["grid-column"]=!1,s["grid-column-end"]=!1,s["grid-column-start"]=!1,s["grid-row"]=!1,s["grid-row-end"]=!1,s["grid-row-start"]=!1,s["grid-template"]=!1,s["grid-template-areas"]=!1,s["grid-template-columns"]=!1,s["grid-template-rows"]=!1,s["hanging-punctuation"]=!1,s.height=!0,s.hyphens=!1,s.icon=!1,s["image-orientation"]=!1,s["image-resolution"]=!1,s["ime-mode"]=!1,s["initial-letters"]=!1,s["inline-box-align"]=!1,s["justify-content"]=!1,s["justify-items"]=!1,s["justify-self"]=!1,s.left=!1,s["letter-spacing"]=!0,s["lighting-color"]=!0,s["line-box-contain"]=!1,s["line-break"]=!1,s["line-grid"]=!1,s["line-height"]=!1,s["line-snap"]=!1,s["line-stacking"]=!1,s["line-stacking-ruby"]=!1,s["line-stacking-shift"]=!1,s["line-stacking-strategy"]=!1,s["list-style"]=!0,s["list-style-image"]=!0,s["list-style-position"]=!0,s["list-style-type"]=!0,s.margin=!0,s["margin-bottom"]=!0,s["margin-left"]=!0,s["margin-right"]=!0,s["margin-top"]=!0,s["marker-offset"]=!1,s["marker-side"]=!1,s.marks=!1,s.mask=!1,s["mask-box"]=!1,s["mask-box-outset"]=!1,s["mask-box-repeat"]=!1,s["mask-box-slice"]=!1,s["mask-box-source"]=!1,s["mask-box-width"]=!1,s["mask-clip"]=!1,s["mask-image"]=!1,s["mask-origin"]=!1,s["mask-position"]=!1,s["mask-repeat"]=!1,s["mask-size"]=!1,s["mask-source-type"]=!1,s["mask-type"]=!1,s["max-height"]=!0,s["max-lines"]=!1,s["max-width"]=!0,s["min-height"]=!0,s["min-width"]=!0,s["move-to"]=!1,s["nav-down"]=!1,s["nav-index"]=!1,s["nav-left"]=!1,s["nav-right"]=!1,s["nav-up"]=!1,s["object-fit"]=!1,s["object-position"]=!1,s.opacity=!1,s.order=!1,s.orphans=!1,s.outline=!1,s["outline-color"]=!1,s["outline-offset"]=!1,s["outline-style"]=!1,s["outline-width"]=!1,s.overflow=!1,s["overflow-wrap"]=!1,s["overflow-x"]=!1,s["overflow-y"]=!1,s.padding=!0,s["padding-bottom"]=!0,s["padding-left"]=!0,s["padding-right"]=!0,s["padding-top"]=!0,s.page=!1,s["page-break-after"]=!1,s["page-break-before"]=!1,s["page-break-inside"]=!1,s["page-policy"]=!1,s.pause=!1,s["pause-after"]=!1,s["pause-before"]=!1,s.perspective=!1,s["perspective-origin"]=!1,s.pitch=!1,s["pitch-range"]=!1,s["play-during"]=!1,s.position=!1,s["presentation-level"]=!1,s.quotes=!1,s["region-fragment"]=!1,s.resize=!1,s.rest=!1,s["rest-after"]=!1,s["rest-before"]=!1,s.richness=!1,s.right=!1,s.rotation=!1,s["rotation-point"]=!1,s["ruby-align"]=!1,s["ruby-merge"]=!1,s["ruby-position"]=!1,s["shape-image-threshold"]=!1,s["shape-outside"]=!1,s["shape-margin"]=!1,s.size=!1,s.speak=!1,s["speak-as"]=!1,s["speak-header"]=!1,s["speak-numeral"]=!1,s["speak-punctuation"]=!1,s["speech-rate"]=!1,s.stress=!1,s["string-set"]=!1,s["tab-size"]=!1,s["table-layout"]=!1,s["text-align"]=!0,s["text-align-last"]=!0,s["text-combine-upright"]=!0,s["text-decoration"]=!0,s["text-decoration-color"]=!0,s["text-decoration-line"]=!0,s["text-decoration-skip"]=!0,s["text-decoration-style"]=!0,s["text-emphasis"]=!0,s["text-emphasis-color"]=!0,s["text-emphasis-position"]=!0,s["text-emphasis-style"]=!0,s["text-height"]=!0,s["text-indent"]=!0,s["text-justify"]=!0,s["text-orientation"]=!0,s["text-overflow"]=!0,s["text-shadow"]=!0,s["text-space-collapse"]=!0,s["text-transform"]=!0,s["text-underline-position"]=!0,s["text-wrap"]=!0,s.top=!1,s.transform=!1,s["transform-origin"]=!1,s["transform-style"]=!1,s.transition=!1,s["transition-delay"]=!1,s["transition-duration"]=!1,s["transition-property"]=!1,s["transition-timing-function"]=!1,s["unicode-bidi"]=!1,s["vertical-align"]=!1,s.visibility=!1,s["voice-balance"]=!1,s["voice-duration"]=!1,s["voice-family"]=!1,s["voice-pitch"]=!1,s["voice-range"]=!1,s["voice-rate"]=!1,s["voice-stress"]=!1,s["voice-volume"]=!1,s.volume=!1,s["white-space"]=!1,s.widows=!1,s.width=!0,s["will-change"]=!1,s["word-break"]=!0,s["word-spacing"]=!0,s["word-wrap"]=!0,s["wrap-flow"]=!1,s["wrap-through"]=!1,s["writing-mode"]=!1,s["z-index"]=!1,s}function e(s,o,l){}function t(s,o,l){}var n=/javascript\s*\:/img;function r(s,o){return n.test(o)?"":o}return Hi.whiteList=i(),Hi.getDefaultWhiteList=i,Hi.onAttr=e,Hi.onIgnoreAttr=t,Hi.safeAttrValue=r,Hi}var $f,Pf;function y0(){return Pf||(Pf=1,$f={indexOf:function(i,e){var t,n;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,n=i.length;t<n;t++)if(i[t]===e)return t;return-1},forEach:function(i,e,t){var n,r;if(Array.prototype.forEach)return i.forEach(e,t);for(n=0,r=i.length;n<r;n++)e.call(t,i[n],n,i)},trim:function(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(i){return String.prototype.trimRight?i.trimRight():i.replace(/(\s*$)/g,"")}}),$f}var aa,Tf;function NC(){if(Tf)return aa;Tf=1;var i=y0();function e(t,n){t=i.trimRight(t),t[t.length-1]!==";"&&(t+=";");var r=t.length,s=!1,o=0,l=0,a="";function h(){if(!s){var d=i.trim(t.slice(o,l)),f=d.indexOf(":");if(f!==-1){var p=i.trim(d.slice(0,f)),m=i.trim(d.slice(f+1));if(p){var O=n(o,a.length,p,m,d);O&&(a+=O+"; ")}}}o=l+1}for(;l<r;l++){var c=t[l];if(c==="/"&&t[l+1]==="*"){var u=t.indexOf("*/",l+2);if(u===-1)break;l=u+1,o=l+1,s=!1}else c==="("?s=!0:c===")"?s=!1:c===";"?s||h():c===`
|
|
318
|
+
`&&h()}return i.trim(a)}return aa=e,aa}var ha,Cf;function GC(){if(Cf)return ha;Cf=1;var i=v0(),e=NC();y0();function t(s){return s==null}function n(s){var o={};for(var l in s)o[l]=s[l];return o}function r(s){s=n(s||{}),s.whiteList=s.whiteList||i.whiteList,s.onAttr=s.onAttr||i.onAttr,s.onIgnoreAttr=s.onIgnoreAttr||i.onIgnoreAttr,s.safeAttrValue=s.safeAttrValue||i.safeAttrValue,this.options=s}return r.prototype.process=function(s){if(s=s||"",s=s.toString(),!s)return"";var o=this,l=o.options,a=l.whiteList,h=l.onAttr,c=l.onIgnoreAttr,u=l.safeAttrValue,d=e(s,function(f,p,m,O,g){var b=a[m],Q=!1;if(b===!0?Q=b:typeof b=="function"?Q=b(O):b instanceof RegExp&&(Q=b.test(O)),Q!==!0&&(Q=!1),O=u(m,O),!!O){var x={position:p,sourcePosition:f,source:g,isWhite:Q};if(Q){var k=h(m,O,x);return t(k)?m+":"+O:k}else{var k=c(m,O,x);if(!t(k))return k}}});return d},ha=r,ha}var Af;function bh(){return Af||(Af=1,function(i,e){var t=v0(),n=GC();function r(o,l){var a=new n(l);return a.process(o)}e=i.exports=r,e.FilterCSS=n;for(var s in t)e[s]=t[s];typeof window<"u"&&(window.filterCSS=i.exports)}(la,la.exports)),la.exports}var _f,Ef;function Pc(){return Ef||(Ef=1,_f={indexOf:function(i,e){var t,n;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,n=i.length;t<n;t++)if(i[t]===e)return t;return-1},forEach:function(i,e,t){var n,r;if(Array.prototype.forEach)return i.forEach(e,t);for(n=0,r=i.length;n<r;n++)e.call(t,i[n],n,i)},trim:function(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(i){var e=/\s|\n|\t/,t=e.exec(i);return t?t.index:-1}}),_f}var Lf;function k0(){if(Lf)return Le;Lf=1;var i=bh().FilterCSS,e=bh().getDefaultWhiteList,t=Pc();function n(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var r=new i;function s(I,W,V){}function o(I,W,V){}function l(I,W,V){}function a(I,W,V){}function h(I){return I.replace(u,"<").replace(d,">")}function c(I,W,V,E){if(V=M(V),W==="href"||W==="src"){if(V=t.trim(V),V==="#")return"#";if(!(V.substr(0,7)==="http://"||V.substr(0,8)==="https://"||V.substr(0,7)==="mailto:"||V.substr(0,4)==="tel:"||V.substr(0,11)==="data:image/"||V.substr(0,6)==="ftp://"||V.substr(0,2)==="./"||V.substr(0,3)==="../"||V[0]==="#"||V[0]==="/"))return""}else if(W==="background"){if(b.lastIndex=0,b.test(V))return""}else if(W==="style"){if(Q.lastIndex=0,Q.test(V)||(x.lastIndex=0,x.test(V)&&(b.lastIndex=0,b.test(V))))return"";E!==!1&&(E=E||r,V=E.process(V))}return V=B(V),V}var u=/</g,d=/>/g,f=/"/g,p=/"/g,m=/&#([a-zA-Z0-9]*);?/gim,O=/:?/gim,g=/&newline;?/gim,b=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Q=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,x=/u\s*r\s*l\s*\(.*/gi;function k(I){return I.replace(f,""")}function $(I){return I.replace(p,'"')}function C(I){return I.replace(m,function(W,V){return V[0]==="x"||V[0]==="X"?String.fromCharCode(parseInt(V.substr(1),16)):String.fromCharCode(parseInt(V,10))})}function T(I){return I.replace(O,":").replace(g," ")}function A(I){for(var W="",V=0,E=I.length;V<E;V++)W+=I.charCodeAt(V)<32?" ":I.charAt(V);return t.trim(W)}function M(I){return I=$(I),I=C(I),I=T(I),I=A(I),I}function B(I){return I=k(I),I=h(I),I}function R(){return""}function D(I,W){typeof W!="function"&&(W=function(){});var V=!Array.isArray(I);function E(ee){return V?!0:t.indexOf(I,ee)!==-1}var H=[],se=!1;return{onIgnoreTag:function(ee,oe,ue){if(E(ee))if(ue.isClosing){var $e="[/removed]",Re=ue.position+$e.length;return H.push([se!==!1?se:ue.position,Re]),se=!1,$e}else return se||(se=ue.position),"[removed]";else return W(ee,oe,ue)},remove:function(ee){var oe="",ue=0;return t.forEach(H,function($e){oe+=ee.slice(ue,$e[0]),ue=$e[1]}),oe+=ee.slice(ue),oe}}}function q(I){for(var W="",V=0;V<I.length;){var E=I.indexOf("<!--",V);if(E===-1){W+=I.slice(V);break}W+=I.slice(V,E);var H=I.indexOf("-->",E);if(H===-1)break;V=H+3}return W}function G(I){var W=I.split("");return W=W.filter(function(V){var E=V.charCodeAt(0);return E===127?!1:E<=31?E===10||E===13:!0}),W.join("")}return Le.whiteList=n(),Le.getDefaultWhiteList=n,Le.onTag=s,Le.onIgnoreTag=o,Le.onTagAttr=l,Le.onIgnoreTagAttr=a,Le.safeAttrValue=c,Le.escapeHtml=h,Le.escapeQuote=k,Le.unescapeQuote=$,Le.escapeHtmlEntities=C,Le.escapeDangerHtml5Entities=T,Le.clearNonPrintableCharacter=A,Le.friendlyAttrValue=M,Le.escapeAttrValue=B,Le.onIgnoreTagStripAll=R,Le.StripTagBody=D,Le.stripCommentTag=q,Le.stripBlankChar=G,Le.attributeWrapSign='"',Le.cssFilter=r,Le.getDefaultCSSWhiteList=e,Le}var Hs={},Rf;function S0(){if(Rf)return Hs;Rf=1;var i=Pc();function e(u){var d=i.spaceIndex(u),f;return d===-1?f=u.slice(1,-1):f=u.slice(1,d+1),f=i.trim(f).toLowerCase(),f.slice(0,1)==="/"&&(f=f.slice(1)),f.slice(-1)==="/"&&(f=f.slice(0,-1)),f}function t(u){return u.slice(0,2)==="</"}function n(u,d,f){var p="",m=0,O=!1,g=!1,b=0,Q=u.length,x="",k="";e:for(b=0;b<Q;b++){var $=u.charAt(b);if(O===!1){if($==="<"){O=b;continue}}else if(g===!1){if($==="<"){p+=f(u.slice(m,b)),O=b,m=b;continue}if($===">"||b===Q-1){p+=f(u.slice(m,O)),k=u.slice(O,b+1),x=e(k),p+=d(O,p.length,x,k,t(k)),m=b+1,O=!1;continue}if($==='"'||$==="'")for(var C=1,T=u.charAt(b-C);T.trim()===""||T==="=";){if(T==="="){g=$;continue e}T=u.charAt(b-++C)}}else if($===g){g=!1;continue}}return m<Q&&(p+=f(u.substr(m))),p}var r=/[^a-zA-Z0-9\\_:.-]/gim;function s(u,d){var f=0,p=0,m=[],O=!1,g=u.length;function b(C,T){if(C=i.trim(C),C=C.replace(r,"").toLowerCase(),!(C.length<1)){var A=d(C,T||"");A&&m.push(A)}}for(var Q=0;Q<g;Q++){var x=u.charAt(Q),k,$;if(O===!1&&x==="="){O=u.slice(f,Q),f=Q+1,p=u.charAt(f)==='"'||u.charAt(f)==="'"?f:l(u,Q+1);continue}if(O!==!1&&Q===p){if($=u.indexOf(x,Q+1),$===-1)break;k=i.trim(u.slice(p+1,$)),b(O,k),O=!1,Q=$,f=Q+1;continue}if(/\s|\n|\t/.test(x))if(u=u.replace(/\s|\n|\t/g," "),O===!1)if($=o(u,Q),$===-1){k=i.trim(u.slice(f,Q)),b(k),O=!1,f=Q+1;continue}else{Q=$-1;continue}else if($=a(u,Q-1),$===-1){k=i.trim(u.slice(f,Q)),k=c(k),b(O,k),O=!1,f=Q+1;continue}else continue}return f<u.length&&(O===!1?b(u.slice(f)):b(O,c(i.trim(u.slice(f))))),i.trim(m.join(" "))}function o(u,d){for(;d<u.length;d++){var f=u[d];if(f!==" ")return f==="="?d:-1}}function l(u,d){for(;d<u.length;d++){var f=u[d];if(f!==" ")return f==="'"||f==='"'?d:-1}}function a(u,d){for(;d>0;d--){var f=u[d];if(f!==" ")return f==="="?d:-1}}function h(u){return u[0]==='"'&&u[u.length-1]==='"'||u[0]==="'"&&u[u.length-1]==="'"}function c(u){return h(u)?u.substr(1,u.length-2):u}return Hs.parseTag=n,Hs.parseAttr=s,Hs}var ca,Mf;function FC(){if(Mf)return ca;Mf=1;var i=bh().FilterCSS,e=k0(),t=S0(),n=t.parseTag,r=t.parseAttr,s=Pc();function o(u){return u==null}function l(u){var d=s.spaceIndex(u);if(d===-1)return{html:"",closing:u[u.length-2]==="/"};u=s.trim(u.slice(d+1,-1));var f=u[u.length-1]==="/";return f&&(u=s.trim(u.slice(0,-1))),{html:u,closing:f}}function a(u){var d={};for(var f in u)d[f]=u[f];return d}function h(u){var d={};for(var f in u)Array.isArray(u[f])?d[f.toLowerCase()]=u[f].map(function(p){return p.toLowerCase()}):d[f.toLowerCase()]=u[f];return d}function c(u){u=a(u||{}),u.stripIgnoreTag&&(u.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),u.onIgnoreTag=e.onIgnoreTagStripAll),u.whiteList||u.allowList?u.whiteList=h(u.whiteList||u.allowList):u.whiteList=e.whiteList,this.attributeWrapSign=u.singleQuotedAttributeValue===!0?"'":e.attributeWrapSign,u.onTag=u.onTag||e.onTag,u.onTagAttr=u.onTagAttr||e.onTagAttr,u.onIgnoreTag=u.onIgnoreTag||e.onIgnoreTag,u.onIgnoreTagAttr=u.onIgnoreTagAttr||e.onIgnoreTagAttr,u.safeAttrValue=u.safeAttrValue||e.safeAttrValue,u.escapeHtml=u.escapeHtml||e.escapeHtml,this.options=u,u.css===!1?this.cssFilter=!1:(u.css=u.css||{},this.cssFilter=new i(u.css))}return c.prototype.process=function(u){if(u=u||"",u=u.toString(),!u)return"";var d=this,f=d.options,p=f.whiteList,m=f.onTag,O=f.onIgnoreTag,g=f.onTagAttr,b=f.onIgnoreTagAttr,Q=f.safeAttrValue,x=f.escapeHtml,k=d.attributeWrapSign,$=d.cssFilter;f.stripBlankChar&&(u=e.stripBlankChar(u)),f.allowCommentTag||(u=e.stripCommentTag(u));var C=!1;f.stripIgnoreTagBody&&(C=e.StripTagBody(f.stripIgnoreTagBody,O),O=C.onIgnoreTag);var T=n(u,function(A,M,B,R,D){var q={sourcePosition:A,position:M,isClosing:D,isWhite:Object.prototype.hasOwnProperty.call(p,B)},G=m(B,R,q);if(!o(G))return G;if(q.isWhite){if(q.isClosing)return"</"+B+">";var I=l(R),W=p[B],V=r(I.html,function(E,H){var se=s.indexOf(W,E)!==-1,ee=g(B,E,H,se);return o(ee)?se?(H=Q(B,E,H,$),H?E+"="+k+H+k:E):(ee=b(B,E,H,se),o(ee)?void 0:ee):ee});return R="<"+B,V&&(R+=" "+V),I.closing&&(R+=" /"),R+=">",R}else return G=O(B,R,q),o(G)?x(R):G},x);return C&&(T=C.remove(T)),T},ca=c,ca}var Zf;function UC(){return Zf||(Zf=1,function(i,e){var t=k0(),n=S0(),r=FC();function s(l,a){var h=new r(a);return h.process(l)}e=i.exports=s,e.filterXSS=s,e.FilterXSS=r,function(){for(var l in t)e[l]=t[l];for(var a in n)e[a]=n[a]}(),typeof window<"u"&&(window.filterXSS=i.exports);function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=i.exports)}(oa,oa.exports)),oa.exports}var Br=UC();const HC=YC(Br),KC=jC({__proto__:null,default:HC},[Br]),Xf={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},JC=(i,e)=>{const{extendedWhiteList:t={},xss:n={}}=e;let r;if(typeof n=="function")r=new Br.FilterXSS(n(KC));else{const s=Br.getDefaultWhiteList();[...Object.keys(t),...Object.keys(Xf)].forEach(o=>{const l=s[o]||[],a=Xf[o]||[],h=t[o]||[];s[o]=[...new Set([...l,...a,...h])]}),r=new Br.FilterXSS({whiteList:s,...n})}i.core.ruler.after("linkify","xss",s=>{for(let o=0;o<s.tokens.length;o++){const l=s.tokens[o];switch(l.type){case"html_block":{l.content=r.process(l.content);break}case"inline":{(l.children||[]).forEach(a=>{a.type==="html_inline"&&(a.content=r.process(a.content))});break}}}})},e2=()=>{Object.keys(lt).forEach(i=>{const e=document.getElementById(lt[i]);e&&e.remove()})},d2=Object.freeze(Object.defineProperty({__proto__:null,DropdownToolbar:Tr,MdCatalog:Pn,MdEditor:fo,MdModal:Tn,MdPreview:Ar,ModalToolbar:_r,NormalFooterToolbar:po,NormalToolbar:Er,StrIcon:Kt,XSSPlugin:JC,allFooter:kh,allToolbar:yh,clearSideEffects:e2,config:G0,editorExtensionsAttrs:N0,en_US:qC,prefix:v,zh_CN:BC},Symbol.toStringTag,{value:"Module"}));export{lg as C,Et as E,Se as I,Un as L,Zm as N,Jn as a,Xx as b,ho as c,EO as d,tr as e,gs as f,Ze as g,Do as h,ar as i,hS as j,aS as k,jm as l,ut as m,U as n,Z as o,Ng as p,Xm as q,xg as r,or as s,y as t,Ym as u,Vt as v,d2 as w};
|