diffing 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-agent-Cx2k0Ki7.mjs → cli-agent-Dk0yRtrA.mjs} +6 -6
- package/dist/{cli-gh-BQuQpV-s.mjs → cli-gh-BvoDabKK.mjs} +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/client/assets/{angular-html-CjzmejZ2.js → angular-html-JZN5kc0L.js} +1 -1
- package/dist/client/assets/{angular-ts-DhODVdiO.js → angular-ts-CJtfwtPm.js} +1 -1
- package/dist/client/assets/{apl-KYCqHKQc.js → apl-BW-LdBEV.js} +1 -1
- package/dist/client/assets/{arc-BTiemUXN.js → arc-CxBp7uj_.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-C036F4I_.js → architectureDiagram-3BPJPVTR-DWRcM6V_.js} +1 -1
- package/dist/client/assets/{astro-DDY2SFEm.js → astro-gYWZxO_0.js} +1 -1
- package/dist/client/assets/{blade-B9Mved2V.js → blade-Dhwn6-nM.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-ezdKSZRk.js → blockDiagram-GPEHLZMM-C5RclE5o.js} +1 -1
- package/dist/client/assets/{bsl-BrHd4RA2.js → bsl-CNzWaPUO.js} +1 -1
- package/dist/client/assets/{c-BU4c8hQj.js → c-DStVJ8gV.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-BjbMz8Go.js → c4Diagram-AAUBKEIU-BGUA_e0K.js} +1 -1
- package/dist/client/assets/{cairo-BDZ6TRZS.js → cairo-DeN51fb8.js} +1 -1
- package/dist/client/assets/channel-BqKSU-HY.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-DauPE73Z.js → chunk-2J33WTMH-B7n4bw-R.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-BsKvhBCg.js → chunk-3OPIFGDE-w01g5zoV.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-0ToMTxXn.js → chunk-4BX2VUAB-DxqZfswb.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-CCAvsTMg.js → chunk-55IACEB6-CbDClk6A.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-7a8TYhF5.js → chunk-5ZQYHXKU-CnsO6rSw.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-DsMUzRtp.js → chunk-727SXJPM-BtcRYmEV.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-BsBse6t1.js → chunk-AQP2D5EJ-CGhb3Sth.js} +1 -1
- package/dist/client/assets/{chunk-BSJP7CBP-BRW98vVd.js → chunk-BSJP7CBP-DeuRDOb1.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-aCJK7F2t.js → chunk-CSCIHK7Q-B9E4vQNj.js} +2 -2
- package/dist/client/assets/{chunk-FMBD7UC4-Dqfmok6Y.js → chunk-FMBD7UC4-Bq9LG2aQ.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-D6wKRsyG.js → chunk-KSCS5N6A-BVlK-NC4.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-Cop-6vuh.js → chunk-L5ZTLDWV-DcdQquQQ.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-DOK9MVkj.js → chunk-LZXEDZCA-D3hLMWf5.js} +2 -2
- package/dist/client/assets/{chunk-ND2GUHAM-D4ydI1Xl.js → chunk-ND2GUHAM-0nxCj3q_.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-5L2wTsAU.js → chunk-NZK2D7GU-C_Wkgas6.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-ATeCgJd_.js → chunk-O5CBEL6O-BjWUWCBx.js} +1 -1
- package/dist/client/assets/chunk-QZHKN3VN-BE1tL2Nx.js +1 -0
- package/dist/client/assets/chunk-WU5MYG2G-DP73Gify.js +1 -0
- package/dist/client/assets/{chunk-XPW4576I-CDOLAUs-.js → chunk-XPW4576I-BoIL-UAf.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK--5lgckcu.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CCQu7EQ7.js +1 -0
- package/dist/client/assets/{cobol-BRTNaQEL.js → cobol-BhFBbthm.js} +1 -1
- package/dist/client/assets/{coffee-BklNhfGV.js → coffee-CIJ9uq8T.js} +1 -1
- package/dist/client/assets/{cose-bilkent-S5V4N54A-DqtIDrNy.js → cose-bilkent-S5V4N54A-CbiOjhru.js} +1 -1
- package/dist/client/assets/{cpp-BKMsxxTF.js → cpp-DtSSrq00.js} +1 -1
- package/dist/client/assets/{crystal-CsarWpvB.js → crystal-CukkuPMH.js} +1 -1
- package/dist/client/assets/{css-Dv67WWLO.js → css-B1khiVXh.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-2kISkU7F.js → dagre-BM42HDAG-DV-L1RXR.js} +1 -1
- package/dist/client/assets/{dagre-DAhKikc0.js → dagre-CIBy0Kg6.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-B3rOrr1p.js → diagram-2AECGRRQ-BIS3Tcy4.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-BSCW3vsr.js → diagram-5GNKFQAL-BT7ScWHB.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-B4emGSGw.js → diagram-KO2AKTUF-DhEvzqhQ.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-6EETroK5.js → diagram-LMA3HP47-DIh9QR2k.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-BNjaPw8L.js → diagram-OG6HWLK6-V6xtTYuU.js} +1 -1
- package/dist/client/assets/{dist-6S1F6myp.js → dist--CAI-jgr.js} +1 -1
- package/dist/client/assets/{edge-B4WfWboP.js → edge-CuCj0fvA.js} +1 -1
- package/dist/client/assets/edit-BMeAI0Sj.js +518 -0
- package/dist/client/assets/{elixir-BldSdPyz.js → elixir-CakheKmu.js} +1 -1
- package/dist/client/assets/{elm-Baz9wiad.js → elm-C1NdUKtL.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-De8q4-8o.js → erDiagram-TEJ5UH35-DLJ0CCH3.js} +1 -1
- package/dist/client/assets/{erb-_hp6QFA9.js → erb-CetH6rlA.js} +1 -1
- package/dist/client/assets/{erlang-cuhwpmsu.js → erlang-CyYoaxLR.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-BiqO2ROW.js → flowDiagram-I6XJVG4X-aIYTauNq.js} +1 -1
- package/dist/client/assets/{fortran-fixed-form-DWr0EnJn.js → fortran-fixed-form-CU1NM1Ca.js} +1 -1
- package/dist/client/assets/{fsharp-CQ5iYSPA.js → fsharp-BCcE_A8b.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-CJEE9dI3.js → ganttDiagram-6RSMTGT7-DRQE_4dV.js} +1 -1
- package/dist/client/assets/{gdresource-CN-lsNu5.js → gdresource-B4zvYYkN.js} +1 -1
- package/dist/client/assets/{git-commit-6e79eN7Q.js → git-commit-DFJq_3Fo.js} +1 -1
- package/dist/client/assets/{git-rebase-CVUn24-q.js → git-rebase-sKnthHnf.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-C9__0BRT.js → gitGraphDiagram-PVQCEYII-DbSrYZsG.js} +1 -1
- package/dist/client/assets/{glimmer-js-DzJxhDKm.js → glimmer-js-Bt7nvyGa.js} +1 -1
- package/dist/client/assets/{glimmer-ts-C6Y0EC83.js → glimmer-ts-YO9zmz82.js} +1 -1
- package/dist/client/assets/{glsl-CEgGa7dW.js → glsl-DsvRozYb.js} +1 -1
- package/dist/client/assets/{graphql-OMSQo6QZ.js → graphql-sXzHf_gb.js} +1 -1
- package/dist/client/assets/{hack-DeuNiRTG.js → hack-C3UDBYU5.js} +1 -1
- package/dist/client/assets/{haml-MTFzbqPZ.js → haml-Bfx2v9ts.js} +1 -1
- package/dist/client/assets/{handlebars-aV-3jqy-.js → handlebars-D7y9m08n.js} +1 -1
- package/dist/client/assets/{html-Dk7NFvoe.js → html-LJt8Nrzd.js} +1 -1
- package/dist/client/assets/{html-derivative-Dj5eILVA.js → html-derivative-GRYtRNx6.js} +1 -1
- package/dist/client/assets/{http-CrTYPxrq.js → http-CFcGSNWA.js} +1 -1
- package/dist/client/assets/{hurl-67mqykeb.js → hurl-EaOExxlv.js} +1 -1
- package/dist/client/assets/{hxml-nwJci6H5.js → hxml-jrLeckcs.js} +1 -1
- package/dist/client/assets/index-BR6EGJ-g.css +1 -0
- package/dist/client/assets/index-DIOUI027.js +3729 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-BNodlxnx.js → infoDiagram-5YYISTIA-CT2k1ZKR.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-2hqxFXYT.js → ishikawaDiagram-YF4QCWOH-D9ZWerXw.js} +1 -1
- package/dist/client/assets/{java-dUpx0fOI.js → java-QdNEgqNn.js} +1 -1
- package/dist/client/assets/{javascript-BAe3TrQC.js → javascript-C0TUIalv.js} +1 -1
- package/dist/client/assets/{jinja-DkZ6M3Ab.js → jinja-CHXCs943.js} +1 -1
- package/dist/client/assets/{jison-DM35qhgH.js → jison-Cu1JVrPL.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-D1K8YBBZ.js → journeyDiagram-JHISSGLW-CS0prGm3.js} +1 -1
- package/dist/client/assets/{json-BllrVlVX.js → json-DbuC832p.js} +1 -1
- package/dist/client/assets/{jsx-D7cROKfU.js → jsx-D2ojEfVP.js} +1 -1
- package/dist/client/assets/{julia-D9WQ8mfH.js → julia-DBG4gf9M.js} +1 -1
- package/dist/client/assets/{just-DaRB3DJQ.js → just-cnG6iJYR.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-DyyK3SjG.js → kanban-definition-UN3LZRKU-B5_nyCCN.js} +1 -1
- package/dist/client/assets/{latex-DF20a121.js → latex-C-t8YHXx.js} +1 -1
- package/dist/client/assets/{line-CIqf1T-G.js → line-PhY2p9yO.js} +1 -1
- package/dist/client/assets/{linear-DRktwZya.js → linear-DZfj4bbh.js} +1 -1
- package/dist/client/assets/{liquid-1TnFZcmx.js → liquid-BXKFGxIR.js} +1 -1
- package/dist/client/assets/{lua-DiFnBrnv.js → lua-BNuqYfRm.js} +1 -1
- package/dist/client/assets/{marko-BwZ8-6ja.js → marko-DSC8kwzM.js} +1 -1
- package/dist/client/assets/{mdc-P-pYOfTm.js → mdc-BwB9Dj6D.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-ZB3FBqrQ.js → mermaid-parser.core-BrVg46EN.js} +1 -1
- package/dist/client/assets/{mermaid.core-ChEL4MWP.js → mermaid.core-Bnf5T6PT.js} +3 -3
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-D2iiEHt1.js → mindmap-definition-RKZ34NQL-CAomoDK8.js} +1 -1
- package/dist/client/assets/{nextflow-DSfydIxt.js → nextflow-DIxDAddB.js} +1 -1
- package/dist/client/assets/{nginx-Dsk_n7oR.js → nginx-BrQvZxpD.js} +1 -1
- package/dist/client/assets/{nim-Ck1s300a.js → nim-tVYcrqi1.js} +1 -1
- package/dist/client/assets/{ordinal-5ziJS8mo.js → ordinal-B18MEz2T.js} +1 -1
- package/dist/client/assets/{perl-B41o_jjC.js → perl-B-60oGLc.js} +1 -1
- package/dist/client/assets/{php-CMujlzV0.js → php-DJJABwVz.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-C8ENYMuT.js → pieDiagram-4H26LBE5-BOtZhQH4.js} +1 -1
- package/dist/client/assets/pierre-dark-DG3NnPOY.js +1 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-DSdBzmCa.js +1 -0
- package/dist/client/assets/pierre-dark-soft-DHijSqjL.js +1 -0
- package/dist/client/assets/pierre-dark-tritanopia-DxHMRsaw.js +1 -0
- package/dist/client/assets/pierre-dark-vibrant-D71fG8Ud.js +1 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-CAngHQA6.js +1 -0
- package/dist/client/assets/pierre-light-soft-_hKYgvpi.js +1 -0
- package/dist/client/assets/pierre-light-t0wnbkUB.js +1 -0
- package/dist/client/assets/pierre-light-tritanopia-DdcSkHqu.js +1 -0
- package/dist/client/assets/pierre-light-vibrant-BKSVzEVV.js +1 -0
- package/dist/client/assets/{pug-D11187PM.js → pug-KJGvmNqp.js} +1 -1
- package/dist/client/assets/{qml-DTIWhV-g.js → qml-6M7QCkVi.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-C9Gl58SH.js → quadrantDiagram-W4KKPZXB-Pcpz6-BU.js} +1 -1
- package/dist/client/assets/{r-BZAS-COm.js → r-CJX_7SfZ.js} +1 -1
- package/dist/client/assets/{razor-CBm_RlUZ.js → razor-DYZH4-tY.js} +1 -1
- package/dist/client/assets/{regexp-BEybnWDb.js → regexp-DWtQcg88.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-nDCWYz0l.js → requirementDiagram-4Y6WPE33-Cruba0r2.js} +1 -1
- package/dist/client/assets/{review-export-D5JAvT15.js → review-export-DUMpiyN2.js} +1 -1
- package/dist/client/assets/{rst-BOC8MHym.js → rst-idvXY1TW.js} +1 -1
- package/dist/client/assets/{ruby-DaL2rAtC.js → ruby-CBUdU1Jx.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-C4_qZSDA.js → sankeyDiagram-5OEKKPKP-DpLjNHX_.js} +1 -1
- package/dist/client/assets/{sas-JlJDv85T.js → sas-CD7-yPwf.js} +1 -1
- package/dist/client/assets/{scss-uXJKsv_B.js → scss-CcmN3LNf.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-aWpy-ufU.js → sequenceDiagram-3UESZ5HK-Dxvk3OQI.js} +1 -1
- package/dist/client/assets/{shaderlab-CbbQwRPF.js → shaderlab-ChwEEuJS.js} +1 -1
- package/dist/client/assets/{shellscript-HMUWC9b7.js → shellscript-BxkDFxdN.js} +1 -1
- package/dist/client/assets/{shellsession-C8yhvjix.js → shellsession-Bz5EKpQO.js} +1 -1
- package/dist/client/assets/{soy-Dz4Z0AvF.js → soy-DMVQQ2W2.js} +1 -1
- package/dist/client/assets/{sparql-DEoxFJ5d.js → sparql-C9c0CFPV.js} +1 -1
- package/dist/client/assets/{sql-DeGOlIES.js → sql-B-oK6O9W.js} +1 -1
- package/dist/client/assets/{src-DppXJDZm.js → src-BNoZKBH3.js} +1 -1
- package/dist/client/assets/{stata-B56wP_fZ.js → stata-CUZrRD4_.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-B-LApCfg.js → stateDiagram-AJRCARHV-DcGkjwzF.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DVv3yrP9.js +1 -0
- package/dist/client/assets/{surrealql-C-EnKGgM.js → surrealql-TyxgDynf.js} +1 -1
- package/dist/client/assets/{svelte-B-gz1UqK.js → svelte-nYNHcaCO.js} +1 -1
- package/dist/client/assets/{templ-DbohGIUJ.js → templ-DfKxw_Rl.js} +1 -1
- package/dist/client/assets/{tex-BeTSKLqn.js → tex-CNwID2CI.js} +1 -1
- package/dist/client/assets/{timeline-definition-PNZ67QCA-CIXefp7c.js → timeline-definition-PNZ67QCA-CluiloeV.js} +1 -1
- package/dist/client/assets/{ts-tags-BkO3jza8.js → ts-tags-DgUARkAi.js} +1 -1
- package/dist/client/assets/{tsx-DaFYbbmG.js → tsx-2yb3iicd.js} +1 -1
- package/dist/client/assets/{twig-DzCVyQww.js → twig-l1ft8ReI.js} +1 -1
- package/dist/client/assets/{typescript-Dln4zzcr.js → typescript-BZqXFlL1.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-CGlY8H3X.js → vennDiagram-CIIHVFJN-DHRoQg07.js} +1 -1
- package/dist/client/assets/{vue-BzONpLvY.js → vue-BgXkMZZj.js} +1 -1
- package/dist/client/assets/{vue-html-COcQmVJc.js → vue-html-Byxl7Gyw.js} +1 -1
- package/dist/client/assets/{vue-vine-DVjvhNim.js → vue-vine-Bzpp44S9.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-Ceqd_0r2.js → wardleyDiagram-YWT4CUSO-DQ_ujF1q.js} +1 -1
- package/dist/client/assets/worker-BJu97yub.js +161 -0
- package/dist/client/assets/{xml-BdpFphXw.js → xml-CpwLtzxK.js} +1 -1
- package/dist/client/assets/{xsl-B0CVAfmA.js → xsl-VlCQyM4_.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-DVSLRUjt.js → xychartDiagram-2RQKCTM6-DjG2u0Gz.js} +1 -1
- package/dist/client/assets/{yaml-DS_pFZ8s.js → yaml-BypQObHK.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/{doctor-BRr5IWHe.mjs → doctor-BdDB6p27.mjs} +1 -1
- package/dist/{doctor-BMfx7_GY.mjs → doctor-BxTaLqAF.mjs} +3 -3
- package/dist/github--rpPZ3vK.mjs +2 -0
- package/dist/{github-DbAFoB92.mjs → github-CToLsvPu.mjs} +90 -6
- package/dist/{github-attachments-fNCKYL-Z.mjs → github-attachments-DEvAeo5P.mjs} +1 -1
- package/dist/{mcp-Bi551clR.mjs → mcp-C9HpAFs0.mjs} +3 -3
- package/dist/native/tui-darwin-arm64/diffing-tui +0 -0
- package/dist/native/tui-darwin-x64/diffing-tui +0 -0
- package/dist/native/tui-linux-arm64-gnu/diffing-tui +0 -0
- package/dist/native/tui-linux-arm64-musl/diffing-tui +0 -0
- package/dist/native/tui-linux-x64-gnu/diffing-tui +0 -0
- package/dist/native/tui-linux-x64-musl/diffing-tui +0 -0
- package/dist/native/tui-win32-x64-msvc/diffing-tui.exe +0 -0
- package/dist/{server-B9NVZu7l.mjs → server-BmQqrWy4.mjs} +63 -8
- package/dist/{server-lock-BNI8FKV1.mjs → server-lock-CdaUNZyX.mjs} +33 -4
- package/dist/{session-conflict-CB0IErdn.mjs → session-conflict-BVgyyerQ.mjs} +2 -2
- package/dist/{session-manager-656aJXFE.mjs → session-manager-CUqF8hkP.mjs} +2 -2
- package/dist/{session-url-B8TrGGeE.mjs → session-url-B9FOnF3F.mjs} +1 -1
- package/dist/{setup-BiwX7vdd.mjs → setup-BnS_rSxK.mjs} +1 -1
- package/package.json +5 -3
- package/dist/client/assets/channel-CiiG2TKm.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-BgSjRmyr.js +0 -1
- package/dist/client/assets/chunk-WU5MYG2G-tQV9amHv.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-S7JMn6cj.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-bWQM1WnL.js +0 -1
- package/dist/client/assets/index-BmrUfJcW.css +0 -1
- package/dist/client/assets/index-DsE97mBG.js +0 -4024
- package/dist/client/assets/pierre-dark-Gtc9M_gS.js +0 -1
- package/dist/client/assets/pierre-light-EDxMHmhf.js +0 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Dsaju7vd.js +0 -1
- package/dist/client/assets/worker-ZCX3SXK5.js +0 -160
- package/dist/github-BLrnsozP.mjs +0 -2
- /package/dist/client/assets/{abap-cWYhO34H.js → abap-vey6FMUr.js} +0 -0
- /package/dist/client/assets/{actionscript-3-B80ndJsD.js → actionscript-3-my8xn3-B.js} +0 -0
- /package/dist/client/assets/{ada-C0C0SoYB.js → ada-ZTrh2YXI.js} +0 -0
- /package/dist/client/assets/{andromeeda-Ch2kWS7s.js → andromeeda-CneIsnZz.js} +0 -0
- /package/dist/client/assets/{apache-DBwBm4bB.js → apache-DRxy-z5z.js} +0 -0
- /package/dist/client/assets/{apex-FcV7UxQi.js → apex-dYa_qg4y.js} +0 -0
- /package/dist/client/assets/{applescript-hQs8VNpS.js → applescript-DFO6YSHI.js} +0 -0
- /package/dist/client/assets/{ara-BOadBOZg.js → ara-izJ2hroH.js} +0 -0
- /package/dist/client/assets/{array-CkF66D10.js → array-JCb05fOg.js} +0 -0
- /package/dist/client/assets/{asciidoc-BsfqiBck.js → asciidoc-BEIHtPMJ.js} +0 -0
- /package/dist/client/assets/{asm-C2vUqzqz.js → asm-B_7A3hVM.js} +0 -0
- /package/dist/client/assets/{aurora-x-BHLqzt7j.js → aurora-x-Bc4rKs7r.js} +0 -0
- /package/dist/client/assets/{awk-D4e-eeZT.js → awk-DolF6Tr1.js} +0 -0
- /package/dist/client/assets/{ayu-dark-DCotN_ZT.js → ayu-dark-DKZmpFRB.js} +0 -0
- /package/dist/client/assets/{ayu-light-CKB6o_im.js → ayu-light-Cpvesbhh.js} +0 -0
- /package/dist/client/assets/{ayu-mirage-B38lW-C5.js → ayu-mirage-DC2LB4Dr.js} +0 -0
- /package/dist/client/assets/{ballerina-BzvFqbha.js → ballerina-fBGtp9ZO.js} +0 -0
- /package/dist/client/assets/{bat-CFyw2ERn.js → bat-a27F4u0a.js} +0 -0
- /package/dist/client/assets/{beancount-a6Gsu5WX.js → beancount-DoAic3vC.js} +0 -0
- /package/dist/client/assets/{berry-C2jyz4Ah.js → berry-wRZBip4S.js} +0 -0
- /package/dist/client/assets/{bibtex-Dyet-B83.js → bibtex-C6tL9gJb.js} +0 -0
- /package/dist/client/assets/{bicep-CghvUIvy.js → bicep-FAGekWcZ.js} +0 -0
- /package/dist/client/assets/{bird2-nHigvs-R.js → bird2-D47vUAud.js} +0 -0
- /package/dist/client/assets/{c3-9ZrcmAmr.js → c3-9Ln86NZ6.js} +0 -0
- /package/dist/client/assets/{cadence-BPDgYNWy.js → cadence-vteWs_Q-.js} +0 -0
- /package/dist/client/assets/{catppuccin-frappe-BY_2ofjk.js → catppuccin-frappe-D5mJxQRe.js} +0 -0
- /package/dist/client/assets/{catppuccin-latte-D6GXPBmA.js → catppuccin-latte-DmTgxxPG.js} +0 -0
- /package/dist/client/assets/{catppuccin-macchiato-BuW8_cyo.js → catppuccin-macchiato-DzwtIliU.js} +0 -0
- /package/dist/client/assets/{catppuccin-mocha-znex9DPe.js → catppuccin-mocha-DFdjXNU1.js} +0 -0
- /package/dist/client/assets/{clarity-Cmao5KSK.js → clarity-Db5au7bW.js} +0 -0
- /package/dist/client/assets/{clojure-D2dPuTkk.js → clojure-DlXg2HmZ.js} +0 -0
- /package/dist/client/assets/{cmake-DaqQuj4A.js → cmake-CUpRt8Bg.js} +0 -0
- /package/dist/client/assets/{codeowners-B748jmvc.js → codeowners-gFMN20nn.js} +0 -0
- /package/dist/client/assets/{codeql-CXb_8gHR.js → codeql-zhKE1bQw.js} +0 -0
- /package/dist/client/assets/{common-lisp-UZn9nc_5.js → common-lisp-BpXWYlpx.js} +0 -0
- /package/dist/client/assets/{coq-DtO6yBIf.js → coq-Brnzrk62.js} +0 -0
- /package/dist/client/assets/{csharp-C3YlYcLV.js → csharp-D2NkPFJ-.js} +0 -0
- /package/dist/client/assets/{csv-BBwiVr0X.js → csv-JHfwQxu2.js} +0 -0
- /package/dist/client/assets/{cue-ScBFXY5f.js → cue-DfRd-AMP.js} +0 -0
- /package/dist/client/assets/{cypher-CGStaC1X.js → cypher-CU79q-JJ.js} +0 -0
- /package/dist/client/assets/{cytoscape.esm-B7MQoI9k.js → cytoscape.esm-V2_1G5GI.js} +0 -0
- /package/dist/client/assets/{d-CuTCIvnX.js → d-Bb_5rtK0.js} +0 -0
- /package/dist/client/assets/{dark-plus-BvePH-r3.js → dark-plus-Vx1q1FnL.js} +0 -0
- /package/dist/client/assets/{dart-CqEodbm2.js → dart-DCM4wyEW.js} +0 -0
- /package/dist/client/assets/{dax-UdE5S0Dh.js → dax-C8RqKH5h.js} +0 -0
- /package/dist/client/assets/{defaultLocale-B_TxGd0k.js → defaultLocale-CoZnZq-L.js} +0 -0
- /package/dist/client/assets/{desktop-DfmsfHJA.js → desktop-C4YoEmhs.js} +0 -0
- /package/dist/client/assets/{diff-CW0RWGd9.js → diff-CUbdp-_8.js} +0 -0
- /package/dist/client/assets/{docker-B1qtW4ha.js → docker-BYHJWJjt.js} +0 -0
- /package/dist/client/assets/{dotenv-BUzOh1k8.js → dotenv-BKFUR1iV.js} +0 -0
- /package/dist/client/assets/{dracula-kJQjC_Gy.js → dracula-Fwyt6QVU.js} +0 -0
- /package/dist/client/assets/{dracula-soft-B3XhEjCl.js → dracula-soft-WVoP9zcY.js} +0 -0
- /package/dist/client/assets/{dream-maker-CBvk18nW.js → dream-maker-D_STdqP4.js} +0 -0
- /package/dist/client/assets/{emacs-lisp-DvSgLhDc.js → emacs-lisp-CBaydq9s.js} +0 -0
- /package/dist/client/assets/{everforest-dark-u0zLn75q.js → everforest-dark-Dy1ID6LQ.js} +0 -0
- /package/dist/client/assets/{everforest-light-D3syIoAR.js → everforest-light-DCq3_A9C.js} +0 -0
- /package/dist/client/assets/{fennel-C-1kWlGf.js → fennel-C_EMPuDd.js} +0 -0
- /package/dist/client/assets/{fish-CCpdtwqS.js → fish-Bj00gCwr.js} +0 -0
- /package/dist/client/assets/{fluent-BLg032oD.js → fluent-DUG6ecx0.js} +0 -0
- /package/dist/client/assets/{fortran-free-form-Br4jRtSc.js → fortran-free-form-DJlrt_Va.js} +0 -0
- /package/dist/client/assets/{gdscript-hSAZM1eh.js → gdscript-C-KM_e-o.js} +0 -0
- /package/dist/client/assets/{gdshader-D4XNAEs9.js → gdshader-B5KAq9U-.js} +0 -0
- /package/dist/client/assets/{genie-DmN-ICAN.js → genie-kvovXJpW.js} +0 -0
- /package/dist/client/assets/{gherkin-cuHHmRcX.js → gherkin-gaZwMa5o.js} +0 -0
- /package/dist/client/assets/{github-dark-CEBLh0--.js → github-dark-DT409rZJ.js} +0 -0
- /package/dist/client/assets/{github-dark-default-Dq0Z4Xai.js → github-dark-default-CpUaksTJ.js} +0 -0
- /package/dist/client/assets/{github-dark-dimmed-D90YmS4w.js → github-dark-dimmed-CwpwNIJ3.js} +0 -0
- /package/dist/client/assets/{github-dark-high-contrast-B6BWv1iC.js → github-dark-high-contrast-DqKHRKzY.js} +0 -0
- /package/dist/client/assets/{github-light-lXSVSq5T.js → github-light-CjDDPH0V.js} +0 -0
- /package/dist/client/assets/{github-light-default-DsPWmj4v.js → github-light-default-Bqn2FMJx.js} +0 -0
- /package/dist/client/assets/{github-light-high-contrast-C7aLb3kp.js → github-light-high-contrast-DJSqnrdB.js} +0 -0
- /package/dist/client/assets/{gleam-D8VhqPDN.js → gleam-DDfmtWEq.js} +0 -0
- /package/dist/client/assets/{gn-BjGRlX27.js → gn-lRhe7knx.js} +0 -0
- /package/dist/client/assets/{gnuplot-BZCXuE4q.js → gnuplot-Dsvl7CSU.js} +0 -0
- /package/dist/client/assets/{go-BJpWXZEs.js → go-ClykLgTr.js} +0 -0
- /package/dist/client/assets/{graphlib-DBdw4opr.js → graphlib-XmsQ2HBS.js} +0 -0
- /package/dist/client/assets/{groovy-D9w3Dn-z.js → groovy-epR4RNba.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-hard-_deksD0U.js → gruvbox-dark-hard-JU0kGeLU.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-medium-CT31284j.js → gruvbox-dark-medium-BXYu8VXB.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-soft-BZuEUCbj.js → gruvbox-dark-soft-CAFUIeaG.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-hard-dxv4n_ZS.js → gruvbox-light-hard-68yp_JaY.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-medium-BsW_fVfR.js → gruvbox-light-medium-BfZIAUTN.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-soft-BiGy99gD.js → gruvbox-light-soft-Bct3ikgS.js} +0 -0
- /package/dist/client/assets/{haskell-DqDdKEgk.js → haskell-CkI6ofLi.js} +0 -0
- /package/dist/client/assets/{haxe-DMg0jS3a.js → haxe-D2IO3jfA.js} +0 -0
- /package/dist/client/assets/{hcl-SZIZUK_X.js → hcl-C2LzlY8J.js} +0 -0
- /package/dist/client/assets/{hjson-DF1VspiE.js → hjson-D56Gqm-A.js} +0 -0
- /package/dist/client/assets/{hlsl-DPe9L0Dt.js → hlsl-B-BU3OYV.js} +0 -0
- /package/dist/client/assets/{horizon-Ngud75Kn.js → horizon-D_7125Q1.js} +0 -0
- /package/dist/client/assets/{horizon-bright-Cnljd0XD.js → horizon-bright-Ca8HuoFF.js} +0 -0
- /package/dist/client/assets/{houston-BenZxlMr.js → houston-JAv2TEQ1.js} +0 -0
- /package/dist/client/assets/{hy-B0f-B1mH.js → hy-w2Jzz9m_.js} +0 -0
- /package/dist/client/assets/{imba-Bq3j1cW5.js → imba-DPbBdr6e.js} +0 -0
- /package/dist/client/assets/{ini-BayloP2U.js → ini-IKH7SH19.js} +0 -0
- /package/dist/client/assets/{init-Ce66tIvf.js → init-BQDWPBzZ.js} +0 -0
- /package/dist/client/assets/{json5-CRSfdIrY.js → json5-BocpWhvz.js} +0 -0
- /package/dist/client/assets/{jsonc-y4g9DQPx.js → jsonc-NK67I9hJ.js} +0 -0
- /package/dist/client/assets/{jsonl-D2paVn9r.js → jsonl-Cb0uXk6R.js} +0 -0
- /package/dist/client/assets/{jsonnet-CLH27mtz.js → jsonnet-CpK_1aUl.js} +0 -0
- /package/dist/client/assets/{jssm-CPPYaqX-.js → jssm-CrL4dqHX.js} +0 -0
- /package/dist/client/assets/{kanagawa-dragon-Bt5mhLu1.js → kanagawa-dragon-Cjq94PqN.js} +0 -0
- /package/dist/client/assets/{kanagawa-lotus-FGA3pRJk.js → kanagawa-lotus-C7qryZ57.js} +0 -0
- /package/dist/client/assets/{kanagawa-wave-DnLVZPAD.js → kanagawa-wave-DImnYG7O.js} +0 -0
- /package/dist/client/assets/{katex-eRFNlMh0.js → katex-7f5yKJf5.js} +0 -0
- /package/dist/client/assets/{kdl-D1BQjjnw.js → kdl-T7f1MobK.js} +0 -0
- /package/dist/client/assets/{kotlin-ndCaDnf0.js → kotlin-DO-VvyWi.js} +0 -0
- /package/dist/client/assets/{kusto-D-4nbkD3.js → kusto-CngRjJvY.js} +0 -0
- /package/dist/client/assets/{laserwave-D2qAZkaG.js → laserwave-CN-xxJxn.js} +0 -0
- /package/dist/client/assets/{lean-YmtAsB0p.js → lean-BvZrUnoV.js} +0 -0
- /package/dist/client/assets/{less-DyHub3ow.js → less-BHMNlKwo.js} +0 -0
- /package/dist/client/assets/{light-plus-CP13QUvm.js → light-plus-DWzqIF7F.js} +0 -0
- /package/dist/client/assets/{llvm-DCcqrY0D.js → llvm-BGG7pW3S.js} +0 -0
- /package/dist/client/assets/{log-DWAAMNbe.js → log-epZwUMJs.js} +0 -0
- /package/dist/client/assets/{logo-ClQMGkNL.js → logo-Bi5ZxfEs.js} +0 -0
- /package/dist/client/assets/{luau-CmcXFvLt.js → luau-Q3oZEzh4.js} +0 -0
- /package/dist/client/assets/{make-DcfJyUzm.js → make-D7Rpg3XJ.js} +0 -0
- /package/dist/client/assets/{markdown-DXxotAxn.js → markdown-h2a5XRAL.js} +0 -0
- /package/dist/client/assets/{material-theme-JFoPTBSr.js → material-theme-DWWfrqZ-.js} +0 -0
- /package/dist/client/assets/{material-theme-darker-BHaqZ19v.js → material-theme-darker-wgpDhYQC.js} +0 -0
- /package/dist/client/assets/{material-theme-lighter-CGnnS2bs.js → material-theme-lighter-C5OsHZ4H.js} +0 -0
- /package/dist/client/assets/{material-theme-ocean-Drhewjqf.js → material-theme-ocean-CvMZFbQ9.js} +0 -0
- /package/dist/client/assets/{material-theme-palenight-DbUypmpb.js → material-theme-palenight-COZXb0oL.js} +0 -0
- /package/dist/client/assets/{matlab-BlfbTznR.js → matlab-D0w6VRbU.js} +0 -0
- /package/dist/client/assets/{mdx-H8fyPQd8.js → mdx-hyTZaJXs.js} +0 -0
- /package/dist/client/assets/{mermaid-CWAV2dmV.js → mermaid-1Zr1MxpD.js} +0 -0
- /package/dist/client/assets/{min-dark-BEelvXUB.js → min-dark-CqCBi6M4.js} +0 -0
- /package/dist/client/assets/{min-light-CTPBOACR.js → min-light-BBoxwOhR.js} +0 -0
- /package/dist/client/assets/{mipsasm-BWYFAm2s.js → mipsasm-CO_Vmqe9.js} +0 -0
- /package/dist/client/assets/{mojo-DZcPJEIN.js → mojo-BEKlpmL9.js} +0 -0
- /package/dist/client/assets/{monokai-DQlZXbkg.js → monokai-BB88t5ne.js} +0 -0
- /package/dist/client/assets/{moonbit-6eslNlJL.js → moonbit-DJGG1uzT.js} +0 -0
- /package/dist/client/assets/{move-DxFc9-QU.js → move-BHMiRKa7.js} +0 -0
- /package/dist/client/assets/{narrat-gv38dJOT.js → narrat-BKaN0mLL.js} +0 -0
- /package/dist/client/assets/{nextflow-groovy-DV4H3hok.js → nextflow-groovy-De9GdmGw.js} +0 -0
- /package/dist/client/assets/{night-owl-BLcrYhaC.js → night-owl-DmUU-_lq.js} +0 -0
- /package/dist/client/assets/{night-owl-light-BG-tBJOz.js → night-owl-light-DMovtpwj.js} +0 -0
- /package/dist/client/assets/{nix-NlOz3HGM.js → nix-CAu-Epnf.js} +0 -0
- /package/dist/client/assets/{nord-Dm2F5_QB.js → nord-Cq5Den5w.js} +0 -0
- /package/dist/client/assets/{nushell-D86Z8aFF.js → nushell-BwuEMOPF.js} +0 -0
- /package/dist/client/assets/{objective-c-iuJvUjCv.js → objective-c-DNQk03nL.js} +0 -0
- /package/dist/client/assets/{objective-cpp-C62JvfMT.js → objective-cpp-AnicUCPq.js} +0 -0
- /package/dist/client/assets/{ocaml-Rbryo9lg.js → ocaml-BBI2LBdX.js} +0 -0
- /package/dist/client/assets/{odin-CfaOVNP_.js → odin-BJIKbElf.js} +0 -0
- /package/dist/client/assets/{one-dark-pro-DC9SHdX0.js → one-dark-pro-DvHC48R_.js} +0 -0
- /package/dist/client/assets/{one-light-Doo39p0H.js → one-light-DqhWsBuX.js} +0 -0
- /package/dist/client/assets/{openscad-DCRhgheK.js → openscad-Cb2s5BCi.js} +0 -0
- /package/dist/client/assets/{pascal-CTesTHtV.js → pascal-B1ez31ad.js} +0 -0
- /package/dist/client/assets/{path-g3G46IZB.js → path-C4mrXsW7.js} +0 -0
- /package/dist/client/assets/{pkl-BjUMjQkt.js → pkl-DmC1-FXa.js} +0 -0
- /package/dist/client/assets/{plastic-B3CcSpon.js → plastic-D9ELbINl.js} +0 -0
- /package/dist/client/assets/{plsql-BgKEZSSo.js → plsql-DyPUGhhH.js} +0 -0
- /package/dist/client/assets/{po-C5s_CVt8.js → po-AeWiHfKa.js} +0 -0
- /package/dist/client/assets/{poimandres-BsK70ma5.js → poimandres-BbzxxHPn.js} +0 -0
- /package/dist/client/assets/{polar-y4hX8qM0.js → polar-Bht-ciCi.js} +0 -0
- /package/dist/client/assets/{postcss-BHCm7Qae.js → postcss-Nnu-lNQ3.js} +0 -0
- /package/dist/client/assets/{powerquery-C2vMt8aZ.js → powerquery-GomboZMg.js} +0 -0
- /package/dist/client/assets/{powershell-DEcjmg1c.js → powershell-ZgpTdYrb.js} +0 -0
- /package/dist/client/assets/{prisma-Ba-Tcxy5.js → prisma-DmHLUH7Z.js} +0 -0
- /package/dist/client/assets/{prolog-B4o261Jv.js → prolog-D4BN-J5S.js} +0 -0
- /package/dist/client/assets/{proto-o3IZKiMR.js → proto-BziI4vEA.js} +0 -0
- /package/dist/client/assets/{puppet-BC0dqZ31.js → puppet-DZLzAalY.js} +0 -0
- /package/dist/client/assets/{purescript-CLDw1y5G.js → purescript-ByVmdUua.js} +0 -0
- /package/dist/client/assets/{python-D1NFioGW.js → python-BM22ZOLA.js} +0 -0
- /package/dist/client/assets/{qmldir-B7i9e9Vn.js → qmldir-C-dHdEsy.js} +0 -0
- /package/dist/client/assets/{qss-DIe6oKX8.js → qss-Cm6TuuqD.js} +0 -0
- /package/dist/client/assets/{racket-CAOC_yyk.js → racket-Dkf2VwPO.js} +0 -0
- /package/dist/client/assets/{raku-Ccua3vW6.js → raku-DrOL7bjF.js} +0 -0
- /package/dist/client/assets/{red-DtDH206x.js → red-DMKoyNTl.js} +0 -0
- /package/dist/client/assets/{reg-CAYZT9kE.js → reg-BPKh5ogl.js} +0 -0
- /package/dist/client/assets/{rel-cvB6F5nO.js → rel-zDwkKiX1.js} +0 -0
- /package/dist/client/assets/{riscv-SYGtE4EN.js → riscv-C0qb7d6i.js} +0 -0
- /package/dist/client/assets/{ron-CRt869SB.js → ron-CxdzFhOl.js} +0 -0
- /package/dist/client/assets/{rose-pine-CjBfSJ5b.js → rose-pine-CERl25PP.js} +0 -0
- /package/dist/client/assets/{rose-pine-dawn-C0xwy7iJ.js → rose-pine-dawn-9oXTxZFr.js} +0 -0
- /package/dist/client/assets/{rose-pine-moon-BSNy9Ty0.js → rose-pine-moon-Zy2VTZyw.js} +0 -0
- /package/dist/client/assets/{rosmsg-BwrfJ66Z.js → rosmsg-_885Hvdk.js} +0 -0
- /package/dist/client/assets/{rough.esm-BBrzuQ0N.js → rough.esm-CfLNTxPb.js} +0 -0
- /package/dist/client/assets/{rust-DCKTTPxN.js → rust-TVzC0_ro.js} +0 -0
- /package/dist/client/assets/{sass-CorcwySt.js → sass-DmVLXOtD.js} +0 -0
- /package/dist/client/assets/{scala-DlI-OmYj.js → scala-5pfDDKQK.js} +0 -0
- /package/dist/client/assets/{scheme-CcNEGkZH.js → scheme-BQLovk51.js} +0 -0
- /package/dist/client/assets/{sdbl-AL_m-RO_.js → sdbl-OSK-5luq.js} +0 -0
- /package/dist/client/assets/{slack-dark-rMhrfPm6.js → slack-dark-DydfDgCL.js} +0 -0
- /package/dist/client/assets/{slack-ochin-9w8X74hU.js → slack-ochin-CzQtVspP.js} +0 -0
- /package/dist/client/assets/{smalltalk-Y2ogrfbk.js → smalltalk-L3BbkSys.js} +0 -0
- /package/dist/client/assets/{snazzy-light-DHr9ygpP.js → snazzy-light-CN4AGa9X.js} +0 -0
- /package/dist/client/assets/{solarized-dark-UPcKev9Q.js → solarized-dark-BfOjRT5R.js} +0 -0
- /package/dist/client/assets/{solarized-light-DUsjROvl.js → solarized-light-BScPjljz.js} +0 -0
- /package/dist/client/assets/{solidity-Bfbm9QZQ.js → solidity-CLGumYJy.js} +0 -0
- /package/dist/client/assets/{splunk-6DJA2XFa.js → splunk-CyEPDxNz.js} +0 -0
- /package/dist/client/assets/{ssh-config-CbQtdF-u.js → ssh-config-CVvZZwRx.js} +0 -0
- /package/dist/client/assets/{stylus-B_iq45Sj.js → stylus-Be_2nKLA.js} +0 -0
- /package/dist/client/assets/{swift-C7KIgN-p.js → swift-D6N4iA16.js} +0 -0
- /package/dist/client/assets/{synthwave-84-lf_Wt0K_.js → synthwave-84-CnA0AANO.js} +0 -0
- /package/dist/client/assets/{system-verilog-C3G9wERd.js → system-verilog-iQh8ktbe.js} +0 -0
- /package/dist/client/assets/{systemd-CwxGrojj.js → systemd-DytnOpVA.js} +0 -0
- /package/dist/client/assets/{talonscript-DqnSo1EO.js → talonscript-BDLqGQX7.js} +0 -0
- /package/dist/client/assets/{tasl-T8ethp86.js → tasl-B73cKR59.js} +0 -0
- /package/dist/client/assets/{tcl-Ccl366o0.js → tcl-DOjJ63Ed.js} +0 -0
- /package/dist/client/assets/{terraform-BBf6ZI_0.js → terraform-4HveOXOO.js} +0 -0
- /package/dist/client/assets/{tokyo-night-BF5ata25.js → tokyo-night-BPIHNMsP.js} +0 -0
- /package/dist/client/assets/{toml-C5Z_BR4r.js → toml-BtN-zV3i.js} +0 -0
- /package/dist/client/assets/{tsv-rX8sUJs7.js → tsv-CMdCss8w.js} +0 -0
- /package/dist/client/assets/{turtle-BM-MG8WY.js → turtle-CTtYRf8T.js} +0 -0
- /package/dist/client/assets/{typespec-C5gKydvR.js → typespec-DEFH1eCC.js} +0 -0
- /package/dist/client/assets/{typst--_5VchrY.js → typst-CyQejCPd.js} +0 -0
- /package/dist/client/assets/{v-C6PwpmTC.js → v-BXaHfHlN.js} +0 -0
- /package/dist/client/assets/{vala-4pTaceSj.js → vala-CZBBKCzO.js} +0 -0
- /package/dist/client/assets/{vb-DhoR5A6S.js → vb-XkEubmqa.js} +0 -0
- /package/dist/client/assets/{verilog-B9f_1lPn.js → verilog-xOqseBog.js} +0 -0
- /package/dist/client/assets/{vesper-CmBi_iCT.js → vesper-BvHUewHc.js} +0 -0
- /package/dist/client/assets/{vhdl-Cy4RAmOe.js → vhdl-CMMVBCME.js} +0 -0
- /package/dist/client/assets/{viml-CFQW-CcD.js → viml-D0rP4VTs.js} +0 -0
- /package/dist/client/assets/{vitesse-black-CE8RoBJP.js → vitesse-black-DMW95Ad4.js} +0 -0
- /package/dist/client/assets/{vitesse-dark-BpF142p_.js → vitesse-dark-Dsw1zB7a.js} +0 -0
- /package/dist/client/assets/{vitesse-light-CMwxPBrg.js → vitesse-light-CfxzxK7D.js} +0 -0
- /package/dist/client/assets/{vyper-BW5zj9bE.js → vyper-BNu5BXMx.js} +0 -0
- /package/dist/client/assets/{wasm-CSccDuAq.js → wasm-C5V1GnFc.js} +0 -0
- /package/dist/client/assets/{wasm-BigxSLnm.js → wasm-Cyd-t8sb.js} +0 -0
- /package/dist/client/assets/{wenyan-BZzM1SQT.js → wenyan-BAVVk9E4.js} +0 -0
- /package/dist/client/assets/{wgsl-xBPHbLlq.js → wgsl-DSDardKJ.js} +0 -0
- /package/dist/client/assets/{wikitext-BXJWUNJK.js → wikitext-DpoujGid.js} +0 -0
- /package/dist/client/assets/{wit-2GnUs67P.js → wit-efh27Wno.js} +0 -0
- /package/dist/client/assets/{wolfram-DIFDmw-g.js → wolfram-DVAg8L4l.js} +0 -0
- /package/dist/client/assets/{zenscript-DQaUUjbx.js → zenscript-BhDkIsWD.js} +0 -0
- /package/dist/client/assets/{zig-BDepRvBi.js → zig-DYS1KFNL.js} +0 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
import{a as e,c as t,f as n,h as r,i,l as a,m as o,n as s,o as c,p as l,r as u,s as d,u as f}from"./index-DIOUI027.js";var p=100,m=1,h=2,g=3,_=class{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??p)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function v(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?h:n?g:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function y(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=S(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
2
|
+
`)&&!a.text.includes(`
|
|
3
|
+
`),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
|
|
4
|
+
`)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=m,n!==m||e.coalescingMode!==void 0&&e.coalescingMode!==m||t.coalescingMode!==void 0&&t.coalescingMode!==m))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){let r;if(c===i.end)r=g;else if(c+(o.end-o.start)!==i.start)return!1;else r=h;if(n??=r,n!==r||e.coalescingMode!==void 0&&e.coalescingMode!==r||t.coalescingMode!==void 0&&t.coalescingMode!==r)return!1;continue}return!1}return n!==void 0}function b(e,t){let n=[],r=[],i;for(let a=0;a<e.forwardEdits.length;a++){let o=e.forwardEdits[a],s=e.inverseEdits[a],c=t.forwardEdits[a],l=t.inverseEdits[a],u=S(c.start,e.forwardEdits);if(o.text.length>0){i??=m,n.push({start:o.start,end:o.end,text:o.text+c.text}),r.push(s.text);continue}if(u===o.end){i??=g,n.push({start:o.start,end:u+(c.end-c.start),text:``}),r.push(s.text+l.text);continue}i??=h,n.push({start:Math.min(o.start,u),end:o.end,text:``}),r.push(l.text+s.text)}return{forwardEdits:n,inverseEdits:x(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice(),coalescingMode:i}}function x(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function S(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var C=1e5,w=10,T=13,ee=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,E=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+(this.hasVirtualTrailingCRBreak?1:0)}},te=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=t(e)}append(e){let t=this.text.length;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r!==w&&r!==T||(r===T&&e.charCodeAt(n+1)===w&&n++,this.lineOffsets.push(t+n+1))}return this.text+=e,t}},D=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-(A(this.left?.subtreeLastCharCode,this.piece.firstCharCode)?1:0)-(A(this.piece.lastCharCode,this.right?.subtreeFirstCharCode)?1:0),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},ne=class{#e;#t=new te(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=null;#c=2654435769;constructor(e){this.#e=new te(e);let t=this.#y(E.Original,0,e.length);this.#n=t.length>0?this.#C(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#g();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#f(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#f(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&O(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=k(e,0,this.#r),i=k(t,r,this.#r);if(r>=i)return``;let a=this.#u(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#v(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&O(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#d(s)}return o.join(``)}charAt(e){let t=this.#u(e);if(t===void 0)return``;let[n,r]=t;return this.#v(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=re(e),n=0,r=!1;return this.#_(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=ie(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=re(e),a=0,o=0,s,c;return this.#_(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!ae(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
|
|
5
|
+
`)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=fe(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#l(t,e.wholeWord,C)}#l(e,n,r){let i=[],a=this.#g(),o=a.length,s=t(a);for(let t=0;t<s.length;t++){let c=s[t],l=s[t+1]??o;for(;l>c&&O(a.charCodeAt(l-1));)l--;let u=a.slice(c,l);e.lastIndex=0;let d;for(;(d=e.exec(u))!==null;){let t=d.index,o=d[0];if(o.length===0){e.lastIndex=he(u,t);continue}let s=c+t;if((!n||de(a,s,o.length))&&(i.push([s,s+o.length]),i.length>=r))return i;t===e.lastIndex&&(e.lastIndex=he(u,t))}}return i}insert(e,t){if(e.length===0)return;let n=k(t,0,this.#r);this.#b(n,n,e),this.#x()}delete(e,t){if(t<=0||this.#r===0)return;let n=k(e,0,this.#r),r=k(n+t,n,this.#r);n!==r&&(this.#b(n,r,``),this.#x())}applyEdits(e){if(e.length!==0){for(let t=e.length-1;t>=0;t--){let n=e[t],r=k(n.start,0,this.#r),i=k(n.end,r,this.#r);this.#b(r,i,n.text)}this.#x()}}positionAt(e){let t=k(e,0,this.#r);if(this.#r===0)return{line:0,character:0};let n=this.#p(t),r=t-(n===0?0:this.#m(n-1));return this.#s=[n,r,t],{line:n,character:r}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#r===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#r===0)return 0;if(e.line>=this.#i)throw Error(`Line index out of range: ${e.line}`);let t=this.#s;if(t!==null&&t[0]===e.line&&t[1]===e.character)return t[2];let n=this.#f(e.line);if(n===void 0)throw Error(`Line index out of range: ${e.line}`);let r=k(e.character,0,n[1]-n[0]);return n[0]+r}#u(e){if(e<0||e>=this.#r)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}#d(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#f(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#r===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#i)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#m(e-1),e<this.#i-1?this.#m(e):this.#r]}#p(e){let t=this.#n,n=k(e,0,this.#r),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(r+=(t.left?.subtreeLineBreakCount??0)-(A(t.left?.subtreeLastCharCode,t.piece.firstCharCode)?1:0),n-=e,n<=t.piece.length){let e=this.#v(t.piece.source),i=Math.min(ce(e.lineOffsets,t.piece.offset+n),t.piece.lineOffsetEnd);return r+=i-t.piece.lineOffsetStart,n===t.piece.length&&t.piece.hasVirtualTrailingCRBreak&&r++,n===t.piece.length&&A(t.piece.lastCharCode,this.#d(t)?.piece.firstCharCode)&&r--,r}r+=t.piece.lineBreakCount-(A(t.piece.lastCharCode,t.right?.subtreeFirstCharCode)?1:0),n-=t.piece.length,t=t.right}return this.#i-1}#m(e){let t=this.#n,n=e,r=0,i;for(;t!==null;){let e=(t.left?.subtreeLineBreakCount??0)-(A(t.left?.subtreeLastCharCode,t.piece.firstCharCode)?1:0);if(n<e){i=t.piece.firstCharCode,t=t.left;continue}let a=t.left?.subtreeLength??0;r+=a,n-=e;let o=t.right?.subtreeFirstCharCode??i,s=t.piece.lineBreakCount-(A(t.piece.lastCharCode,o)?1:0);if(n<s)return r+this.#h(t.piece,n);r+=t.piece.length,n-=s,t=t.right}return this.#r}#h(e,t){return t<e.lineOffsetEnd-e.lineOffsetStart?this.#v(e.source).lineOffsets[e.lineOffsetStart+t]-e.offset:e.length}#g(){let e=[];return this.#_(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#_(e){this.#j(this.#n,t=>{let n=this.#v(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#v(e){return e===E.Original?this.#e:this.#t}#y(e,t,n){let r=this.#v(e),i=t+n,a=ce(r.lineOffsets,t),o=ce(r.lineOffsets,i),s=r.text.charCodeAt(i-1);return new E(e,t,n,a,o,s===T&&r.lineOffsets[o-1]!==i,r.text.charCodeAt(t),s)}#b(e,t,n){if(e===t&&n.length===0)return;let[r,i]=this.#E(this.#n,e),a=this.#D(i,t-e),o;if(n.length>0){let e=this.#y(E.Added,this.#t.append(n),n.length);o=this.#O(this.#k(r,e),a)}else{let[e,t]=this.#A(a);o=e===void 0?r:this.#O(this.#k(r,e),t)}o!==null&&(o.parent=null),this.#n=o,this.#r=o?.subtreeLength??0,this.#i=(o?.subtreeLineBreakCount??0)+1}#x(){this.#a=null,this.#o=null,this.#s=null}#S(){return this.#c=Math.imul(this.#c,1664525)+1013904223>>>0,this.#c}#C(e){let t=new D(e);return t.priority=this.#S(),t}#w(e,t){e.left=t,t!==null&&(t.parent=e)}#T(e,t){e.right=t,t!==null&&(t.parent=e)}#E(e,t){if(e===null)return[null,null];if(t<=0)return[null,e];if(t>=e.subtreeLength)return[e,null];let n=e.left?.subtreeLength??0;if(t<=n){let[n,r]=this.#E(e.left,t);return this.#w(e,r),e.updateSubtreeLength(),[n,e]}let r=e.piece.length;if(t>=n+r){let[i,a]=this.#E(e.right,t-n-r);return this.#T(e,i),e.updateSubtreeLength(),[e,a]}let i=t-n,a=new D(this.#y(e.piece.source,e.piece.offset,i)),o=new D(this.#y(e.piece.source,e.piece.offset+i,r-i));return a.priority=e.priority,o.priority=e.priority,this.#w(a,e.left),this.#T(o,e.right),a.updateSubtreeLength(),o.updateSubtreeLength(),[a,o]}#D(e,t){if(e===null||t>=e.subtreeLength)return null;if(t<=0)return e;let n=e.left?.subtreeLength??0;if(t<=n)return this.#w(e,this.#D(e.left,t)),e.updateSubtreeLength(),e;let r=n+e.piece.length;if(t>=r)return this.#D(e.right,t-r);let i=t-n,a=new D(this.#y(e.piece.source,e.piece.offset+i,e.piece.length-i));return a.priority=e.priority,this.#T(a,e.right),a.updateSubtreeLength(),a}#O(e,t){return e===null?t:t===null?e:e.priority>=t.priority?(this.#T(e,this.#O(e.right,t)),e.updateSubtreeLength(),e):(this.#w(t,this.#O(e,t.left)),t.updateSubtreeLength(),t)}#k(e,t){if(e===null)return this.#C(t);let n=e;for(;n.right!==null;)n=n.right;if(oe(n.piece,t)){n.piece=se(n.piece,t);for(let t=n;t!==null&&(t.updateSubtreeLength(),t!==e);)t=t.parent;return e}return this.#O(e,this.#C(t))}#A(e){if(e===null)return[void 0,null];if(e.left===null)return[e.piece,e.right];let[t,n]=this.#A(e.left);return this.#w(e,n),e.updateSubtreeLength(),[t,e]}#j(e,t){return e===null?!0:!this.#j(e.left,t)||t(e)===!1?!1:this.#j(e.right,t)}};function O(e){return e===10||e===13}function k(e,t,n){return Math.min(Math.max(e,t),n)}function re(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function ie(e,t){let n=[];for(let[r,i]of e){let e=k(r,0,t),a=k(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];if(t!==void 0&&e[0]<=t[1]){t[1]=Math.max(t[1],e[1]);continue}r.push(e)}return r}function ae(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function oe(e,t){return e.source===t.source&&e.offset+e.length===t.offset&&!A(e.lastCharCode,t.firstCharCode)}function se(e,t){return new E(e.source,e.offset,e.length+t.length,e.lineOffsetStart,t.lineOffsetEnd,t.hasVirtualTrailingCRBreak,e.firstCharCode,t.lastCharCode)}function A(e,t){return e===T&&t===w}function ce(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ue(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return ee.includes(t)}function de(e,t,n){let r=t<=0||ue(e.charCodeAt(t-1)),i=t+n>=e.length||ue(e.charCodeAt(t+n));return r&&i}function fe(e,t,n){let r=t?e:le(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function pe(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function me(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l;try{l=fe(r.text,!0,r.caseSensitive)}catch{return r.replaceText}l.lastIndex=c;let u=l.exec(s);return u===null||u.index!==c||u[0].length!==a-i?r.replaceText:pe(r.replaceText,u)}function he(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}var ge=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new _){this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new ne(t),this.#i=i;let a=this.#r.getLineText(0,!0);a.endsWith(`\r
|
|
6
|
+
`)?this.#a=`\r
|
|
7
|
+
`:a.endsWith(`\r`)?this.#a=`\r`:this.#a=`
|
|
8
|
+
`}get uri(){return this.#e}get languageId(){return this.#t}get version(){return this.#n}get lineCount(){return this.#r.lineCount}get eol(){return this.#a}get canUndo(){return this.#i.canUndo}get canRedo(){return this.#i.canRedo}positionAt(e){return this.normalizePosition(this.#r.positionAt(e))}positionsAt(e){let t=this.#r.positionsAt(e);for(let e=0;e<t.length;e++)t[e]=this.normalizePosition(t[e]);return t}offsetAt(e){return this.#r.offsetAt(this.normalizePosition(e))}getText(e){return e===void 0?this.#r.getText():this.#r.getText({start:this.normalizePosition(e.start),end:this.normalizePosition(e.end)})}getLineText(e,t){return this.#r.getLineText(e,t)}normalizeEol(e){return e.replace(/\r\n|\r|\n/g,this.eol)}getLineLength(e,t){return this.#r.getLineLength(e,t)}charAt(e){return typeof e==`number`?this.#r.charAt(e):this.#r.charAt(this.offsetAt(e))}getTextSlice(e,t){return this.#r.getTextSlice(e,t)}findNextNonOverlappingSubstring(e,t){return this.#r.findNextNonOverlappingSubstring(e,t)}search(e){return this.#r.search(e)}applyEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(this.resolveEdits(e)),t,n,r,i)}resolveEdits(e){return e.map(e=>this.#c(e))}applyResolvedEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(e.map(e=>this.#l(e))),t,n,r,i)}#o(e,t,n,r,i){let a=v(this,e,this.#n,this.#n+1,t?n:void 0,t?r:void 0);t&&i&&(a.undoBoundary=!0);let o=this.#i.peekUndoForCoalescing(),s=this.#f(e);return this.#n++,s.lineDelta===0&&y(o,a)?this.#i.replaceLastUndo(b(o,a)):this.#i.push(a),s}setLastUndoSelectionsAfter(e){this.#i.setLastUndoSelectionsAfter(e)}setLastUndoLineAnnotations(e,t){this.#i.setLastUndoLineAnnotations(e,t)}undo(){let e=this.#i.popUndoToRedo();if(e===void 0)return;let t=this.#f(e.inverseEdits);if(t===void 0)return;this.#n=e.versionBefore;let n=e.selectionsBefore?.slice();return[t,n,e.lineAnnotationsBefore?.slice(),n===void 0?e.inverseEdits.map(e=>({...e})):void 0]}redo(){let e=this.#i.popRedoToUndo();if(e===void 0)return;let t=this.#f(e.forwardEdits);if(t===void 0)return;this.#n=e.versionAfter;let n=e.selectionsAfter?.slice();return[t,n,e.lineAnnotationsAfter?.slice(),n===void 0?e.forwardEdits.map(e=>({...e})):void 0]}normalizePosition(t){let n=e.#s(t.line,this.lineCount-1);return{line:n,character:e.#s(t.character,this.getLineLength(n))}}static#s(e,t){return Number.isNaN(e)?0:Math.max(0,Math.min(Math.floor(e),t))}#c(e){let t=this.offsetAt(e.range.start),n=this.offsetAt(e.range.end);if(t>n){let e=t;t=n,n=e}return this.#l({start:t,end:n,text:e.newText})}#l(e){let{start:t,end:n}=e,r=t===n;return this.#u(t)&&t--,r?n=t:this.#u(n)&&n++,{start:t,end:n,text:e.text}}#u(e){let t=this.#r.charAt(e-1).charCodeAt(0),n=this.#r.charAt(e).charCodeAt(0);return t>=55296&&t<=56319&&n>=56320&&n<=57343}#d(e){let t=[...e].sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});for(let e=0;e<t.length-1;e++)if(t[e].end>t[e+1].start)throw Error(`Overlapping text edits are not supported`);return t}#f(e){let t=this.#r.lineCount,n=this.positionsAt(e.flatMap(e=>[e.start,e.end])),r=this.#p(e,n),i=n[0],a=n[n.length-1],o=a.line===t-1&&a.character===this.#r.getLineLength(a.line);this.#r.applyEdits(e);let s=this.#r.lineCount;return{changes:e.map((e,t)=>({...e,range:{start:n[t*2],end:n[t*2+1]}})),startLine:r.startLine,startCharacter:i.character,endCharacter:a.character,endLine:Math.min(r.endLine,Math.max(0,s-1)),endedAtDocumentEnd:o,previousLineCount:t,lineCount:s,lineDelta:s-t,changedLineRanges:r.ranges,changedLineChanges:r.changes}}#p(e,t){let n=1/0,r=0,i=0,o=[],s=[],c=this.#r.lineCount-1,l=this.#r.getLineLength(c);for(let u=0;u<e.length;u++){let d=e[u],f=t[u*2],p=t[u*2+1],m=f.line,h=p.line,g=a(d.text),_=m+i,v=_+g,y=g-(h-m);n=Math.min(n,m),r=Math.max(r,v);let b=o[o.length-1];b!==void 0&&_<=b[1]+1?o[o.length-1]=[b[0],Math.max(b[1],v)]:o.push([_,v]),s.push([_,v,y,f.character,p.character,h===c&&p.character===l]),i+=y}return n===1/0?{startLine:0,endLine:0,ranges:[[0,0]],changes:[[0,0,0,0,0,!1]]}:{startLine:n,endLine:r,ranges:o,changes:s}}};function j({metaKey:e,ctrlKey:t},n=s()){return n?e&&!t:t&&!e}function _e(e){if(s()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(j(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}var ve=new WeakMap,ye=xe([{bindings:{Tab:`indent`,"shift+Tab":`outdent`,"cmdOrCtrl+[":`indentLess`,"cmdOrCtrl+]":`indentMore`,"cmdOrCtrl+z":`undo`,"cmdOrCtrl+shift+z":`redo`,"cmdOrCtrl+a":`selectAll`,"cmdOrCtrl+d":`findNextMatch`,"cmdOrCtrl+f":`openSearchPanel`,"cmdOrCtrl+alt+f":`openSearchReplacePanel`,"alt+ArrowUp":`moveLineUp`,"alt+ArrowDown":`moveLineDown`,"shift+alt+ArrowUp":`copyLineUp`,"shift+alt+ArrowDown":`copyLineDown`,Escape:`simplifySelection`,"cmdOrCtrl+Enter":`insertBlankLine`,"cmdOrCtrl+/":`toggleComment`,"shift+alt+a":`toggleBlockComment`,"cmdOrCtrl+Home":`moveCursorToDocStart`,"cmdOrCtrl+End":`moveCursorToDocEnd`,"cmdOrCtrl+shift+Home":`expandSelectionDocStart`,"cmdOrCtrl+shift+End":`expandSelectionDocEnd`}},{platform:`mac`,bindings:{"ctrl+k":`deleteHardLineForward`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`,"cmd+ArrowUp":`moveCursorToDocStart`,"cmd+ArrowDown":`moveCursorToDocEnd`,"cmd+shift+ArrowUp":`expandSelectionDocStart`,"cmd+shift+ArrowDown":`expandSelectionDocEnd`}},{platform:`windows`,bindings:{"ctrl+y":`redo`}},{platform:`linux`,bindings:{"ctrl+y":`redo`,"ctrl+alt+p":`moveLineUp`,"ctrl+alt+n":`moveLineDown`}}]),be={Backquote:"`",Minus:`-`,Equal:`=`,Comma:`,`,Period:`.`,Slash:`/`,Semicolon:`;`,Quote:`'`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Space:`Space`};function xe(e){let t=ve.get(e);if(t===void 0){t={mac:new Map,windows:new Map,linux:new Map};for(let n of e)for(let e of Object.keys(n.bindings)){let r=n.bindings[e];if(r===void 0)continue;let i=e.split(`+`),a=i.pop();for(let e of[`mac`,`windows`,`linux`]){if(n.platform!==void 0&&n.platform!==e)continue;let o=0;for(let t of i)t===`alt`?o|=1:t===`ctrl`?o|=2:t===`cmd`?o|=4:t===`shift`?o|=8:t===`cmdOrCtrl`&&(o|=e===`mac`?4:2);let s=t[e].get(o);s===void 0&&(s=new Map,t[e].set(o,s)),s.set(a,r)}}ve.set(e,t)}return t}function Se(e,t,n=s()){let r=e.key===` `?`Space`:e.key.length===1?e.key.toLowerCase():e.key,i=e.code??``,a=i.startsWith(`Key`)&&i.length===4?i.slice(3).toLowerCase():i.startsWith(`Digit`)&&i.length===6?i.slice(5):be[i],o=n?`mac`:globalThis.navigator?.platform.includes(`Linux`)===!0?`linux`:`windows`,c=(e.altKey?1:0)|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);if(t!==void 0){let e=xe(t)[o].get(c),n=e?.get(r)??(a===void 0?void 0:e?.get(a));if(n!==void 0)return n}let l=ye[o].get(c);return l?.get(r)??(a===void 0?void 0:l?.get(a))}function Ce(e,t=s()){if(!e.altKey&&j(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var we=`::selection {
|
|
9
|
+
background-color: #0000;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[data-deleted-text-selection] [data-deletions] ::selection, [data-deleted-text-selection] [data-line-type="change-deletion"] ::selection {
|
|
13
|
+
background-color: var(--diffs-editor-selection-bg);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes blinking {
|
|
17
|
+
0% {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
50% {
|
|
22
|
+
opacity: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
100% {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host, [data-code], [data-content], [data-diff-type="split"][data-overflow="wrap"] {
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-code] {
|
|
35
|
+
container-type: inline-size;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-content] {
|
|
39
|
+
cursor: text;
|
|
40
|
+
caret-color: var(--diffs-bg-caret);
|
|
41
|
+
background-color: #0000;
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-line] {
|
|
46
|
+
cursor: text;
|
|
47
|
+
background-color: #0000;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-line]:after {
|
|
51
|
+
content: "";
|
|
52
|
+
z-index: -20;
|
|
53
|
+
background-color: var(--diffs-line-bg);
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-line][data-editor-active-line]:after {
|
|
60
|
+
box-shadow: inset 0 0 0 1px var(--diffs-editor-line-highlight-border);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-editor-overlay] {
|
|
64
|
+
display: contents;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-caret], [data-selection-range], [data-match-range], [data-bracket-match-range], [data-marker-range] {
|
|
68
|
+
height: 1lh;
|
|
69
|
+
line-height: var(--diffs-line-height);
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-caret] {
|
|
77
|
+
background-color: var(--diffs-bg-caret-override, var(--diffs-editor-cursor-fg, light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));
|
|
78
|
+
visibility: hidden;
|
|
79
|
+
width: 2px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
83
|
+
[data-caret] {
|
|
84
|
+
animation: 1.2s .8s infinite blinking;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-selection-range] {
|
|
89
|
+
z-index: -10;
|
|
90
|
+
background-color: var(--diffs-editor-selection-bg);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-selection-corner] {
|
|
94
|
+
background-color: var(--diffs-selection-corner-bg, var(--diffs-bg));
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-match-range] {
|
|
100
|
+
z-index: -10;
|
|
101
|
+
background-color: var(--diffs-editor-match-bg, var(--diffs-editor-selection-bg));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-match-range]:not([data-focus]) {
|
|
105
|
+
background-color: var(--diffs-editor-match-highlight-bg, light-dark(#ff963288, #ff963266));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-bracket-match-range] {
|
|
109
|
+
z-index: -9;
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
border-bottom: 1px solid
|
|
112
|
+
var(--diffs-editor-bracket-match-border, color-mix(in lab, var(--diffs-fg) 60%, transparent));
|
|
113
|
+
background-color: var(--diffs-editor-bracket-match-bg, color-mix(in lab, var(--diffs-fg) 5%, transparent));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-rtl] {
|
|
117
|
+
border-top-left-radius: 3px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-rtr] {
|
|
121
|
+
border-top-right-radius: 3px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-rbl] {
|
|
125
|
+
border-bottom-left-radius: 3px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-rbr] {
|
|
129
|
+
border-bottom-right-radius: 3px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[data-marker-range] {
|
|
133
|
+
z-index: 1;
|
|
134
|
+
background-color: var(--diffs-marker-bg);
|
|
135
|
+
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+");
|
|
136
|
+
mask-position: 0 100%;
|
|
137
|
+
mask-size: 6px 3px;
|
|
138
|
+
mask-repeat: repeat-x;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[data-marker-error] {
|
|
142
|
+
--diffs-marker-contrast: light-dark(#fff, #000);
|
|
143
|
+
--diffs-marker-bg: var(--diffs-editor-error-fg, var(--diffs-deletion-base));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-marker-warning] {
|
|
147
|
+
--diffs-marker-contrast: #000;
|
|
148
|
+
--diffs-marker-bg: var(--diffs-editor-warning-fg, light-dark(var(--diffs-warning-light), var(--diffs-warning-dark)));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-marker-info] {
|
|
152
|
+
--diffs-marker-contrast: #000;
|
|
153
|
+
--diffs-marker-bg: var(--diffs-editor-info-fg, var(--diffs-modified-base));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-marker-hint] {
|
|
157
|
+
--diffs-marker-contrast: light-dark(#fff, #000);
|
|
158
|
+
--diffs-marker-bg: var(--diffs-editor-hint-fg, var(--diffs-fg-number));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (width >= 480px) {
|
|
162
|
+
[data-content] {
|
|
163
|
+
caret-color: #0000;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[data-content]:focus ~ [data-editor-overlay] [data-caret] {
|
|
167
|
+
visibility: visible;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[data-editor-widget] {
|
|
172
|
+
--diffs-widget-fg: var(--diffs-fg);
|
|
173
|
+
--diffs-widget-bg: color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));
|
|
174
|
+
--diffs-widget-border: color-mix(in lab, var(--diffs-fg) 20%, transparent);
|
|
175
|
+
--diffs-widget-shadow: inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013,
|
|
176
|
+
0 6px 18px #00000013;
|
|
177
|
+
z-index: 100;
|
|
178
|
+
width: fit-content;
|
|
179
|
+
max-width: calc(100% - 24px);
|
|
180
|
+
font: 14px/20px var(--diffs-header-font-fallback);
|
|
181
|
+
border: 1px solid var(--diffs-widget-border);
|
|
182
|
+
background-color: var(--diffs-widget-bg);
|
|
183
|
+
box-shadow: var(--diffs-widget-shadow);
|
|
184
|
+
background-clip: padding-box;
|
|
185
|
+
border-radius: 9px;
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: 0;
|
|
188
|
+
left: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-marker-popover], [data-selection-action-popover] {
|
|
192
|
+
--popover-gap: var(--diffs-popover-gap, var(--diffs-gap-fallback, 8px));
|
|
193
|
+
--popover-viewport-left: 0px;
|
|
194
|
+
--popover-viewport-right: 100cqw;
|
|
195
|
+
--popover-viewport-top: -99999px;
|
|
196
|
+
--popover-viewport-bottom: 99999px;
|
|
197
|
+
--popover-min-left: calc(var(--popover-viewport-left) + var(--gutter-width, 0px) + var(--popover-gap));
|
|
198
|
+
--popover-available-width: max(0px,
|
|
199
|
+
calc(var(--popover-viewport-right) - var(--popover-min-left) -
|
|
200
|
+
var(--popover-gap)));
|
|
201
|
+
max-width: min(640px, var(--popover-available-width));
|
|
202
|
+
translate: clamp(var(--popover-min-left),
|
|
203
|
+
var(--popover-x, var(--popover-min-left)),
|
|
204
|
+
calc(var(--popover-viewport-right) - var(--popover-gap) - 100%))
|
|
205
|
+
/* Clamp into the scrollport so a popover with no fitting side stays in view. */
|
|
206
|
+
clamp(var(--popover-viewport-top),
|
|
207
|
+
calc(var(--popover-y, 0px) + var(--popover-y-shift, 0px)),
|
|
208
|
+
calc(var(--popover-viewport-bottom) - var(--popover-gap) - 100%));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
[data-marker-popover] {
|
|
212
|
+
--diffs-widget-bg: var(--diffs-marker-bg);
|
|
213
|
+
--diffs-widget-shadow: 0 4px 8px #00000026, 0 6px 18px #00000026;
|
|
214
|
+
min-width: min(180px, var(--popover-available-width));
|
|
215
|
+
overflow-wrap: anywhere;
|
|
216
|
+
color: var(--diffs-marker-contrast);
|
|
217
|
+
white-space: normal;
|
|
218
|
+
pointer-events: auto;
|
|
219
|
+
border: 0;
|
|
220
|
+
padding: 8px 12px;
|
|
221
|
+
|
|
222
|
+
@supports (color: contrast-color(red)) {
|
|
223
|
+
color: contrast-color(var(--diffs-marker-bg), var(--diffs-bg));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
& [data-marker-message] {
|
|
227
|
+
white-space: normal;
|
|
228
|
+
overflow-wrap: anywhere;
|
|
229
|
+
|
|
230
|
+
& code {
|
|
231
|
+
white-space: normal;
|
|
232
|
+
color: inherit;
|
|
233
|
+
background-color: #0000;
|
|
234
|
+
display: inline;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
[data-selection-action-popover] {
|
|
240
|
+
pointer-events: auto;
|
|
241
|
+
flex-wrap: wrap;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 4px;
|
|
244
|
+
width: max-content;
|
|
245
|
+
padding: 4px;
|
|
246
|
+
display: flex;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
[data-search-panel] {
|
|
250
|
+
z-index: 100;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
justify-content: right;
|
|
253
|
+
width: 100%;
|
|
254
|
+
height: 0;
|
|
255
|
+
display: flex;
|
|
256
|
+
position: sticky;
|
|
257
|
+
top: 16px;
|
|
258
|
+
right: 16px;
|
|
259
|
+
container: search-panel / inline-size;
|
|
260
|
+
|
|
261
|
+
& [data-editor-widget] {
|
|
262
|
+
z-index: 100;
|
|
263
|
+
flex-shrink: 0;
|
|
264
|
+
align-items: stretch;
|
|
265
|
+
gap: 8px;
|
|
266
|
+
min-width: 260px;
|
|
267
|
+
max-width: 100%;
|
|
268
|
+
margin-inline: auto 16px;
|
|
269
|
+
padding: 4px;
|
|
270
|
+
display: flex;
|
|
271
|
+
position: relative;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
& svg {
|
|
275
|
+
fill: currentColor;
|
|
276
|
+
width: 12px;
|
|
277
|
+
height: 12px;
|
|
278
|
+
display: block;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
[data-search-grid] {
|
|
283
|
+
grid-template-columns: auto auto auto;
|
|
284
|
+
grid-template-areas: "find matches nav"
|
|
285
|
+
"replace actions .";
|
|
286
|
+
align-items: center;
|
|
287
|
+
gap: 4px 6px;
|
|
288
|
+
width: 100%;
|
|
289
|
+
display: grid;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
[data-input-box][data-find] {
|
|
293
|
+
grid-area: find;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
[data-search-nav] {
|
|
297
|
+
grid-area: nav;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
[data-input-box][data-replace] {
|
|
301
|
+
grid-area: replace;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
[data-replace-actions] {
|
|
305
|
+
grid-area: actions;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
[data-search-grid][data-mode="find"] {
|
|
309
|
+
grid-template-areas: "find matches nav";
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[data-search-grid][data-mode="find"] [data-replace-cell] {
|
|
313
|
+
display: none;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@container search-panel (width < 400px) {
|
|
317
|
+
[data-search-panel] [data-editor-widget] {
|
|
318
|
+
padding: 10px;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
[data-search-grid][data-mode="replace"] {
|
|
322
|
+
grid-template-columns: auto 1fr auto;
|
|
323
|
+
grid-template-areas: "find find find"
|
|
324
|
+
"replace replace replace"
|
|
325
|
+
"nav matches actions";
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
[data-search-grid][data-mode="find"] {
|
|
329
|
+
grid-template-columns: auto 1fr auto;
|
|
330
|
+
grid-template-areas: "find find find"
|
|
331
|
+
"nav matches matches";
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
[data-replace-actions] {
|
|
335
|
+
justify-self: end;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
[data-search-grid] [data-input-box] {
|
|
339
|
+
width: auto;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
[data-input-box] {
|
|
344
|
+
align-items: center;
|
|
345
|
+
width: 200px;
|
|
346
|
+
display: flex;
|
|
347
|
+
position: relative;
|
|
348
|
+
|
|
349
|
+
& input {
|
|
350
|
+
width: 100%;
|
|
351
|
+
min-width: 0;
|
|
352
|
+
color: var(--diffs-fg);
|
|
353
|
+
background-color: var(--diffs-bg);
|
|
354
|
+
border: 1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));
|
|
355
|
+
border-radius: 6px;
|
|
356
|
+
outline: none;
|
|
357
|
+
flex-grow: 1;
|
|
358
|
+
padding-inline: 6px;
|
|
359
|
+
font-size: 13px;
|
|
360
|
+
line-height: 24px;
|
|
361
|
+
|
|
362
|
+
&::selection {
|
|
363
|
+
background-color: color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg));
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&:focus-visible {
|
|
367
|
+
outline: 1px solid var(--diffs-modified-base);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&[data-find] input {
|
|
372
|
+
padding-inline-end: 72px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
& [data-search-icon] {
|
|
376
|
+
--diffs-search-icon-size: 20px;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
[data-search-toggles] {
|
|
381
|
+
align-items: center;
|
|
382
|
+
gap: 1px;
|
|
383
|
+
display: flex;
|
|
384
|
+
position: absolute;
|
|
385
|
+
top: 50%;
|
|
386
|
+
right: 4px;
|
|
387
|
+
transform: translateY(-50%);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
[data-matches] {
|
|
391
|
+
white-space: nowrap;
|
|
392
|
+
min-width: 50px;
|
|
393
|
+
color: color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));
|
|
394
|
+
flex-shrink: 0;
|
|
395
|
+
grid-area: matches;
|
|
396
|
+
font-size: 12px;
|
|
397
|
+
font-weight: 500;
|
|
398
|
+
line-height: 20px;
|
|
399
|
+
|
|
400
|
+
&[data-no-matches] {
|
|
401
|
+
color: color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
[data-replace-actions], [data-search-nav] {
|
|
406
|
+
align-items: center;
|
|
407
|
+
display: flex;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
[data-search-icon] {
|
|
411
|
+
appearance: none;
|
|
412
|
+
width: var(--diffs-search-icon-size, 24px);
|
|
413
|
+
height: var(--diffs-search-icon-size, 24px);
|
|
414
|
+
color: color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));
|
|
415
|
+
border-radius: var(--diffs-search-icon-radius, 4px);
|
|
416
|
+
cursor: pointer;
|
|
417
|
+
background: none;
|
|
418
|
+
border: 0;
|
|
419
|
+
flex-shrink: 0;
|
|
420
|
+
justify-content: center;
|
|
421
|
+
align-items: center;
|
|
422
|
+
margin: 0;
|
|
423
|
+
padding: 0;
|
|
424
|
+
transition: background-color .1s ease-in-out, color .1s ease-in-out;
|
|
425
|
+
display: flex;
|
|
426
|
+
|
|
427
|
+
&:disabled {
|
|
428
|
+
opacity: .25;
|
|
429
|
+
cursor: default;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
&:not(:disabled):hover {
|
|
433
|
+
color: var(--diffs-fg);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&:focus-visible {
|
|
437
|
+
outline: 1px solid var(--diffs-modified-base);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
&[aria-pressed="true"] {
|
|
441
|
+
color: var(--diffs-modified-base);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
[data-search-close] {
|
|
446
|
+
--diffs-search-icon-size: 20px;
|
|
447
|
+
--diffs-search-icon-radius: 50%;
|
|
448
|
+
color: var(--diffs-widget-bg);
|
|
449
|
+
background-color: color-mix(in lab,
|
|
450
|
+
var(--diffs-widget-fg) 50%,
|
|
451
|
+
var(--diffs-bg));
|
|
452
|
+
position: absolute;
|
|
453
|
+
top: 0;
|
|
454
|
+
right: 0;
|
|
455
|
+
transform: translate(50%, -50%);
|
|
456
|
+
|
|
457
|
+
&:not(:disabled):hover {
|
|
458
|
+
opacity: 1;
|
|
459
|
+
color: var(--diffs-widget-bg);
|
|
460
|
+
background-color: var(--diffs-widget-fg);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
`,Te=`//`,Ee=[`/*`,`*/`],De={sql:{lineComment:`--`},ruby:{lineComment:`#`,blockComment:[`=begin`,`=end`]},rst:{lineComment:`..`},coffeescript:{lineComment:`#`,blockComment:[`###`,`###`]},cmd:{lineComment:`@REM`},julia:{lineComment:`#`,blockComment:[`#=`,`=#`]},yaml:{lineComment:`#`},yml:{lineComment:`#`},markdown:{lineComment:null,blockComment:[`<!--`,`-->`]},zsh:{lineComment:`#`},makefile:{lineComment:`#`},handlebars:{lineComment:null,blockComment:[`{{!--`,`--}}`]},ini:{lineComment:`;`,blockComment:[`;`,` `]},powershell:{lineComment:`#`,blockComment:[`<#`,`#>`]},vb:{lineComment:`'`},xml:{lineComment:null,blockComment:[`<!--`,`-->`]},lua:{lineComment:`--`,blockComment:[`--[[`,`]]`]},html:{lineComment:null,blockComment:[`<!--`,`-->`]},diff:{lineComment:`#`,blockComment:[`#`,` `]},r:{lineComment:`#`},fsharp:{blockComment:[`(*`,`*)`]},pug:{lineComment:`//-`},perl:{lineComment:`#`},tex:{lineComment:`%`},clojure:{lineComment:`;;`},css:{lineComment:null},python:{lineComment:`#`,blockComment:[`"""`,`"""`]},dotenv:{lineComment:`#`},dockerfile:{lineComment:`#`},razor:{lineComment:null,blockComment:[`<!--`,`-->`]},prompt:{lineComment:null,blockComment:[`<!--`,`-->`]}};function Oe(e,t){let n={...De[e],...t?.[e]};return{lineComment:n.lineComment===void 0?Te:n.lineComment,blockComment:n.blockComment??Ee}}function ke(e,t,n){let r=[],i=new Set;for(let a of t){let t=a.end.line;a.start.line<t&&a.end.character===0&&t--;let o=r.length,s=1/0;for(let o=a.start.line;o<=t;o++){if(i.has(o))continue;i.add(o);let t=e.getLineText(o),a=t.length-t.trimStart().length,c=a===t.length;c||(s=Math.min(s,a)),r.push({line:o,comment:t.slice(a,a+n.length)===n?a:-1,empty:c,indent:a,single:!1})}if(s!==1/0)for(let e=o;e<r.length;e++)r[e].empty||(r[e].indent=s);r.length===o+1&&(r[o].single=!0)}let a=r.some(e=>e.comment<0&&(!e.empty||e.single)),o=[];if(a){for(let e of r){if(e.empty&&!e.single)continue;let t={line:e.line,character:e.indent};o.push({range:{start:t,end:t},newText:n+` `})}return o}for(let t of r){if(t.comment<0)continue;let r=e.getLineText(t.line),i=t.comment,a=i+n.length+(r[i+n.length]===` `?1:0);o.push({range:{start:{line:t.line,character:i},end:{line:t.line,character:a}},newText:``})}return o}var M=50;function Ae(e,t,n,r,i){let a=Math.max(0,r-M),o=e.getTextSlice(a,r),s=e.getTextSlice(i,i+M),c=o.length-o.trimEnd().length,l=s.length-s.trimStart().length,u=o.length-c;if(o.slice(u-t.length,u)===t&&s.slice(l,l+n.length)===n)return{open:{start:r-c-t.length,end:r-c+(c>0?1:0),text:``},close:{start:i+l-(l>0?1:0),end:i+l+n.length,text:``},contentStart:r,contentEnd:i};let d=i-r<=M*2?e.getTextSlice(r,i):void 0,f=d??e.getTextSlice(r,r+M),p=d??e.getTextSlice(i-M,i),m=f.length-f.trimStart().length,h=i-(p.length-p.trimEnd().length)-n.length;if(f.slice(m,m+t.length)!==t||e.getTextSlice(h,h+n.length)!==n)return;let g=r+m,_=g+t.length+(/\s/.test(f[t.length+m]??``)?1:0),v=h-(/\s/.test(e.getTextSlice(h-1,h))?1:0);return{open:{start:g,end:_,text:``},close:{start:v,end:h+n.length,text:``},contentStart:_,contentEnd:v}}function je(e,t,n,r){let i=0,a=t.length;for(;i<a;){let n=i+a>>>1;t[n].end<e?i=n+1:a=n}let o=n[i];for(let n=i;n<t.length;n++){let i=t[n];if(e<i.start)break;if(i.start===i.end&&e===i.start){if(r<0)break;o+=i.text.length;continue}if(e>i.end){o+=i.text.length-(i.end-i.start);continue}return e===i.end?i.start+o+i.text.length:i.start+o+(r>0?i.text.length:0)}return e+o}function Me(e,t,[n,r],i=!1){let a=t.map(t=>{let{start:n,end:r}=t;if(i){let t=r.line;n.line<t&&r.character===0&&t--;let i=e.getLineText(n.line),a=i.length-i.trimStart().length;n={line:n.line,character:a},r={line:t,character:e.getLineLength(t)}}return{from:e.offsetAt(n),to:e.offsetAt(r),direction:t.direction,comment:void 0}});if(i&&a.length>1){a.sort((e,t)=>{let n=e.from-t.from;return n===0?e.to-t.to:n});let e=0;for(let t=1;t<a.length;t++){let n=a[e],r=a[t];r.from<=n.to?n.to=Math.max(n.to,r.to):a[++e]=r}a.length=e+1}for(let t of a)t.comment=Ae(e,n,r,t.from,t.to);let o=a.every(e=>e.comment!==void 0),s=[];for(let e of a){let t=e.comment;if(o&&t!==void 0){s.push(t.open,t.close);continue}if(t===void 0){if(e.from===e.to){s.push({start:e.from,end:e.to,text:n+` `+r});continue}s.push({start:e.from,end:e.from,text:n+` `},{start:e.to,end:e.to,text:` `+r})}}if(s.length===0)return;s.sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});let c=s.map(t=>({range:{start:e.positionAt(t.start),end:e.positionAt(t.end)},newText:t.text}));if(i)return{edits:c,nextSelectionOffsets:[]};let l=a.map(e=>{let t=e.comment;return o&&t!==void 0?{start:t.contentStart,end:t.contentEnd,startAssociation:1,endAssociation:-1}:t===void 0?e.from===e.to?{start:e.from,end:e.to,startAssociation:-1,endAssociation:-1,collapsedInset:n.length+1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:-1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:1}}),u=Array(s.length+1);u[0]=0;for(let e=0;e<s.length;e++){let t=s[e];u[e+1]=u[e]+t.text.length-(t.end-t.start)}return{edits:c,nextSelectionOffsets:l.map((e,t)=>{let n=je(e.start,s,u,e.startAssociation)+(e.collapsedInset??0);return[n,e.collapsedInset===void 0?je(e.end,s,u,e.endAssociation):n,a[t].direction]})}}function N(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function P(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function F(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function Ne(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function Pe(e,t){return Object.assign(e,t)}function Fe(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function I(e,t=1e3){return Math.round(e*t)/t}function Ie(e){return e.endsWith(`
|
|
464
|
+
`)||e.endsWith(`\r`)}function Le(e){if(!(typeof Intl>`u`||typeof Intl.Segmenter!=`function`))return new Intl.Segmenter(void 0,e)}var Re,ze=!1;function L(){return ze||=(Re=Le({granularity:`grapheme`}),!0),Re}function R(e,t){let n=Be(e);if(n.length===0)return;let r=[],i=!1;for(let a of t){if(a.side===`deletions`||a.lineNumber<=0){r.push(a);continue}let t=a.lineNumber-1,o=e.previousLineCount,s=!1;for(let e of n){let n=Math.max(1,o+e.lineDelta),r=Ve(t,e,n);if(r===void 0){s=!0,t=void 0;break}(r!==t||Ue(t,e))&&(s=!0),t=r,o=n}if(t===void 0){i=!0;continue}let c=t+1;if(s){r.push(c===a.lineNumber?a:{...a,lineNumber:c}),i=!0;continue}r.push(a)}return i?r:void 0}function Be(e){if(e.changedLineChanges!==void 0)return e.changedLineChanges.flatMap(([e,t,n,r=0,i=0,a=!1])=>{if(n===0)return[];let o=Math.max(0,t-e);return[{startLine:e,startCharacter:r,endLine:e+Math.max(0,o-n),deletesEndLine:n<0&&a,insertedLineBreaks:o,lineDelta:n}]});if(e.lineDelta===0)return e.changedLineRanges.flatMap(([e,t])=>{let n=t-e;return n<=0?[]:[{startLine:e,startCharacter:0,endLine:e,deletesEndLine:!1,insertedLineBreaks:n,lineDelta:n}]});let t=Math.max(0,-e.lineDelta),n=e.endedAtDocumentEnd&&e.startLine+t===e.previousLineCount-1;return[{startLine:e.startLine,startCharacter:e.startCharacter,endLine:e.startLine+t,deletesEndLine:n,insertedLineBreaks:Math.max(0,e.lineDelta),lineDelta:e.lineDelta}]}function Ve(e,t,n){if(e<t.startLine)return e;if(e>t.endLine||t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)return e+t.lineDelta;if(t.startLine===t.endLine)return t.startCharacter===0?e+t.insertedLineBreaks:e;if(He(e,t))return;let r=Math.min(Math.max(0,e-t.startLine),t.insertedLineBreaks);return We(t.startLine+r,n)}function He(e,t){return!(t.lineDelta>=0||e<t.startLine||e>t.endLine||e===t.startLine&&t.startCharacter>0||e===t.endLine&&!t.deletesEndLine)}function Ue(e,t){return t.lineDelta===0||e<t.startLine||e>t.endLine?!1:!(t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)}function We(e,t){return Math.max(0,Math.min(e,Math.max(0,t-1)))}function Ge(e,t,n){let r=new Map,i=new Map;for(let t of e){let e=t.lineNumber;r.has(e)||r.set(e,[]),i.has(e)||i.set(e,[]),(t.side===`deletions`?i:r).get(e).push(o(t))}let a=t.parentElement?.previousElementSibling,s,c;if(a!=null&&a instanceof HTMLElement&&a.dataset.deletions!==void 0)for(let e of a.children){let t=e,{gutter:n,content:r}=t.dataset;n===void 0?r!==void 0&&(c=t):s=t}Ke(t,n),c!==void 0&&Ke(c,s);let l=qe(r,t,n);if(c===void 0)return;let u=qe(i,c,s);requestAnimationFrame(()=>{Je(r,i,l,u)})}function Ke(e,t){let n=[];for(let r=1;r<e.childElementCount;r++){let i=e.children[r];i.dataset.lineAnnotation!==void 0&&(n.push(i),t!==void 0&&n.push(t.children[r]))}for(let e of n)e.remove()}function qe(e,t,n){let r=new Map;for(let n of t.children){let t=F(n);if(t!==void 0){let i=e.get(t);if(i!==void 0){let e=N(`div`,{dataset:{lineAnnotation:`0,`+(t-1)},children:[N(`div`,{dataset:`annotationContent`,children:i.map(e=>N(`slot`,{name:e}))})]});n.after(e),r.set(t,e)}}}if(n!==void 0)for(let t of n.children){let n=F(t,`columnNumber`);if(n!==void 0&&e.has(n)){let e=N(`div`,{dataset:{gutterBuffer:`annotation`,bufferSize:`1`},style:{gridRow:`span 1`}});t.after(e)}}return r}function Je(e,t,n,r){let i=new Map;for(let[t,n]of e.entries()){let e=r.get(t);if(n.length===0&&e!==void 0){let n=Ye(e);n>0&&i.set(t,n)}}for(let[e,r]of t.entries()){let t=n.get(e);if(r.length===0&&t!==void 0){let n=Ye(t);n>0&&i.set(e,n)}}Xe(e,n,i),Xe(t,r,i)}function Ye(e){let t=e.firstElementChild;return t instanceof HTMLElement?t.getBoundingClientRect().height:0}function Xe(e,t,n){for(let[r,i]of t.entries()){let t=e.get(r),a=n.get(r);t?.length===0&&a!==void 0&&i.style.setProperty(`--diffs-annotation-min-height`,`${a}px`)}}var Ze=class{#e;#t;#n;#r;#i;#a;#o=0;#s=0;#c=0;#l=!0;#u;#d=new Map;#f;#p;constructor(e){this.#f=e.hasActivePopover,this.#p=e.updateActivePopover}setViewportElements(e,t){let n=this.#e!==e||this.#t!==t;this.#e=e,n&&(this.#t=t,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0)}cleanUp(){this.#t=void 0,this.#e=void 0,this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#a=void 0,this.#o=0,this.#s=0,this.#c=0,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0,this.#d.clear()}resetPlacement(e=`default`){this.#d.delete(e)}setPlacement(e,t=`default`){this.#d.set(t,e)}choosePlacement(e){let{preferred:t,fallback:n,viewport:r,popoverHeight:i,atDocumentEdge:a,placementKey:o=`default`}=e,s=this.#d.get(o),c;if(r!==void 0&&i>0){let e=(e,t=0)=>e.top>=r.top+t&&e.bottom<=r.bottom-t;c=s===`fallback`&&e(n)&&!e(t,4)||!e(t)&&e(n)?`fallback`:`preferred`}else c=a?`fallback`:`preferred`;return this.#d.set(o,c),c}getPlacementBounds(){let e=this.#g();if(e===void 0)return;let t=this.#_(),n,r;if(t===void 0?(n=0,r=window.innerHeight):(n=t.top,r=t.bottom),n=Math.max(n,e.top),r=Math.min(r,e.bottom),r<=n)return;let i=this.#o,a=this.#s,o=this.#c>0?this.#c:e.width,s=t===void 0?0:t.left,c=t===void 0?window.innerWidth:t.right,l=i,u=i+o,d=Math.max(l,s-e.left+i),f=Math.min(u,c-e.left+i);return{top:n-e.top+a,bottom:r-e.top+a,left:d,right:Math.max(d,f)}}#m(){let e=this.#e;if(e===void 0)return;if(this.#r===e&&(this.#n===void 0||this.#n.isConnected))return this.#n;let t=e.parentElement;for(;t!==null;){let n=getComputedStyle(t).overflowY;if(n===`auto`||n===`scroll`||n===`overlay`)return this.#n=t,this.#r=e,t;t=t.parentElement}this.#n=void 0,this.#r=e}#h(){if(!this.#l)return;this.#v();let e=this.#t;this.#i=e?.getBoundingClientRect(),this.#o=e?.scrollLeft??0,this.#s=e?.scrollTop??0,this.#c=e?.clientWidth??0,this.#a=this.#m()?.getBoundingClientRect(),this.#l=!1}#g(){return this.#h(),this.#i}#_(){return this.#h(),this.#a}#v(){if(this.#u!==void 0)return;let e,t=()=>{this.#l=!0,!(!this.#f()||e!==void 0)&&(e=requestAnimationFrame(()=>{e=void 0,this.#p()}))},n=this.#m(),r=this.#t;this.#u=[P(n===void 0?window:n,`scroll`,t,{passive:!0}),...r===void 0?[]:[P(r,`scroll`,t,{passive:!0})],P(window,`resize`,t,{passive:!0}),()=>{e!==void 0&&(cancelAnimationFrame(e),e=void 0)}]}};function Qe(e,{gutterWidth:t,placeAbove:n,viewport:r,x:i,y:a}){if(e.style.setProperty(`--gutter-width`,t+`px`),e.style.setProperty(`--popover-x`,i+`px`),e.style.setProperty(`--popover-y`,a+`px`),e.style.setProperty(`--popover-y-shift`,n?`-100%`:`0px`),r===void 0){e.style.removeProperty(`--popover-viewport-left`),e.style.removeProperty(`--popover-viewport-right`),e.style.removeProperty(`--popover-viewport-top`),e.style.removeProperty(`--popover-viewport-bottom`);return}e.style.setProperty(`--popover-viewport-left`,r.left+`px`),e.style.setProperty(`--popover-viewport-right`,r.right+`px`),e.style.setProperty(`--popover-viewport-top`,r.top+`px`),e.style.setProperty(`--popover-viewport-bottom`,r.bottom+`px`)}var $e=new Map([[`'`,`'`],[`"`,`"`],["`","`"],[`{`,`}`],[`[`,`]`],[`<`,`>`],[`(`,`)`]]),et=new Set([`'`,`"`,"`"]),tt=new Set([`{`,`[`,`(`,`<`]);function nt(e,t=0){let n=en(e.startContainer,e.startOffset),r=en(e.endContainer,e.endOffset);if(!(n===null||r===null))return{start:n,end:r,direction:t}}function rt(e,t,n,r){if(e===void 0)return[[],t];let{start:i,end:a}=t,o=[],s={...t},c=i.line!==a.line,l=a.line;i.line<a.line&&a.character===0&&l--;for(let t=i.line;t<=l;t++){let l=e.getLineText(t);if(l===void 0||c&&l.trim().length===0)continue;let u=l.startsWith(` `)?` `:` `.repeat(n),d=0,f=u;if(r){if(l.startsWith(` `))d=1;else if(l.startsWith(` `)){let e=l.length-l.trimStart().length;d=Math.min(u.length,e)}if(d===0)continue;f=``}o.push({range:{start:{line:t,character:0},end:{line:t,character:d}},newText:f});let p=f.length-d;t===i.line&&(s={...s,start:{...i,character:Math.max(0,i.character+p)}}),t===a.line&&(s={...s,end:{...a,character:Math.max(0,a.character+p)}})}return[o,s]}function it(e,t,n,r={}){let i=e.lineCount;return t.map(t=>{let{line:a,character:o}=n===`up`||n===`left`?t.start:t.end;if(n===`textStart`||n===`start`||n===`end`){let i=H(t);a=i.line,o=i.character;let s=st(e,a,o,r);if(n===`textStart`){let t=e.getLineText(a).slice(s.start,s.end),n=s.start+Zt(t);o=o===n?s.start:n}else o=n===`start`?s.start:s.end}else if(n===`up`){let t=at(e,a,o,-1,r);t===void 0?a>0&&(a=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`)??a):(a=t.line,o=t.character)}else if(n===`down`){let t=at(e,a,o,1,r);if(t!==void 0)a=t.line,o=t.character;else{let e=Math.max(i-1,0);a<e&&(a=r.resolveRenderableLine==null?a+1:Math.min(r.resolveRenderableLine(a+1,`down`)??a,e))}}else if(V(t)){let t=e.getLineLength(a);if(o=Math.min(o,t),n===`left`){if(o>0)o=K(e,a,o,!1);else if(a>0){let t=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`);t!==void 0&&(a=t,o=e.getLineLength(a))}}else if(o<t)o=K(e,a,o,!0);else if(a<i-1){let e=r.resolveRenderableLine==null?a+1:r.resolveRenderableLine(a+1,`down`);e!==void 0&&(a=Math.min(e,i-1),o=0)}}let s={line:a,character:o};return{start:s,end:s,direction:0}})}function at(e,t,n,r,i){if(i.getSoftLineOffsets===void 0)return;let a=st(e,t,n,i),o=a.index+r,s=t,c;if(o>=0&&o<a.count)c=z(e,s,o,i);else{let a=t+r;if(a<0||a>=e.lineCount)return{line:t,character:n};let o=i.resolveRenderableLine==null?a:i.resolveRenderableLine(a,r<0?`up`:`down`);if(o===void 0)return{line:t,character:n};s=Math.min(o,e.lineCount-1);let l=ct(e,s,i);c=z(e,s,r<0?l-1:0,i)}let l=Math.max(0,n-a.start),u=c.start+l,d=c.index===c.count-1?u:Math.min(u,c.end),f=e.getLineText(s);return{line:s,character:d>f.length?d:ot(f,d)}}function ot(e,t){if(t<=0||t>=e.length)return t;let n=L();if(n!==void 0){for(let r of n.segment(e)){if(t<=r.index)return t;let e=r.index+r.segment.length;if(t<e)return e}return t}let r=0;for(let n of e){if(t<=r)return t;let e=r+n.length;if(t<e)return e;r=e}return t}function st(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};for(let i=0;i+1<a.length;i++){let a=z(e,t,i,r);if(n>=a.start&&n<=a.end)return a}return z(e,t,n<(a[0]??0)?0:a.length-2,r)}function ct(e,t,n){let r=n.getSoftLineOffsets?.(t);return r===void 0||r.length<2?1:r.length-1}function z(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};let o=a.length-1,s=Math.max(0,Math.min(n,o-1)),c=Math.max(0,Math.min(i,a[s]??0));return{start:c,end:Math.max(c,Math.min(i,a[s+1]??i)),index:s,count:o}}function lt(e,t,n,r={}){return t.map(t=>{let i=t.direction===-1?t.start:t.end,[a]=it(e,[{start:i,end:i,direction:0}],n,r);return Tt(t,a)})}function ut(e,t,n,r,i=2,a=!1){if(t[t.length-1]===void 0)return{nextSelections:[]};let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=s[(t.length-1)*2],l=s[(t.length-1)*2+1],u=[],d=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=u[u.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(d=!1),u.push(t)}d||u.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let f=$t(e,n,i),p=[],m=Array.from({length:t.length}),h=0,g,_=()=>{if(g===void 0)return;let t=$t(e,{start:g.start,end:g.end,text:f.text},i),n=Xt(e,t.text,t.start);p.push({start:t.start,end:t.end,text:n});let r=[g.start+h+n.length,g.start+h+n.length];for(let e of g.indices)m[e]=r;h+=n.length-(t.end-t.start),g=void 0};for(let e of u){let t=Math.max(0,e.start+(f.start-c)),n=Math.max(t,e.end+(f.end-l));if(g!==void 0&&t<g.end){g.end=Math.max(g.end,n),g.indices.push(e.index);continue}_(),g={start:t,end:n,indices:[e.index]}}_();let v=e.applyResolvedEdits(p,!0,t,void 0,a),y=Qt(e,m.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(y),v!==void 0&&r!==void 0){let t=R(v,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:y,change:v}}function dt(e,t){if(t.length!==e.length+2)return;let n=$e.get(t[0]);if(!(n===void 0||t[t.length-1]!==n||t.slice(1,-1)!==e))return 1}function ft(e,t,n,r){let i=t.start+n,a=i+r.length;if(t.end-t.start>0){let n=e.getTextSlice(t.start,t.end),a=dt(n,r)??r.indexOf(n);if(a!==-1&&a+n.length<=r.length){let e=i+a;return[e,e+n.length]}}return[a,a]}function B(e,t,n,r,i=!1,a=`selection`){if(t.length!==n.length)throw Error(`Selection text replacements must match the selection count`);let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=[],l=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=c[c.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(l=!1),c.push(t)}l||c.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let u=n.every(e=>e===``),d,f=Array.from({length:t.length});if(u){d=[];let e=!1;for(let t of c){if(f[t.index]=[t.end,t.end],t.start>=t.end)continue;e=!0;let n=d[d.length-1];n!==void 0&&t.start<n.end?d[d.length-1]={start:n.start,end:Math.max(n.end,t.end),text:``}:d.push({start:t.start,end:t.end,text:``})}if(!e)return{nextSelections:t};for(let e of c){let t=e.end,n=0,r=t;for(let e of d){if(t<=e.start)break;if(t>=e.end){n-=e.end-e.start;continue}r=e.start+n;break}r===t&&(r+=n),f[e.index]=[r,r]}}else{d=[];let t=0,r=-1;for(let i=0;i<c.length;i++){let o=c[i];if(o.start<r)throw Error(`Overlapping multi-selection edits are not supported`);r=o.end;let s=Xt(e,n[a===`document`?i:o.index],o.start);d.push({start:o.start,end:o.end,text:s}),f[o.index]=ft(e,o,t,s),t+=s.length-(o.end-o.start)}}let p=e.applyResolvedEdits(d,!0,t,void 0,i),m=Qt(e,f.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(m),p!==void 0&&r!==void 0){let t=R(p,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:m,change:p}}function pt(e,t){return e===`never`?!1:e===`brackets`?tt.has(t):e===`quotes`?et.has(t):!0}function mt(e,t,n,r){if(n.length!==1||t.length===0)return;let i=$e.get(n);if(i===void 0||!pt(r,n))return;let a=[];for(let r of t){if(V(r))return;a.push(n+e.getText(r)+i)}return a}function ht(e,t,n){let r=[],i=[];for(let n of t){let[t,a]=Jt(e,n);if(!V(n)){i.push([t,a]);continue}let{line:o,character:s}=n.start,c=t,l=e.getLineText(o),u=l.length,d=c-s,f=qt(l),p;if(s>0&&s<u){let e=G(l,s,!1,f),t=G(l,s,!0,f);p={start:d+e,end:d+t,text:l.slice(s,t)+l.slice(e,s)},i.push([d+t,d+t])}else if(s===u&&f.length>=2){let e=f[f.length-1],t=f[f.length-2];p={start:d+t,end:c,text:l.slice(e,u)+l.slice(t,e)},i.push([c,c])}else if(s===0&&o>0&&u>0){let t=o-1,n=e.getLineText(t),r=n.length,a=e.offsetAt({line:t,character:r}),s=r>0?G(n,r,!1,qt(n)):r,u=G(l,0,!0,f),d=a-(r-s),m=l.slice(0,u)+e.getTextSlice(a,c)+n.slice(s,r);p={start:d,end:c+u,text:m};let h=d+m.length;i.push([h,h])}else{i.push([t,a]);continue}r.push(p)}if(r.length===0)return{nextSelections:t};r.sort((e,t)=>e.start-t.start);for(let e=1;e<r.length;e++)if(r[e].start<r[e-1].end)throw Error(`Overlapping multi-selection edits are not supported`);let a=e.applyResolvedEdits(r,!0,t),o=Qt(e,i);if(e.setLastUndoSelectionsAfter(o),a!==void 0&&n!==void 0){let t=R(a,n);t!==void 0&&e.setLastUndoLineAnnotations(n,t)}return{nextSelections:o,change:a}}function gt(e,t,n){let r=t.map(t=>{let n=Yt(e,t);return{start:n.start,end:n.end,direction:0}});return B(e,r,r.map(()=>``),n)}function _t(e,t,n,r){let i=t.map(t=>{if(!V(t))return{start:t.start,end:t.end,direction:0};let r=H(t),{line:i,character:a}=r,o=n?.(i,a)??0;if(a>o)return{start:{line:i,character:o},end:{line:i,character:a},direction:0};if(i===0)return{start:r,end:r,direction:0};let s=e.getLineLength(i-1);return{start:{line:i-1,character:s},end:{line:i,character:0},direction:0}});return B(e,i,i.map(()=>``),r)}function vt(e,t,n){let r=t.map(t=>{let[n,r]=Kt(e,t);return{start:n,end:r,direction:0}});return B(e,r,r.map(()=>``),n)}function yt(e,t,n){if(!V(t))return[t.start,t.end];let r=H(t),{line:i,character:a}=r,o=e.getLineLength(i),s=e.lineCount;if(a=Math.min(a,o),n)return a<o?[{line:i,character:a},{line:i,character:K(e,i,a,!0)}]:i<s-1?[{line:i,character:o},{line:i+1,character:0}]:[r,r];if(a>0)return[{line:i,character:K(e,i,a,!1)},{line:i,character:a}];if(i>0){let t=e.getLineLength(i-1);return[{line:i-1,character:t},{line:i,character:0}]}return[r,r]}function bt(e,t,n,r,i=2){let a=t.map(t=>{let[r,a]=yt(e,t,n);if(!n&&V(t)){let t=$t(e,{start:e.offsetAt(r),end:e.offsetAt(a),text:``},i);r=e.positionAt(t.start),a=e.positionAt(t.end)}return{start:r,end:a,direction:0}});return B(e,a,a.map(()=>``),r)}function V(e){return e.start.line===e.end.line&&e.start.character===e.end.character}function H(e){let{start:t,end:n,direction:r}=e;return r===-1?t:n}function U(e){return e===`context`||e===`context-expanded`||e===`change-addition`}function xt(e,t){let n=V(e),r=V(t);return n&&r?W(e.start,t.start)===0:n?W(t.start,e.start)<=0&&W(e.start,t.end)<=0:r?W(e.start,t.start)<=0&&W(t.start,e.end)<=0:W(e.start,t.end)<0&&W(t.start,e.end)<0}function W(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function St(e,t,n){let r=t===n?0:t<n?1:-1,i=Math.min(t,n),a=Math.max(t,n);return{start:e.positionAt(i),end:e.positionAt(a),direction:r}}function Ct(e,t){let n=0;for(let r of t){if(e<r.start)break;if(e>=r.end)n+=r.text.length-(r.end-r.start);else return r.start+n+r.text.length}return e+n}function wt(e,t,n,r){return t.map((t,i)=>{let[a,o]=n[i],s=Ct(a,r),c=Ct(o,r);return St(e,t.direction===-1?c:s,t.direction===-1?s:c)})}function Tt(e,t){let n=e.direction===-1?e.end:e.start,r=W(n,t.start),i=W(n,t.end),a=t.end;a=r<=0?t.end:i>=0?t.start:r===0?t.end:t.start;let o=W(n,a);return{start:o<=0?n:a,end:o<=0?a:n,direction:o===0?0:o<0?1:-1}}function Et(e,t){let n=W(t.start,e.start)<0,r=W(t.end,e.end)>0;return n&&!r?{start:t.start,end:e.end,direction:-1}:r&&!n?{start:e.start,end:t.end,direction:1}:e.direction===-1?{start:t.start,end:e.end,direction:W(t.start,e.end)===0?0:-1}:{start:e.start,end:t.end,direction:W(e.start,t.end)===0?0:1}}function Dt(e,t){return Ot(e.map(e=>Et(e,t)))}function Ot(e){if(e.length<=1)return e;let t=e.map((e,t)=>({index:t,selection:e})).sort((e,t)=>{let n=W(e.selection.start,t.selection.start);if(n!==0)return n;let r=W(e.selection.end,t.selection.end);return r===0?e.index-t.index:r}),n=[],r=t[0];for(let e of t.slice(1)){if(xt(r.selection,e.selection)){let t=e.index>r.index?e:r,n=W(e.selection.start,r.selection.start)<0?e.selection.start:r.selection.start,i=W(e.selection.end,r.selection.end)>0?e.selection.end:r.selection.end,a=t.selection.direction;a===0&&W(n,i)!==0&&(a=W(t.selection.start,n)===0?-1:1),r={index:t.index,selection:{direction:a,end:i,start:n}};continue}n.push(r),r=e}return n.push(r),n.sort((e,t)=>e.index-t.index).map(({selection:e})=>e)}function kt(e){let t=e.map(e=>{let t=e.end.line;return e.end.character===0&&W(e.start,e.end)!==0&&t--,{startLine:e.start.line,endLine:Math.max(e.start.line,t)}}).sort((e,t)=>{let n=e.startLine-t.startLine;return n===0?e.endLine-t.endLine:n}),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&e.startLine<=t.endLine+1?t.endLine=Math.max(t.endLine,e.endLine):n.push({...e})}return n}function At(e,t,n,r){let i=e=>{let i=e.line+t;if(i>=n){let e=Math.max(0,n-1);return{line:e,character:r(e)}}return i<0?{line:0,character:0}:{line:i,character:e.character}};return{start:i(e.start),end:i(e.end),direction:e.direction}}function jt(e,t){if(t.length===0)return;let n=t.map(t=>V(t)?Wt(e,t):t),r=n.map(t=>e.getText(t)),i=r[0];if(i.length===0||r.some(e=>e!==i))return;let a=n.map(t=>[e.offsetAt(t.start),e.offsetAt(t.end)]),o=e.findNextNonOverlappingSubstring(i,a);if(o===void 0)return n.some((e,n)=>{let r=t[n];return W(e.start,r.start)!==0||W(e.end,r.end)!==0||e.direction!==r.direction})?n:void 0;let s=St(e,o,o+i.length);return[...n,s]}function Mt(e){let t=e.lineCount-1;return{start:{line:0,character:0},end:{line:t,character:e.getLineLength(t)},direction:1}}function Nt(e,t,n){let r=0;if(t){let t=e.lineCount-1;r=n===!0&&t>0&&e.getLineLength(t)===0?t-1:t}let i=t?e.getLineLength(r):0,a={line:r,character:i};return{start:a,end:a,direction:1}}function Pt(e,t){if(V(t)){let n=t.start.line;return{start:e.offsetAt({line:n,character:0}),end:n<e.lineCount-1?e.offsetAt({line:n+1,character:0}):e.offsetAt({line:n,character:e.getLineLength(n)})}}let n=e.offsetAt(t.start),r=e.offsetAt(t.end);return n<=r?{start:n,end:r}:{start:r,end:n}}function Ft(e,t){return t.map(t=>Pt(e,t)).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n})}function It(e,t){return Ft(e,t).map(({start:t,end:n})=>e.getTextSlice(t,n))}function Lt(e,t){let n=Ft(e,t),r=e.eol,i=``,a=-1;for(let t of n)if(!(t.end<=t.start)){if(t.start<=a){t.end>a&&(i+=e.getTextSlice(a,t.end),a=t.end);continue}i.length>0&&!Ie(i)&&(i+=r),i+=e.getTextSlice(t.start,t.end),a=t.end}return i}function Rt(e,t){if(V(t))return zt(e,t);let[n,r]=W(t.start,t.end)<=0?[t.start,t.end]:[t.end,t.start];return{start:e.offsetAt(n),end:e.offsetAt(r),text:``}}function zt(e,t){let n=t.start.line,r=e.offsetAt({line:n,character:0}),i=e.offsetAt({line:n,character:e.getLineLength(n)});return n<e.lineCount-1?{start:r,end:e.offsetAt({line:n+1,character:0}),text:``}:n>0?{start:e.offsetAt({line:n-1,character:e.getLineLength(n-1)}),end:i,text:``}:{start:r,end:i,text:``}}function Bt(e){let t=[];for(let{edit:n}of e){if(n.start>=n.end)continue;let e=t.at(-1);e!==void 0&&n.start<=e.end?t[t.length-1]={start:e.start,end:Math.max(e.end,n.end),text:``}:t.push(n)}return t}function Vt(e,t){let n=Array.from({length:e.length}),r=0,i=0;for(let a of e){for(;r<t.length&&a.edit.start>t[r].end;){let e=t[r];i-=e.end-e.start,r++}let e=t[r];e!==void 0&&a.edit.start>=e.start&&a.edit.start<=e.end?n[a.index]=e.start+i:n[a.index]=a.edit.start+i}return n}function Ht(e,t){let n=[...t.map((t,n)=>({index:n,edit:Rt(e,t)}))].sort((e,t)=>{let n=e.edit.start-t.edit.start;if(n!==0)return n;let r=e.edit.end-t.edit.end;return r===0?e.index-t.index:r}),r=Bt(n);return{text:Lt(e,t),edits:r,nextSelectionOffsets:Vt(n,r)}}function Ut(e,t){let n=Math.max(0,t),r=tn(e),i=null;for(let e of r){i=e;let t=Y(e);if(n<=t+(e.textContent?.length??0)){let r=nn(e,n<t?0:n-t);if(r!==null)return r}}if(i!==null){let e=nn(i,i.textContent?.length??0);return e===null?[i,0]:e}let a=0,o=null;for(let t of e.childNodes){if(t.nodeType===1&&t.tagName===`BR`)return[t,0];if(t.nodeType!==3)continue;o=t;let e=X(o.textContent,o.textContent?.length??0);if(n<=a+e)return[o,X(o.textContent,n-a)];a+=e}return o===null?[e,0]:[o,X(o.textContent,o.textContent?.length??0)]}function Wt(e,t){let{line:n,character:r}=t.start,i=e.getLineText(n),a=Gt(i,Math.max(0,Math.min(r,i.length)));return a===void 0?t:{start:{line:n,character:a.start},end:{line:n,character:a.end},direction:1}}function Gt(e,t){let n=Le({granularity:`word`});if(n!==void 0){for(let r of n.segment(e)){if(r.isWordLike!==!0)continue;let e=r.index,n=e+r.segment.length;if(t>=e&&t<=n)return{start:e,end:n}}return}let r=/[\p{Alphabetic}\p{Number}_]+/gu,i;for(;(i=r.exec(e))!==null;){let e=i.index,n=e+i[0].length;if(t>=e&&t<=n)return{start:e,end:n}}}function Kt(e,t){if(!V(t))return[t.start,t.end];let n=H(t),{line:r,character:i}=n;if(i===0){if(r===0)return[n,n];let t=e.getLineLength(r-1);return[{line:r-1,character:t},{line:r,character:0}]}let a=e.getLineText(r),o=qt(a),s=i,c;for(;s>0;){let e=G(a,s,!1,o),t=a.slice(e,s),n=/\S/.test(t)?/\p{Alphabetic}|\p{Number}|_/u.test(t)?1:2:0;if(c!==void 0&&n!==c)break;(n!==0||s!==i)&&(c=n),s=e}return[{line:r,character:s},{line:r,character:i}]}function G(e,t,n,r){if(n){for(let e of r)if(e>t)return e;return e.length}for(let e=r.length-1;e>=0;e--){let n=r[e];if(n<t)return n}return 0}function qt(e){let t=[0],n=L();if(n!==void 0){for(let r of n.segment(e))r.index>0&&t.push(r.index);return t}let r=0;for(let n of e)r>0&&t.push(r),r+=n.length;return t}function K(e,t,n,r){let i=e.getLineLength(t);if(r){if(n>=i)return i;let r=e.offsetAt({line:t,character:0}),a=e.getTextSlice(r+n,r+i),o=L();if(o!==void 0){for(let e of o.segment(a))return n+e.segment.length;return i}for(let e of a)return n+e.length;return i}if(n<=0)return 0;let a=e.offsetAt({line:t,character:0}),o=e.getTextSlice(a,a+n),s=0,c=L();if(c!==void 0){for(let e of c.segment(o))s=e.index;return s}let l=0;for(let e of o)s=l,l+=e.length;return s}function Jt(e,t){let n=t.direction===-1;return[e.offsetAt(n?t.end:t.start),e.offsetAt(H(t))]}function Yt(e,t){if(!V(t))return{start:t.start,end:t.end};let{line:n,character:r}=t.start,i=e.getLineText(n).length;return r<i?{start:{line:n,character:r},end:{line:n,character:i}}:n<e.lineCount-1?{start:{line:n,character:r},end:{line:n+1,character:0}}:{start:{line:n,character:r},end:{line:n,character:r}}}function Xt(e,t,n){if(t!==`
|
|
465
|
+
`&&t!==`\r`&&t!==`\r
|
|
466
|
+
`)return t;let r=e.positionAt(n).line,i=e.getLineText(r),a=Zt(i);return a===0?t:t+i.slice(0,a)}function Zt(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}return t}function Qt(e,t){let n=[];for(let[e,r]of t)n.push(Math.min(e,r),Math.max(e,r));let r=e.positionsAt(n);return t.map(([e,t],n)=>{let i=e===t?0:e<t?1:-1;return{start:r[n*2],end:r[n*2+1],direction:i}})}function $t(e,t,n){if(t.text!==``||t.start!==t.end-1)return t;let r=e.positionAt(t.end);if(r.character===0)return t;let i=e.getLineText(r.line),a=i.slice(0,r.character);if(/[^ \t]/.test(a)||i[r.character-1]===` `)return t;let o=Math.max(0,r.character-n),s=i.slice(o,r.character);return s.length===n&&/^ +$/.test(s)?{...t,start:t.end-s.length}:t}function en(e,t){let n=e.nodeType===1?e:e.parentElement;for(;n!==null&&J(n)===void 0;)n=n.parentElement;if(n===null)return null;let r=J(n);if(r===void 0)return null;if(e.nodeType===3)return e.parentElement===null?null:sn(e.parentElement)===null?{line:r,character:on(n,e)+X(e.textContent,t)}:{line:r,character:q(e,t)};if(e.nodeType===1){let i=e;if(i.tagName===`DIV`){let e=0;for(let n=0;n<t;n++)e=q(i.childNodes[n]);return{line:r,character:e}}if(i.tagName===`BR`)return{line:r,character:0};if(i.tagName===`SPAN`){if(t<i.childNodes.length){let e=i.childNodes[t];if(e?.nodeType===1){let t=Y(e);if(t!==void 0)return{line:r,character:t};let n=sn(e),i=n===null?void 0:Y(n);if(i!==void 0)return{line:r,character:i}}}return{line:r,character:t>0?q(i.childNodes[t-1]):on(n,i)}}return{line:r,character:on(n,i)}}return null}function tn(e){let t=[];for(let n of e.childNodes){if(n.nodeType!==1)continue;let e=n;if(e.tagName===`SPAN`){if(Y(e)!==void 0){t.push(e);continue}for(let n of e.childNodes)n.nodeType===1&&Y(n)!==void 0&&t.push(n)}}return t}function nn(e,t){let n=Math.max(0,t),r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let t=e.container.childNodes[e.index];if(e.index++,t.nodeType===3){let e=X(t.textContent,t.textContent?.length??0);if(n<=e)return[t,n];n-=e}else t.nodeType===1&&r.push({container:t,index:0})}return null}function rn(e,t){let n=0,r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let i=e.container.childNodes[e.index];if(i===t)return n;e.index++,i.nodeType===3?n+=X(i.textContent,i.textContent?.length??0):i.nodeType===1&&r.push({container:i,index:0})}return n}function an(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=n.parentElement}return!1}function on(e,t){if(t.parentElement===e){let n=0,r=Array.prototype.indexOf.call(e.childNodes,t);for(let t=0;t<r;t++)n=q(e.childNodes[t]);return n}for(let n of tn(e))if(an(n,t))return Y(n)+(t.nodeType===3?rn(n,t):0);let n=0,r=t.nodeType===1?t:t.parentElement;for(;r!==null&&r.parentElement!==null&&J(r.parentElement)===void 0;){let e=r.parentElement,t=Array.prototype.indexOf.call(e.childNodes,r);for(let r=0;r<t;r++)n=q(e.childNodes[r]);r=e}return n}function sn(e){let t=e;for(;t!==null;){if(J(t)!==void 0)return null;if(Y(t)!==void 0)return t;t=t.parentElement}return null}function q(e,t){if(e===void 0)return 0;if(e.nodeType===3){let n=e.parentElement;if(n===null)return 0;let r=sn(n);if(r===null)return 0;let i=Y(r);if(i===void 0)return 0;let a=t===void 0?X(e.textContent,e.textContent?.length??0):X(e.textContent,t);return i+rn(r,e)+a}if(e.nodeType!==1)return 0;let n=e;if(n.tagName!==`SPAN`&&n.tagName!==`BR`)return 0;let r=Y(n);if(r!==void 0)return r+(n.textContent?.length??0);let i=0;for(let e of n.childNodes)i=Math.max(i,q(e));return i}function J(e){let{line:t,lineType:n}=e.dataset;if(t!==void 0&&n!==`change-deletion`){let e=parseInt(t,10);if(!Number.isNaN(e))return e-1}}function Y(e){let{char:t}=e.dataset;if(t!==void 0){let e=parseInt(t,10);if(!Number.isNaN(e))return e}}function X(e,t){let n=e??``,r=n.search(/[\r\n]/);return Math.min(t,r===-1?n.length:r)}var cn=300,ln=100,un=`marker-popover`,dn=class{#e;#t=[];#n=0;#r;#i;#a;#o;#s;#c;#l;#u=!1;constructor(e){this.#e=e}get markers(){return this.#t}isPopoverVisible(){return this.#l!==void 0}updatePopoverPosition(){let e=this.#l,t=this.#r;if(e===void 0||t===void 0)return;let n=this.#t[e];if(n===void 0){this.removePopover();return}this.#_(t,n.start.line,n.start.character)}setMarkers(e,t){this.#n=t.lineCount,this.#t=e.map(e=>({...e,start:t.normalizePosition(e.start),end:t.normalizePosition(e.end)})),this.removePopover()}listenHover(e){this.#a?.forEach(e=>e()),this.#a=void 0,this.#t.length!==0&&(this.#a=[P(e,`mouseover`,e=>{if(this.#e.isMouseDown())return;let t=e.composedPath()[0];if(t===void 0)return;let n=this.#d(t);n===void 0?(this.#f(),this.#h()):this.#m(n)}),P(e,`mouseleave`,()=>{this.#f(),this.#h()})])}removePopover(){this.#f(),this.#p(),this.#v()}cleanup(){this.#a?.forEach(e=>e()),this.#a=void 0,this.removePopover(),this.#t=[]}#d(e){let t=e.closest(`[data-line]`);if(t==null)return;let n=F(t);if(n===void 0)return;let r;if(e.tagName===`SPAN`){let t=e.dataset.char;if(t===void 0||(r=parseInt(t,10),Number.isNaN(r)))return}else if(e.tagName===`BR`)r=0;else return;let i={line:n-1,character:r};for(let e=this.#t.length-1;e>=0;e--)if(xt({start:i,end:i},this.#t[e]))return e}#f(){this.#o!==void 0&&(clearTimeout(this.#o),this.#o=void 0),this.#c=void 0}#p(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0)}#m(e){if(e===this.#l||e===this.#c){this.#p();return}if(this.#f(),this.#p(),this.#r!==void 0){this.#y(e);return}this.#c=e,this.#o=setTimeout(()=>{this.#o=void 0,this.#c=void 0,this.#y(e)},cn)}#h(){this.#u||(this.#p(),this.#s=setTimeout(()=>{this.#s=void 0,this.#u||this.removePopover()},ln))}#g(e,t,n,r,i=this.#e.popoverManager.getPlacementBounds()){Qe(e,{gutterWidth:this.#e.getGutterWidth(),placeAbove:r,viewport:i,x:t,y:n})}#_(e,t,n){let{getCharX:r,getLineY:i,getLineHeight:a,popoverManager:o}=this.#e,[s,c]=r(t,n),l=a(),u=i(t)+c*l,d=e.offsetHeight,f={top:u+l,bottom:u+l+d},p={top:u-d,bottom:u},m=t>=this.#n-3,h=o.getPlacementBounds(),g=o.choosePlacement({preferred:f,fallback:p,viewport:h,popoverHeight:d,atDocumentEdge:m,placementKey:un})===`fallback`;this.#g(e,s,g?u:u+l,g,h)}#v(){this.#i?.forEach(e=>e()),this.#i=void 0,this.#r?.remove(),this.#r=void 0,this.#l=void 0,this.#u=!1,this.#e.popoverManager.resetPlacement(un)}#y(e){if(e===this.#l)return;let t=this.#e.getOverlayElement();if(e>=this.#t.length||t==null)return;let{start:n,message:r,severity:i}=this.#t[e],{line:a,character:o}=n,s=this.#r;if(this.#e.popoverManager.resetPlacement(un),s!==void 0){pn(s,i);let t=s.firstElementChild;t?.dataset.markerMessage!==void 0&&(typeof r==`string`?t.textContent=r:r instanceof HTMLElement?t.replaceChildren(r):t.innerHTML=r.html),this.#_(s,a,o),this.#l=e;return}this.#r=N(`div`,{dataset:{editorWidget:``,markerPopover:``,[mn(i)]:``},children:[N(`div`,{dataset:`markerMessage`,...typeof r==`string`?{textContent:r}:r instanceof HTMLElement?{children:[r]}:{innerHTML:r.html}})]},t),this.#_(this.#r,a,o),this.#l=e,this.#i=[P(this.#r,`mouseenter`,()=>{this.#u=!0,this.#p()}),P(this.#r,`mouseleave`,()=>{this.#u=!1,this.#h()})]}},fn=[`error`,`warning`,`info`,`hint`];function pn(e,t){for(let t of fn)delete e.dataset[mn(t)];e.dataset[mn(t)]=``}function mn(e){switch(e){case`error`:return`markerError`;case`warning`:return`markerWarning`;case`info`:return`markerInfo`;case`hint`:return`markerHint`}}var hn=new Map([[`(`,`)`],[`[`,`]`],[`{`,`}`]]),gn=new Map([...hn].map(([e,t])=>[t,e])),_n=1e3,vn=5e4;function yn(e,t,n){let r=bn(e,t,e.normalizePosition(n));if(r===void 0)return;let i=hn.get(r.char),a=gn.get(r.char);if(i!==void 0)return kn(r,Cn(e,t,r,i));if(a!==void 0)return kn(wn(e,t,r,a),r)}function bn(e,t,n){let r=xn(n);if(r!==void 0){let n=Sn(e,t,r);if(n!==void 0)return n}return Sn(e,t,n)}function xn(e){if(e.character>0)return{line:e.line,character:e.character-1}}function Sn(e,t,n){let r=e.getLineText(n.line)[n.character];if(!(r===void 0||!hn.has(r)&&!gn.has(r)||Tn(t,n)))return{...n,char:r}}function Cn(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s<e.lineCount;s++){if(a>=_n)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:0},d=s===n.line?n.character:0;for(let e=d;e<c.length;e++){if(o>=vn)return;if(o++,Dn(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function wn(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s>=0;s--){if(a>=_n)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:l===null?-1:l.length-1},d=s===n.line?n.character:c.length-1;for(let e=d;e>=0;e--){if(o>=vn)return;if(o++,On(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function Tn(e,t){return En(e.getStringCommentRegexpRangesInLine(t.line),t.character)}function En(e,t){if(e===null)return!1;for(let[n,r]of e){if(t<n)return!1;if(t<r)return!0}return!1}function Dn(e,t,n){if(e===null)return!1;for(;n.index<e.length&&t>=e[n.index][1];)n.index++;let r=e[n.index];return r!==void 0&&t>=r[0]}function On(e,t,n){if(e===null)return!1;for(;n.index>=0&&t<e[n.index][0];)n.index--;let r=e[n.index];return r!==void 0&&t<r[1]}function kn(e,t){if(!(e===void 0||t===void 0))return[An(e),An(t)]}function An(e){return{start:{line:e.line,character:e.character},end:{line:e.line,character:e.character+1}}}var jn=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
467
|
+
<symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
|
|
468
|
+
<path fill="currentColor" d="M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z"></path>
|
|
469
|
+
</symbol>
|
|
470
|
+
<symbol id="diffs-editor-icon-arrow-up" viewBox="0 0 16 16">
|
|
471
|
+
<path fill="currentColor" transform="rotate(-90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
472
|
+
</symbol>
|
|
473
|
+
<symbol id="diffs-editor-icon-arrow-down" viewBox="0 0 16 16">
|
|
474
|
+
<path fill="currentColor" transform="rotate(90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
475
|
+
</symbol>
|
|
476
|
+
<symbol id="diffs-editor-icon-case" viewBox="0 0 16 16">
|
|
477
|
+
<path fill="currentColor" d="M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z"></path>
|
|
478
|
+
<path fill="currentColor" d="M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z"></path>
|
|
479
|
+
</symbol>
|
|
480
|
+
<symbol id="diffs-editor-icon-whole-word" viewBox="0 0 16 16">
|
|
481
|
+
<path fill="currentColor" d="M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z"></path>
|
|
482
|
+
<path fill="currentColor" d="M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z"></path>
|
|
483
|
+
<path fill="currentColor" d="M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z"></path>
|
|
484
|
+
</symbol>
|
|
485
|
+
<symbol id="diffs-editor-icon-regex" viewBox="0 0 16 16">
|
|
486
|
+
<path fill="currentColor" d="M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z"></path>
|
|
487
|
+
<path fill="currentColor" d="M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z"></path>
|
|
488
|
+
</symbol>
|
|
489
|
+
<symbol id="diffs-editor-icon-replace" viewBox="0 0 16 16">
|
|
490
|
+
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M5.28033 5.71967C5.57322 6.01256 5.57322 6.48744 5.28033 6.78033L3.56066 8.5H11.75C12.7165 8.5 13.5 7.7165 13.5 6.75V2.75C13.5 2.33579 13.8358 2 14.25 2C14.6642 2 15 2.33579 15 2.75V6.75C15 8.54493 13.5449 10 11.75 10H3.56066L5.28033 11.7197C5.57322 12.0126 5.57322 12.4874 5.28033 12.7803C4.98744 13.0732 4.51256 13.0732 4.21967 12.7803L1.21967 9.78033C0.926777 9.48744 0.926777 9.01256 1.21967 8.71967L4.21967 5.71967C4.51256 5.42678 4.98744 5.42678 5.28033 5.71967Z"></path>
|
|
491
|
+
</symbol>
|
|
492
|
+
<symbol id="diffs-editor-icon-replace-all" viewBox="0 0 16 16">
|
|
493
|
+
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M10.7197 0.21967C11.0126 -0.0732233 11.4874 -0.0732233 11.7803 0.21967L14.7803 3.21967C15.0732 3.51256 15.0732 3.98744 14.7803 4.28033L11.7803 7.28033C11.4874 7.57322 11.0126 7.57322 10.7197 7.28033C10.4268 6.98744 10.4268 6.51256 10.7197 6.21967L12.4393 4.5H4.25C3.2835 4.5 2.5 5.2835 2.5 6.25V6.875C2.5 7.28921 2.16421 7.625 1.75 7.625C1.33579 7.625 1 7.28921 1 6.875V6.25C1 4.45507 2.45508 3 4.25 3H12.4393L10.7197 1.28033C10.4268 0.987437 10.4268 0.512563 10.7197 0.21967ZM5.28033 8.71967C5.57322 9.01256 5.57322 9.48744 5.28033 9.78033L3.56066 11.5H11.75C12.7165 11.5 13.5 10.7165 13.5 9.75V9.125C13.5 8.71079 13.8358 8.375 14.25 8.375C14.6642 8.375 15 8.71079 15 9.125V9.75C15 11.5449 13.5449 13 11.75 13H3.56066L5.28033 14.7197C5.57322 15.0126 5.57322 15.4874 5.28033 15.7803C4.98744 16.0732 4.51256 16.0732 4.21967 15.7803L1.21967 12.7803C0.926777 12.4874 0.926777 12.0126 1.21967 11.7197L4.21967 8.71967C4.51256 8.42678 4.98744 8.42678 5.28033 8.71967Z"></path>
|
|
494
|
+
</symbol>
|
|
495
|
+
</svg>`,Mn=()=>{let e=document.createElement(`div`);e.innerHTML=jn;let t=e.firstElementChild;if(t===null||!(t instanceof SVGSVGElement))throw Error(`Failed to create sprite element`);return t},Nn=(e,t=16)=>`<svg width="${t}" height="${t}" aria-hidden="true" focusable="false">
|
|
496
|
+
<use href="#diffs-editor-icon-${e}"></use>
|
|
497
|
+
</svg>`,Pn=class{#e;#t;#n;#r;#i;#a;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,initialMatch:a,scrollToMatch:o,applyReplace:s,onUpdate:c,onClose:l}=e,u={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},d={all:[],current:void 0},f=N(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),p=e=>{d.all=u.text===``?[]:t.search(u);let n=d.all.length===0;if(O.disabled=n,k.disabled=n,n){f.textContent=`No results`,f.dataset.noMatches=``,d.current=void 0,c([]);return}if(delete f.dataset.noMatches,e?.syncSelection===!1){m(c(d.all,{syncSelection:!1}));return}m(c(d.all))};this.#n=p;let m=e=>{if(e===void 0)f.textContent=`${d.all.length} results`;else{let[t,n]=e;f.textContent=`${d.all.findIndex(e=>e[0]===t&&e[1]===n)+1} of ${d.all.length}`}d.current=e},h=(e,t)=>{u[e]=t,p()},g=(e=!1,t=!1)=>{let n=d.all,r=n[0];if(n.length>0)if(e){let e=d.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=d.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}r!==void 0&&(m(r),o(r,t)),d.current=r};this.#i=e=>g(e,!0);let _=(e,n)=>({start:e,end:n,text:me(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),u,e,n)}),v=()=>{if(u.text===``||d.all.length===0)return;let e=d.current;if(e===void 0&&(g(!1,!0),e=d.current,e===void 0))return;let[t,n]=e,r=_(t,n);s([r]),o([t+r.text.length,t+r.text.length],!0),d.current=void 0,p()},y=()=>{u.text===``||d.all.length===0||(s(d.all.map(([e,t])=>_(e,t))),d.current=void 0,p())},b=()=>{this.cleanup(),l()};this.#a=b;let x=e=>N(`button`,{type:`button`,title:e.label,ariaLabel:e.label,dataset:{searchIcon:``,...e.dataset},innerHTML:Nn(e.icon,e.size??16),onclick:e.onClick}),S=(e,t,n)=>{let r=x({icon:e,label:t,size:14,onClick:()=>{let e=!u[n];r.ariaPressed=String(e),h(n,e)}});return r.ariaPressed=String(u[n]),r},C=S(`case`,`Match Case`,`caseSensitive`),w=S(`whole-word`,`Whole Word`,`wholeWord`),T=S(`regex`,`Regexp`,`regex`),ee=N(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{u.replaceText=e.target.value},onkeydown:e=>{if(e.isComposing)return;let t=Ce(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),v()):t!==void 0&&(e.preventDefault(),g(t===`previous`,!0))}});this.#t=N(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{u.text=e.target.value,d.current=void 0,p()},onkeydown:e=>{let t=Ce(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),g(e.shiftKey,!0)):t===void 0?j(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),oe(e.altKey?`replace`:`find`)):(e.preventDefault(),g(t===`previous`,!0))}});let E=N(`div`,{dataset:`searchToggles`,children:[C,w,T]}),te=N(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,E]}),D=N(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[ee]}),ne=N(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[x({icon:`replace`,label:`Replace`,onClick:v}),x({icon:`replace-all`,label:`Replace All`,onClick:y})]}),O=x({icon:`arrow-up`,label:`Previous`,onClick:()=>{g(!0)}}),k=x({icon:`arrow-down`,label:`Next`,onClick:()=>{g()}});O.disabled=!0,k.disabled=!0;let re=N(`div`,{dataset:`searchNav`,children:[O,k]}),ie=x({icon:`close`,label:`Close`,onClick:b,dataset:{searchClose:``}}),ae=N(`div`,{dataset:{searchGrid:``,mode:i},children:[te,D,ne,f,re,ie]}),oe=e=>{ae.dataset.mode=e,this.#t.focus(),this.#t.select()};this.#r=oe,this.#e=N(`div`,{dataset:`searchPanel`,children:[N(`div`,{dataset:`editorWidget`,children:[ae]})]}),d.current=a,n.before(this.#e),requestAnimationFrame(()=>{a===void 0?c([]):p(),this.#t.select()})}focus(){this.#t.focus()}navigate(e){this.#i?.(e)}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}close(){this.#a?.()}cleanup(){this.#e.remove()}},Fn=class{#e;#t;#n;constructor(e,t,n){this.#e=N(`div`,{dataset:{editorWidget:``,selectionActionPopover:``},contentEditable:`false`,children:[e]},t),this.#t=this.#e.offsetHeight,this.#n=new ResizeObserver(()=>{let e=this.#e.offsetHeight;e!==this.#t&&(this.#t=e,n())}),this.#n.observe(this.#e)}reposition(e,t,n,r,i,a){this.#e.style.visibility=i?``:`hidden`,Qe(this.#e,{gutterWidth:n,placeAbove:r,viewport:a,x:e,y:t})}get height(){return this.#t}cleanup(){this.#n.disconnect(),this.#e.remove()}};function Z(e){return{selections:e.selections?.map(e=>({start:{...e.start},end:{...e.end},direction:e.direction})),view:e.view===void 0?void 0:{...e.view}}}function In(e){return typeof e==`object`?e:e===`indexedDB`?new Bn:new Ln}var Ln=class{#e=new Map;get(e){let t=this.#e.get(e);return t===void 0?void 0:Z(t)}set(e,t){this.#e.set(e,Z(t))}},Rn=`pierre-diffs-editor-state`,zn=1,Q=`states`,Bn=class{#e=Vn();async get(e){let t=await this.#e;if(t===void 0)return;let n=await Hn(t.transaction(Q,`readonly`).objectStore(Q).get(e));return n===void 0?void 0:Z(n)}async set(e,t){let n=await this.#e;n!==void 0&&await Hn(n.transaction(Q,`readwrite`).objectStore(Q).put(Z(t),e))}};function Vn(){try{let e=globalThis.indexedDB;if(e===void 0)return Promise.resolve(void 0);let t=e.open(Rn,zn);return t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(Q)||e.createObjectStore(Q)},Hn(t)}catch{return Promise.resolve(void 0)}}function Hn(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}var Un=4096,Wn=/\p{Mark}/u,Gn=class{#e;#t;#n;#r=new Map;ch=-1;tabSize=2;lineHeight=20;paddingTop=0;init(e){if(this.#e===e&&this.#t!==void 0&&this.ch!==-1)return;if(this.#e=e,this.#t??=document.createElement(`canvas`).getContext(`2d`)??void 0,this.#t===void 0)throw Error(`Could not get canvas context`);let t=e.parentElement;if(t!==null){let{paddingTop:e}=getComputedStyle(t);e.endsWith(`px`)&&(this.paddingTop=parseFloat(e.slice(0,-2)))}let{fontSize:n,fontFamily:r,tabSize:i,lineHeight:a}=getComputedStyle(e);a.endsWith(`px`)?this.lineHeight=parseFloat(a.slice(0,-2)):n.endsWith(`px`)&&(this.lineHeight=I(parseFloat(n.slice(0,-2))*parseFloat(a)));let o=n+` `+r;(this.#n!==o||this.ch===-1)&&(this.#n=o,this.#t.font=o,this.ch=this.canvasMeasureTextWidth(`0`),this.clearTextWidthCache());let s=parseInt(i,10);Number.isNaN(s)||(this.tabSize=s)}remeasureCharacterWidth(){if(this.#t===void 0||this.#n===void 0)return!1;this.#t.font=this.#n;let e=this.canvasMeasureTextWidth(`0`),t=e!==this.ch;t&&(this.ch=e);let n=this.#a();return t||n}measureTextWidth(e){if(!e.includes(` `))return this.#i(e);if(this.#t===void 0)throw Error(`Metrics not initialized`);let t=Yn(e,this.tabSize);if(t!==-1)return t*this.ch;let n=0,r=0,i=this.tabSize*this.ch;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===9){if(t>r&&(n+=this.#i(e.slice(r,t))),i>0){let e=n%i;n+=e===0?i:i-e}r=t+1}return r<e.length&&(n+=this.#i(e.slice(r))),I(n)}#i(e){return Kn(e)?this.domMeasureTextWidth(e):this.canvasMeasureTextWidth(e)}canvasMeasureTextWidth(e){if(this.#t===void 0)throw Error(`Metrics not initialized`);return I(this.#t.measureText(e).width)}domMeasureTextWidth(e){if(this.#e===void 0)throw Error(`Metrics not initialized`);let t=e+`|`+this.#n,n=this.#r.get(t);if(n!==void 0)return n;let r=N(`span`,{style:{position:`absolute`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,font:`inherit`},textContent:e},this.#e),i;try{i=I(r.getBoundingClientRect().width)}finally{r.remove()}if(this.#r.size>=Un){let e=this.#r.keys().next().value;e!==void 0&&this.#r.delete(e)}return this.#r.set(t,i),i}clearTextWidthCache(){this.#a()}#a(){let e=this.#r.size>0;return this.#r.clear(),e}};function Kn(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=57343||n===8205||n===65038||n===65039||n>127&&Wn.test(e.charAt(t)))return!0}return!1}function qn(e,t){let n=Math.max(0,Math.min(t,e.length));if(n===0||n===e.length||!Kn(e))return n;let r=L();if(r!==void 0){for(let t of r.segment(e)){let e=t.index,r=e+t.segment.length;if(n>e&&n<r)return r;if(n<=e)break}return n}let i=0;for(let t of e){let e=i+t.length;if(n>i&&n<e)return e;if(n<=i)break;i=e}return n}function Jn(e){if(!Kn(e))return;let t=[0],n=L();if(n!==void 0){for(let r of n.segment(e))t.push(r.index+r.segment.length);return t}let r=0;for(let n of e)r+=n.length,t.push(r);return t}function Yn(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i>127)return-1;n+=i===9?t-n%t:1}return n}var Xn=500,Zn=0,Qn=class{#e;#t;#n;#r=`dark`;#i=``;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=!1;#h=[l];#g=[];#_=0;#v=[];#y=-1;#b=!0;#x=!1;#S=0;#C=++Zn;#w=-1;#T=-1;#E;#D=0;#O=[];#k=!1;#A=Fe(async e=>{if(this.#m)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#o.lineCount);if(this.#t===void 0&&!tr(this.#o.languageId)){if(await this.#e.loadLanguage(this.#o.languageId),this.#m)return;this.#t=this.#e.getLanguage(this.#o.languageId)}this.#F(),this.#V(r)},500);#j=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#C&&typeof r==`number`&&r===this.#S&&(this.#w>=0?this.#q(r):this.#J(r))};get themeType(){return this.#r}getStringCommentRegexpRangesInLine(e){if(!this.#d||e<0||e>=this.#o.lineCount||(this.#I(),this.#t===void 0))return null;if(this.#O[e]===void 0){this.#K(e);let t=this.#h[e]??l,n=this.#H(e,t);this.#h[e+1]=n.state}return this.#O[e]??null}constructor({codeOptions:e,highlighter:t,textDocument:n,matchBrackets:i,setStyle:a,onDeferTokenize:o,onThemeChange:s,__debug:c}){let{themeType:l=`system`,theme:u=r,tokenizeMaxLineLength:d=1e3}=e;this.#n=window.matchMedia(`(prefers-color-scheme: dark)`);let f;if(f=l===`system`?this.#N():l,typeof u!=`string`&&l===`system`){let e=new MutationObserver(e=>{for(let{type:t,attributeName:n}of e)if(t===`attributes`&&n!==null&&(n===`class`||n.startsWith(`data-`))){let e=this.#N();this.#M(u[e],e);break}});e.observe(document.documentElement,{attributes:!0}),e.observe(document.body,{attributes:!0}),this.#p=[P(this.#n,`change`,()=>{let e=this.#N();this.#M(u[e],e)}),()=>e.disconnect()]}this.#e=t,this.#o=n,this.#s=d,this.#c=a,this.#l=o,this.#u=s,this.#d=i!==!1,this.#f=c??!1,this.#I(),this.#a=[],this.#P(typeof u==`string`?u:u[f],typeof u==`string`?void 0:f)}#M(e,t){e===this.#i&&t===this.#r||(this.#P(e,t),this.stopBackgroundTokenize(),this.#h=[l],this.#g=[],this.#_=0,this.#v=[],this.#t!==void 0&&this.#o.lineCount>0&&this.#B(0),this.#u?.())}#N(){try{if(typeof document<`u`&&typeof getComputedStyle==`function`&&document.body!=null){let e=getComputedStyle(document.body).colorScheme.split(/\s+/),t=e.includes(`dark`);if(t!==e.includes(`light`))return t?`dark`:`light`}}catch{}return this.#n.matches?`dark`:`light`}syncTheme(e){let{themeType:t=`system`,theme:n=r}=e;if(typeof n==`string`){let e=this.#e.getTheme(n).type;if(n===this.#i&&e===this.#r)return;this.#M(n,e);return}let i=t===`system`?this.#N():t,a=n[i];i===this.#r&&a===this.#i||this.#M(a,i)}#P(e,t){let{theme:n,colorMap:r}=this.#e.setTheme(e),{colors:i={}}=this.#e.getTheme(e),a=i[`editor.selectionBackground`],o=i[`editor.lineHighlightBackground`],s=o!=null&&o.trim()!==``&&!d.isFullyTransparent(o)?o:void 0,c=i[`editor.lineHighlightBorder`]??(s==null?`color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-fg))`:`transparent`),l=s==null?`100%`:`85%`,u=i[`editorCursor.foreground`],f=i[`editor.findMatchBackground`],p=i[`editor.findMatchHighlightBackground`],m=i[`editorBracketMatch.background`],h=i[`editorBracketMatch.border`],g=i[`editorHint.foreground`],_=i[`editorInfo.foreground`],v=i[`editorWarning.foreground`],y=i[`editorError.foreground`];this.#c(`:host {
|
|
498
|
+
--diffs-editor-selection-bg: ${a??`var(--diffs-line-bg)`};
|
|
499
|
+
--diffs-editor-line-highlight-border: ${c};
|
|
500
|
+
--diffs-editor-active-line-source-mix: ${l};
|
|
501
|
+
--diffs-editor-match-bg: ${f??`initial`};
|
|
502
|
+
--diffs-editor-match-highlight-bg: ${p??`initial`};
|
|
503
|
+
--diffs-editor-bracket-match-bg: ${m??`initial`};
|
|
504
|
+
--diffs-editor-bracket-match-border: ${h??`initial`};
|
|
505
|
+
--diffs-editor-cursor-fg: ${u??`initial`};
|
|
506
|
+
--diffs-editor-hint-fg: ${g??`initial`};
|
|
507
|
+
--diffs-editor-info-fg: ${_??`initial`};
|
|
508
|
+
--diffs-editor-warning-fg: ${v??`initial`};
|
|
509
|
+
--diffs-editor-error-fg: ${y??`initial`};
|
|
510
|
+
}`),this.#i=e,this.#r=t??n.type,this.#a=r}#F(){if(this.#i===``)return;let{colorMap:e}=this.#e.setTheme(this.#i);this.#a=e}cleanUp(){this.#m=!0,this.stopBackgroundTokenize(),this.#R(),this.#p?.forEach(e=>e()),this.#p=void 0}tokenize(e,t){if(this.#I(),this.#F(),this.#t===void 0&&!tr(this.#o.languageId))throw Error(`Grammar for language "${this.#o.languageId}" not loaded`);this.#d&&(this.#O.length=Math.min(this.#O.length,e.startLine));let{lineCount:n}=this.#o,{startingLine:r=0,totalLines:i=1/0}=t??{},a=i===1/0?n:Math.min(r+i,n),o=e.startLine,s=Math.max(r,o),c=t!==void 0&&i!==1/0&&e.lineDelta>0&&o<a&&e.endLine>=a,u=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0),d=u||t===void 0||o>=s,f=e.changedLineRanges??[[o,e.endLine]];this.#g=[],this.#_=0,this.#v=[];let p=-1;if(o<s)for(let[e,t]of f)e<s&&(p=Math.max(p,Math.min(t,s-1)));let m=p>=o&&(u||e.lineDelta<0);u?this.#K(o):(this.#W(e),(t===void 0||o>=s)&&this.#K(s));let h=0,g=f[h][1],_,v=0,y=u?f[h][0]:s,b=!1,x=new Map,S=m?new Map:void 0;if(S!==void 0&&!u){let e=Math.min(p+1,s,a);if(e>o){this.#K(e);let t=o,n=this.#h[t]??l;for(;t<e;t++){let e=this.#H(t,n);n=e.state,S.set(t,e.resolvedTokens)}this.#h[e]=n}}let C=this.#h[y]??l;for(;y<a;){let e=u?this.#h[y+1]:void 0;d&&(this.#h[y]=C);let{resolvedTokens:t,state:n}=this.#H(y,C);if(C=n,y>=s?x.set(y,t):S?.set(y,t),d&&(this.#h[y+1]=C),b=y>=g&&u&&e!==void 0&&C.equals(e),b){h++;let e=f[h];if(e===void 0)break;if(e[0]>=a){_=e[0],v=h;break}this.#h[e[0]]===void 0?(g=e[1],y++):(y=e[0],C=this.#h[y]??C,g=e[1]),b=!1;continue}y++}if(d&&(y<a?this.#h[y+1]=C:this.#h[y]=C),S!==void 0&&S.size>0&&this.#l(S,this.#r),_!==void 0)this.#B(_,f,v);else if(!b&&y<n){let e=c&&o>=s?a:o<s&&!u?o:y;this.#B(e,f,h)}return x}prebuildStateStack(e){this.#I(),this.#A(e)}stopBackgroundTokenize(){this.#T=-1,!this.#b&&(this.#b=!0,this.#x=!1,this.#y=-1,this.#w=-1,this.#E=void 0,this.#D=0,this.#g=[],this.#_=0,this.#v=[],this.#R())}pauseBackgroundTokenize(){this.#b||this.#x||(this.#f&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#S}),this.#x=!0)}resumeBackgroundTokenize(){this.#b||!this.#x||this.#t===void 0||this.#y<0||(this.#f&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#S}),this.#x=!1,this.#z(this.#S))}#I(){this.#t===void 0&&!tr(this.#o.languageId)&&this.#e.getLoadedLanguages().includes(this.#o.languageId)&&(this.#t=this.#e.getLanguage(this.#o.languageId))}#L(){this.#k||=(globalThis.addEventListener(`message`,this.#j),!0)}#R(){this.#k&&=(globalThis.removeEventListener(`message`,this.#j),!1)}#z(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#C,jobId:e})}#B(e,t,n=0){if(tr(this.#o.languageId))return;let r=++this.#S;this.#f&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#b=!1,this.#x=!1,this.#y=e,this.#w>=0&&(this.#T=Math.max(this.#T,this.#w)),this.#w=-1,this.#E=t,this.#D=n,this.#L(),this.#z(r)}#V(e){if(this.#t===void 0||this.#h.length>e)return;if(!this.#b){this.#w>=0?this.#w=Math.max(this.#w,e):this.#T=Math.max(this.#T,e);return}let t=++this.#S;this.#b=!1,this.#x=!1,this.#y=this.#h.length-1,this.#w=e,this.#T=-1,this.#E=void 0,this.#D=0,this.#L(),this.#z(t)}#H(e,t){let n=this.#o.getLineText(e);if(n.length>this.#s)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#U(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t===void 0||n===``||n.trim()===``)return this.#U(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=$n(this.#t,this.#a,n,t,Xn,this.#d);return this.#U(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#U(e,t){this.#d&&(this.#O[e]=t)}#W(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#h.length-n?(this.#g=this.#h,this.#_=0,this.#h=this.#h.slice(0,n)):(this.#_=n,this.#g=this.#h.slice(n),this.#h.length=Math.min(this.#h.length,n)),this.#v=t}#G(e){let t=e;for(let n=this.#v.length-1;n>=0;n--){let[r,i,a]=this.#v[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#h[e]}}return this.#g[t-this.#_]??this.#h[e]}#K(e,t){let n=Math.min(Math.max(0,e),this.#o.lineCount);if(this.#h.length>n||this.#t===void 0)return!0;let r=t===void 0?0:performance.now(),i=this.#h.length-1,a=this.#h[i]??l;for(;i<n;){this.#h[i]=a;let e=this.#o.getLineText(i);if(e.length<=this.#s&&e!==``&&e.trim()!==``){let t=$n(this.#t,this.#a,e,a,Xn,this.#d,!1);this.#U(i,t.bracketIgnoredRanges),a=t.ruleStack}else this.#U(i,null);if(i++,this.#h[i]=a,t!==void 0&&performance.now()-r>t)break}return i>=n}#q(e){if(this.#b||this.#x||this.#t===void 0||e!==this.#S)return;this.#F();let t=this.#K(this.#w,1);if(!(this.#b||this.#x||e!==this.#S)){if(t){this.stopBackgroundTokenize();return}this.#y=this.#h.length-1,this.#z(e)}}#J(e){if(this.#b||this.#x||this.#t===void 0||e!==this.#S)return;this.#F();let t=performance.now(),n=new Map,r=this.#o.lineCount,i=this.#E,a=this.#y,o=this.#h[a]??l,s=!1,c=this.#D,u=i?.[c]?.[1];for(;a<r;){this.#h[a]=o;let e=u===void 0?void 0:this.#G(a+1),r=this.#o.getLineText(a);if(r.length>this.#s)console.warn(`[diffs] Line(${a}) too long to tokenize: ${r.length}`),n.set(a,[[0,``,r]]),this.#U(a,null);else if(r===``||r.trim()===``)n.set(a,[[0,``,r]]),this.#U(a,null);else{let e=$n(this.#t,this.#a,r,o,Xn,this.#d);n.set(a,e.resolvedTokens),this.#U(a,e.bracketIgnoredRanges),o=e.ruleStack}if(this.#h[a+1]=o,s=u!==void 0&&a>=u&&e!==void 0&&o.equals(e),a++,s){c++;let e=i?.[c];if(e===void 0)break;if(u=e[1],this.#h[e[0]]===void 0)s=!1;else{a=e[0],o=this.#h[a]??o,s=!1;continue}}if(performance.now()-t>1)break}if(this.#l(n,this.#r),!(this.#b||this.#x||e!==this.#S)){if(s||a>=r){let e=this.#T;this.stopBackgroundTokenize(),e>=0&&this.#V(e);return}this.#y=a,this.#D=c,this.#z(e)}}};function $n(e,t,r,i,a,o=!0,s=!0){let c=e.tokenizeLine2(r,i,a);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${r.substring(0,100)}`);let l=c.tokens,u=l.length/2,d=[],f=[];if(!s&&!o)return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let e=0;e<u;e++){let i=l[2*e],a=e+1<u?l[2*e+2]:r.length;if(i===a)continue;let c=l[2*e+1];if(s){let e=n.getForeground(c);d.push([i,t[e],r.slice(i,a)])}o&&n.getTokenType(c)>0&&f.push([i,a])}return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function er(e){return e.map(([e,t,n])=>e===0&&t===``?n===``?N(`br`):n:N(`span`,{dataset:{char:e.toString()},style:`color:${t};`,textContent:n}))}function tr(e){return e===`text`||e===`ansi`}function nr(e){let t=e.getSelection?.();if(t==null||t.rangeCount===0)return;let n=t.getRangeAt(0);return{collapsed:n.collapsed,startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}}function $(e){if(typeof e.cacheKey!=`string`||e.cacheKey.length===0)throw Error(`Editor persistState requires a non-empty file.cacheKey for "${e.name}". Provide a unique, stable cacheKey for every editable file.`);return e.cacheKey}function rr(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}var ir=2,ar=1e4,or=`selection-action`,sr=`application/vnd.pierre.diffs-selections+json`,cr=class{#e;#t=new Gn;#n;#r;#i=new Map;#a;#o;#s=new Map;#c;#l=0;#u=!1;#d;#f;#p;#m;#h={generation:0,callback:void 0,delivered:!1};#g;#_;#v;#y=new Map;#b=new Map;#x=new Map;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H;#U=!0;#W=!1;#G=!1;#K=!1;#q;#J=!1;#Y=!1;#X=!1;#Z=!1;#Q;#$=``;#ee;#te;#ne;#re;#ie;#ae;#oe=!1;#se=!1;#ce=!1;#le=!1;#ue;#de=(e,t)=>{if(this.#P?.updateRenderCache(e,t),this.#R!==void 0&&this.#R.totalLines!==1/0){let{startingLine:t,totalLines:n}=this.#R,r=Math.min(t+n,this.#L?.lineCount??0);for(let[n,i]of e)if(n>=t&&n<r){let e=this.#Lt(n);e!==void 0&&e.replaceChildren(...er(i))}}};constructor(e={}){this.#e=e}setOptions(e){let t=this.#e.persistStateStorage??`inMemory`,n={...this.#e,...e};if(n.persistState===!0&&this.#P?.type===`file`){let e=this.#P.__getCurrentFile?.()??this.#F;e!==void 0&&$(e)}this.#e=n,this.#e.persistState!==!0&&(this.#i.clear(),this.#l++,this.#u=!1),(this.#e.persistStateStorage??`inMemory`)!==t&&(this.#l++,this.#a=void 0,this.#o=void 0,this.#s.clear())}edit(e){if(this.#e.persistState===!0&&e.type===`file`){let t=e.__getCurrentFile?.();t!==void 0&&$(t)}return this.#Oe(),this.#P=e,this.#Ae(),this.#m=e.attachEditor(this),()=>this.cleanUp()}applyEdits(e,t=!0){let n=this.#L;if(n==null)throw Error(`Editor is not attached`);let r=this.#K,i=this.#ne,a=i?.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]),o=i===void 0?void 0:n.resolveEdits(e).sort((e,t)=>e.start-t.start),s=n.applyEdits(e,t,i);if(s===void 0)return;let c;i!==void 0&&a!==void 0&&o!==void 0&&(c=wt(n,i,a,o),t&&n.setLastUndoSelectionsAfter(c)),this.#Pt(s,c,this.#Ft(s),{skipFocus:!r})}get canUndo(){return this.#L?.canUndo??!1}get canRedo(){return this.#L?.canRedo??!1}undo(){this.#Re(`undo`)}redo(){this.#Re(`redo`)}getFile(){let e=this.#F,t=this.#L;if(e===void 0||t===void 0)return;let n={...e};return Object.defineProperty(n,`contents`,{enumerable:!0,get:()=>t.getText()}),n}getText(){return this.#L?.getText()??``}getState(){let e=this.#P;return{selections:this.#ne,view:e==null?void 0:{scrollLeft:e.getCodeScrollLeft()}}}setState({selections:e,view:t}){if(this.#P===void 0||this.#L===void 0)throw Error(`Editor is not attached`);if(this.#U=!1,this.#mt(e??[]),t!=null){this.#P.setCodeScrollLeft(t.scrollLeft);return}this.#tt()}setSelections(e){let t=this.#L;if(t===void 0)throw Error(`Text document is not initialized`);let n=e.map(e=>{let n=t.normalizePosition(e.start),r=t.normalizePosition(e.end),i=e.direction===`none`?0:e.direction===`backward`?-1:1;return W(n,r)>0&&([n,r]=[r,n],i!==0&&(i=i===1?-1:1)),{direction:i,start:n,end:r}});this.#U=!1,this.#mt(n);let r=n.at(-1);r!==void 0&&this.#xe(H(r).line),this.#tt()}setMarkers(e){let t=this.#L;if(t===void 0)throw Error(`Text document is not initialized`);if(e.length===0){this.#B?.cleanup(),this.#B=void 0,this.#mt(this.#ne??[]);return}this.#B??=new dn({popoverManager:this.#Te(),getLineHeight:()=>this.#t.lineHeight,getOverlayElement:()=>this.#A,getGutterWidth:()=>this.#Rt(),getCharX:(e,t)=>this.#Vt(e,t),getLineY:e=>this.#Bt(e),isMouseDown:()=>this.#X||this.#Y}),this.#B.setMarkers(e,t),this.#k!==void 0&&this.#B.listenHover(this.#k),this.#mt(this.#ne??[])}focus(e){let t=e?.preventScroll??!1,n=e?.lineNumber;if(n===`first-visible`||typeof n==`number`){let r=this.#L;if(r==null||this.#P==null)return;let i=n===`first-visible`?this.#Ze(e?.offset):n;if(i==null)return;let a=r.normalizePosition({line:i-1,character:n===`first-visible`?0:e?.character??0});this.#$e(a,t);return}let r=this.#ne?.at(-1);if(r!==void 0){let e=r.direction===-1?r.end:r.start;this.#Je(e,t)}else this.#Je(void 0,t)}blur(){this.#q=void 0,this.#K=!1,this.#W=!1,this.#k?.blur()}cleanUp(t=!1){this.#Oe(),t||(this.#h.delivered=!1);let n=this.#P!=null,r=this.#fe;this.#l++,this.#he(),n&&(this.#u=r),e(this.#Fe),this.#n?.cleanUp(),this.#n=void 0,t||(this.#L=void 0,this.#F=void 0),this.#f?.forEach(e=>e()),this.#f=void 0,this.#d?.forEach(e=>e()),this.#d=void 0,this.#p?.forEach(e=>e()),this.#p=void 0,this.#m?.(t),this.#m=void 0,this.#_=void 0,this.#v=void 0,this.#y.clear(),this.#b.clear(),this.#x.clear(),this.#S=void 0,this.#C?.remove(),this.#C=void 0,this.#w?.remove(),this.#w=void 0,this.#T?.remove(),this.#T=void 0,this.#E?.remove(),this.#E=void 0,this.#D=void 0,this.#r?.cleanUp(),this.#r=void 0,this.#O=void 0,this.#k?.removeAttribute(`contentEditable`),this.#k=void 0,this.#q=void 0,this.#K=!1,this.#A?.remove(),this.#A=void 0,this.#N?.disconnect(),this.#N=void 0,this.#le=!1,this.#ue!==void 0&&(cancelAnimationFrame(this.#ue),this.#ue=void 0),this.#De(),this.#P=void 0}__prepareFile(e){if(this.#e.persistState!==!0)return e;let t=$(e),n=this.#F,r=e.lang??f(e.name);n!==void 0&&($(n)!==t||n.name!==e.name||this.#L?.languageId!==r)&&(this.#l++,this.#he());let i=this.#pe(e,t);return i===void 0||i.getText()===e.contents?e:{...e,contents:i.getText()}}__postponeBgTokenizeToNextFrame(){let e=this.#n;e!==void 0&&(e.pauseBackgroundTokenize(),requestAnimationFrame(()=>{e.resumeBackgroundTokenize()}))}__captureFocusForDOMReplacement(){let e=this.#k,t=this.#D?.shadowRoot?.activeElement;e!=null&&(this.#K||t===e||t!=null&&e.contains(t))&&(this.#q={})}__syncRenderView=(e,t,n,r,i)=>{let a=this.#P;if(a==null)return;let o=t.shadowRoot;if(o==null){console.error(`[editor] Could not find the shadow root.`);return}let s,c,l;for(let e of o.querySelectorAll(`[data-code]`))if(e.dataset.deletions===void 0){s=e;for(let t of e.children){let e=t,{gutter:n,content:r}=e.dataset;n===void 0?r!==void 0&&(l=e):c=e}break}if(s===void 0||l===void 0){this.#q=void 0;return}this.#Te().setViewportElements(t,s),this.#D!==t&&(this.#D=t,this.#C!==void 0&&t.appendChild(this.#C),this.#w!==void 0&&o.appendChild(this.#w),this.#T!==void 0&&o.appendChild(this.#T),this.#E!==void 0&&o.prepend(this.#E));let u=this.#L===void 0||this.#F===void 0||this.#F.name!==n.name||this.#F.lang!==n.lang||this.#F.cacheKey!==n.cacheKey,d=this.#fe?$(n):void 0,p;if(u){this.#Oe();let e=``;e=`contents`in n?n.contents:n.additionLines.join(``);let t=new _({maxEntries:this.#e.historyMaxEntries}),{name:r,lang:i,cacheKey:a}=n,o=i??f(n.name),s=(d===void 0?void 0:this.#pe(n,d))??new ge(n.name,e,o,0,t);this.#F={name:r,lang:i,cacheKey:a},this.#L=s,d!==void 0&&(this.#i.set(d,s),p={cacheKey:d,textDocument:s}),this.#n?.cleanUp(),this.#n=void 0,this.#De(),this.#b.clear(),this.#ne=this.#te,this.#L!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] text document rebuilt from`,n.name)}p===void 0&&this.#u&&d!==void 0&&this.#L!==void 0&&(p={cacheKey:d,textDocument:this.#L});let m=this.#L;if(this.#n==null&&m!=null&&(this.#n=new Qn({highlighter:e,textDocument:m,codeOptions:this.#P?.__getEffectiveCodeOptions()??{},matchBrackets:this.#e.matchBrackets,onDeferTokenize:this.#de,onThemeChange:()=>this.#pt(),setStyle:e=>{this.#T.textContent=e},__debug:this.#e.__debug})),this.#k!==l&&(this.#O=c,this.#k=Pe(l,{contentEditable:`true`,role:`textbox`,ariaMultiLine:`true`,autocapitalize:`off`,writingSuggestions:`off`,autocorrect:!1,spellcheck:!1,translate:!1}),this.#A!==void 0&&l.after(this.#A),this.#t.init(l),this.#Ge(),this.#Pe(l,c),this.#k!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] full re-render triggered !!!`)),this.#q!=null&&(this.#q.target=l),l.ariaLabel!==n.name&&(l.ariaLabel=n.name),r!==void 0&&r.length>0||this.#Ce)for(let e of this.#k.children){let t=e,{lineAnnotation:n,lineType:r,separator:i}=t.dataset;(n!==void 0||i!==void 0||r===`change-deletion`)&&t.setAttribute(`contenteditable`,`false`)}if(this.#Ee(),this.#n?.syncTheme(this.#P?.__getEffectiveCodeOptions()??{}),this.#I=r,this.#R=i,this.#z=i?.totalLines,this.#n?.prebuildStateStack(i),this.#B?.removePopover(),(this.#ne!==void 0||this.#re!==void 0||this.#B!==void 0)&&this.#mt(this.#ne??[]),this.#te!==void 0&&this.#M!==void 0?(this.#te=void 0,this.#tt(!1,`center`)):this.#ie===void 0?this.#q===void 0?this.#ne!==void 0&&this.#ne.length>0&&this.#K&&!this.#ce&&this.focus({preventScroll:!0}):this.#Ye():this.#rt(this.#ie,this.#ae,this.#se),this.#ce&&this.#V?.focus(),this.#e.__debug===!0&&i!==void 0){let{startingLine:e,totalLines:t}=i;console.log(`[diffs/editor] render file:`,n.name,`RenderRange:`,e+`-`+(e+t),`of`,this.#L?.lineCount,`lines`)}p!==void 0&&(this.#u=!1,this.#ve(p.cacheKey,p.textDocument)),this.#ke(a)};get#fe(){return this.#e.persistState===!0&&this.#P?.type===`file`}#pe(e,t){let n=this.#i.get(t),r=e.lang??f(e.name);return n?.languageId===r?n:void 0}#me(){let e=this.#e.persistStateStorage??`inMemory`;return(this.#a===void 0||this.#o!==e)&&(this.#a=In(e),this.#o=e),this.#a}#he(){let e=this.#F,t=this.#L;if(!this.#fe||e===void 0||t===void 0)return;let n=$(e);this.#i.set(n,t);let r;try{r=this.#me()}catch{return}let i=Z(this.getState()),a=this.#c;if(a?.cacheKey===n&&a.textDocument===t){if(this.#c=void 0,t.version===a.documentVersion&&this.#ne===a.selections&&i.view?.scrollLeft===a.view?.scrollLeft)return;this.#ge(r,n,i,a.completion);return}this.#ge(r,n,i)}#ge(e,t,n,r){let i=this.#s.get(t);if(r!==void 0||i!==void 0){let a=r??Promise.resolve();i!==void 0&&(a=a.then(()=>i)),this.#_e(t,a.then(()=>e.set(t,n)));return}let a;try{a=e.set(t,n)}catch{return}rr(a)&&this.#_e(t,a)}#_e(e,t){let n=t.catch(()=>{});this.#s.set(e,n),n.finally(()=>{this.#s.get(e)===n&&this.#s.delete(e)})}#ve(e,t){let n=++this.#l,r=t.version,i=this.#ne,a=this.getState().view,o=o=>{let s=this.getState().view;o===void 0||n!==this.#l||this.#L!==t||t.version!==r||this.#ne!==i||s?.scrollLeft!==a?.scrollLeft||this.#F===void 0||$(this.#F)!==e||this.setState(Z(o))},s=()=>{let t;try{t=this.#me().get(e)}catch{return}if(rr(t))return t.then(o).catch(()=>{});try{o(t)}catch{}},c=this.#s.get(e),l=c===void 0?s():c.then(s);if(rr(l)){let n={cacheKey:e,textDocument:t,documentVersion:r,selections:i,view:a,completion:l.catch(()=>{})};this.#c=n,n.completion.finally(()=>{this.#c===n&&(this.#c=void 0)})}}#ye(e){return this.#P?.isLineRenderable?.(e+1)??!0}get#be(){let e=this.#P;if(e?.getNearestRenderableLine!=null)return(t,n)=>{let r=e.getNearestRenderableLine(t+1,n);return r==null?void 0:r-1}}#xe(e){this.#ye(e)||this.#P?.revealLine?.(e+1)}get#Se(){return this.#P?.options.diffStyle??`split`}get#Ce(){return this.#P?.type===`file-diff`}get#we(){return this.#P?.options.overflow===`wrap`}#Te(){return this.#r??=new Ze({hasActivePopover:()=>this.#H!==void 0||this.#B?.isPopoverVisible()===!0,updateActivePopover:()=>{this.#bt(),this.#B?.updatePopoverPosition()}})}#Ee(){this.#y.clear(),this.#x.clear(),this.#S=void 0}#De(){this.#ft(null),this.#_=void 0,this.#v=void 0,this.#W=!1,this.#G=!1,this.#j?.forEach(e=>e.remove()),this.#j=void 0,this.#ne=void 0,this.#ee=void 0,this.#ie=void 0,this.#B?.cleanup(),this.#B=void 0,this.#V?.cleanup(),this.#V=void 0,this.#H?.cleanup(),this.#H=void 0,this.#U=!0}#Oe(){let t=this.#h;t.generation++,t.callback!=null&&(e(t.callback),t.callback=void 0)}#ke(e){let t=this.#h,n=this.#L;if(t.delivered||t.callback!=null||n==null)return;let{generation:r}=t,i=()=>{if(t.callback!==i||(t.callback=void 0,r!==t.generation||this.#P!==e||this.#L!==n))return;let a=this.#k,o=this.#D?.shadowRoot;a==null||o==null||!o.contains(a)||(t.delivered=!0,this.#e.onAttach?.(this,e))};t.callback=i,c(i)}#Ae(){this.#C=N(`style`,{dataset:`editorGlobalCss`,textContent:`
|
|
511
|
+
[data-annotation-slot] {
|
|
512
|
+
user-select: none;
|
|
513
|
+
-webkit-user-select: none;
|
|
514
|
+
}
|
|
515
|
+
`}),this.#w=N(`style`,{dataset:`editorCss`,textContent:we}),this.#T=N(`style`,{dataset:`editorThemeCss`}),this.#E=Mn(),this.#A=N(`div`,{dataset:`editorOverlay`});let e=e=>{let t=e.composedPath()[0];return t instanceof Node&&this.#k?.contains(t)===!0},t=()=>{this.#q!=null&&(this.#q=void 0,this.#K=!1,this.#W=!1)};this.#f=[P(document,`focusin`,n=>{e(n)||t()},{passive:!0}),P(document,`pointerdown`,n=>{e(n)||queueMicrotask(t)},{capture:!0,passive:!0}),P(document,`selectionchange`,()=>{let e=this.#D?.shadowRoot;if(this.#W||this.#G||e==null||!this.#K||this.#ne!==void 0&&this.#ne.length>1&&!this.#X)return;let t=document.getSelection();if(t==null)return;let n=typeof t.getComposedRanges==`function`?t.getComposedRanges({shadowRoots:[e]})?.[0]:nr(e);if(n===void 0||!this.#Wt(n))return;let r=nt(n,0);if(r!==void 0){if(this.#X&&this.#Z&&this.#ne!==void 0&&this.#ne.length>0){let e=this.#ne.at(-1);this.#mt([Et(e,r)]);return}if(this.#X)this.#Q===void 0?this.#Q=r:r=Tt(this.#Q,r);else if(this.#Q!==void 0)r.direction=Tt(this.#Q,r).direction;else if(this.#ne!==void 0&&this.#ne.length===1){let e=this.#ne[0];W(e.start,r.start)===0&&W(e.end,r.end)===0&&(r.direction=e.direction)}this.#ee===void 0?this.#mt([r]):this.#mt([...this.#ee.filter(e=>!xt(e,r)),r])}},{passive:!0}),P(document,`pointerup`,e=>{e.pointerType===`mouse`&&(this.#p?.forEach(e=>e()),this.#p=void 0,this.#Y&&(this.#Y=!1,this.#Je()),this.#W=!1,this.#X=!1,this.#Z=!1,this.#Q=void 0,this.#ee=void 0,this.#e.enabledSelectionAction===!0&&this.#ne!==void 0&&this.#ne.length>0&&!V(this.#ne.at(-1))&&this.#mt(this.#ne))},{passive:!0}),P(document,`keydown`,e=>{e.key===`Shift`&&(this.#Q=this.#ne?.at(-1))},{passive:!0}),P(document,`keyup`,e=>{e.key===`Shift`&&(this.#Q=void 0)},{passive:!0})]}#je(e){this.#p?.forEach(e=>e()),this.#p=e}#Me(){return this.#P?.options.enableLineSelection===!0}#Ne(){this.#G=this.#ne!==void 0}#Pe(e,t){let{onFocus:n,onBlur:r}=this.#e,a=t=>{let n=t.composedPath()[0];return n!==void 0&&(n===e||e.contains(n))};this.#d?.forEach(e=>e()),this.#d=[P(e,`focus`,()=>{this.#K=!0,n?.(),!this.#X&&!this.#W&&this.#ne!==void 0&&this.#ne.length>0&&this.#et(this.#ne.at(-1))},{passive:!0}),P(e,`blur`,()=>{this.#q?.target===e&&(this.#q=void 0,this.#W=!1),this.#K=!1,r?.()},{passive:!0}),P(e,`pointerdown`,t=>{if(this.#U=!0,this.#G=!1,t.pointerType===`mouse`){if(this.#at(t)){this.#dt(!0),this.#ne!==void 0&&this.#mt([]);return}if(this.#dt(!1),this.#B?.removePopover(),u()&&this.#I!==void 0&&this.#I.length>0){let t=[...e.querySelectorAll(`[data-line-annotation]`)].map(e=>[P(e,`mouseenter`,()=>{this.#W=!0}),P(e,`mouseleave`,()=>{this.#W=!1})]).flat();this.#je(t)}if(this.#X=!0,this.#Q=void 0,t.button===0&&j(t)&&(this.#ee=this.#ne?.map(e=>({...e}))),t.shiftKey){let e=this.#ne?.at(-1);if(e!==void 0){let t=e.direction===-1?e.end:e.start;this.#et({start:t,end:t,direction:0})}this.#Z=!0}}},{passive:!0}),P(e,`keydown`,e=>{if(!a(e))return;this.#U=!0,this.#G=!1;let t=Se(e,this.#e.keymap);if(t!==void 0){e.preventDefault(),t===`simplifySelection`&&(this.#V?.close(),this.#V=void 0,this.#ce=!1,this.#H?.cleanup(),this.#H=void 0),this.#Re(t);return}let n=_e(e),r=this.#L;if(this.#ne!==void 0&&this.#ne.length>0&&n!==void 0&&r!==void 0){let t={getSoftLineOffsets:this.#we?e=>this.#Ut(e):void 0,resolveRenderableLine:this.#be};e.shiftKey?this.#mt(lt(r,this.#ne,n,t)):this.#mt(it(r,this.#ne,n,t)),this.#tt(),e.preventDefault();return}if((e.key.length===1?e.key.toLowerCase():e.key)===`v`&&j(e)){if(e.repeat&&this.#Ce){e.preventDefault();return}if(this.#e.clipboard!==void 0){e.preventDefault(),c(this.#Fe);return}}if(this.#V!==void 0){let t=Ce(e);if(t!==void 0){e.preventDefault(),this.#V.navigate(t===`previous`);return}}}),P(e,`copy`,e=>{a(e)&&(e.preventDefault(),this.#lt()?e.clipboardData?.setData(`text`,this.#ut()):this.#Tt(e.clipboardData,this.#Ct(),this.#wt()))}),P(e,`cut`,e=>{if(a(e))if(e.preventDefault(),this.#lt())e.clipboardData?.setData(`text`,this.#ut());else{let t=this.#wt();this.#Tt(e.clipboardData,this.#Et(),t)}}),P(e,`paste`,e=>{if(!a(e))return;e.preventDefault();let t=e.clipboardData,n=this.#L;if(t===null||n===void 0)return;let r=t.getData(`text`),i=this.#ne?.length??0;if(i>1){let e=t.getData(sr);if(e!==void 0)try{let t=JSON.parse(e);Array.isArray(t)&&t.length===i&&(r=t)}catch{}}this.#Ot(Array.isArray(r)?r.map(e=>n.normalizeEol(e)):n.normalizeEol(r),void 0,!0,`document`)}),P(e,`beforeinput`,e=>{a(e)&&e.inputType!==`insertCompositionText`&&(e.preventDefault(),this.#qe(e.inputType,e.data))}),P(e,`drop`,e=>{a(e)&&e.preventDefault()}),P(e,`compositionstart`,e=>{a(e)&&(this.#J=!0,this.#W=!0)},{passive:!0}),P(e,`compositionend`,e=>{if(!a(e))return;this.#W=!1;let t=this.#J;this.#J=!1,(e.data!==``||!t)&&this.#qe(`insertText`,e.data)},{passive:!0})];let o=this.#D?.shadowRoot?.querySelector(`[data-deletions]`);if(o!=null&&this.#d.push(P(o,`pointerdown`,e=>{let t=e.composedPath();if(i(t)){this.#Ne();return}let n=t[0],r=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(r instanceof HTMLElement){if(this.#Me()){this.#Ne();return}if(this.#ct(r,o,e.pointerType===`mouse`))return}this.#dt(!0),this.#ne!==void 0&&this.#mt([])},{passive:!0})),t!==void 0){let e=(e,t=!1)=>{let n=e;return n?.dataset.lineNumberContent===void 0?t&&n?.tagName===`SPAN`&&(n=n.closest(`[data-line]`)):n=n.parentElement??void 0,n},n=e=>{if(e===void 0)return;let t=e.dataset.lineType,n=F(e)??F(e,`columnNumber`);if(!(n===void 0||t===void 0||!U(t)))return n-1};this.#d.push(P(t,`pointerdown`,t=>{let r=t.composedPath();if(i(r)){this.#Ne();return}let a=e(r[0]);if(a!==void 0&&this.#Me()){this.#Ne();return}if(a?.dataset.lineType===`change-deletion`){let e=a.closest(`[data-code]`);e!=null&&this.#ct(a,e,t.pointerType===`mouse`);return}if(t.pointerType!==`mouse`)return;let o=this.#L,s=n(a);if(s===void 0||o===void 0)return;this.#U=!0,this.#B?.removePopover();let c=this.#it(s,s,o);this.#Y=!0,this.#Q=c,this.#mt([c]),this.#et(c),this.#Je(),this.#je([P(document,`mousemove`,t=>{if(!this.#Y)return;let r=this.#L,i=n(e(t.composedPath()[0],!0));if(i===void 0||r===void 0)return;let a=this.#Q?.start.line??i,o=this.#it(a,i,r);this.#Q??=o,this.#mt([o]),this.#Je(o.direction===-1?o.start:o.end)},{passive:!0})])},{passive:!0}))}this.#B?.listenHover(e),this.#N?.disconnect(),this.#N=new ResizeObserver(this.#We),this.#N.observe(e),this.#N.observe(e.parentElement),this.#Ie(e)}#Fe=async()=>{let e=this.#e.clipboard;if(e!==void 0){let t=await e.readText(),n=this.#ne?.length??0;if(n>1){let r=await e.readText(sr);try{let e=JSON.parse(r);Array.isArray(e)&&e.length===n&&(t=e)}catch{}}let r=this.#L;r!==void 0&&this.#Ot(Array.isArray(t)?t.map(e=>r.normalizeEol(e)):r.normalizeEol(t),void 0,!0,`document`)}};#Ie(e){this.#Ce&&this.#Se===`split`&&this.#we&&(this.#g={top:e.offsetTop,left:e.offsetLeft-this.#Rt()},this.#e.__debug===!0&&console.log(`[diffs/editor] content offset:`,this.#g))}get#Le(){if(this.#Ce&&this.#Se===`split`&&this.#we)return this.#g}#Re(e){let t=this.#L;if(t!==void 0)switch(e){case`openSearchPanel`:this.#xt(`find`);break;case`openSearchReplacePanel`:this.#xt(`replace`);break;case`findNextMatch`:{let e=this.#ne;if(e===void 0)break;if(e.some(V)){let n=e.map(e=>V(e)?Wt(t,e):e);this.#mt(n),this.focus()}else{let n=jt(t,e);if(n!==void 0){this.#mt(n);let e=n.at(-1);e!==void 0&&this.#xe(H(e).line),this.#tt()}}break}case`moveLineUp`:case`moveLineDown`:this.#Ue(e===`moveLineUp`?-1:1);break;case`copyLineUp`:case`copyLineDown`:this.#Ve(e===`copyLineUp`?-1:1);break;case`simplifySelection`:{let e=this.#ne,t=e?.at(-1);if(e===void 0||t===void 0)break;if(e.length>1)this.#mt([t]),this.#Je(H(t));else if(!V(t)){let e=H(t);this.#mt([{start:e,end:e,direction:0}]),this.#Je(e)}break}case`insertBlankLine`:this.#He();break;case`deleteHardLineForward`:this.#Mt();break;case`toggleComment`:case`toggleBlockComment`:{let n=this.#ne;if(n===void 0)break;let{lineComment:r,blockComment:i}=Oe(t.languageId,this.#e.languageCommentConfig);if(e===`toggleComment`&&r!==null){this.#Be(ke(t,n,r));break}let a=e===`toggleComment`,o=Me(t,n,i,a);o!==void 0&&this.#Be(o.edits,a?void 0:e=>o.nextSelectionOffsets.map(([t,n,r])=>({start:e.positionAt(t),end:e.positionAt(n),direction:r})));break}case`indent`:case`outdent`:case`indentLess`:case`indentMore`:if(this.#ne!==void 0){let n=[],r=[],i=new Set,a=[];for(let o of this.#ne){let s=o.start.line,c=e===`outdent`||e===`indentLess`,l=e===`indentLess`||e===`indentMore`;if(s!==o.end.line||c||l){let e=rt(t,o,this.#t.tabSize,c);for(let t of e[0]){let e=t.range.start.line;i.has(e)||(i.add(e),n.push(t))}r.push(e[1])}else{let e=t.charAt({line:s,character:0})===` `?` `:` `.repeat(this.#t.tabSize);n.push({range:o,newText:e}),a.push({line:s,startCharacter:o.start.character,addedLength:e.length-(o.end.character-o.start.character),selectionIndex:r.length});let i={line:o.start.line,character:o.start.character+e.length};r.push({start:i,end:i,direction:0})}}for(let e of a){let t=0;for(let n of a)n.line===e.line&&n.startCharacter<e.startCharacter&&(t+=n.addedLength);if(t!==0){let n=r[e.selectionIndex],i={line:e.line,character:n.start.character+t};r[e.selectionIndex]={start:i,end:i,direction:0}}}let o=t.applyEdits(n,!0,this.#ne,r);o!==void 0&&this.#Pt(o,r)}break;case`selectAll`:{let e=Mt(t);this.#mt([e]),this.focus();let n=this.#It(),r=n[0]?.[0],i=n.at(-1)?.[1];r!==void 0&&i!==void 0&&(this.#G=!0,this.#et({start:{line:r,character:0},end:{line:i,character:t.getLineLength(i)},direction:1}));break}case`moveCursorToDocStart`:case`moveCursorToDocEnd`:{let n=Nt(t,e===`moveCursorToDocEnd`,this.#Ce);this.#mt([n]),this.#xe(H(n).line),this.#tt()}break;case`expandSelectionDocStart`:case`expandSelectionDocEnd`:{let n=e===`expandSelectionDocEnd`,r=this.#ne;if(r!==void 0){let e=Nt(t,n,this.#Ce);this.#mt(Dt(r,e)),this.#xe(H(e).line),this.#tt()}}break;case`undo`:case`redo`:this.#ze(e);break}}#ze(e){let t=this.#L;if(t===void 0||e===`undo`&&!t.canUndo||e===`redo`&&!t.canRedo)return;let n=this.#ne,r=n?.map(e=>[t.offsetAt(e.start),t.offsetAt(e.end)]),i=e===`undo`?t.undo():t.redo();if(i===void 0)return;let[a,o,s,c]=i,l=o??(n!==void 0&&r!==void 0&&c!==void 0?wt(t,n,r,c):void 0);this.#Pt(a,l,s)}#Be(e,t){let n=this.#L,r=this.#ne;if(n===void 0||r===void 0)return;let i=t===void 0,a=i?r.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]):void 0,o=i?e.map(e=>{let t=n.offsetAt(e.range.start),r=n.offsetAt(e.range.end);return{start:Math.min(t,r),end:Math.max(t,r),text:e.newText}}).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n}):void 0,s=n.applyEdits(e,!0,r,void 0,!0);if(s===void 0)return;let c=i?wt(n,r,a,o):t(n);n.setLastUndoSelectionsAfter(c),this.#Pt(s,c,this.#Ft(s))}#Ve(e){let t=this.#L,n=this.#ne;if(t===void 0||n===void 0)return;let r=kt(n);if(r.length===0)return;let i=[],a=0,o=[];for(let n of r){i.push(a);let r=n.endLine-n.startLine+1;a+=r;let s=t.getText({start:{line:n.startLine,character:0},end:{line:n.endLine,character:t.getLineLength(n.endLine)}});if(e>0){let e={line:n.startLine,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else if(n.endLine<t.lineCount-1){let e={line:n.endLine+1,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else{let e={line:n.endLine,character:t.getLineLength(n.endLine)};o.push({range:{start:e,end:e},newText:t.eol+s})}}let s=n.map(t=>{let n=t.start.line,a=0,o=r.length-1;for(;a<=o;){let e=a+o>>>1,t=r[e];if(n<t.startLine)o=e-1;else if(n>t.endLine)a=e+1;else{a=e;break}}let s=Math.max(0,a<=o?a:o),c=r[s],l=i[s]+(e>0?c.endLine-c.startLine+1:0);return{start:{...t.start,line:t.start.line+l},end:{...t.end,line:t.end.line+l},direction:t.direction}});this.#Be(o,()=>s)}#He(){let e=this.#L,t=this.#ne;if(e===void 0||t===void 0)return;let n=t.map(e=>H(e).line),r=Array.from(new Set(n)).sort((e,t)=>e-t),i=new Map,a=new Map,o=[];for(let t=0;t<r.length;t++){let n=r[t],s=e.getLineText(n),c=/^\s*/.exec(s)?.[0]??``;i.set(n,t),a.set(n,c);let l={line:n,character:e.getLineLength(n)};o.push({range:{start:l,end:l},newText:e.eol+c})}let s=t.map((e,t)=>{let r=n[t],o={line:r+1+i.get(r),character:a.get(r).length};return{start:o,end:o,direction:0}});this.#Be(o,()=>s)}#Ue(e){let t=this.#L,n=this.#ne;if(t===void 0||n===void 0)return;let r=kt(n);if(r.length===0||e<0&&r[0].startLine===0||e>0&&r.at(-1).endLine>=t.lineCount-1)return;let i=t.lineCount,a=e=>e<i-1?{line:e+1,character:0}:{line:e,character:t.getLineLength(e)},o=(e,n)=>{let r=e.map(e=>t.getLineText(e)).join(t.eol);return n?r+t.eol:r},s=[];if(e<0)for(let e of r){let t=e.startLine-1,n=[];for(let t=e.startLine;t<=e.endLine;t++)n.push(t);s.push({range:{start:{line:t,character:0},end:a(e.endLine)},newText:o([...n,t],e.endLine<i-1)})}else for(let e=r.length-1;e>=0;e--){let t=r[e],n=t.endLine+1,c=[];for(let e=t.startLine;e<=t.endLine;e++)c.push(e);s.push({range:{start:{line:t.startLine,character:0},end:a(n)},newText:o([n,...c],n<i-1)})}let c=r.at(-1),l=e>0&&c.endLine===i-2?t.getLineLength(c.endLine):t.getLineLength(i-1),u=n.map(n=>At(n,e,i,e=>e===i-1?l:t.getLineLength(e))),d=t.applyEdits(s,!0,n,u,!0);d!==void 0&&this.#Pt(d,u)}#We=()=>{let e=this.#I?.length??0,t=this.#_,n=this.#v;this.#_=void 0,this.#v=void 0;let r=this.#Rt()!==t,i=this.#zt()!==n;!r&&!i||(this.#x.clear(),this.#S=void 0,this.#t.clearTextWidthCache(),i&&(this.#b.clear(),(this.#we||e>0)&&this.#y.clear()),(this.#ne!==void 0||this.#re!==void 0||this.#B!==void 0)&&(this.#mt(this.#ne??[]),this.#ne!==void 0&&this.#K&&this.focus()),this.#B?.removePopover(),this.#Ie(this.#k))};#Ge(){if(this.#le)return;let e=document.fonts;e!==void 0&&(this.#le=!0,e.ready.then(()=>{this.#k===void 0||!this.#t.remeasureCharacterWidth()||(this.#_=void 0,this.#v=void 0,this.#Ee(),this.#b.clear(),(this.#ne!==void 0||this.#re!==void 0||this.#B!==void 0)&&this.#mt(this.#ne??[]),this.#B?.removePopover())}))}#Ke(e,t,n=this.#R,r){let i=this.#n,a=this.#P,o=this.#L,s=this.#O,c=this.#k;if(i===void 0||a===void 0||o===void 0||c===void 0)return;i.stopBackgroundTokenize();let l=performance.now(),u=i.tokenize(e,n),d=performance.now();if(u.size>0){let e=c.children,t=new Set;for(let e of u.keys())this.#ye(e)&&t.add(e);for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=F(r),n=r.dataset.lineType;if(e===void 0||n===`change-deletion`)continue;let i=e-1;if(t.has(i)){let e=u.get(i);if(r.replaceChildren(...er(e)),t.delete(i),t.size===0)break}}}if(t.size>0){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t],i=F(r);if(i!==void 0&&r.dataset.lineType!==`change-deletion`){n=i;break}}for(let e of t){if(e<n)continue;let t=u.get(e),r=String(e+1);N(`div`,{dataset:{line:r,lineType:`context`,lineIndex:e.toString()},children:er(t)},c),s!==void 0&&N(`div`,{dataset:{lineType:`context`,columnNumber:r,lineIndex:e.toString()},children:[N(`span`,{dataset:{lineNumberContent:``},textContent:r})]},s)}}}if(e.lineDelta<0)for(let t of[c.children,s?.children??[]])for(let n=t.length-1;n>=0;n--){let r=t[n],i=F(r)??F(r,`columnNumber`),a=r.dataset.lineType;if(!(i===void 0||a===`change-deletion`)){if(i-1<e.lineCount)break;r.remove()}}let f=e.lineDelta!==0;if(f){let e=c.children.length;for(let t of c.children){let{bufferSize:n}=t.dataset;n!==void 0&&(e+=parseInt(n)-1)}c.style.gridRow=`span `+e,s!==void 0&&(s.style.gridRow=`span `+e)}a.updateRenderCache(u,i.themeType,{shouldRefreshDiffsView:this.#Ce&&!f,lineCountChangeInFlight:f}),f&&a.applyDocumentChange(o,t,r),(f||this.#Ce&&this.#Se===`unified`)&&this.#Ee(),t!==void 0&&(this.#I=t,Ge(t,c,s)),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${I(performance.now()-d)}ms,`,`tokenize in: ${I(d-l)}ms (${u.size} dirty lines)`)}#qe(e,t){switch(e){case`insertText`:{let e=t??``,n=this.#L,r=this.#ne,i=n!==void 0&&r!==void 0?mt(n,r,e,this.#e.autoSurround):void 0;this.#Ot(i??e);break}case`insertCompositionText`:break;case`insertLineBreak`:case`insertParagraph`:this.#Ot(this.#L?.eol??`
|
|
516
|
+
`);break;case`deleteContentBackward`:this.#kt();break;case`deleteContentForward`:this.#kt(!0);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:this.#At();break;case`deleteWordBackward`:this.#jt();break;case`insertTranspose`:this.#Nt();break;default:console.warn(`[diffs] Unknown input type: ${e}`,t);break}}#Je(e,t=!0,n){this.#K=!0,e===void 0?n?.()===!1?this.#K=!1:this.#k?.focus({preventScroll:t}):(this.#W=!0,this.#et({start:e,end:e,direction:0}),c(()=>{if(n?.()===!1||!this.#K){this.#W=!1;return}this.#k?.focus({preventScroll:t}),c(()=>{this.#W=!1})}))}#Ye(e){let t=this.#q;if(t==null)return;if(this.#ce){this.#q=void 0,this.#K=!1,this.#W=!1;return}let n=this.#k;if(n==null||!this.#Xe(n)){this.#q=void 0,this.#K=!1;return}let r=()=>{if(this.#q!==t)return!1;let e=this.#Xe(n);return this.#q=void 0,e};if(e!=null){this.#Je(e,!0,r);return}let i=this.#ne?.at(-1);if(i==null){this.#Je(void 0,!0,r);return}let a=i.direction===-1?i.end:i.start;this.#Je(a,!0,r)}#Xe(e){let t=this.#D,n=t?.shadowRoot;if(t==null||n==null||this.#k!==e||!n.contains(e))return!1;let{activeElement:r}=n;if(r===e||r!=null&&e.contains(r))return!0;if(r!=null)return!1;let{ownerDocument:i}=t,{activeElement:a}=i;return a==null||a===i.body||a===i.documentElement||a===t}#Ze(e=0){let t=this.#k,n=this.#D;if(this.#L==null||t==null||n==null)return;let r=this.#P?.getEditorViewport?.()??this.#Qe(n),i,a;if(r instanceof HTMLElement){let e=r.getBoundingClientRect();i=e.top,a=e.bottom}else{let e=r.defaultView;if(e==null)return;i=0,a=e.innerHeight}let o=n.shadowRoot?.querySelector(`[data-diffs-header][data-sticky]`);if(o!=null&&(i=Math.max(i,o.getBoundingClientRect().bottom)),Number.isFinite(e)&&(i+=Math.max(0,e)),!(a<=i))for(let e of t.children){let t=e,n=F(t),r=t.dataset.lineType;if(n==null||r==null||!U(r))continue;let o=t.getBoundingClientRect();if(!(o.bottom<=o.top)&&o.top>=i&&o.top<a)return n}}#Qe(e){let t=e.ownerDocument,n=e.parentElement;for(;n!=null&&n!==t.body&&n!==t.documentElement;){let e=n.ownerDocument.defaultView?.getComputedStyle(n).overflowY;if(e===`auto`||e===`scroll`||e===`overlay`)return n;n=n.parentElement}return t}#$e(e,t){let n={start:e,end:e,direction:0};this.#U=!1,this.#mt([n]),this.#xe(e.line),t?this.#Je(e,!0):this.#tt()}#et(e){let t=window.getSelection();if(t===null)return;let{start:n,end:r,direction:i}=e;W(n,r)>0&&([n,r]=[r,n]);let a=this.#Lt(n.line),o=this.#Lt(r.line);if(a===void 0||o===void 0)return;let[s,c]=Ut(a,n.character),[l,u]=Ut(o,r.character);i===-1&&([s,c,l,u]=[l,u,s,c]);try{t.setBaseAndExtent(s,Ne(s,c),l,Ne(l,u))}catch(e){console.error(`[diffs/editor] failed to update window selection:`,e)}}#tt(e=!1,t=`nearest`){let n=this.#ne?.at(-1);if(n===void 0)return;let r=this.#M;if(r!==void 0){if(r.scrollIntoView({block:t,inline:`nearest`}),!e){let e=n.direction===-1?n.end:n.start;this.#q===void 0?this.#Je(e):this.#Ye(e)}}else{let t=H(n);this.#rt(t.line,t.character,e)}}#nt(){let e=this.#V===void 0?0:48,t=this.#Rt()+this.#t.ch;return`${e}px ${this.#t.ch}px 0 ${t}px`}#rt(e,t=0,n=!1){this.__postponeBgTokenizeToNextFrame();let r=N(`div`,{style:{position:`absolute`,left:`0`,width:`2px`,height:this.#t.lineHeight+`px`,scrollMargin:this.#nt()}});if(this.#Lt(e)!==void 0){let[i,a]=this.#Vt(e,t),o=this.#Bt(e)+a*this.#t.lineHeight;if(r.style.top=o+`px`,r.style.left=i+`px`,this.#A?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),!n){let n={line:e,character:t};this.#q===void 0?this.#Je(n):this.#Ye(n)}this.#ie=void 0,this.#ae=void 0,this.#oe=!1,this.#se=!1}else{let i=this.#P?.getLinePosition?.(e+1);if(i!==void 0)r.style.top=i.top+`px`,this.#D?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),i.height>0&&this.#ye(e)?(this.#ie=e,this.#ae=t,this.#se=n):(this.#ie=void 0,this.#ae=void 0,this.#se=!1);else{let i=0;if(this.#ie===e&&this.#k!==void 0)for(let t=this.#k.childElementCount-1;t>=0;t--){let n=this.#k.children[t],r=n.dataset.lineType,a=F(n);if(r!==void 0&&U(r)&&a!==void 0){i=(e-(a-1))*this.#t.lineHeight;break}}let a=((this.#I??[]).filter(t=>t.lineNumber<e).length+e)*this.#t.lineHeight+i;r.style.top=a+`px`,this.#D?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),this.#ie===e&&(i===0||this.#oe)||!this.#ye(e)?(this.#ie=void 0,this.#ae=void 0,this.#oe=!1,this.#se=!1):(this.#ie=e,this.#ae=t,this.#oe=i!==0,this.#se=n)}}r.remove()}#it(e,t,n){let r=e=>({line:e,character:0}),i=e=>({line:e,character:n.getLineText(e).length});return t<e?{start:r(t),end:i(e),direction:-1}:{start:r(e),end:i(t),direction:1}}#at(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&t.closest(`[data-line]`)?.getAttribute(`data-line-type`)===`change-deletion`}#ot(e,t,n){let r=[...n.querySelectorAll(`[data-content] > [data-line]`)],i=r.indexOf(e),a=r.indexOf(t),[o,s]=a<i?[t,e]:[e,t],c=window.getSelection();if(c!==null){let e=document.createRange();e.setStart(o,0),e.setEnd(s,s.childNodes.length),c.removeAllRanges(),c.addRange(e)}this.#dt(!0),this.#mt([]),this.#ft(F(t)??null,!0,`deletions`);let l=Math.min(i,a),u=Math.max(i,a);this.#$=l<0?``:r.slice(l,u+1).filter(e=>e.getAttribute(`data-line-type`)===`change-deletion`).map(e=>e.textContent??``).join(`
|
|
517
|
+
`)}#st(e,t){let n=e.parentElement;if(n==null||t==null)return;let r=[...n.children].indexOf(e),i=t.children[r];return i instanceof HTMLElement?i:void 0}#ct(e,t,n){let r=t.querySelector(`[data-content]`),i=this.#st(e,r);return i===void 0?!1:(this.#ot(i,i,t),n&&this.#je([P(document,`mousemove`,e=>{let n=e.composedPath()[0],a=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(a instanceof HTMLElement&&t.contains(a)){let e=this.#st(a,r);e!==void 0&&this.#ot(i,e,t)}},{passive:!0})]),!0)}#lt(){return this.#D?.shadowRoot?.querySelector(`pre`)?.hasAttribute(`data-deleted-text-selection`)??!1}#ut(){return this.#$===``?window.getSelection()?.toString()??``:this.#$}#dt(e){let t=this.#D?.shadowRoot?.querySelector(`pre`);t!=null&&(e?(t.setAttribute(`data-deleted-text-selection`,``),this.#ft(null),this.#$=``):(t.removeAttribute(`data-deleted-text-selection`),this.#$=``))}#ft(e,t=!1,n=`additions`){try{this.#P?.setEditorActiveLine(e,{lineNumberOnly:t,side:n})}catch{}}#pt(){this.#ue===void 0&&(this.#ue=requestAnimationFrame(()=>{this.#ue=void 0,(this.#ne!==void 0||this.#re!==void 0||this.#B!==void 0)&&this.#mt(this.#ne??[])}))}#mt(e){if(this.__postponeBgTokenizeToNextFrame(),this.#M=void 0,this.#ft(null),e.length===0&&this.#re===void 0&&this.#B===void 0){this.#ne=void 0,this.#j?.forEach(e=>e.remove()),this.#j?.clear(),this.#H?.cleanup(),this.#H=void 0;return}let t=document.createDocumentFragment(),n={fragment:t,elements:new Map};if(e.length>0){let t=Ot(e),r=t.at(-1);this.#ne=t;let i=t.some(e=>!V(e)),a=H(r).line+1;this.#ft(a,i);for(let e of t)V(e)||this.#ht(n,`selection`,e),this.#yt(n,e,e===r);let o=this.#e.matchBrackets!==!1&&this.#L!==void 0&&this.#n!==void 0&&V(r)?yn(this.#L,this.#n,r.start):void 0;if(o!==void 0)for(let e of o)this.#ht(n,`bracketMatch`,e)}let r=this.#L;if(this.#re!==void 0&&r!==void 0){let e=this.#re,t=this.#R,i=t!==void 0&&Number.isFinite(t.totalLines)||this.#Ce&&this.#P?.options.expandUnchanged!==!0?this.#It():void 0,a=this.#ne?.at(-1),o=a===void 0?-1:r.offsetAt(a.start),s=a===void 0?-1:r.offsetAt(a.end),c=0,l=i?.length??1;for(let t=0;t<l;t++){let a=1/0,l=i?.[t];if(l!==void 0){let[t,n]=l,i=r.offsetAt({line:t,character:0}),o=n+1;a=o<r.lineCount?r.offsetAt({line:o,character:0}):r.offsetAt({line:o-1,character:r.getLineLength(o-1)});let s=c,u=e.length;for(;s<u;){let t=s+Math.floor((u-s)/2);e[t][1]<=i?s=t+1:u=t}c=s}for(;c<e.length;c++){let[t,i]=e[c];if(t>=a)break;let l={start:r.positionAt(t),end:r.positionAt(i)},u=o===t&&s===i;this.#ht(n,`match`,l,u?`focus`:void 0)}}}if(this.#B!==void 0&&r!==void 0)for(let e of this.#B.markers)this.#ht(n,`marker`,e,mn(e.severity));this.#A?.appendChild(t),this.#j?.forEach(e=>e.remove()),this.#j?.clear(),this.#j=n.elements,this.#bt()}#ht(e,t,n,r){if(this.#L===void 0)return;let{start:i,end:a}=n,o=i.line,s=a.line+1;if(this.#R!==void 0){let{startingLine:e,totalLines:t}=this.#R;o=Math.max(o,e),s=Math.min(s,e+t)}for(let n=o;n<s;n++){if(!this.#Gt(n))continue;let o=n===a.line,s=n===i.line?i.character:0,c=o?a.character:this.#L.getLineLength(n);if(this.#we){let i=this.#zt(),a=this.#L.getLineText(n);if(2*this.#t.ch+this.#t.measureTextWidth(a)>i){this.#gt(e,n,a,s,c,o,t,r);continue}}let l=0,u=0,d=0;l=s===0?this.#Rt()+this.#t.ch+(this.#Le?.left??0):this.#Vt(n,s)[0],!o&&t===`selection`&&(d=this.#t.ch),u=s===c?d:this.#Vt(n,c)[0]-l+d,this.#vt(e,t,n,0,l,u,r)}}#gt(e,t,n,r,i,a,o,s){let c=this.#Ut(t),l=c.length-1,u=this.#Rt()+this.#t.ch+(this.#Le?.left??0);for(let d=0;d<l;d++){let f=c[d],p=c[d+1],m=Math.max(r,f),h=Math.min(i,p);if(m>h)continue;let g=this.#_t(n,f,m),_=u+g,v=0;!a&&d===l-1&&o===`selection`&&(v=this.#t.ch);let y=m===h?v:this.#_t(n,f,h)-g+v;this.#vt(e,o,t,d,_,y,s)}}#_t(e,t,n){if(n<=t)return 0;let r=e.slice(t,n),i=Yn(r,this.#t.tabSize);return i===-1?this.#t.measureTextWidth(r):i*this.#t.ch}#vt(e,t,n,r,i,a,o){if(a===0)return;let{ch:s,lineHeight:c}=this.#t,l=this.#Bt(n)+r*c,u=`${t}-${n}/${r}-${i}-${a} ${o??``}`,d=this.#j,f=(this.#e.roundedSelection??!0)&&t===`selection`,p=(n,r,i,a)=>{let o=this.#Bt(n)+r*c,l=this.#Lt(n),u=`initial`;l!==void 0&&(l.dataset.lineType===`change-addition`||l.dataset.selectedLine!==void 0)&&(u=getComputedStyle(l).getPropertyValue(`--diffs-line-bg`));let f=`width:${s}px;transform:translateX(${i}px) translateY(${o}px);--diffs-selection-corner-bg:${u}`,p={selectionCorner:``,[a]:``},m=`${t}-block-${n}/${r}-${i}-1ch`,h=m+`-`+a;if(a===`rbl`){let t=m+`-rtl`,n=e.elements.get(t);n!==void 0&&(n.remove(),e.elements.delete(t),h+=`-rtl`,p.rtl=``)}let g=e.elements.get(h);g===void 0&&(d?.has(h)===!0?(g=d.get(h),g.style.cssText=f,d.delete(h)):g=N(`div`,{dataset:`selectionRange`,style:{cssText:f},children:[N(`div`,{dataset:p})]},e.fragment),e.elements.set(h,g))},m=t=>{let o=i+a,c=t.dataset,l=e.previousSelectionRange;if((l===void 0||l.line!==n||l.wrapLine!==r)&&(e.previousSelectionRange={element:t,line:n,wrapLine:r,left:i,width:a}),l===void 0||o<=l.left)[`rtl`,`rtr`,`rbl`,`rbr`].forEach(e=>{c[e]=``});else{let e=l.line,t=l.wrapLine,a=l.left,u=l.element.dataset,d=a+l.width;a>i&&p(e,t,a-s,`rbr`),delete u.rbl,delete c.rtl,delete c.rtr,o>=d&&delete u.rbr,o>d&&(p(e,t,d,`rbl`),c.rtr=``),o<d&&p(n,r,o,`rtl`),i<a&&(c.rtl=``),c.rbl=``,c.rbr=``}},h=e.elements.get(u);if(h!==void 0){f&&m(h);return}d?.has(u)===!0?(h=d.get(u),d.delete(u)):h=N(`div`,{dataset:o?[t+`Range`,o]:t+`Range`},e.fragment),h.style.width=`${a}px`,h.style.transform=`translateX(${i}px) translateY(${l}px)`,f&&m(h),e.elements.set(u,h)}#yt(e,t,n){let{line:r,character:i}=H(t);if(!this.#Gt(r))return;let[a,o]=this.#Vt(r,i),s=`caret-`+r+`/`+o+`:`+i;if(e.elements.has(s))return;let c=N(`div`,{dataset:`caret`,style:{transform:`translateX(${a-1}px) translateY(${this.#Bt(r)+o*this.#t.lineHeight}px)`}},e.fragment);e.elements.set(s,c),n&&(c.style.scrollMargin=this.#nt(),this.#M=c)}#bt(){let e=this.#ne?.at(-1),t=this.#A,n=this.#L,r=this.#e.renderSelectionAction,i=()=>{this.#H?.cleanup(),this.#H=void 0};if(this.#e.enabledSelectionAction!==!0||r===void 0||e===void 0||V(e)||this.#X||t===void 0||n===void 0){i();return}let a=H(e);if(!this.#Gt(a.line)){i();return}if(this.#H===void 0){if(!this.#U)return;let a=()=>this.#ne?.at(-1)??e;this.#H=new Fn(r({textDocument:n,get selection(){return a()},applyEdits:e=>this.applyEdits(e),getSelectionText:()=>this.#L?.getText(a())??``,replaceSelectionText:e=>{this.#Ot(e,[a()])},close:()=>{i(),this.#tt()}}),t,()=>this.#bt()),this.#Te().resetPlacement(or)}let o=this.#t.lineHeight,s=e.direction===-1,c={placeAbove:s,anchor:a},l=s?{placeAbove:!1,anchor:e.end}:{placeAbove:!0,anchor:e.start},u=this.#H.height,d=e=>{let[t,n]=this.#Vt(e.anchor.line,e.anchor.character),r=this.#Bt(e.anchor.line)+n*o,i=e.placeAbove?r:r+o,a=e.placeAbove?i-u:i;return{top:a,bottom:a+u,left:t,anchorTop:i,rowTop:r}},f=d(c),p=n.lineCount,m=s?a.line<3:a.line>=p-3,h=this.#Gt(l.anchor.line)?d(l):void 0,g=this.#Te(),_=g.getPlacementBounds(),v=h!==void 0&&g.choosePlacement({preferred:f,fallback:h,viewport:_,popoverHeight:u,atDocumentEdge:m,placementKey:or})===`fallback`;h===void 0&&g.setPlacement(`preferred`,or);let{placeAbove:y}=v?l:c,{left:b,anchorTop:x}=v&&h!==void 0?h:f,S=s?f.rowTop:h?.rowTop??-1/0,C=(s?h?.rowTop??1/0:f.rowTop)+(e.end.line>e.start.line&&e.end.character===0?0:o),w=_===void 0||C>_.top&&S<_.bottom;this.#H.reposition(b,x,this.#Rt(),y,w,_)}#xt(e){if(this.#V!==void 0){this.#V.setMode(e);return}this.#St(e)}#St(e){this.#V?.cleanup();let t=this.#L,n=this.#D?.shadowRoot?.querySelector(`pre`),r=this.#ne;if(t===void 0||n==null)return;let i=``,a;if(r!==void 0&&r.length>0){let e=r.at(-1);if(V(e)){e=Wt(t,e),this.#mt([...r.slice(0,-1),e]);let n=t.getText(e);n!==``&&!n.includes(`
|
|
518
|
+
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=St(t,e,n);this.#mt([i]),this.#xe(H(i).line),this.#tt(!0),this.#ce=r};this.#V=new Pn({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#ne);n!==void 0&&this.#Pt(n,void 0,this.#Ft(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#re=void 0,this.#mt(this.#ne??[]);return}if(this.#re=e,n?.syncSelection===!1){this.#mt(this.#ne??[]);let n=this.#ne?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#ne?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#mt(this.#ne??[]):o(a,!0),a},onClose:()=>{this.#V=void 0,this.#ce=!1,this.#re=void 0,this.#mt(this.#ne??[])}}),this.#ce=!1}#Ct(){let e=this.#L,t=this.#ne;return e===void 0||t===void 0?``:Lt(e,t)}#wt(){let e=this.#L,t=this.#ne;return e===void 0||t===void 0?[]:It(e,t)}#Tt(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(sr,JSON.stringify(n)))}#Et(){let e=this.#L,t=this.#ne;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>V(e))){let n=Ht(e,t);return this.#Dt(n.edits,n.nextSelectionOffsets),n.text}let n=Lt(e,t);return this.#Ot(``,void 0,!0),n}#Dt(e,t){let n=this.#L,r=this.#ne;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#Pt(i,a,this.#Ft(i))}#Ot(e,t=this.#ne,n=!1,r=`selection`){if(t===void 0)return;let i=this.#L,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?B(i,t,e,this.#I,n,r):ut(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#I,void 0,n);s!==void 0&&this.#Pt(s,o,this.#Ft(s))}#kt(e=!1){let t=this.#ne,n=this.#L;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=bt(n,t,e,this.#I,this.#t.tabSize);i!==void 0&&this.#Pt(i,r,this.#Ft(i))}#At(){let e=this.#ne,t=this.#L;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=_t(t,e,this.#we?(e,t)=>{let n=this.#Ut(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#I);r!==void 0&&this.#Pt(r,n,this.#Ft(r))}#jt(){let e=this.#ne,t=this.#L;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=vt(t,e,this.#I);r!==void 0&&this.#Pt(r,n,this.#Ft(r))}#Mt(){let e=this.#ne,t=this.#L;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=gt(t,e,this.#I);r!==void 0&&this.#Pt(r,n,this.#Ft(r))}#Nt(){let e=this.#ne,t=this.#L;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=ht(t,e,this.#I);r!==void 0&&this.#Pt(r,n,this.#Ft(r))}#Pt(e,t,n,r){let i=this.getFile(),a=this.#e.onChange;if(i!==void 0&&a!==void 0){let t=n??this.#I;a(i,t,{changes:e.changes,file:i,lineAnnotations:t})}if(e.lineDelta!==0||this.#we)for(let t of this.#y.keys())t>=e.startLine&&this.#y.delete(t);if(this.#b.size>0)if(e.lineDelta===0&&(e.changedLineRanges.length===1||e.changedLineChanges?.every(([,,e])=>e===0)===!0))for(let[t,n]of e.changedLineRanges)for(let e=t;e<=n;e++)this.#b.delete(e);else for(let t of this.#b.keys())t>=e.startLine&&this.#b.delete(t);this.#S=void 0;let o=this.#R,s;if(o!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=o.startingLine+o.totalLines;if(n.end.line>=r){let t=n.end.line-o.startingLine+1,i=this.#z===void 0||this.#z===1/0?1/0:this.#z*ir;e.startLine<=r&&t<=i&&this.#ye(n.end.line)?(n.end.line>r&&(s=!0),o={...o,totalLines:t},this.#R=o):s=!0}}if(this.#Ke(e,n,o,s),r?.skipSearchRefresh!==!0&&this.#V!==void 0&&this.#re!==void 0&&this.#V.updateMatches({syncSelection:!1}),t!==void 0&&(this.#mt(t),r?.skipFocus!==!0)){let e=t.at(-1);if(e!==void 0&&this.#xe(H(e).line),this.#M!==void 0)requestAnimationFrame(()=>{this.#M?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=H(t.at(-1));this.#rt(e.line,e.character)}this.focus({preventScroll:!0})}}#Ft(e){if(this.#I!==void 0){let t=R(e,this.#I);if(t!==void 0)return this.#L?.setLastUndoLineAnnotations(this.#I,t),t}}#It(){let e=this.#k;if(e===void 0)return[];let t=[];for(let n of e.children){let e=n,r=e.dataset.lineType,i=F(e);if(i===void 0||r===void 0||!U(r))continue;let a=i-1,o=t.at(-1);o!==void 0&&a<=o[1]+1?o[1]=Math.max(o[1],a):t.push([a,a])}return t}#Lt(e){let t=this.#x.get(e);if(t!==void 0)return t??void 0;let n=this.#R;if(n!==void 0&&(e<n.startingLine||e>=n.startingLine+n.totalLines))return;let r=this.#k;if(r!==void 0){if(n!==void 0){let{startingLine:i}=n,{children:a}=r;for(let n=e-i;n<=a.length;n++){let r=a[n];if(r===void 0)break;let i=F(r),o=r.dataset.lineType;if(i!==void 0&&i===e+1&&o!==void 0&&U(o)){t=r;break}}}return t??=r.querySelector(`[data-line="${e+1}"]`+(this.#Se===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#x.set(e,t),t??void 0}}#Rt(){if(this.#O===void 0)return 0;if(this.#_===void 0){let e=this.#k?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#_=parseInt(e.slice(0,-2),10):this.#_=this.#O.offsetWidth}return this.#_}#zt(){if(this.#k===void 0)return 0;if(this.#v===void 0){let e=this.#k.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#v=parseFloat(e.slice(0,-2)):this.#v=this.#k.offsetWidth}return this.#v}#Bt(e){let t=this.#y.get(e);if(t!==void 0)return t;let n=this.#Lt(e);if(n===void 0)return-1;let r=n.offsetTop+this.#t.paddingTop;return r+=this.#Le?.top??0,this.#y.set(e,r),r}#Vt(e,t){if(this.#S!==void 0&&this.#S[0]===e&&this.#S[1]===t)return[this.#S[2],this.#S[3]];let n=this.#L?.getLineText(e),r=this.#Rt()+this.#t.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#Le?.left??0),0];let i=qn(n,Math.min(t,n.length)),a=n.slice(0,i),o=Yn(a,this.#t.tabSize),s=0,c=0;if(s=o===-1?r+this.#t.measureTextWidth(a):r+o*this.#t.ch,this.#we){let t=this.#zt();if(2*this.#t.ch+this.#t.measureTextWidth(n)>t){let t=this.#Ht(e);if(t==null)return[s+(this.#Le?.left??0),0];for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=Yn(t,this.#t.tabSize);s=o===-1?r+this.#t.measureTextWidth(t):r+o*this.#t.ch;break}}}s+=this.#Le?.left??0}return this.#S===void 0?this.#S=[e,t,s,c]:(this.#S[0]=e,this.#S[1]=t,this.#S[2]=s,this.#S[3]=c),[s,c]}#Ht(e){let t=this.#b.get(e);if(t!==void 0)return t;this.#b.size>=ar&&this.#b.clear();let n=this.#L?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#b.set(e,t),t}let r=this.#k;if(r==null||!r.isConnected)return;let i=N(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#t.tabSize.toString()},textContent:n},r),a=i.firstChild,o=document.createRange(),s=[];try{let t=i.getBoundingClientRect();if(t.width===0)return;let r=Jn(n),c=t.left+this.#t.ch,l=r===void 0?n.length:r.length-1,d=e=>r===void 0?e:r[e],f=e=>(o.setStart(a,d(e)),o.setEnd(a,d(e+1)),o.getBoundingClientRect());s.push(0);let p=f(0).top,m=1;for(;m<l;){let e=m,t=l;for(;e<t;){let n=e+t>>1;f(n).top>p?t=n:e=n+1}if(e>=l)break;let{left:n,top:r}=f(e),i=u()&&n-c>this.#t.ch/2;s.push(d(i?e-1:e)),p=r,m=e+1}let h=new Uint32Array(s.length+1);for(let e=0;e<s.length;e++)h[e]=s[e];return h[s.length]=n.length,this.#b.set(e,h),h}finally{i.remove()}}#Ut(e){let t=this.#Ht(e);if(t!==void 0)return t;let n=this.#L?.getLineText(e)?.length??0;return Uint32Array.of(0,n)}#Wt({startContainer:e,endContainer:t}){let n=this.#k;return n===void 0?!1:n.contains(e)&&n.contains(t)}#Gt(e){let t=this.#L?.lineCount??0;return e<0||e>=t?!1:this.#Lt(e)!==void 0}};export{cr as Editor,ge as TextDocument};
|