@marimo-team/islands 0.19.10-dev2 → 0.19.10-dev21

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.
Files changed (418) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BAeQ8DWw.js → ConnectedDataExplorerComponent-CkXO-pKy.js} +6 -6
  2. package/dist/{react-plotly-BuRa9xtI.js → Plot-CmsrWWji.js} +72 -286
  3. package/dist/{any-language-editor-D0UQItkS.js → any-language-editor-t_VsTNa-.js} +16 -16
  4. package/dist/apl-C1bki_dE.js +4 -0
  5. package/dist/{arc-CEWBr4jc.js → arc-9nABupDE.js} +2 -2
  6. package/dist/{architectureDiagram-VXUJARFQ-DPPYVq8H.js → architectureDiagram-VXUJARFQ-DmJQhcJb.js} +6 -6
  7. package/dist/asciiarmor-BdlkCCRr.js +4 -0
  8. package/dist/asn1-CvE30hox.js +4 -0
  9. package/dist/{blockDiagram-VD42YOAC-BA5N05Y9.js → blockDiagram-VD42YOAC-CRofISJs.js} +10 -10
  10. package/dist/brainfuck-BalwWy1a.js +4 -0
  11. package/dist/{c4Diagram-YG6GDRKO-DJLzuGJJ.js → c4Diagram-YG6GDRKO-Deqoag4I.js} +4 -4
  12. package/dist/{channel-Dob5kWXR.js → channel-CMsnebrL.js} +1 -1
  13. package/dist/{chunk-4BX2VUAB-DZQibjKA.js → chunk-4BX2VUAB-WmXmzRBr.js} +1 -1
  14. package/dist/{chunk-55IACEB6-C3BASkh4.js → chunk-55IACEB6-irYMvHJu.js} +1 -1
  15. package/dist/{chunk-5FQGJX7Z-BEb20Lzt.js → chunk-5FQGJX7Z-pOElJy8t.js} +2 -2
  16. package/dist/{chunk-ABZYJK2D-BXTC53mt.js → chunk-ABZYJK2D-BGWvKte3.js} +2 -2
  17. package/dist/{chunk-ATLVNIR6-BJDjUR_c.js → chunk-ATLVNIR6-BYZB6C5T.js} +2 -2
  18. package/dist/{chunk-B4BG7PRW-DzmUUpfH.js → chunk-B4BG7PRW-CwYUp6Uj.js} +7 -7
  19. package/dist/{chunk-CVBHYZKI-Dhc_e3rA.js → chunk-CVBHYZKI-Bb2XMuXJ.js} +1 -1
  20. package/dist/{chunk-DI55MBZ5-gTd3J8Tu.js → chunk-DI55MBZ5-Gyro6dvN.js} +6 -6
  21. package/dist/{chunk-EXTU4WIE-DyoOs5QX.js → chunk-EXTU4WIE-BlA7aWEw.js} +2 -2
  22. package/dist/{chunk-FMBD7UC4-geNUIndh.js → chunk-FMBD7UC4-C0DZU_4q.js} +1 -1
  23. package/dist/{chunk-HN2XXSSU-CqPwpolw.js → chunk-HN2XXSSU-BsB4dtgF.js} +1 -1
  24. package/dist/{chunk-JA3XYJ7Z-BGnAIbOP.js → chunk-JA3XYJ7Z-Cm-pccR-.js} +3 -3
  25. package/dist/{chunk-JZLCHNYA-CIRgweVQ.js → chunk-JZLCHNYA-CoLqqXMe.js} +6 -6
  26. package/dist/{chunk-MI3HLSF2-DOJkNER1.js → chunk-MI3HLSF2-DeDZS-tQ.js} +1 -1
  27. package/dist/{chunk-N4CR4FBY-DKSvXAIS.js → chunk-N4CR4FBY-ByLbY9L-.js} +7 -7
  28. package/dist/{chunk-QN33PNHL-B6zC8BTi.js → chunk-QN33PNHL-eodIiY9F.js} +2 -2
  29. package/dist/{chunk-QXUST7PY-C7750n_u.js → chunk-QXUST7PY-CuJlDW6A.js} +10 -10
  30. package/dist/{chunk-QZHKN3VN-BF_oGUlG.js → chunk-QZHKN3VN-Diy_Cdek.js} +1 -1
  31. package/dist/{chunk-S3R3BYOJ-CBkH6JZZ.js → chunk-S3R3BYOJ-CwDGYMVf.js} +3 -3
  32. package/dist/{chunk-TZMSLE5B-DObGL7xi.js → chunk-TZMSLE5B-DFDr5FCr.js} +2 -2
  33. package/dist/classDiagram-2ON5EDUG-BDBX9etk.js +30 -0
  34. package/dist/classDiagram-v2-WZHVMYZB-Bzj_L_BF.js +30 -0
  35. package/dist/{clike-B1zispTy.js → clike-B90WKs4D.js} +1 -1
  36. package/dist/clojure-CUC2I1hM.js +4 -0
  37. package/dist/cmake-8PcMxXnB.js +4 -0
  38. package/dist/cobol-DkkkDz5v.js +4 -0
  39. package/dist/{code-block-37QAKDTI-u5kgjqmr.js → code-block-37QAKDTI-zh5AeoJo.js} +1 -1
  40. package/dist/coffeescript-CCupxOZf.js +4 -0
  41. package/dist/commonlisp-DhUfGX6b.js +4 -0
  42. package/dist/{cose-bilkent-S5V4N54A-CO4ORQHF.js → cose-bilkent-S5V4N54A-BK1nIR2J.js} +1 -1
  43. package/dist/crystal-DSaw6rFQ.js +4 -0
  44. package/dist/css-D4QDewkG.js +4 -0
  45. package/dist/cypher-CrYVqw_F.js +4 -0
  46. package/dist/d-Cr3H3pPx.js +4 -0
  47. package/dist/{dagre-6UL2VRFP-C2C2XxsB.js → dagre-6UL2VRFP-r2rSdJYL.js} +9 -9
  48. package/dist/{data-grid-overlay-editor-BXqtz1ia.js → data-grid-overlay-editor-BVFT970w.js} +2 -2
  49. package/dist/{diagram-PSM6KHXK-DHBY-94p.js → diagram-PSM6KHXK-BpxVUe9U.js} +10 -10
  50. package/dist/{diagram-QEK2KX5R-CgMshOwn.js → diagram-QEK2KX5R-q3dHUcp6.js} +5 -5
  51. package/dist/{diagram-S2PKOQOG-F1KPva3Y.js → diagram-S2PKOQOG-MDBKrxSC.js} +5 -5
  52. package/dist/diff-ODiZJGls.js +4 -0
  53. package/dist/dist-4YNZxwMI.js +8 -0
  54. package/dist/dist-7nR3r2kG.js +5 -0
  55. package/dist/{dist-CBA36Nuy.js → dist-B2-r9y-0.js} +109 -109
  56. package/dist/dist-B2gkyT3r.js +5 -0
  57. package/dist/{dist--JwRU9u5.js → dist-B4tYJP_i.js} +2 -2
  58. package/dist/{dist-DA1J6LvO.js → dist-B5ATpkxy.js} +2 -2
  59. package/dist/dist-B8G3I6vJ.js +8 -0
  60. package/dist/{dist-DKnxaCRl.js → dist-B94MxrQS.js} +2 -2
  61. package/dist/dist-BJ96Ykfp.js +8 -0
  62. package/dist/dist-BKLIWGw4.js +5 -0
  63. package/dist/{dist-l0KayR2-.js → dist-BLwfpZD-.js} +2 -2
  64. package/dist/{dist-C_Kw_Kc0.js → dist-BYmtF1W6.js} +2 -2
  65. package/dist/{dist-Cpj5BHNP.js → dist-BbBnU4tG.js} +1 -1
  66. package/dist/dist-Bf3ou00A.js +6 -0
  67. package/dist/{dist-CITQGRtG.js → dist-BfactX3G.js} +4 -4
  68. package/dist/{dist-CsN7lsea.js → dist-BoAHOW2l.js} +2 -2
  69. package/dist/{dist-BcXuIt-h.js → dist-Bsv_ARko.js} +4 -4
  70. package/dist/dist-BvkKXuPm.js +5 -0
  71. package/dist/{dist-DsqQCNKw.js → dist-C2-m5aEk.js} +119 -119
  72. package/dist/dist-C6NJ3n6r.js +5 -0
  73. package/dist/{dist-DIVeCGlI.js → dist-CC9VUnXd.js} +1 -1
  74. package/dist/{dist-BKGWAN8J.js → dist-CE43BRmt.js} +1 -1
  75. package/dist/{dist-COp5dkis.js → dist-CJrHMxlI.js} +31 -31
  76. package/dist/{dist-BbQ-5HAA.js → dist-CPTE45iS.js} +1 -1
  77. package/dist/{dist-9trj4p6n.js → dist-CcOGT46m.js} +27 -27
  78. package/dist/dist-CecLPYY5.js +5 -0
  79. package/dist/{dist-BSMZYwqW.js → dist-Cgf353Ki.js} +1 -1
  80. package/dist/dist-Ch0SwRzK.js +5 -0
  81. package/dist/{dist-C6p7UKkB.js → dist-CkEUrAus.js} +2 -2
  82. package/dist/{dist-MFzhAmKV.js → dist-CmZYrgd_.js} +1 -1
  83. package/dist/{dist-b7Sc3Tj8.js → dist-Crk9ejOy.js} +4 -4
  84. package/dist/dist-D6eWHiFh.js +6 -0
  85. package/dist/dist-DCQ710Bv.js +5 -0
  86. package/dist/{dist-r6N_0WG-.js → dist-DOil6y-3.js} +4 -4
  87. package/dist/{dist-CPd_adhw.js → dist-Dc1SFk5I.js} +2 -2
  88. package/dist/dist-Dit9tk8a.js +1242 -0
  89. package/dist/{dist-B7NoEgR4.js → dist-DqJdzAYM.js} +2 -2
  90. package/dist/dist-P_pkS5f-.js +8 -0
  91. package/dist/{dist--Em7gfgX.js → dist-T4g7Sr6e.js} +3 -3
  92. package/dist/{dist-BhBtK2sL.js → dist-glA_fIK_.js} +2 -2
  93. package/dist/{dist-9J8_3DZN.js → dist-iiugPhCC.js} +1 -1
  94. package/dist/{dist-D7jHtwN8.js → dist-r8ecBV-v.js} +135 -65
  95. package/dist/{dist-BlRm4v0e.js → dist-yVJ4xE5n.js} +5 -5
  96. package/dist/{dockerfile-BBT_Ira6.js → dockerfile-D1Q_4uCN.js} +1 -1
  97. package/dist/dtd-C-t2Rk7F.js +4 -0
  98. package/dist/dylan-B4ctBLGp.js +4 -0
  99. package/dist/ecl-DqWfymni.js +4 -0
  100. package/dist/eiffel-DjBKKAr7.js +4 -0
  101. package/dist/elm--fxeC0FV.js +4 -0
  102. package/dist/{erDiagram-Q2GNP2WA-18gGng8V.js → erDiagram-Q2GNP2WA-CX1XdqVD.js} +13 -13
  103. package/dist/erlang-CaKXCX6H.js +4 -0
  104. package/dist/{esm-CgRNPmz8.js → esm-BAS2d2Ad.js} +1503 -1536
  105. package/dist/{factor-DdqWbSyy.js → factor--4HHM8Rw.js} +1 -1
  106. package/dist/factor-DlLO5EFS.js +4 -0
  107. package/dist/{flowDiagram-NV44I4VS-iHFiHYe0.js → flowDiagram-NV44I4VS-BCj-ONTw.js} +15 -15
  108. package/dist/forth-rOO6LVj_.js +4 -0
  109. package/dist/fortran-CUg15VGR.js +4 -0
  110. package/dist/{ganttDiagram-JELNMOA3-D7GixxiF.js → ganttDiagram-JELNMOA3-D1l5ewiQ.js} +8 -8
  111. package/dist/gas-BMRJspiW.js +4 -0
  112. package/dist/gherkin-DRxzijZU.js +4 -0
  113. package/dist/{gitGraphDiagram-NY62KEGX-CJFHytRK.js → gitGraphDiagram-NY62KEGX-KdZh0iiW.js} +5 -5
  114. package/dist/{glide-data-editor-BYwb17Bf.js → glide-data-editor-2RvcPqmc.js} +75 -76
  115. package/dist/groovy-BmrQ8pUP.js +4 -0
  116. package/dist/haskell-BuaYfKOz.js +4 -0
  117. package/dist/haxe-DcH9eA0a.js +5 -0
  118. package/dist/idl-DGlcm4Ls.js +4 -0
  119. package/dist/{infoDiagram-WHAUD3N6-B5Lkh3A9.js → infoDiagram-WHAUD3N6-PSH7lQ0D.js} +3 -3
  120. package/dist/javascript-CeTk7rzr.js +4 -0
  121. package/dist/{journeyDiagram-XKPGCS4Q-CV_9R9iP.js → journeyDiagram-XKPGCS4Q-BrTAxQ1J.js} +5 -5
  122. package/dist/julia-BoP_q1gm.js +4 -0
  123. package/dist/{kanban-definition-3W4ZIXB7-Dp21D5Ym.js → kanban-definition-3W4ZIXB7-BoYCDp_9.js} +10 -10
  124. package/dist/{katex-CX2BKujk.js → katex-DaGuLbVh.js} +1 -1
  125. package/dist/{line-LK_5q2B9.js → line-Bc27KE1D.js} +3 -3
  126. package/dist/{linear-vWf1Qj0e.js → linear-Bnc6E9kA.js} +4 -4
  127. package/dist/livescript-B7IMN-ba.js +4 -0
  128. package/dist/{loader-B0KEFFi-.js → loader-C0-eIoas.js} +1 -1
  129. package/dist/lua-q1InavKb.js +4 -0
  130. package/dist/main.js +207 -204
  131. package/dist/mathematica-DvR8-_EI.js +4 -0
  132. package/dist/mbox-7h5MNBS_.js +4 -0
  133. package/dist/{mermaid-4DMBBIKO-BhDCqnO1.js → mermaid-4DMBBIKO-BmJdHPwx.js} +1 -1
  134. package/dist/{mermaid-B__BZSXU.js → mermaid-C2cSe5YL.js} +40 -40
  135. package/dist/{mhchem-w1tkUnWr.js → mhchem-B_tiMbKF.js} +1 -1
  136. package/dist/{mindmap-definition-VGOIOE7T-B_5mfdYp.js → mindmap-definition-VGOIOE7T-CmRjsKEt.js} +12 -12
  137. package/dist/mirc-D-XM8A5c.js +4 -0
  138. package/dist/mllike-BQGkkbmf.js +6 -0
  139. package/dist/modelica-D_yRj_WU.js +4 -0
  140. package/dist/mscgen-B-rltAjp.js +6 -0
  141. package/dist/mumps-2kh8TU2b.js +4 -0
  142. package/dist/{nsis-CunMjZ_n.js → nsis-B6EN9LWI.js} +1 -1
  143. package/dist/nsis-CtusEqwb.js +4 -0
  144. package/dist/ntriples-BdAXw6zV.js +4 -0
  145. package/dist/{number-overlay-editor-D-4WQAGX.js → number-overlay-editor-DKVJgXpp.js} +1 -1
  146. package/dist/octave-CsNFmVp5.js +4 -0
  147. package/dist/{ordinal-IlASfRja.js → ordinal-DLLbwLkP.js} +1 -1
  148. package/dist/oz-odIXCrKd.js +4 -0
  149. package/dist/pascal-B9Mfk3Fo.js +4 -0
  150. package/dist/perl-C48inLcz.js +4 -0
  151. package/dist/{pieDiagram-ADFJNKIX-B-DGEopK.js → pieDiagram-ADFJNKIX-CtxQlnsU.js} +10 -10
  152. package/dist/pig-uwRtAssU.js +4 -0
  153. package/dist/powershell-CXqlca-i.js +4 -0
  154. package/dist/{precisionRound-CGLoV26P.js → precisionRound-Duzbr5ur.js} +1 -1
  155. package/dist/properties-D6Zu1rpK.js +4 -0
  156. package/dist/protobuf-BlNNWZaR.js +4 -0
  157. package/dist/pug-DytcK7bv.js +4 -0
  158. package/dist/{pug-Dr-sA_9V.js → pug-xrm7jQ2R.js} +1 -1
  159. package/dist/puppet-lJ8Ok3iY.js +4 -0
  160. package/dist/python-cMaF7kUp.js +4 -0
  161. package/dist/q-Dgt2HYQh.js +4 -0
  162. package/dist/{quadrantDiagram-AYHSOK5B-M_yRSIZn.js → quadrantDiagram-AYHSOK5B-DllnB2Hl.js} +4 -4
  163. package/dist/r-Bm4S4awf.js +4 -0
  164. package/dist/react-vega-1ub36dPZ.js +9 -0
  165. package/dist/{react-vega-DLFvGrpJ.js → react-vega-CCNu2JE0.js} +18 -18
  166. package/dist/{requirementDiagram-UZGBJVZJ-9Wt82hOZ.js → requirementDiagram-UZGBJVZJ-D36MI1k0.js} +12 -12
  167. package/dist/rpm-_8LbzMVc.js +5 -0
  168. package/dist/ruby-Cr8IJ5VZ.js +4 -0
  169. package/dist/{sankeyDiagram-TZEHDZUN-x_aTXZeN.js → sankeyDiagram-TZEHDZUN-D1mygNPC.js} +4 -4
  170. package/dist/sas-CFcSfo2_.js +4 -0
  171. package/dist/scheme-N4XRoKgc.js +4 -0
  172. package/dist/{sequenceDiagram-WL72ISMW-CXXmJqiQ.js → sequenceDiagram-WL72ISMW-CWdn91Rf.js} +6 -6
  173. package/dist/shell-B4L7f_ds.js +4 -0
  174. package/dist/sieve-UI6J3Gm0.js +4 -0
  175. package/dist/smalltalk-BuaPZAZU.js +4 -0
  176. package/dist/sparql-1rKrq463.js +4 -0
  177. package/dist/{src-szye8OCw.js → src-jICM_d2B.js} +1 -1
  178. package/dist/{stateDiagram-FKZM4ZOC-CiSKS_Mx.js → stateDiagram-FKZM4ZOC-CPxroWXd.js} +15 -15
  179. package/dist/{stateDiagram-v2-4FDKWEC3-A43Itnjp.js → stateDiagram-v2-4FDKWEC3-BpM9Q54b.js} +13 -13
  180. package/dist/{step-1PmBKr2y.js → step-BqVgkWtk.js} +1 -1
  181. package/dist/stylus-DvSovJEP.js +4 -0
  182. package/dist/swift-D-_E7Yyb.js +4 -0
  183. package/dist/tcl-Di5sAVHN.js +4 -0
  184. package/dist/textile-Benwt66z.js +4 -0
  185. package/dist/{time-DC4qQGmA.js → time-CrYsYnQU.js} +4 -4
  186. package/dist/{timeline-definition-IT6M3QCI-DR26eWb4.js → timeline-definition-IT6M3QCI-CVnRHx_t.js} +3 -3
  187. package/dist/toml-CeOvPOkY.js +4 -0
  188. package/dist/troff-DJN9hfgu.js +4 -0
  189. package/dist/ttcn-DQW2Psjf.js +4 -0
  190. package/dist/ttcn-cfg-zFG_MNpg.js +4 -0
  191. package/dist/turtle-DHRyNlSc.js +4 -0
  192. package/dist/{types-Bb-6p8hv.js → types-Ckva8JJq.js} +203 -156
  193. package/dist/{useDeepCompareMemoize-BhZZsis0.js → useDeepCompareMemoize-ChviuF5n.js} +1 -1
  194. package/dist/vb-CXWH9DD-.js +4 -0
  195. package/dist/vbscript-qr8qVck5.js +4 -0
  196. package/dist/{vega-component-DCxUyPnb.js → vega-component-CnG0vAjf.js} +7 -7
  197. package/dist/{vega-loader.browser-BJ1uJidF.js → vega-loader.browser-DqHiiBeQ.js} +3 -3
  198. package/dist/velocity-C_9pUJRx.js +4 -0
  199. package/dist/verilog-DxBstgBa.js +4 -0
  200. package/dist/vhdl-odUxAbE6.js +4 -0
  201. package/dist/webidl-Dfn5Rku4.js +4 -0
  202. package/dist/xquery-CrJs6SXr.js +4 -0
  203. package/dist/{xychartDiagram-PRI3JC2R-BcVxCRox.js → xychartDiagram-PRI3JC2R-BltwMWKC.js} +11 -11
  204. package/dist/yacas-B-uDDLZe.js +4 -0
  205. package/dist/z80-51gxgAXE.js +4 -0
  206. package/package.json +10 -11
  207. package/src/components/data-table/__tests__/columns.test.tsx +47 -0
  208. package/src/components/data-table/column-header.tsx +3 -0
  209. package/src/components/data-table/columns.tsx +17 -2
  210. package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
  211. package/src/core/codemirror/misc/__tests__/paste.test.ts +18 -0
  212. package/src/core/codemirror/misc/paste.ts +14 -10
  213. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -0
  214. package/src/plugins/impl/chat/chat-ui.tsx +10 -1
  215. package/src/plugins/impl/plotly/Plot.tsx +171 -0
  216. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +5 -10
  217. package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +1 -0
  218. package/src/plugins/impl/plotly/__tests__/usePlotlyLayout.test.ts +2 -1
  219. package/src/plugins/impl/plotly/parse-from-template.ts +1 -0
  220. package/src/plugins/impl/plotly/usePlotlyLayout.ts +2 -1
  221. package/src/theme/ThemeProvider.tsx +2 -0
  222. package/dist/apl-BuwKwesW.js +0 -4
  223. package/dist/asciiarmor-zAEd_wtn.js +0 -4
  224. package/dist/asn1-DWEA66J4.js +0 -4
  225. package/dist/brainfuck-mIPR6Ong.js +0 -4
  226. package/dist/classDiagram-2ON5EDUG-B9pkKjjc.js +0 -30
  227. package/dist/classDiagram-v2-WZHVMYZB-CRhhA0tV.js +0 -30
  228. package/dist/clojure-DkhhNHNQ.js +0 -4
  229. package/dist/cmake-1obPvqtc.js +0 -4
  230. package/dist/cobol-oWNTiXPE.js +0 -4
  231. package/dist/coffeescript-LtYUvf6r.js +0 -4
  232. package/dist/commonlisp-C_06qBYF.js +0 -4
  233. package/dist/crystal-CDJkbx14.js +0 -4
  234. package/dist/css-Bi_Nk0uN.js +0 -4
  235. package/dist/cypher-TrG0NvZ0.js +0 -4
  236. package/dist/d-CFKOrZsi.js +0 -4
  237. package/dist/diff-CfnSF48q.js +0 -4
  238. package/dist/dist-2OSzSqy2.js +0 -5
  239. package/dist/dist-B1H2TQGB.js +0 -8
  240. package/dist/dist-BNvasp6N.js +0 -5
  241. package/dist/dist-CFi_P6cs.js +0 -5
  242. package/dist/dist-CG4LWTPv.js +0 -8
  243. package/dist/dist-CHWVQZ6Z.js +0 -6
  244. package/dist/dist-C_8-swED.js +0 -5
  245. package/dist/dist-DIhtur5b.js +0 -5
  246. package/dist/dist-DoQ7RS4e.js +0 -5
  247. package/dist/dist-DsMd-F9h.js +0 -5
  248. package/dist/dist-DurmUshd.js +0 -8
  249. package/dist/dist-PZgrh2z6.js +0 -6
  250. package/dist/dist-g1p2PEVs.js +0 -1242
  251. package/dist/dist-wudNDAiO.js +0 -5
  252. package/dist/dist-zVskjQcA.js +0 -8
  253. package/dist/dtd-Ctw8_JkU.js +0 -4
  254. package/dist/dylan-f7rMBKDP.js +0 -4
  255. package/dist/ecl-C2h3oBMY.js +0 -4
  256. package/dist/eiffel-Ce81wv20.js +0 -4
  257. package/dist/elm-BVV8QQcc.js +0 -4
  258. package/dist/erlang-DjB35ZUh.js +0 -4
  259. package/dist/factor-CIcp3U2B.js +0 -4
  260. package/dist/forth-CVgjsHhD.js +0 -4
  261. package/dist/fortran-CcTXj0d_.js +0 -4
  262. package/dist/gas-JWpamkLf.js +0 -4
  263. package/dist/gherkin-BveSCSJV.js +0 -4
  264. package/dist/groovy-Np3AZt00.js +0 -4
  265. package/dist/haskell-CVfmFALm.js +0 -4
  266. package/dist/haxe-C10xkMLg.js +0 -5
  267. package/dist/idl-CKBSGnKC.js +0 -4
  268. package/dist/javascript-Cur-15Bn.js +0 -4
  269. package/dist/julia-BZZH2Gnx.js +0 -4
  270. package/dist/livescript-D_rTTm_U.js +0 -4
  271. package/dist/lua-Mf_Of7eV.js +0 -4
  272. package/dist/mathematica-DCYjugDb.js +0 -4
  273. package/dist/mbox-KBWrT8JD.js +0 -4
  274. package/dist/mirc-JwEQJ8Fb.js +0 -4
  275. package/dist/mllike-C7TxLvh6.js +0 -6
  276. package/dist/modelica-uvNgvUyw.js +0 -4
  277. package/dist/mscgen-CGnokp5x.js +0 -6
  278. package/dist/mumps-Dl9QdOZz.js +0 -4
  279. package/dist/nsis-BbDhbgPN.js +0 -4
  280. package/dist/ntriples-ChL1mlp7.js +0 -4
  281. package/dist/octave-B9ZGG6zv.js +0 -4
  282. package/dist/oz-XHEu31wr.js +0 -4
  283. package/dist/pascal-BxtYw-iH.js +0 -4
  284. package/dist/perl-Br5BgHPb.js +0 -4
  285. package/dist/pig-BByO2hBz.js +0 -4
  286. package/dist/powershell-Cd4Zaef3.js +0 -4
  287. package/dist/prop-types-C9QZf2SY.js +0 -51
  288. package/dist/properties-B-BOCIOl.js +0 -4
  289. package/dist/protobuf-CaLimlho.js +0 -4
  290. package/dist/pug-bonARSG6.js +0 -4
  291. package/dist/puppet-BSlT-3sc.js +0 -4
  292. package/dist/python-BIJhGYYP.js +0 -4
  293. package/dist/q-D9TX8A0B.js +0 -4
  294. package/dist/r-BXelX7Rl.js +0 -4
  295. package/dist/react-vega-3WcLHYC7.js +0 -9
  296. package/dist/rpm-BxAh9B1A.js +0 -5
  297. package/dist/ruby-BCZLQyhc.js +0 -4
  298. package/dist/sas-Bo7lsyNX.js +0 -4
  299. package/dist/scheme-Brhptkt-.js +0 -4
  300. package/dist/shell-fWWb8_qx.js +0 -4
  301. package/dist/sieve-Ba8_hMLn.js +0 -4
  302. package/dist/smalltalk-7sHxwMDT.js +0 -4
  303. package/dist/sparql-BBFrPJ7z.js +0 -4
  304. package/dist/stylus-CIB0KT46.js +0 -4
  305. package/dist/swift-CZinekXz.js +0 -4
  306. package/dist/tcl-DCHZJVq_.js +0 -4
  307. package/dist/textile-ThTMxgkN.js +0 -4
  308. package/dist/toml-DK17wlJ7.js +0 -4
  309. package/dist/troff-CuUAOgMy.js +0 -4
  310. package/dist/ttcn-DS2tj6rW.js +0 -4
  311. package/dist/ttcn-cfg-CdZGarnc.js +0 -4
  312. package/dist/turtle-Bkz-FLZ7.js +0 -4
  313. package/dist/vb-ITdOmxvR.js +0 -4
  314. package/dist/vbscript-B7oeGyfL.js +0 -4
  315. package/dist/velocity-D__EkuSd.js +0 -4
  316. package/dist/verilog-CPH50gr9.js +0 -4
  317. package/dist/vhdl-CQAwKCk_.js +0 -4
  318. package/dist/webidl-BnEptfVX.js +0 -4
  319. package/dist/xquery-D7eTv-CR.js +0 -4
  320. package/dist/yacas-0x1rX89s.js +0 -4
  321. package/dist/z80-B25SJVDf.js +0 -4
  322. /package/dist/{ImageComparisonComponent-DkEXPki_.js → ImageComparisonComponent-CRbA-1eg.js} +0 -0
  323. /package/dist/{apl-D9gTcP3Q.js → apl-Oc3bL26_.js} +0 -0
  324. /package/dist/{array-D7wW5QoO.js → array-CEIRxyh3.js} +0 -0
  325. /package/dist/{asciiarmor-mLyg-Z5h.js → asciiarmor-DTbPh2VI.js} +0 -0
  326. /package/dist/{asn1-AE7eHomk.js → asn1-CGhwu1Ri.js} +0 -0
  327. /package/dist/{brainfuck-Bdd6NcL6.js → brainfuck-CA0L8lRq.js} +0 -0
  328. /package/dist/{click-outside-container-DNfggvIW.js → click-outside-container-C_k38vlR.js} +0 -0
  329. /package/dist/{clike-D_s3fKg5.js → clike-CEtUBPHD.js} +0 -0
  330. /package/dist/{clojure-zTYBCd80.js → clojure-BszjvdGo.js} +0 -0
  331. /package/dist/{cmake-BnJV90fC.js → cmake-B2Gvps8b.js} +0 -0
  332. /package/dist/{cobol-CH0OZO8A.js → cobol-DuMch8nn.js} +0 -0
  333. /package/dist/{coffeescript-CLhc1U6Q.js → coffeescript-L9aKXVsJ.js} +0 -0
  334. /package/dist/{colors-6DRQ0kEF.js → colors-DR_aHfmQ.js} +0 -0
  335. /package/dist/{commonlisp-8K2-IkUD.js → commonlisp-CrtdssxB.js} +0 -0
  336. /package/dist/{crystal-8to4H-ep.js → crystal-vvNY0LpY.js} +0 -0
  337. /package/dist/{css-BVo-JOy5.js → css-B1GdzqT1.js} +0 -0
  338. /package/dist/{cypher-BTFaDDd_.js → cypher-BtZvV7bW.js} +0 -0
  339. /package/dist/{d-c9bddW2W.js → d-B0UN3V-Z.js} +0 -0
  340. /package/dist/{defaultLocale-Bxoo2-30.js → defaultLocale-B_A76Zpk.js} +0 -0
  341. /package/dist/{defaultLocale-qS7DaAmi.js → defaultLocale-DjFHq3Xk.js} +0 -0
  342. /package/dist/{diff-PA28xMKg.js → diff-DOpgjj1W.js} +0 -0
  343. /package/dist/{dist-BBYTEAvO.js → dist-DF_77D2B.js} +0 -0
  344. /package/dist/{dtd-DRlC7Bx8.js → dtd-Ctnjxrle.js} +0 -0
  345. /package/dist/{dylan-d5ufc25E.js → dylan-DFXkoaZy.js} +0 -0
  346. /package/dist/{ecl-Ci3afVKc.js → ecl-C1NExZip.js} +0 -0
  347. /package/dist/{eiffel-G6DmeEi3.js → eiffel-uXVGgleg.js} +0 -0
  348. /package/dist/{elm-ByYWHu8b.js → elm-CBOFnnib.js} +0 -0
  349. /package/dist/{erlang-C7_LcVDw.js → erlang-DMnrT8XK.js} +0 -0
  350. /package/dist/{esm-CAd2HmbR.js → esm-0_ieXYNc.js} +0 -0
  351. /package/dist/{forth-BgUerAyz.js → forth-DDpxS4nw.js} +0 -0
  352. /package/dist/{fortran-BCXxm4xF.js → fortran-B6uYqQMz.js} +0 -0
  353. /package/dist/{gas-CKTQRKLl.js → gas-BKnWzuFz.js} +0 -0
  354. /package/dist/{gherkin-ByVP9cY_.js → gherkin-pBt0wT4X.js} +0 -0
  355. /package/dist/{groovy-BPbrw0GZ.js → groovy-DKsn4ppB.js} +0 -0
  356. /package/dist/{haskell-B8fq1DW4.js → haskell-BJVBJQcy.js} +0 -0
  357. /package/dist/{haxe-B7SHQmJo.js → haxe-rLN5UZU5.js} +0 -0
  358. /package/dist/{idl-CeJBDjsl.js → idl-B4mwMAo-.js} +0 -0
  359. /package/dist/{init-BfRhston.js → init-TaqZJsBY.js} +0 -0
  360. /package/dist/{javascript-dCv9_Kn8.js → javascript-Hf2NLNC0.js} +0 -0
  361. /package/dist/{julia-CD5lO88_.js → julia-GGpx21YN.js} +0 -0
  362. /package/dist/{katex-Db0k5oV_.js → katex-Ba7xZPrx.js} +0 -0
  363. /package/dist/{livescript-Cc8RvFBv.js → livescript-CSvXMspZ.js} +0 -0
  364. /package/dist/{lua-4nedfnvd.js → lua-CVMR5LMW.js} +0 -0
  365. /package/dist/{math-BbMyrONz.js → math-CTnb-N1W.js} +0 -0
  366. /package/dist/{mathematica-BIufdZr2.js → mathematica-JENNt-p4.js} +0 -0
  367. /package/dist/{mbox-DQkYSHKe.js → mbox-mzifoc8E.js} +0 -0
  368. /package/dist/{mirc-CI-RWqUR.js → mirc-BXoiItvN.js} +0 -0
  369. /package/dist/{mllike-DQzbf1xo.js → mllike-H-KR9OuH.js} +0 -0
  370. /package/dist/{modelica-BnF_cDWj.js → modelica-B6Hm3mMl.js} +0 -0
  371. /package/dist/{mscgen-MirFrDhW.js → mscgen-D8TF_Hei.js} +0 -0
  372. /package/dist/{mumps-eNRTuWOD.js → mumps-CD-kNPt4.js} +0 -0
  373. /package/dist/{ntriples-BLneip4i.js → ntriples-DgnpxU40.js} +0 -0
  374. /package/dist/{octave-C0eG-pKq.js → octave-CkobqyVm.js} +0 -0
  375. /package/dist/{oz-BPMLow2T.js → oz-ChDLd9tS.js} +0 -0
  376. /package/dist/{pascal-5eb9v5Dl.js → pascal-CvlkwK7E.js} +0 -0
  377. /package/dist/{path-C_x2ySFi.js → path-7gr7eZmp.js} +0 -0
  378. /package/dist/{perl-DOu6rCkF.js → perl-BNEFTNbM.js} +0 -0
  379. /package/dist/{pig-CRW0kne3.js → pig-Cd1DMS7P.js} +0 -0
  380. /package/dist/{powershell-CWgJhiiJ.js → powershell-CPxA0zpc.js} +0 -0
  381. /package/dist/{properties-CHxpmfXW.js → properties-BaFBm-Xa.js} +0 -0
  382. /package/dist/{protobuf-DGUXb_-T.js → protobuf-BQV_-X0H.js} +0 -0
  383. /package/dist/{puppet-C7uSiW6_.js → puppet-LXLST0mx.js} +0 -0
  384. /package/dist/{python-DAbhVcUr.js → python-DLjLzX4k.js} +0 -0
  385. /package/dist/{q-DKjWHias.js → q-DswTX1Y9.js} +0 -0
  386. /package/dist/{r-KD2KhyeL.js → r-CO7NpMwE.js} +0 -0
  387. /package/dist/{range-BYuZFTbA.js → range-DwpxnYuB.js} +0 -0
  388. /package/dist/{rpm-GFtnpQ6M.js → rpm-BlmEDT6r.js} +0 -0
  389. /package/dist/{ruby-CBAewzLY.js → ruby-BTPKgeZZ.js} +0 -0
  390. /package/dist/{sas-CCi_AaZi.js → sas-DTDTiNO8.js} +0 -0
  391. /package/dist/{scheme-CGGGD6kR.js → scheme-UzAAg4GJ.js} +0 -0
  392. /package/dist/{shell-b7vZ8ucI.js → shell-DQ0hQCsB.js} +0 -0
  393. /package/dist/{sieve-ClXOUV85.js → sieve-BVyYIx9u.js} +0 -0
  394. /package/dist/{simple-mode-Uad4lEG7.js → simple-mode-Dryu-fC9.js} +0 -0
  395. /package/dist/{slides-component-Dp-y50K9.js → slides-component-DfwLApNr.js} +0 -0
  396. /package/dist/{smalltalk-_PFt9_gp.js → smalltalk-DAdMAHTu.js} +0 -0
  397. /package/dist/{sparql-BCF6qcHt.js → sparql-Bi7quYgw.js} +0 -0
  398. /package/dist/{stylus-DMFZWz-G.js → stylus-jhpzcQ6Y.js} +0 -0
  399. /package/dist/{swift-De2YpSxT.js → swift-BrO8qThZ.js} +0 -0
  400. /package/dist/{tcl-jV8Xs_1k.js → tcl-s5QI5gv3.js} +0 -0
  401. /package/dist/{textile-D_zo778l.js → textile-ClhvJrxM.js} +0 -0
  402. /package/dist/{timer-pEiW44EO.js → timer-DV8t68ti.js} +0 -0
  403. /package/dist/{toml-_M0gsKn5.js → toml-TFa3EJQE.js} +0 -0
  404. /package/dist/{treemap-BzS5cW_6.js → treemap-CQJ0bIDy.js} +0 -0
  405. /package/dist/{troff-B06gyD33.js → troff-SqLg0heF.js} +0 -0
  406. /package/dist/{ttcn-DoQoQNUM.js → ttcn-Cfrap7HJ.js} +0 -0
  407. /package/dist/{ttcn-cfg-l_6PksD2.js → ttcn-cfg-Dopc-iwE.js} +0 -0
  408. /package/dist/{turtle-zEnD4bpn.js → turtle-Dt52DvVH.js} +0 -0
  409. /package/dist/{useAsyncData-Dyq3DyOF.js → useAsyncData-dr8GazGv.js} +0 -0
  410. /package/dist/{vb-fUsnAuzb.js → vb-D1pAvfDe.js} +0 -0
  411. /package/dist/{vbscript-CVlD7uZQ.js → vbscript-DZ7RBxn5.js} +0 -0
  412. /package/dist/{velocity-CHkEIdMC.js → velocity-Csau7eZy.js} +0 -0
  413. /package/dist/{verilog-B3ctZTB4.js → verilog-gXlZACs5.js} +0 -0
  414. /package/dist/{vhdl-rXdBgR5O.js → vhdl-NaUWbI1B.js} +0 -0
  415. /package/dist/{webidl-Cv9aQfcc.js → webidl-BJmPjW01.js} +0 -0
  416. /package/dist/{xquery-Du0w47aa.js → xquery-CJIPsC0g.js} +0 -0
  417. /package/dist/{yacas-Eq4p_g3L.js → yacas-8f2Vjiiz.js} +0 -0
  418. /package/dist/{z80-Dz4HTTRf.js → z80-s5Xk2hCP.js} +0 -0
@@ -0,0 +1,1242 @@
1
+ import { $ as ViewPlugin, At as Prec, Bt as combineConfig, Et as EditorSelection, Ft as StateField, I as syntaxTree, It as Text, Lt as Transaction, Nt as RangeValue, Ot as Facet, Pt as StateEffect, Rt as codePointAt, Ut as fromCodePoint, X as Direction, Y as Decoration, Z as EditorView, at as getTooltip, dt as keymap, et as WidgetType, j as indentUnit, jt as RangeSet, kt as MapMode, pt as logException, wt as CharCategory, xt as Annotation, yt as showTooltip, zt as codePointSize } from "./dist-r8ecBV-v.js";
2
+ var CompletionContext = class {
3
+ constructor(i8, N, P, F) {
4
+ this.state = i8, this.pos = N, this.explicit = P, this.view = F, this.abortListeners = [], this.abortOnDocChange = false;
5
+ }
6
+ tokenBefore(i8) {
7
+ let N = syntaxTree(this.state).resolveInner(this.pos, -1);
8
+ for (; N && i8.indexOf(N.name) < 0; ) N = N.parent;
9
+ return N ? {
10
+ from: N.from,
11
+ to: this.pos,
12
+ text: this.state.sliceDoc(N.from, this.pos),
13
+ type: N.type
14
+ } : null;
15
+ }
16
+ matchBefore(i8) {
17
+ let N = this.state.doc.lineAt(this.pos), P = Math.max(N.from, this.pos - 250), F = N.text.slice(P - N.from, this.pos - N.from), I = F.search(ensureAnchor(i8, false));
18
+ return I < 0 ? null : {
19
+ from: P + I,
20
+ to: this.pos,
21
+ text: F.slice(I)
22
+ };
23
+ }
24
+ get aborted() {
25
+ return this.abortListeners == null;
26
+ }
27
+ addEventListener(i8, N, P) {
28
+ i8 == "abort" && this.abortListeners && (this.abortListeners.push(N), P && P.onDocChange && (this.abortOnDocChange = true));
29
+ }
30
+ };
31
+ function toSet(i8) {
32
+ let N = Object.keys(i8).join(""), P = /\w/.test(N);
33
+ return P && (N = N.replace(/\w/g, "")), `[${P ? "\\w" : ""}${N.replace(/[^\w\s]/g, "\\$&")}]`;
34
+ }
35
+ function prefixMatch(i8) {
36
+ let N = /* @__PURE__ */ Object.create(null), P = /* @__PURE__ */ Object.create(null);
37
+ for (let { label: F2 } of i8) {
38
+ N[F2[0]] = true;
39
+ for (let i9 = 1; i9 < F2.length; i9++) P[F2[i9]] = true;
40
+ }
41
+ let F = toSet(N) + toSet(P) + "*$";
42
+ return [/* @__PURE__ */ RegExp("^" + F), new RegExp(F)];
43
+ }
44
+ function completeFromList(i8) {
45
+ let N = i8.map((i9) => typeof i9 == "string" ? { label: i9 } : i9), [P, F] = N.every((i9) => /^\w+$/.test(i9.label)) ? [/\w*$/, /\w+$/] : prefixMatch(N);
46
+ return (i9) => {
47
+ let I = i9.matchBefore(F);
48
+ return I || i9.explicit ? {
49
+ from: I ? I.from : i9.pos,
50
+ options: N,
51
+ validFor: P
52
+ } : null;
53
+ };
54
+ }
55
+ function ifNotIn(i8, N) {
56
+ return (P) => {
57
+ for (let N2 = syntaxTree(P.state).resolveInner(P.pos, -1); N2; N2 = N2.parent) {
58
+ if (i8.indexOf(N2.name) > -1) return null;
59
+ if (N2.type.isTop) break;
60
+ }
61
+ return N(P);
62
+ };
63
+ }
64
+ var Option = class {
65
+ constructor(i8, N, P, F) {
66
+ this.completion = i8, this.source = N, this.match = P, this.score = F;
67
+ }
68
+ };
69
+ function cur(i8) {
70
+ return i8.selection.main.from;
71
+ }
72
+ function ensureAnchor(i8, N) {
73
+ let { source: P } = i8, F = N && P[0] != "^", I = P[P.length - 1] != "$";
74
+ return !F && !I ? i8 : RegExp(`${F ? "^" : ""}(?:${P})${I ? "$" : ""}`, i8.flags ?? (i8.ignoreCase ? "i" : ""));
75
+ }
76
+ var pickedCompletion = /* @__PURE__ */ Annotation.define();
77
+ function insertCompletionText(i8, N, P, I) {
78
+ let { main: L } = i8.selection, R = P - L.from, z = I - L.from;
79
+ return {
80
+ ...i8.changeByRange((B) => {
81
+ if (B != L && P != I && i8.sliceDoc(B.from + R, B.from + z) != i8.sliceDoc(P, I)) return { range: B };
82
+ let V = i8.toText(N);
83
+ return {
84
+ changes: {
85
+ from: B.from + R,
86
+ to: I == L.from ? B.to : B.from + z,
87
+ insert: V
88
+ },
89
+ range: EditorSelection.cursor(B.from + R + V.length)
90
+ };
91
+ }),
92
+ scrollIntoView: true,
93
+ userEvent: "input.complete"
94
+ };
95
+ }
96
+ var SourceCache = /* @__PURE__ */ new WeakMap();
97
+ function asSource(i8) {
98
+ if (!Array.isArray(i8)) return i8;
99
+ let N = SourceCache.get(i8);
100
+ return N || SourceCache.set(i8, N = completeFromList(i8)), N;
101
+ }
102
+ var startCompletionEffect = /* @__PURE__ */ StateEffect.define(), closeCompletionEffect = /* @__PURE__ */ StateEffect.define(), FuzzyMatcher = class {
103
+ constructor(i8) {
104
+ this.pattern = i8, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
105
+ for (let N = 0; N < i8.length; ) {
106
+ let P = codePointAt(i8, N), F = codePointSize(P);
107
+ this.chars.push(P);
108
+ let I = i8.slice(N, N + F), L = I.toUpperCase();
109
+ this.folded.push(codePointAt(L == I ? I.toLowerCase() : L, 0)), N += F;
110
+ }
111
+ this.astral = i8.length != this.chars.length;
112
+ }
113
+ ret(i8, N) {
114
+ return this.score = i8, this.matched = N, this;
115
+ }
116
+ match(i8) {
117
+ if (this.pattern.length == 0) return this.ret(-100, []);
118
+ if (i8.length < this.pattern.length) return null;
119
+ let { chars: N, folded: P, any: F, precise: I, byWord: L } = this;
120
+ if (N.length == 1) {
121
+ let F2 = codePointAt(i8, 0), I2 = codePointSize(F2), L2 = I2 == i8.length ? 0 : -100;
122
+ if (F2 != N[0]) if (F2 == P[0]) L2 += -200;
123
+ else return null;
124
+ return this.ret(L2, [0, I2]);
125
+ }
126
+ let R = i8.indexOf(this.pattern);
127
+ if (R == 0) return this.ret(i8.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
128
+ let z = N.length, B = 0;
129
+ if (R < 0) {
130
+ for (let I2 = 0, L2 = Math.min(i8.length, 200); I2 < L2 && B < z; ) {
131
+ let L3 = codePointAt(i8, I2);
132
+ (L3 == N[B] || L3 == P[B]) && (F[B++] = I2), I2 += codePointSize(L3);
133
+ }
134
+ if (B < z) return null;
135
+ }
136
+ let V = 0, H = 0, G = false, K = 0, q = -1, J = -1, Y = /[a-z]/.test(i8), X = true;
137
+ for (let F2 = 0, B2 = Math.min(i8.length, 200), Z = 0; F2 < B2 && H < z; ) {
138
+ let B3 = codePointAt(i8, F2);
139
+ R < 0 && (V < z && B3 == N[V] && (I[V++] = F2), K < z && (B3 == N[K] || B3 == P[K] ? (K == 0 && (q = F2), J = F2 + 1, K++) : K = 0));
140
+ let Q, $ = B3 < 255 ? B3 >= 48 && B3 <= 57 || B3 >= 97 && B3 <= 122 ? 2 : B3 >= 65 && B3 <= 90 ? 1 : 0 : (Q = fromCodePoint(B3)) == Q.toLowerCase() ? Q == Q.toUpperCase() ? 0 : 2 : 1;
141
+ (!F2 || $ == 1 && Y || Z == 0 && $ != 0) && (N[H] == B3 || P[H] == B3 && (G = true) ? L[H++] = F2 : L.length && (X = false)), Z = $, F2 += codePointSize(B3);
142
+ }
143
+ return H == z && L[0] == 0 && X ? this.result(-100 + (G ? -200 : 0), L, i8) : K == z && q == 0 ? this.ret(-200 - i8.length + (J == i8.length ? 0 : -100), [0, J]) : R > -1 ? this.ret(-700 - i8.length, [R, R + this.pattern.length]) : K == z ? this.ret(-900 - i8.length, [q, J]) : H == z ? this.result(-100 + (G ? -200 : 0) + -700 + (X ? 0 : -1100), L, i8) : N.length == 2 ? null : this.result((F[0] ? -700 : 0) + -200 + -1100, F, i8);
144
+ }
145
+ result(i8, N, P) {
146
+ let F = [], I = 0;
147
+ for (let i9 of N) {
148
+ let N2 = i9 + (this.astral ? codePointSize(codePointAt(P, i9)) : 1);
149
+ I && F[I - 1] == i9 ? F[I - 1] = N2 : (F[I++] = i9, F[I++] = N2);
150
+ }
151
+ return this.ret(i8 - P.length, F);
152
+ }
153
+ }, StrictMatcher = class {
154
+ constructor(i8) {
155
+ this.pattern = i8, this.matched = [], this.score = 0, this.folded = i8.toLowerCase();
156
+ }
157
+ match(i8) {
158
+ if (i8.length < this.pattern.length) return null;
159
+ let N = i8.slice(0, this.pattern.length), P = N == this.pattern ? 0 : N.toLowerCase() == this.folded ? -200 : null;
160
+ return P == null ? null : (this.matched = [0, N.length], this.score = P + (i8.length == this.pattern.length ? 0 : -100), this);
161
+ }
162
+ }, completionConfig = /* @__PURE__ */ Facet.define({ combine(i8) {
163
+ return combineConfig(i8, {
164
+ activateOnTyping: true,
165
+ activateOnCompletion: () => false,
166
+ activateOnTypingDelay: 100,
167
+ selectOnOpen: true,
168
+ override: null,
169
+ closeOnBlur: true,
170
+ maxRenderedOptions: 100,
171
+ defaultKeymap: true,
172
+ tooltipClass: () => "",
173
+ optionClass: () => "",
174
+ aboveCursor: false,
175
+ icons: true,
176
+ addToOptions: [],
177
+ positionInfo: defaultPositionInfo,
178
+ filterStrict: false,
179
+ compareCompletions: (i9, N) => (i9.sortText || i9.label).localeCompare(N.sortText || N.label),
180
+ interactionDelay: 75,
181
+ updateSyncTime: 100
182
+ }, {
183
+ defaultKeymap: (i9, N) => i9 && N,
184
+ closeOnBlur: (i9, N) => i9 && N,
185
+ icons: (i9, N) => i9 && N,
186
+ tooltipClass: (i9, N) => (P) => joinClass(i9(P), N(P)),
187
+ optionClass: (i9, N) => (P) => joinClass(i9(P), N(P)),
188
+ addToOptions: (i9, N) => i9.concat(N),
189
+ filterStrict: (i9, N) => i9 || N
190
+ });
191
+ } });
192
+ function joinClass(i8, N) {
193
+ return i8 ? N ? i8 + " " + N : i8 : N;
194
+ }
195
+ function defaultPositionInfo(i8, N, P, F, I, L) {
196
+ let R = i8.textDirection == Direction.RTL, z = R, B = false, V = "top", H, U, W = N.left - I.left, K = I.right - N.right, q = F.right - F.left, J = F.bottom - F.top;
197
+ if (z && W < Math.min(q, K) ? z = false : !z && K < Math.min(q, W) && (z = true), q <= (z ? W : K)) H = Math.max(I.top, Math.min(P.top, I.bottom - J)) - N.top, U = Math.min(400, z ? W : K);
198
+ else {
199
+ B = true, U = Math.min(400, (R ? N.right : I.right - N.left) - 30);
200
+ let i9 = I.bottom - N.bottom;
201
+ i9 >= J || i9 > N.top ? H = P.bottom - N.top : (V = "bottom", H = N.bottom - P.top);
202
+ }
203
+ let Y = (N.bottom - N.top) / L.offsetHeight, X = (N.right - N.left) / L.offsetWidth;
204
+ return {
205
+ style: `${V}: ${H / Y}px; max-width: ${U / X}px`,
206
+ class: "cm-completionInfo-" + (B ? R ? "left-narrow" : "right-narrow" : z ? "left" : "right")
207
+ };
208
+ }
209
+ function optionContent(i8) {
210
+ let N = i8.addToOptions.slice();
211
+ return i8.icons && N.push({
212
+ render(i9) {
213
+ let N2 = document.createElement("div");
214
+ return N2.classList.add("cm-completionIcon"), i9.type && N2.classList.add(...i9.type.split(/\s+/g).map((i10) => "cm-completionIcon-" + i10)), N2.setAttribute("aria-hidden", "true"), N2;
215
+ },
216
+ position: 20
217
+ }), N.push({
218
+ render(i9, N2, P, F) {
219
+ let I = document.createElement("span");
220
+ I.className = "cm-completionLabel";
221
+ let L = i9.displayLabel || i9.label, R = 0;
222
+ for (let i10 = 0; i10 < F.length; ) {
223
+ let N3 = F[i10++], P2 = F[i10++];
224
+ N3 > R && I.appendChild(document.createTextNode(L.slice(R, N3)));
225
+ let z = I.appendChild(document.createElement("span"));
226
+ z.appendChild(document.createTextNode(L.slice(N3, P2))), z.className = "cm-completionMatchedText", R = P2;
227
+ }
228
+ return R < L.length && I.appendChild(document.createTextNode(L.slice(R))), I;
229
+ },
230
+ position: 50
231
+ }, {
232
+ render(i9) {
233
+ if (!i9.detail) return null;
234
+ let N2 = document.createElement("span");
235
+ return N2.className = "cm-completionDetail", N2.textContent = i9.detail, N2;
236
+ },
237
+ position: 80
238
+ }), N.sort((i9, N2) => i9.position - N2.position).map((i9) => i9.render);
239
+ }
240
+ function rangeAroundSelected(i8, N, P) {
241
+ if (i8 <= P) return {
242
+ from: 0,
243
+ to: i8
244
+ };
245
+ if (N < 0 && (N = 0), N <= i8 >> 1) {
246
+ let i9 = Math.floor(N / P);
247
+ return {
248
+ from: i9 * P,
249
+ to: (i9 + 1) * P
250
+ };
251
+ }
252
+ let F = Math.floor((i8 - N) / P);
253
+ return {
254
+ from: i8 - (F + 1) * P,
255
+ to: i8 - F * P
256
+ };
257
+ }
258
+ var CompletionTooltip = class {
259
+ constructor(i8, N, P) {
260
+ this.view = i8, this.stateField = N, this.applyCompletion = P, this.info = null, this.infoDestroy = null, this.placeInfoReq = {
261
+ read: () => this.measureInfo(),
262
+ write: (i9) => this.placeInfo(i9),
263
+ key: this
264
+ }, this.space = null, this.currentClass = "";
265
+ let F = i8.state.field(N), { options: I, selected: L } = F.open, R = i8.state.facet(completionConfig);
266
+ this.optionContent = optionContent(R), this.optionClass = R.optionClass, this.tooltipClass = R.tooltipClass, this.range = rangeAroundSelected(I.length, L, R.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(i8.state), this.dom.addEventListener("mousedown", (P2) => {
267
+ let { options: F2 } = i8.state.field(N).open;
268
+ for (let N2 = P2.target, I2; N2 && N2 != this.dom; N2 = N2.parentNode) if (N2.nodeName == "LI" && (I2 = /-(\d+)$/.exec(N2.id)) && +I2[1] < F2.length) {
269
+ this.applyCompletion(i8, F2[+I2[1]]), P2.preventDefault();
270
+ return;
271
+ }
272
+ }), this.dom.addEventListener("focusout", (N2) => {
273
+ let P2 = i8.state.field(this.stateField, false);
274
+ P2 && P2.tooltip && i8.state.facet(completionConfig).closeOnBlur && N2.relatedTarget != i8.contentDOM && i8.dispatch({ effects: closeCompletionEffect.of(null) });
275
+ }), this.showOptions(I, F.id);
276
+ }
277
+ mount() {
278
+ this.updateSel();
279
+ }
280
+ showOptions(i8, N) {
281
+ this.list && this.list.remove(), this.list = this.dom.appendChild(this.createListBox(i8, N, this.range)), this.list.addEventListener("scroll", () => {
282
+ this.info && this.view.requestMeasure(this.placeInfoReq);
283
+ });
284
+ }
285
+ update(i8) {
286
+ var _a;
287
+ let N = i8.state.field(this.stateField), P = i8.startState.field(this.stateField);
288
+ if (this.updateTooltipClass(i8.state), N != P) {
289
+ let { options: F, selected: I, disabled: L } = N.open;
290
+ (!P.open || P.open.options != F) && (this.range = rangeAroundSelected(F.length, I, i8.state.facet(completionConfig).maxRenderedOptions), this.showOptions(F, N.id)), this.updateSel(), L != ((_a = P.open) == null ? void 0 : _a.disabled) && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!L);
291
+ }
292
+ }
293
+ updateTooltipClass(i8) {
294
+ let N = this.tooltipClass(i8);
295
+ if (N != this.currentClass) {
296
+ for (let i9 of this.currentClass.split(" ")) i9 && this.dom.classList.remove(i9);
297
+ for (let i9 of N.split(" ")) i9 && this.dom.classList.add(i9);
298
+ this.currentClass = N;
299
+ }
300
+ }
301
+ positioned(i8) {
302
+ this.space = i8, this.info && this.view.requestMeasure(this.placeInfoReq);
303
+ }
304
+ updateSel() {
305
+ let i8 = this.view.state.field(this.stateField), N = i8.open;
306
+ (N.selected > -1 && N.selected < this.range.from || N.selected >= this.range.to) && (this.range = rangeAroundSelected(N.options.length, N.selected, this.view.state.facet(completionConfig).maxRenderedOptions), this.showOptions(N.options, i8.id));
307
+ let P = this.updateSelectedOption(N.selected);
308
+ if (P) {
309
+ this.destroyInfo();
310
+ let { completion: F } = N.options[N.selected], { info: I } = F;
311
+ if (!I) return;
312
+ let L = typeof I == "string" ? document.createTextNode(I) : I(F);
313
+ if (!L) return;
314
+ "then" in L ? L.then((N2) => {
315
+ N2 && this.view.state.field(this.stateField, false) == i8 && this.addInfoPane(N2, F);
316
+ }).catch((i9) => logException(this.view.state, i9, "completion info")) : (this.addInfoPane(L, F), P.setAttribute("aria-describedby", this.info.id));
317
+ }
318
+ }
319
+ addInfoPane(i8, N) {
320
+ this.destroyInfo();
321
+ let P = this.info = document.createElement("div");
322
+ if (P.className = "cm-tooltip cm-completionInfo", P.id = "cm-completionInfo-" + Math.floor(Math.random() * 65535).toString(16), i8.nodeType != null) P.appendChild(i8), this.infoDestroy = null;
323
+ else {
324
+ let { dom: N2, destroy: F } = i8;
325
+ P.appendChild(N2), this.infoDestroy = F || null;
326
+ }
327
+ this.dom.appendChild(P), this.view.requestMeasure(this.placeInfoReq);
328
+ }
329
+ updateSelectedOption(i8) {
330
+ let N = null;
331
+ for (let P = this.list.firstChild, F = this.range.from; P; P = P.nextSibling, F++) P.nodeName != "LI" || !P.id ? F-- : F == i8 ? P.hasAttribute("aria-selected") || (P.setAttribute("aria-selected", "true"), N = P) : P.hasAttribute("aria-selected") && (P.removeAttribute("aria-selected"), P.removeAttribute("aria-describedby"));
332
+ return N && scrollIntoView(this.list, N), N;
333
+ }
334
+ measureInfo() {
335
+ let i8 = this.dom.querySelector("[aria-selected]");
336
+ if (!i8 || !this.info) return null;
337
+ let N = this.dom.getBoundingClientRect(), P = this.info.getBoundingClientRect(), F = i8.getBoundingClientRect(), I = this.space;
338
+ if (!I) {
339
+ let i9 = this.dom.ownerDocument.documentElement;
340
+ I = {
341
+ left: 0,
342
+ top: 0,
343
+ right: i9.clientWidth,
344
+ bottom: i9.clientHeight
345
+ };
346
+ }
347
+ return F.top > Math.min(I.bottom, N.bottom) - 10 || F.bottom < Math.max(I.top, N.top) + 10 ? null : this.view.state.facet(completionConfig).positionInfo(this.view, N, F, P, I, this.dom);
348
+ }
349
+ placeInfo(i8) {
350
+ this.info && (i8 ? (i8.style && (this.info.style.cssText = i8.style), this.info.className = "cm-tooltip cm-completionInfo " + (i8.class || "")) : this.info.style.cssText = "top: -1e6px");
351
+ }
352
+ createListBox(i8, N, P) {
353
+ let F = document.createElement("ul");
354
+ F.id = N, F.setAttribute("role", "listbox"), F.setAttribute("aria-expanded", "true"), F.setAttribute("aria-label", this.view.state.phrase("Completions")), F.addEventListener("mousedown", (i9) => {
355
+ i9.target == F && i9.preventDefault();
356
+ });
357
+ let I = null;
358
+ for (let L = P.from; L < P.to; L++) {
359
+ let { completion: R, match: z } = i8[L], { section: B } = R;
360
+ if (B) {
361
+ let i9 = typeof B == "string" ? B : B.name;
362
+ if (i9 != I && (L > P.from || P.from == 0)) if (I = i9, typeof B != "string" && B.header) F.appendChild(B.header(B));
363
+ else {
364
+ let N2 = F.appendChild(document.createElement("completion-section"));
365
+ N2.textContent = i9;
366
+ }
367
+ }
368
+ let V = F.appendChild(document.createElement("li"));
369
+ V.id = N + "-" + L, V.setAttribute("role", "option");
370
+ let H = this.optionClass(R);
371
+ H && (V.className = H);
372
+ for (let i9 of this.optionContent) {
373
+ let N2 = i9(R, this.view.state, this.view, z);
374
+ N2 && V.appendChild(N2);
375
+ }
376
+ }
377
+ return P.from && F.classList.add("cm-completionListIncompleteTop"), P.to < i8.length && F.classList.add("cm-completionListIncompleteBottom"), F;
378
+ }
379
+ destroyInfo() {
380
+ this.info && (this.info = (this.infoDestroy && this.infoDestroy(), this.info.remove(), null));
381
+ }
382
+ destroy() {
383
+ this.destroyInfo();
384
+ }
385
+ };
386
+ function completionTooltip(i8, N) {
387
+ return (P) => new CompletionTooltip(P, i8, N);
388
+ }
389
+ function scrollIntoView(i8, N) {
390
+ let P = i8.getBoundingClientRect(), F = N.getBoundingClientRect(), I = P.height / i8.offsetHeight;
391
+ F.top < P.top ? i8.scrollTop -= (P.top - F.top) / I : F.bottom > P.bottom && (i8.scrollTop += (F.bottom - P.bottom) / I);
392
+ }
393
+ function score(i8) {
394
+ return (i8.boost || 0) * 100 + (i8.apply ? 10 : 0) + (i8.info ? 5 : 0) + (i8.type ? 1 : 0);
395
+ }
396
+ function sortOptions(i8, N) {
397
+ let P = [], F = null, I = null, L = (i9) => {
398
+ P.push(i9);
399
+ let { section: N2 } = i9.completion;
400
+ if (N2) {
401
+ F || (F = []);
402
+ let i10 = typeof N2 == "string" ? N2 : N2.name;
403
+ F.some((N3) => N3.name == i10) || F.push(typeof N2 == "string" ? { name: i10 } : N2);
404
+ }
405
+ }, R = N.facet(completionConfig);
406
+ for (let F2 of i8) if (F2.hasResult()) {
407
+ let i9 = F2.result.getMatch;
408
+ if (F2.result.filter === false) for (let N2 of F2.result.options) L(new Option(N2, F2.source, i9 ? i9(N2) : [], 1e9 - P.length));
409
+ else {
410
+ let P2 = N.sliceDoc(F2.from, F2.to), z2, B2 = R.filterStrict ? new StrictMatcher(P2) : new FuzzyMatcher(P2);
411
+ for (let N2 of F2.result.options) if (z2 = B2.match(N2.label)) {
412
+ let P3 = N2.displayLabel ? i9 ? i9(N2, z2.matched) : [] : z2.matched, R2 = z2.score + (N2.boost || 0);
413
+ if (L(new Option(N2, F2.source, P3, R2)), typeof N2.section == "object" && N2.section.rank === "dynamic") {
414
+ let { name: i10 } = N2.section;
415
+ I || (I = /* @__PURE__ */ Object.create(null)), I[i10] = Math.max(R2, I[i10] || -1e9);
416
+ }
417
+ }
418
+ }
419
+ }
420
+ if (F) {
421
+ let i9 = /* @__PURE__ */ Object.create(null), N2 = 0, L2 = (i10, N3) => (i10.rank === "dynamic" && N3.rank === "dynamic" ? I[N3.name] - I[i10.name] : 0) || (typeof i10.rank == "number" ? i10.rank : 1e9) - (typeof N3.rank == "number" ? N3.rank : 1e9) || (i10.name < N3.name ? -1 : 1);
422
+ for (let P2 of F.sort(L2)) N2 -= 1e5, i9[P2.name] = N2;
423
+ for (let N3 of P) {
424
+ let { section: P2 } = N3.completion;
425
+ P2 && (N3.score += i9[typeof P2 == "string" ? P2 : P2.name]);
426
+ }
427
+ }
428
+ let z = [], B = null, V = R.compareCompletions;
429
+ for (let i9 of P.sort((i10, N2) => N2.score - i10.score || V(i10.completion, N2.completion))) {
430
+ let N2 = i9.completion;
431
+ !B || B.label != N2.label || B.detail != N2.detail || B.type != null && N2.type != null && B.type != N2.type || B.apply != N2.apply || B.boost != N2.boost ? z.push(i9) : score(i9.completion) > score(B) && (z[z.length - 1] = i9), B = i9.completion;
432
+ }
433
+ return z;
434
+ }
435
+ var CompletionDialog = class i {
436
+ constructor(i8, N, P, F, I, L) {
437
+ this.options = i8, this.attrs = N, this.tooltip = P, this.timestamp = F, this.selected = I, this.disabled = L;
438
+ }
439
+ setSelected(N, P) {
440
+ return N == this.selected || N >= this.options.length ? this : new i(this.options, makeAttrs(P, N), this.tooltip, this.timestamp, N, this.disabled);
441
+ }
442
+ static build(N, P, F, I, L, R) {
443
+ if (I && !R && N.some((i8) => i8.isPending)) return I.setDisabled();
444
+ let z = sortOptions(N, P);
445
+ if (!z.length) return I && N.some((i8) => i8.isPending) ? I.setDisabled() : null;
446
+ let B = P.facet(completionConfig).selectOnOpen ? 0 : -1;
447
+ if (I && I.selected != B && I.selected != -1) {
448
+ let i8 = I.options[I.selected].completion;
449
+ for (let N2 = 0; N2 < z.length; N2++) if (z[N2].completion == i8) {
450
+ B = N2;
451
+ break;
452
+ }
453
+ }
454
+ return new i(z, makeAttrs(F, B), {
455
+ pos: N.reduce((i8, N2) => N2.hasResult() ? Math.min(i8, N2.from) : i8, 1e8),
456
+ create: createTooltip,
457
+ above: L.aboveCursor
458
+ }, I ? I.timestamp : Date.now(), B, false);
459
+ }
460
+ map(N) {
461
+ return new i(this.options, this.attrs, {
462
+ ...this.tooltip,
463
+ pos: N.mapPos(this.tooltip.pos)
464
+ }, this.timestamp, this.selected, this.disabled);
465
+ }
466
+ setDisabled() {
467
+ return new i(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, true);
468
+ }
469
+ }, CompletionState = class i2 {
470
+ constructor(i8, N, P) {
471
+ this.active = i8, this.id = N, this.open = P;
472
+ }
473
+ static start() {
474
+ return new i2(none, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
475
+ }
476
+ update(N) {
477
+ let { state: P } = N, F = P.facet(completionConfig), I = (F.override || P.languageDataAt("autocomplete", cur(P)).map(asSource)).map((i8) => (this.active.find((N2) => N2.source == i8) || new ActiveSource(i8, this.active.some((i9) => i9.state != 0) ? 1 : 0)).update(N, F));
478
+ I.length == this.active.length && I.every((i8, N2) => i8 == this.active[N2]) && (I = this.active);
479
+ let L = this.open, R = N.effects.some((i8) => i8.is(setActiveEffect));
480
+ L && N.docChanged && (L = L.map(N.changes)), N.selection || I.some((i8) => i8.hasResult() && N.changes.touchesRange(i8.from, i8.to)) || !sameResults(I, this.active) || R ? L = CompletionDialog.build(I, P, this.id, L, F, R) : L && L.disabled && !I.some((i8) => i8.isPending) && (L = null), !L && I.every((i8) => !i8.isPending) && I.some((i8) => i8.hasResult()) && (I = I.map((i8) => i8.hasResult() ? new ActiveSource(i8.source, 0) : i8));
481
+ for (let i8 of N.effects) i8.is(setSelectedEffect) && (L && (L = L.setSelected(i8.value, this.id)));
482
+ return I == this.active && L == this.open ? this : new i2(I, this.id, L);
483
+ }
484
+ get tooltip() {
485
+ return this.open ? this.open.tooltip : null;
486
+ }
487
+ get attrs() {
488
+ return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs;
489
+ }
490
+ };
491
+ function sameResults(i8, N) {
492
+ if (i8 == N) return true;
493
+ for (let P = 0, F = 0; ; ) {
494
+ for (; P < i8.length && !i8[P].hasResult(); ) P++;
495
+ for (; F < N.length && !N[F].hasResult(); ) F++;
496
+ let I = P == i8.length, L = F == N.length;
497
+ if (I || L) return I == L;
498
+ if (i8[P++].result != N[F++].result) return false;
499
+ }
500
+ }
501
+ var baseAttrs = { "aria-autocomplete": "list" }, noAttrs = {};
502
+ function makeAttrs(i8, N) {
503
+ let P = {
504
+ "aria-autocomplete": "list",
505
+ "aria-haspopup": "listbox",
506
+ "aria-controls": i8
507
+ };
508
+ return N > -1 && (P["aria-activedescendant"] = i8 + "-" + N), P;
509
+ }
510
+ var none = [];
511
+ function getUpdateType(i8, N) {
512
+ if (i8.isUserEvent("input.complete")) {
513
+ let P2 = i8.annotation(pickedCompletion);
514
+ if (P2 && N.activateOnCompletion(P2)) return 12;
515
+ }
516
+ let P = i8.isUserEvent("input.type");
517
+ return P && N.activateOnTyping ? 5 : P ? 1 : i8.isUserEvent("delete.backward") ? 2 : i8.selection ? 8 : i8.docChanged ? 16 : 0;
518
+ }
519
+ var ActiveSource = class i3 {
520
+ constructor(i8, N, P = false) {
521
+ this.source = i8, this.state = N, this.explicit = P;
522
+ }
523
+ hasResult() {
524
+ return false;
525
+ }
526
+ get isPending() {
527
+ return this.state == 1;
528
+ }
529
+ update(N, P) {
530
+ let F = getUpdateType(N, P), I = this;
531
+ (F & 8 || F & 16 && this.touches(N)) && (I = new i3(I.source, 0)), F & 4 && I.state == 0 && (I = new i3(this.source, 1)), I = I.updateFor(N, F);
532
+ for (let P2 of N.effects) if (P2.is(startCompletionEffect)) I = new i3(I.source, 1, P2.value);
533
+ else if (P2.is(closeCompletionEffect)) I = new i3(I.source, 0);
534
+ else if (P2.is(setActiveEffect)) for (let i8 of P2.value) i8.source == I.source && (I = i8);
535
+ return I;
536
+ }
537
+ updateFor(i8, N) {
538
+ return this.map(i8.changes);
539
+ }
540
+ map(i8) {
541
+ return this;
542
+ }
543
+ touches(i8) {
544
+ return i8.changes.touchesRange(cur(i8.state));
545
+ }
546
+ }, ActiveResult = class i4 extends ActiveSource {
547
+ constructor(i8, N, P, F, I, L) {
548
+ super(i8, 3, N), this.limit = P, this.result = F, this.from = I, this.to = L;
549
+ }
550
+ hasResult() {
551
+ return true;
552
+ }
553
+ updateFor(N, P) {
554
+ if (!(P & 3)) return this.map(N.changes);
555
+ let F = this.result;
556
+ F.map && !N.changes.empty && (F = F.map(F, N.changes));
557
+ let I = N.changes.mapPos(this.from), L = N.changes.mapPos(this.to, 1), R = cur(N.state);
558
+ if (R > L || !F || P & 2 && (cur(N.startState) == this.from || R < this.limit)) return new ActiveSource(this.source, P & 4 ? 1 : 0);
559
+ let z = N.changes.mapPos(this.limit);
560
+ return checkValid(F.validFor, N.state, I, L) ? new i4(this.source, this.explicit, z, F, I, L) : F.update && (F = F.update(F, I, L, new CompletionContext(N.state, R, false))) ? new i4(this.source, this.explicit, z, F, F.from, F.to ?? cur(N.state)) : new ActiveSource(this.source, 1, this.explicit);
561
+ }
562
+ map(N) {
563
+ return N.empty ? this : (this.result.map ? this.result.map(this.result, N) : this.result) ? new i4(this.source, this.explicit, N.mapPos(this.limit), this.result, N.mapPos(this.from), N.mapPos(this.to, 1)) : new ActiveSource(this.source, 0);
564
+ }
565
+ touches(i8) {
566
+ return i8.changes.touchesRange(this.from, this.to);
567
+ }
568
+ };
569
+ function checkValid(i8, N, P, F) {
570
+ if (!i8) return false;
571
+ let I = N.sliceDoc(P, F);
572
+ return typeof i8 == "function" ? i8(I, P, F, N) : ensureAnchor(i8, true).test(I);
573
+ }
574
+ var setActiveEffect = /* @__PURE__ */ StateEffect.define({ map(i8, N) {
575
+ return i8.map((i9) => i9.map(N));
576
+ } }), setSelectedEffect = /* @__PURE__ */ StateEffect.define(), completionState = /* @__PURE__ */ StateField.define({
577
+ create() {
578
+ return CompletionState.start();
579
+ },
580
+ update(i8, N) {
581
+ return i8.update(N);
582
+ },
583
+ provide: (i8) => [showTooltip.from(i8, (i9) => i9.tooltip), EditorView.contentAttributes.from(i8, (i9) => i9.attrs)]
584
+ });
585
+ function applyCompletion(i8, N) {
586
+ let P = N.completion.apply || N.completion.label, F = i8.state.field(completionState).active.find((i9) => i9.source == N.source);
587
+ return F instanceof ActiveResult ? (typeof P == "string" ? i8.dispatch({
588
+ ...insertCompletionText(i8.state, P, F.from, F.to),
589
+ annotations: pickedCompletion.of(N.completion)
590
+ }) : P(i8, N.completion, F.from, F.to), true) : false;
591
+ }
592
+ var createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
593
+ function moveCompletionSelection(i8, N = "option") {
594
+ return (P) => {
595
+ let F = P.state.field(completionState, false);
596
+ if (!F || !F.open || F.open.disabled || Date.now() - F.open.timestamp < P.state.facet(completionConfig).interactionDelay) return false;
597
+ let I = 1, L;
598
+ N == "page" && (L = getTooltip(P, F.open.tooltip)) && (I = Math.max(2, Math.floor(L.dom.offsetHeight / L.dom.querySelector("li").offsetHeight) - 1));
599
+ let { length: R } = F.open.options, z = F.open.selected > -1 ? F.open.selected + I * (i8 ? 1 : -1) : i8 ? 0 : R - 1;
600
+ return z < 0 ? z = N == "page" ? 0 : R - 1 : z >= R && (z = N == "page" ? R - 1 : 0), P.dispatch({ effects: setSelectedEffect.of(z) }), true;
601
+ };
602
+ }
603
+ var acceptCompletion = (i8) => {
604
+ let N = i8.state.field(completionState, false);
605
+ return i8.state.readOnly || !N || !N.open || N.open.selected < 0 || N.open.disabled || Date.now() - N.open.timestamp < i8.state.facet(completionConfig).interactionDelay ? false : applyCompletion(i8, N.open.options[N.open.selected]);
606
+ }, startCompletion = (i8) => i8.state.field(completionState, false) ? (i8.dispatch({ effects: startCompletionEffect.of(true) }), true) : false, closeCompletion = (i8) => {
607
+ let N = i8.state.field(completionState, false);
608
+ return !N || !N.active.some((i9) => i9.state != 0) ? false : (i8.dispatch({ effects: closeCompletionEffect.of(null) }), true);
609
+ }, RunningQuery = class {
610
+ constructor(i8, N) {
611
+ this.active = i8, this.context = N, this.time = Date.now(), this.updates = [], this.done = void 0;
612
+ }
613
+ }, MaxUpdateCount = 50, MinAbortTime = 1e3, completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
614
+ constructor(i8) {
615
+ this.view = i8, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = false, this.composing = 0;
616
+ for (let N of i8.state.field(completionState).active) N.isPending && this.startQuery(N);
617
+ }
618
+ update(i8) {
619
+ let N = i8.state.field(completionState), P = i8.state.facet(completionConfig);
620
+ if (!i8.selectionSet && !i8.docChanged && i8.startState.field(completionState) == N) return;
621
+ let F = i8.transactions.some((i9) => {
622
+ let N2 = getUpdateType(i9, P);
623
+ return N2 & 8 || (i9.selection || i9.docChanged) && !(N2 & 3);
624
+ });
625
+ for (let N2 = 0; N2 < this.running.length; N2++) {
626
+ let P2 = this.running[N2];
627
+ if (F || P2.context.abortOnDocChange && i8.docChanged || P2.updates.length + i8.transactions.length > MaxUpdateCount && Date.now() - P2.time > MinAbortTime) {
628
+ for (let i9 of P2.context.abortListeners) try {
629
+ i9();
630
+ } catch (i10) {
631
+ logException(this.view.state, i10);
632
+ }
633
+ P2.context.abortListeners = null, this.running.splice(N2--, 1);
634
+ } else P2.updates.push(...i8.transactions);
635
+ }
636
+ this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), i8.transactions.some((i9) => i9.effects.some((i10) => i10.is(startCompletionEffect))) && (this.pendingStart = true);
637
+ let I = this.pendingStart ? 50 : P.activateOnTypingDelay;
638
+ if (this.debounceUpdate = N.active.some((i9) => i9.isPending && !this.running.some((N2) => N2.active.source == i9.source)) ? setTimeout(() => this.startUpdate(), I) : -1, this.composing != 0) for (let N2 of i8.transactions) N2.isUserEvent("input.type") ? this.composing = 2 : this.composing == 2 && N2.selection && (this.composing = 3);
639
+ }
640
+ startUpdate() {
641
+ this.debounceUpdate = -1, this.pendingStart = false;
642
+ let { state: i8 } = this.view, N = i8.field(completionState);
643
+ for (let i9 of N.active) i9.isPending && !this.running.some((N2) => N2.active.source == i9.source) && this.startQuery(i9);
644
+ this.running.length && N.open && N.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime));
645
+ }
646
+ startQuery(i8) {
647
+ let { state: N } = this.view, P = new CompletionContext(N, cur(N), i8.explicit, this.view), F = new RunningQuery(i8, P);
648
+ this.running.push(F), Promise.resolve(i8.source(P)).then((i9) => {
649
+ F.context.aborted || (F.done = i9 || null, this.scheduleAccept());
650
+ }, (i9) => {
651
+ this.view.dispatch({ effects: closeCompletionEffect.of(null) }), logException(this.view.state, i9);
652
+ });
653
+ }
654
+ scheduleAccept() {
655
+ this.running.every((i8) => i8.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime));
656
+ }
657
+ accept() {
658
+ this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
659
+ let i8 = [], N = this.view.state.facet(completionConfig), P = this.view.state.field(completionState);
660
+ for (let F = 0; F < this.running.length; F++) {
661
+ let I = this.running[F];
662
+ if (I.done === void 0) continue;
663
+ if (this.running.splice(F--, 1), I.done) {
664
+ let P2 = cur(I.updates.length ? I.updates[0].startState : this.view.state), F2 = Math.min(P2, I.done.from + (I.active.explicit ? 0 : 1)), L2 = new ActiveResult(I.active.source, I.active.explicit, F2, I.done, I.done.from, I.done.to ?? P2);
665
+ for (let i9 of I.updates) L2 = L2.update(i9, N);
666
+ if (L2.hasResult()) {
667
+ i8.push(L2);
668
+ continue;
669
+ }
670
+ }
671
+ let L = P.active.find((i9) => i9.source == I.active.source);
672
+ if (L && L.isPending) if (I.done == null) {
673
+ let P2 = new ActiveSource(I.active.source, 0);
674
+ for (let i9 of I.updates) P2 = P2.update(i9, N);
675
+ P2.isPending || i8.push(P2);
676
+ } else this.startQuery(L);
677
+ }
678
+ (i8.length || P.open && P.open.disabled) && this.view.dispatch({ effects: setActiveEffect.of(i8) });
679
+ }
680
+ }, { eventHandlers: {
681
+ blur(i8) {
682
+ let N = this.view.state.field(completionState, false);
683
+ if (N && N.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {
684
+ let P = N.open && getTooltip(this.view, N.open.tooltip);
685
+ (!P || !P.dom.contains(i8.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: closeCompletionEffect.of(null) }), 10);
686
+ }
687
+ },
688
+ compositionstart() {
689
+ this.composing = 1;
690
+ },
691
+ compositionend() {
692
+ this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20), this.composing = 0;
693
+ }
694
+ } }), windows = typeof navigator == "object" && /* @__PURE__ */ /Win/.test(navigator.platform), commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.domEventHandlers({ keydown(i8, N) {
695
+ let P = N.state.field(completionState, false);
696
+ if (!P || !P.open || P.open.disabled || P.open.selected < 0 || i8.key.length > 1 || i8.ctrlKey && !(windows && i8.altKey) || i8.metaKey) return false;
697
+ let F = P.open.options[P.open.selected], I = P.active.find((i9) => i9.source == F.source), L = F.completion.commitCharacters || I.result.commitCharacters;
698
+ return L && L.indexOf(i8.key) > -1 && applyCompletion(N, F), false;
699
+ } })), baseTheme = /* @__PURE__ */ EditorView.baseTheme({
700
+ ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
701
+ fontFamily: "monospace",
702
+ whiteSpace: "nowrap",
703
+ overflow: "hidden auto",
704
+ maxWidth_fallback: "700px",
705
+ maxWidth: "min(700px, 95vw)",
706
+ minWidth: "250px",
707
+ maxHeight: "10em",
708
+ height: "100%",
709
+ listStyle: "none",
710
+ margin: 0,
711
+ padding: 0,
712
+ "& > li, & > completion-section": {
713
+ padding: "1px 3px",
714
+ lineHeight: 1.2
715
+ },
716
+ "& > li": {
717
+ overflowX: "hidden",
718
+ textOverflow: "ellipsis",
719
+ cursor: "pointer"
720
+ },
721
+ "& > completion-section": {
722
+ display: "list-item",
723
+ borderBottom: "1px solid silver",
724
+ paddingLeft: "0.5em",
725
+ opacity: 0.7
726
+ }
727
+ } },
728
+ "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
729
+ background: "#17c",
730
+ color: "white"
731
+ },
732
+ "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#777" },
733
+ "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
734
+ background: "#347",
735
+ color: "white"
736
+ },
737
+ "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": { background: "#444" },
738
+ ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
739
+ content: '"\xB7\xB7\xB7"',
740
+ opacity: 0.5,
741
+ display: "block",
742
+ textAlign: "center"
743
+ },
744
+ ".cm-tooltip.cm-completionInfo": {
745
+ position: "absolute",
746
+ padding: "3px 9px",
747
+ width: "max-content",
748
+ maxWidth: "400px",
749
+ boxSizing: "border-box",
750
+ whiteSpace: "pre-line"
751
+ },
752
+ ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
753
+ ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
754
+ ".cm-completionInfo.cm-completionInfo-left-narrow": { right: "30px" },
755
+ ".cm-completionInfo.cm-completionInfo-right-narrow": { left: "30px" },
756
+ "&light .cm-snippetField": { backgroundColor: "#00000022" },
757
+ "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
758
+ ".cm-snippetFieldPosition": {
759
+ verticalAlign: "text-top",
760
+ width: 0,
761
+ height: "1.15em",
762
+ display: "inline-block",
763
+ margin: "0 -0.7px -.7em",
764
+ borderLeft: "1.4px dotted #888"
765
+ },
766
+ ".cm-completionMatchedText": { textDecoration: "underline" },
767
+ ".cm-completionDetail": {
768
+ marginLeft: "0.5em",
769
+ fontStyle: "italic"
770
+ },
771
+ ".cm-completionIcon": {
772
+ fontSize: "90%",
773
+ width: ".8em",
774
+ display: "inline-block",
775
+ textAlign: "center",
776
+ paddingRight: ".6em",
777
+ opacity: "0.6",
778
+ boxSizing: "content-box"
779
+ },
780
+ ".cm-completionIcon-function, .cm-completionIcon-method": { "&:after": { content: "'\u0192'" } },
781
+ ".cm-completionIcon-class": { "&:after": { content: "'\u25CB'" } },
782
+ ".cm-completionIcon-interface": { "&:after": { content: "'\u25CC'" } },
783
+ ".cm-completionIcon-variable": { "&:after": { content: "'\u{1D465}'" } },
784
+ ".cm-completionIcon-constant": { "&:after": { content: "'\u{1D436}'" } },
785
+ ".cm-completionIcon-type": { "&:after": { content: "'\u{1D461}'" } },
786
+ ".cm-completionIcon-enum": { "&:after": { content: "'\u222A'" } },
787
+ ".cm-completionIcon-property": { "&:after": { content: "'\u25A1'" } },
788
+ ".cm-completionIcon-keyword": { "&:after": { content: "'\u{1F511}\uFE0E'" } },
789
+ ".cm-completionIcon-namespace": { "&:after": { content: "'\u25A2'" } },
790
+ ".cm-completionIcon-text": { "&:after": {
791
+ content: "'abc'",
792
+ fontSize: "50%",
793
+ verticalAlign: "middle"
794
+ } }
795
+ }), FieldPos = class {
796
+ constructor(i8, N, P, F) {
797
+ this.field = i8, this.line = N, this.from = P, this.to = F;
798
+ }
799
+ }, FieldRange = class i5 {
800
+ constructor(i8, N, P) {
801
+ this.field = i8, this.from = N, this.to = P;
802
+ }
803
+ map(N) {
804
+ let P = N.mapPos(this.from, -1, MapMode.TrackDel), F = N.mapPos(this.to, 1, MapMode.TrackDel);
805
+ return P == null || F == null ? null : new i5(this.field, P, F);
806
+ }
807
+ }, Snippet = class i6 {
808
+ constructor(i8, N) {
809
+ this.lines = i8, this.fieldPositions = N;
810
+ }
811
+ instantiate(i8, N) {
812
+ let P = [], F = [N], I = i8.doc.lineAt(N), L = /^\s*/.exec(I.text)[0];
813
+ for (let I2 of this.lines) {
814
+ if (P.length) {
815
+ let P2 = L, R = /^\t*/.exec(I2)[0].length;
816
+ for (let N2 = 0; N2 < R; N2++) P2 += i8.facet(indentUnit);
817
+ F.push(N + P2.length - R), I2 = P2 + I2.slice(R);
818
+ }
819
+ P.push(I2), N += I2.length + 1;
820
+ }
821
+ return {
822
+ text: P,
823
+ ranges: this.fieldPositions.map((i9) => new FieldRange(i9.field, F[i9.line] + i9.from, F[i9.line] + i9.to))
824
+ };
825
+ }
826
+ static parse(N) {
827
+ let P = [], F = [], I = [], L;
828
+ for (let i8 of N.split(/\r\n?|\n/)) {
829
+ for (; L = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(i8); ) {
830
+ let N2 = L[1] ? +L[1] : null, R = L[2] || L[3] || "", z = -1, B = R.replace(/\\[{}]/g, (i9) => i9[1]);
831
+ for (let i9 = 0; i9 < P.length; i9++) (N2 == null ? B && P[i9].name == B : P[i9].seq == N2) && (z = i9);
832
+ if (z < 0) {
833
+ let i9 = 0;
834
+ for (; i9 < P.length && (N2 == null || P[i9].seq != null && P[i9].seq < N2); ) i9++;
835
+ P.splice(i9, 0, {
836
+ seq: N2,
837
+ name: B
838
+ }), z = i9;
839
+ for (let i10 of I) i10.field >= z && i10.field++;
840
+ }
841
+ for (let i9 of I) if (i9.line == F.length && i9.from > L.index) {
842
+ let N3 = L[2] ? 3 + (L[1] || "").length : 2;
843
+ i9.from -= N3, i9.to -= N3;
844
+ }
845
+ I.push(new FieldPos(z, F.length, L.index, L.index + B.length)), i8 = i8.slice(0, L.index) + R + i8.slice(L.index + L[0].length);
846
+ }
847
+ i8 = i8.replace(/\\([{}])/g, (i9, N2, P2) => {
848
+ for (let i10 of I) i10.line == F.length && i10.from > P2 && (i10.from--, i10.to--);
849
+ return N2;
850
+ }), F.push(i8);
851
+ }
852
+ return new i6(F, I);
853
+ }
854
+ }, fieldMarker = /* @__PURE__ */ Decoration.widget({ widget: /* @__PURE__ */ new class extends WidgetType {
855
+ toDOM() {
856
+ let i8 = document.createElement("span");
857
+ return i8.className = "cm-snippetFieldPosition", i8;
858
+ }
859
+ ignoreEvent() {
860
+ return false;
861
+ }
862
+ }() }), fieldRange = /* @__PURE__ */ Decoration.mark({ class: "cm-snippetField" }), ActiveSnippet = class i7 {
863
+ constructor(i8, N) {
864
+ this.ranges = i8, this.active = N, this.deco = Decoration.set(i8.map((i9) => (i9.from == i9.to ? fieldMarker : fieldRange).range(i9.from, i9.to)), true);
865
+ }
866
+ map(N) {
867
+ let P = [];
868
+ for (let i8 of this.ranges) {
869
+ let F = i8.map(N);
870
+ if (!F) return null;
871
+ P.push(F);
872
+ }
873
+ return new i7(P, this.active);
874
+ }
875
+ selectionInsideField(i8) {
876
+ return i8.ranges.every((i9) => this.ranges.some((N) => N.field == this.active && N.from <= i9.from && N.to >= i9.to));
877
+ }
878
+ }, setActive = /* @__PURE__ */ StateEffect.define({ map(i8, N) {
879
+ return i8 && i8.map(N);
880
+ } }), moveToField = /* @__PURE__ */ StateEffect.define(), snippetState = /* @__PURE__ */ StateField.define({
881
+ create() {
882
+ return null;
883
+ },
884
+ update(i8, N) {
885
+ for (let P of N.effects) {
886
+ if (P.is(setActive)) return P.value;
887
+ if (P.is(moveToField) && i8) return new ActiveSnippet(i8.ranges, P.value);
888
+ }
889
+ return i8 && N.docChanged && (i8 = i8.map(N.changes)), i8 && N.selection && !i8.selectionInsideField(N.selection) && (i8 = null), i8;
890
+ },
891
+ provide: (i8) => EditorView.decorations.from(i8, (i9) => i9 ? i9.deco : Decoration.none)
892
+ });
893
+ function fieldSelection(i8, N) {
894
+ return EditorSelection.create(i8.filter((i9) => i9.field == N).map((i9) => EditorSelection.range(i9.from, i9.to)));
895
+ }
896
+ function snippet(i8) {
897
+ let N = Snippet.parse(i8);
898
+ return (i9, P, F, I) => {
899
+ let { text: L, ranges: B } = N.instantiate(i9.state, F), { main: V } = i9.state.selection, U = {
900
+ changes: {
901
+ from: F,
902
+ to: I == V.from ? V.to : I,
903
+ insert: Text.of(L)
904
+ },
905
+ scrollIntoView: true,
906
+ annotations: P ? [pickedCompletion.of(P), Transaction.userEvent.of("input.complete")] : void 0
907
+ };
908
+ if (B.length && (U.selection = fieldSelection(B, 0)), B.some((i10) => i10.field > 0)) {
909
+ let N2 = new ActiveSnippet(B, 0), P2 = U.effects = [setActive.of(N2)];
910
+ i9.state.field(snippetState, false) === void 0 && P2.push(StateEffect.appendConfig.of([
911
+ snippetState,
912
+ addSnippetKeymap,
913
+ snippetPointerHandler,
914
+ baseTheme
915
+ ]));
916
+ }
917
+ i9.dispatch(i9.state.update(U));
918
+ };
919
+ }
920
+ function moveField(i8) {
921
+ return ({ state: N, dispatch: P }) => {
922
+ let F = N.field(snippetState, false);
923
+ if (!F || i8 < 0 && F.active == 0) return false;
924
+ let I = F.active + i8, L = i8 > 0 && !F.ranges.some((N2) => N2.field == I + i8);
925
+ return P(N.update({
926
+ selection: fieldSelection(F.ranges, I),
927
+ effects: setActive.of(L ? null : new ActiveSnippet(F.ranges, I)),
928
+ scrollIntoView: true
929
+ })), true;
930
+ };
931
+ }
932
+ var defaultSnippetKeymap = [{
933
+ key: "Tab",
934
+ run: /* @__PURE__ */ moveField(1),
935
+ shift: /* @__PURE__ */ moveField(-1)
936
+ }, {
937
+ key: "Escape",
938
+ run: ({ state: i8, dispatch: N }) => i8.field(snippetState, false) ? (N(i8.update({ effects: setActive.of(null) })), true) : false
939
+ }], snippetKeymap = /* @__PURE__ */ Facet.define({ combine(i8) {
940
+ return i8.length ? i8[0] : defaultSnippetKeymap;
941
+ } }), addSnippetKeymap = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.compute([snippetKeymap], (i8) => i8.facet(snippetKeymap)));
942
+ function snippetCompletion(i8, N) {
943
+ return {
944
+ ...N,
945
+ apply: snippet(i8)
946
+ };
947
+ }
948
+ var snippetPointerHandler = /* @__PURE__ */ EditorView.domEventHandlers({ mousedown(i8, N) {
949
+ let P = N.state.field(snippetState, false), F;
950
+ if (!P || (F = N.posAtCoords({
951
+ x: i8.clientX,
952
+ y: i8.clientY
953
+ })) == null) return false;
954
+ let I = P.ranges.find((i9) => i9.from <= F && i9.to >= F);
955
+ return !I || I.field == P.active ? false : (N.dispatch({
956
+ selection: fieldSelection(P.ranges, I.field),
957
+ effects: setActive.of(P.ranges.some((i9) => i9.field > I.field) ? new ActiveSnippet(P.ranges, I.field) : null),
958
+ scrollIntoView: true
959
+ }), true);
960
+ } }), defaults = {
961
+ brackets: [
962
+ "(",
963
+ "[",
964
+ "{",
965
+ "'",
966
+ '"'
967
+ ],
968
+ before: ")]}:;>",
969
+ stringPrefixes: []
970
+ }, closeBracketEffect = /* @__PURE__ */ StateEffect.define({ map(i8, N) {
971
+ return N.mapPos(i8, -1, MapMode.TrackAfter) ?? void 0;
972
+ } }), closedBracket = /* @__PURE__ */ new class extends RangeValue {
973
+ }();
974
+ closedBracket.startSide = 1, closedBracket.endSide = -1;
975
+ var bracketState = /* @__PURE__ */ StateField.define({
976
+ create() {
977
+ return RangeSet.empty;
978
+ },
979
+ update(i8, N) {
980
+ if (i8 = i8.map(N.changes), N.selection) {
981
+ let P = N.state.doc.lineAt(N.selection.main.head);
982
+ i8 = i8.update({ filter: (i9) => i9 >= P.from && i9 <= P.to });
983
+ }
984
+ for (let P of N.effects) P.is(closeBracketEffect) && (i8 = i8.update({ add: [closedBracket.range(P.value, P.value + 1)] }));
985
+ return i8;
986
+ }
987
+ });
988
+ function closeBrackets() {
989
+ return [inputHandler, bracketState];
990
+ }
991
+ var definedClosing = "()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";
992
+ function closing(i8) {
993
+ for (let N = 0; N < 16; N += 2) if (definedClosing.charCodeAt(N) == i8) return definedClosing.charAt(N + 1);
994
+ return fromCodePoint(i8 < 128 ? i8 : i8 + 1);
995
+ }
996
+ function config(i8, N) {
997
+ return i8.languageDataAt("closeBrackets", N)[0] || defaults;
998
+ }
999
+ var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), inputHandler = /* @__PURE__ */ EditorView.inputHandler.of((i8, N, P, F) => {
1000
+ if ((android ? i8.composing : i8.compositionStarted) || i8.state.readOnly) return false;
1001
+ let I = i8.state.selection.main;
1002
+ if (F.length > 2 || F.length == 2 && codePointSize(codePointAt(F, 0)) == 1 || N != I.from || P != I.to) return false;
1003
+ let L = insertBracket(i8.state, F);
1004
+ return L ? (i8.dispatch(L), true) : false;
1005
+ }), closeBracketsKeymap = [{
1006
+ key: "Backspace",
1007
+ run: ({ state: i8, dispatch: N }) => {
1008
+ if (i8.readOnly) return false;
1009
+ let P = config(i8, i8.selection.main.head).brackets || defaults.brackets, I = null, L = i8.changeByRange((N2) => {
1010
+ if (N2.empty) {
1011
+ let I2 = prevChar(i8.doc, N2.head);
1012
+ for (let L2 of P) if (L2 == I2 && nextChar(i8.doc, N2.head) == closing(codePointAt(L2, 0))) return {
1013
+ changes: {
1014
+ from: N2.head - L2.length,
1015
+ to: N2.head + L2.length
1016
+ },
1017
+ range: EditorSelection.cursor(N2.head - L2.length)
1018
+ };
1019
+ }
1020
+ return { range: I = N2 };
1021
+ });
1022
+ return I || N(i8.update(L, {
1023
+ scrollIntoView: true,
1024
+ userEvent: "delete.backward"
1025
+ })), !I;
1026
+ }
1027
+ }];
1028
+ function insertBracket(i8, N) {
1029
+ let P = config(i8, i8.selection.main.head), F = P.brackets || defaults.brackets;
1030
+ for (let I of F) {
1031
+ let L = closing(codePointAt(I, 0));
1032
+ if (N == I) return L == I ? handleSame(i8, I, F.indexOf(I + I + I) > -1, P) : handleOpen(i8, I, L, P.before || defaults.before);
1033
+ if (N == L && closedBracketAt(i8, i8.selection.main.from)) return handleClose(i8, I, L);
1034
+ }
1035
+ return null;
1036
+ }
1037
+ function closedBracketAt(i8, N) {
1038
+ let P = false;
1039
+ return i8.field(bracketState).between(0, i8.doc.length, (i9) => {
1040
+ i9 == N && (P = true);
1041
+ }), P;
1042
+ }
1043
+ function nextChar(i8, N) {
1044
+ let P = i8.sliceString(N, N + 2);
1045
+ return P.slice(0, codePointSize(codePointAt(P, 0)));
1046
+ }
1047
+ function prevChar(i8, N) {
1048
+ let P = i8.sliceString(N - 2, N);
1049
+ return codePointSize(codePointAt(P, 0)) == P.length ? P : P.slice(1);
1050
+ }
1051
+ function handleOpen(i8, N, P, I) {
1052
+ let L = null, R = i8.changeByRange((R2) => {
1053
+ if (!R2.empty) return {
1054
+ changes: [{
1055
+ insert: N,
1056
+ from: R2.from
1057
+ }, {
1058
+ insert: P,
1059
+ from: R2.to
1060
+ }],
1061
+ effects: closeBracketEffect.of(R2.to + N.length),
1062
+ range: EditorSelection.range(R2.anchor + N.length, R2.head + N.length)
1063
+ };
1064
+ let z = nextChar(i8.doc, R2.head);
1065
+ return !z || /\s/.test(z) || I.indexOf(z) > -1 ? {
1066
+ changes: {
1067
+ insert: N + P,
1068
+ from: R2.head
1069
+ },
1070
+ effects: closeBracketEffect.of(R2.head + N.length),
1071
+ range: EditorSelection.cursor(R2.head + N.length)
1072
+ } : { range: L = R2 };
1073
+ });
1074
+ return L ? null : i8.update(R, {
1075
+ scrollIntoView: true,
1076
+ userEvent: "input.type"
1077
+ });
1078
+ }
1079
+ function handleClose(i8, N, P) {
1080
+ let I = null, L = i8.changeByRange((N2) => N2.empty && nextChar(i8.doc, N2.head) == P ? {
1081
+ changes: {
1082
+ from: N2.head,
1083
+ to: N2.head + P.length,
1084
+ insert: P
1085
+ },
1086
+ range: EditorSelection.cursor(N2.head + P.length)
1087
+ } : I = { range: N2 });
1088
+ return I ? null : i8.update(L, {
1089
+ scrollIntoView: true,
1090
+ userEvent: "input.type"
1091
+ });
1092
+ }
1093
+ function handleSame(i8, N, P, I) {
1094
+ let L = I.stringPrefixes || defaults.stringPrefixes, R = null, z = i8.changeByRange((I2) => {
1095
+ if (!I2.empty) return {
1096
+ changes: [{
1097
+ insert: N,
1098
+ from: I2.from
1099
+ }, {
1100
+ insert: N,
1101
+ from: I2.to
1102
+ }],
1103
+ effects: closeBracketEffect.of(I2.to + N.length),
1104
+ range: EditorSelection.range(I2.anchor + N.length, I2.head + N.length)
1105
+ };
1106
+ let z2 = I2.head, B = nextChar(i8.doc, z2), V;
1107
+ if (B == N) {
1108
+ if (nodeStart(i8, z2)) return {
1109
+ changes: {
1110
+ insert: N + N,
1111
+ from: z2
1112
+ },
1113
+ effects: closeBracketEffect.of(z2 + N.length),
1114
+ range: EditorSelection.cursor(z2 + N.length)
1115
+ };
1116
+ if (closedBracketAt(i8, z2)) {
1117
+ let I3 = P && i8.sliceDoc(z2, z2 + N.length * 3) == N + N + N ? N + N + N : N;
1118
+ return {
1119
+ changes: {
1120
+ from: z2,
1121
+ to: z2 + I3.length,
1122
+ insert: I3
1123
+ },
1124
+ range: EditorSelection.cursor(z2 + I3.length)
1125
+ };
1126
+ }
1127
+ } else if (P && i8.sliceDoc(z2 - 2 * N.length, z2) == N + N && (V = canStartStringAt(i8, z2 - 2 * N.length, L)) > -1 && nodeStart(i8, V)) return {
1128
+ changes: {
1129
+ insert: N + N + N + N,
1130
+ from: z2
1131
+ },
1132
+ effects: closeBracketEffect.of(z2 + N.length),
1133
+ range: EditorSelection.cursor(z2 + N.length)
1134
+ };
1135
+ else if (i8.charCategorizer(z2)(B) != CharCategory.Word && canStartStringAt(i8, z2, L) > -1 && !probablyInString(i8, z2, N, L)) return {
1136
+ changes: {
1137
+ insert: N + N,
1138
+ from: z2
1139
+ },
1140
+ effects: closeBracketEffect.of(z2 + N.length),
1141
+ range: EditorSelection.cursor(z2 + N.length)
1142
+ };
1143
+ return { range: R = I2 };
1144
+ });
1145
+ return R ? null : i8.update(z, {
1146
+ scrollIntoView: true,
1147
+ userEvent: "input.type"
1148
+ });
1149
+ }
1150
+ function nodeStart(i8, N) {
1151
+ let P = syntaxTree(i8).resolveInner(N + 1);
1152
+ return P.parent && P.from == N;
1153
+ }
1154
+ function probablyInString(i8, N, P, F) {
1155
+ let I = syntaxTree(i8).resolveInner(N, -1), R = F.reduce((i9, N2) => Math.max(i9, N2.length), 0);
1156
+ for (let L = 0; L < 5; L++) {
1157
+ let L2 = i8.sliceDoc(I.from, Math.min(I.to, I.from + P.length + R)), z = L2.indexOf(P);
1158
+ if (!z || z > -1 && F.indexOf(L2.slice(0, z)) > -1) {
1159
+ let N2 = I.firstChild;
1160
+ for (; N2 && N2.from == I.from && N2.to - N2.from > P.length + z; ) {
1161
+ if (i8.sliceDoc(N2.to - P.length, N2.to) == P) return false;
1162
+ N2 = N2.firstChild;
1163
+ }
1164
+ return true;
1165
+ }
1166
+ let B = I.to == N && I.parent;
1167
+ if (!B) break;
1168
+ I = B;
1169
+ }
1170
+ return false;
1171
+ }
1172
+ function canStartStringAt(i8, N, P) {
1173
+ let F = i8.charCategorizer(N);
1174
+ if (F(i8.sliceDoc(N - 1, N)) != CharCategory.Word) return N;
1175
+ for (let I of P) {
1176
+ let P2 = N - I.length;
1177
+ if (i8.sliceDoc(P2, N) == I && F(i8.sliceDoc(P2 - 1, P2)) != CharCategory.Word) return P2;
1178
+ }
1179
+ return -1;
1180
+ }
1181
+ function autocompletion(i8 = {}) {
1182
+ return [
1183
+ commitCharacters,
1184
+ completionState,
1185
+ completionConfig.of(i8),
1186
+ completionPlugin,
1187
+ completionKeymapExt,
1188
+ baseTheme
1189
+ ];
1190
+ }
1191
+ var completionKeymap = [
1192
+ {
1193
+ key: "Ctrl-Space",
1194
+ run: startCompletion
1195
+ },
1196
+ {
1197
+ mac: "Alt-`",
1198
+ run: startCompletion
1199
+ },
1200
+ {
1201
+ mac: "Alt-i",
1202
+ run: startCompletion
1203
+ },
1204
+ {
1205
+ key: "Escape",
1206
+ run: closeCompletion
1207
+ },
1208
+ {
1209
+ key: "ArrowDown",
1210
+ run: /* @__PURE__ */ moveCompletionSelection(true)
1211
+ },
1212
+ {
1213
+ key: "ArrowUp",
1214
+ run: /* @__PURE__ */ moveCompletionSelection(false)
1215
+ },
1216
+ {
1217
+ key: "PageDown",
1218
+ run: /* @__PURE__ */ moveCompletionSelection(true, "page")
1219
+ },
1220
+ {
1221
+ key: "PageUp",
1222
+ run: /* @__PURE__ */ moveCompletionSelection(false, "page")
1223
+ },
1224
+ {
1225
+ key: "Enter",
1226
+ run: acceptCompletion
1227
+ }
1228
+ ], completionKeymapExt = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.computeN([completionConfig], (i8) => i8.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));
1229
+ export {
1230
+ closeBracketsKeymap as a,
1231
+ completionKeymap as c,
1232
+ snippet as d,
1233
+ snippetCompletion as f,
1234
+ closeBrackets as i,
1235
+ ifNotIn as l,
1236
+ acceptCompletion as n,
1237
+ closeCompletion as o,
1238
+ autocompletion as r,
1239
+ completeFromList as s,
1240
+ CompletionContext as t,
1241
+ insertCompletionText as u
1242
+ };