@powerhousedao/connect 1.0.0 → 1.0.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/LICENSE +661 -0
  2. package/dist/.env +11 -6
  3. package/dist/assets/app-CDyci3gH.js +79796 -0
  4. package/dist/assets/app-CYjeY4R-.css +5715 -0
  5. package/dist/assets/app-loader-CrrV0_f9.js +31458 -0
  6. package/dist/assets/app-loader-DC8DXqh9.css +5608 -0
  7. package/dist/assets/ccip-D3crAAb6.js +170 -0
  8. package/dist/assets/connect-loader-CvOC68Ih.mp4 +0 -0
  9. package/dist/assets/content-BCSN7ap3.js +3967 -0
  10. package/dist/assets/home-bg-BEhF9NuW.png +0 -0
  11. package/dist/assets/index-BomSBpCj.js +12 -0
  12. package/dist/assets/index-CvT8Fjzs.js +2560 -0
  13. package/dist/assets/index-gSAUFVts.js +46565 -0
  14. package/dist/assets/main.-_7fbZHa.js +105 -0
  15. package/dist/assets/powerhouse-rounded-CeKGGUG4.png +0 -0
  16. package/dist/assets/renown-short-hover-BiSLBV7L.png +0 -0
  17. package/dist/assets/rwa-report-Bb0W5-ac.png +0 -0
  18. package/dist/assets/style-Ce3V83BE.css +1658 -0
  19. package/dist/external-packages.js +5 -0
  20. package/dist/hmr.js +4 -0
  21. package/dist/icon.ico +0 -0
  22. package/dist/index.html +48 -10
  23. package/dist/modules/@powerhousedao/reactor-browser/chunk-2ESYSVXG.js +48 -0
  24. package/dist/modules/@powerhousedao/reactor-browser/chunk-2ONJ2PX4.js +50 -0
  25. package/dist/modules/@powerhousedao/reactor-browser/chunk-2X2M6BYG.js +2542 -0
  26. package/dist/modules/@powerhousedao/reactor-browser/chunk-6MBHOHAA.js +2513 -0
  27. package/dist/modules/@powerhousedao/reactor-browser/chunk-7OQWVUC5.js +43 -0
  28. package/dist/modules/@powerhousedao/reactor-browser/chunk-C7QRY43M.js +786 -0
  29. package/dist/modules/@powerhousedao/reactor-browser/chunk-CO2RVWYY.js +67 -0
  30. package/dist/modules/@powerhousedao/reactor-browser/chunk-DKDARAJS.js +0 -0
  31. package/dist/modules/@powerhousedao/reactor-browser/chunk-FQF4YAVC.js +11917 -0
  32. package/dist/modules/@powerhousedao/reactor-browser/chunk-GDP7BUIH.js +45 -0
  33. package/dist/modules/@powerhousedao/reactor-browser/chunk-IC6B3767.js +82 -0
  34. package/dist/modules/@powerhousedao/reactor-browser/chunk-IQTSFTNF.js +48 -0
  35. package/dist/modules/@powerhousedao/reactor-browser/chunk-J5TYPY7U.js +36 -0
  36. package/dist/modules/@powerhousedao/reactor-browser/chunk-LH2T6NLN.js +0 -0
  37. package/dist/modules/@powerhousedao/reactor-browser/chunk-LRNZZ3SR.js +14 -0
  38. package/dist/modules/@powerhousedao/reactor-browser/chunk-N5UNGAA6.js +14051 -0
  39. package/dist/modules/@powerhousedao/reactor-browser/chunk-NHD6VUCD.js +53 -0
  40. package/dist/modules/@powerhousedao/reactor-browser/chunk-OVGOA2P5.js +11 -0
  41. package/dist/modules/@powerhousedao/reactor-browser/chunk-OYYVE7RP.js +178 -0
  42. package/dist/modules/@powerhousedao/reactor-browser/chunk-P6NJ6IAQ.js +12 -0
  43. package/dist/modules/@powerhousedao/reactor-browser/chunk-QXHTR6KF.js +0 -0
  44. package/dist/modules/@powerhousedao/reactor-browser/chunk-RGIB4DD4.js +162 -0
  45. package/dist/modules/@powerhousedao/reactor-browser/chunk-U34SEKEB.js +250 -0
  46. package/dist/modules/@powerhousedao/reactor-browser/chunk-U36SV333.js +0 -0
  47. package/dist/modules/@powerhousedao/reactor-browser/chunk-UDKYG6I4.js +113 -0
  48. package/dist/modules/@powerhousedao/reactor-browser/chunk-XBTEGV5M.js +17 -0
  49. package/dist/modules/@powerhousedao/reactor-browser/chunk-Y7NTRTMT.js +25 -0
  50. package/dist/modules/@powerhousedao/reactor-browser/chunk-YG67WAIS.js +0 -0
  51. package/dist/modules/@powerhousedao/reactor-browser/chunk-YWKVPJNL.js +52 -0
  52. package/dist/modules/@powerhousedao/reactor-browser/chunk-ZL5IPB6D.js +0 -0
  53. package/dist/modules/@powerhousedao/reactor-browser/context/index.js +16 -0
  54. package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +15 -0
  55. package/dist/modules/@powerhousedao/reactor-browser/crypto/browser.js +7 -0
  56. package/dist/modules/@powerhousedao/reactor-browser/crypto/index.js +7 -0
  57. package/dist/modules/@powerhousedao/reactor-browser/document-model.js +10 -0
  58. package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js +96 -0
  59. package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +98 -0
  60. package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +11 -0
  61. package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +12 -0
  62. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocument.js +7 -0
  63. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDispatch.js +7 -0
  64. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +13 -0
  65. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +20 -0
  66. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +9 -0
  67. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +14 -0
  68. package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveContext.js +9 -0
  69. package/dist/modules/@powerhousedao/reactor-browser/hooks/useUiNodesContext.js +46 -0
  70. package/dist/modules/@powerhousedao/reactor-browser/hooks/useUserPermissions.js +7 -0
  71. package/dist/modules/@powerhousedao/reactor-browser/index.js +125 -0
  72. package/dist/modules/@powerhousedao/reactor-browser/reactor.js +11 -0
  73. package/dist/modules/@powerhousedao/reactor-browser/renown/constants.js +53 -0
  74. package/dist/modules/@powerhousedao/reactor-browser/renown/types.js +1 -0
  75. package/dist/modules/@powerhousedao/reactor-browser/storage/index.js +1 -0
  76. package/dist/modules/@powerhousedao/reactor-browser/storage/types.js +1 -0
  77. package/dist/modules/@powerhousedao/reactor-browser/uiNodes/constants.js +37 -0
  78. package/dist/modules/@powerhousedao/reactor-browser/uiNodes/types.js +1 -0
  79. package/dist/modules/@powerhousedao/reactor-browser/utils/export-document.js +8 -0
  80. package/dist/modules/@powerhousedao/reactor-browser/utils/index.js +9 -0
  81. package/dist/modules/@powerhousedao/reactor-browser/utils/signature.js +10 -0
  82. package/dist/service-worker.js +46 -2
  83. package/dist/swEnv.js +9 -8
  84. package/dist/vite-envs.sh +56 -35
  85. package/nginx.conf +93 -0
  86. package/nginx.sh +10 -0
  87. package/package.json +35 -52
  88. package/dist/assets/ArrowFilledRight-BXP1j8Cl.js +0 -2
  89. package/dist/assets/ArrowFilledRight-BXP1j8Cl.js.map +0 -1
  90. package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js +0 -2
  91. package/dist/assets/ArrowFilledRight-blx8xu7X-D3d8PUWh.js.map +0 -1
  92. package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js +0 -2
  93. package/dist/assets/ArrowLeft-7pYNK4eX-8ZR_YHAJ.js.map +0 -1
  94. package/dist/assets/ArrowLeft-8ZR_YHAJ.js +0 -2
  95. package/dist/assets/ArrowLeft-8ZR_YHAJ.js.map +0 -1
  96. package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js +0 -2
  97. package/dist/assets/ArrowUp-Bbr_dwo_-C5ppCQo4.js.map +0 -1
  98. package/dist/assets/ArrowUp-E2jS6Wzt.js +0 -2
  99. package/dist/assets/ArrowUp-E2jS6Wzt.js.map +0 -1
  100. package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js +0 -2
  101. package/dist/assets/BarChart-B0G05Nfd-CHDJ7OaJ.js.map +0 -1
  102. package/dist/assets/BarChart-C-E6t7dt.js +0 -2
  103. package/dist/assets/BarChart-C-E6t7dt.js.map +0 -1
  104. package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js +0 -2
  105. package/dist/assets/BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js.map +0 -1
  106. package/dist/assets/BaseArrowLeft-DtHrkTW4.js +0 -2
  107. package/dist/assets/BaseArrowLeft-DtHrkTW4.js.map +0 -1
  108. package/dist/assets/BaseArrowRight-BIwzFHnh.js +0 -2
  109. package/dist/assets/BaseArrowRight-BIwzFHnh.js.map +0 -1
  110. package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js +0 -2
  111. package/dist/assets/BaseArrowRight-DYQTBWAs-CkkPllYm.js.map +0 -1
  112. package/dist/assets/Braces-3LcexUsR.js +0 -2
  113. package/dist/assets/Braces-3LcexUsR.js.map +0 -1
  114. package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js +0 -2
  115. package/dist/assets/Braces-N-sH2Zyc-3LcexUsR.js.map +0 -1
  116. package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js +0 -2
  117. package/dist/assets/Branch-CWdBw1_P-CmGdOXsI.js.map +0 -1
  118. package/dist/assets/Branch-D0CssEh3.js +0 -2
  119. package/dist/assets/Branch-D0CssEh3.js.map +0 -1
  120. package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js +0 -2
  121. package/dist/assets/BrickGlobe-67zaG6_H-DP0By6z_.js.map +0 -1
  122. package/dist/assets/BrickGlobe-CdHw7ZVP.js +0 -2
  123. package/dist/assets/BrickGlobe-CdHw7ZVP.js.map +0 -1
  124. package/dist/assets/Briefcase-CV2bgnSj.js +0 -2
  125. package/dist/assets/Briefcase-CV2bgnSj.js.map +0 -1
  126. package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js +0 -2
  127. package/dist/assets/Briefcase-CedW3KRR-DO5_k15F.js.map +0 -1
  128. package/dist/assets/Calendar-C-6HV96D-YetudWvP.js +0 -2
  129. package/dist/assets/Calendar-C-6HV96D-YetudWvP.js.map +0 -1
  130. package/dist/assets/Calendar-DuXN-sPt.js +0 -2
  131. package/dist/assets/Calendar-DuXN-sPt.js.map +0 -1
  132. package/dist/assets/CalendarTime-Bhjzlgn_-BVlYgNLL.js +0 -2
  133. package/dist/assets/CalendarTime-Bhjzlgn_-BVlYgNLL.js.map +0 -1
  134. package/dist/assets/CalendarTime-BowYBiVM.js +0 -2
  135. package/dist/assets/CalendarTime-BowYBiVM.js.map +0 -1
  136. package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js +0 -2
  137. package/dist/assets/Caret-Ep0j0fz2-By3ojfim.js.map +0 -1
  138. package/dist/assets/Caret-r16V7Hcs.js +0 -2
  139. package/dist/assets/Caret-r16V7Hcs.js.map +0 -1
  140. package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js +0 -2
  141. package/dist/assets/CaretDown-3X7LFYBf-C43xdKg8.js.map +0 -1
  142. package/dist/assets/CaretDown-DljrBfIz.js +0 -2
  143. package/dist/assets/CaretDown-DljrBfIz.js.map +0 -1
  144. package/dist/assets/CaretLeft-B_Lzd_Rn.js +0 -2
  145. package/dist/assets/CaretLeft-B_Lzd_Rn.js.map +0 -1
  146. package/dist/assets/CaretLeft-Df3E-68c-wke5zKLt.js +0 -2
  147. package/dist/assets/CaretLeft-Df3E-68c-wke5zKLt.js.map +0 -1
  148. package/dist/assets/CaretRight-Bbz5nCpg.js +0 -2
  149. package/dist/assets/CaretRight-Bbz5nCpg.js.map +0 -1
  150. package/dist/assets/CaretRight-DSVWUSka-Cx0Mkcqa.js +0 -2
  151. package/dist/assets/CaretRight-DSVWUSka-Cx0Mkcqa.js.map +0 -1
  152. package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js +0 -2
  153. package/dist/assets/CaretSort-BkGdLETT-DVOzEEqR.js.map +0 -1
  154. package/dist/assets/CaretSort-DSgBum1h.js +0 -2
  155. package/dist/assets/CaretSort-DSgBum1h.js.map +0 -1
  156. package/dist/assets/Check-CbV9BYHY.js +0 -2
  157. package/dist/assets/Check-CbV9BYHY.js.map +0 -1
  158. package/dist/assets/Check-DV-U4AEq-B582NMZp.js +0 -2
  159. package/dist/assets/Check-DV-U4AEq-B582NMZp.js.map +0 -1
  160. package/dist/assets/CheckCircle-CX2jIKoF.js +0 -2
  161. package/dist/assets/CheckCircle-CX2jIKoF.js.map +0 -1
  162. package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js +0 -2
  163. package/dist/assets/CheckCircle-DI5fEgGd-CVF4LDhR.js.map +0 -1
  164. package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js +0 -2
  165. package/dist/assets/CheckCircleFill-C-F0v5mB-BSW1YMqM.js.map +0 -1
  166. package/dist/assets/CheckCircleFill-DLK12sW5.js +0 -2
  167. package/dist/assets/CheckCircleFill-DLK12sW5.js.map +0 -1
  168. package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js +0 -2
  169. package/dist/assets/Checkmark-BXnfChpo-CyQitGI2.js.map +0 -1
  170. package/dist/assets/Checkmark-DBvUEZAd.js +0 -2
  171. package/dist/assets/Checkmark-DBvUEZAd.js.map +0 -1
  172. package/dist/assets/ChevronDown-eUsCPXcB.js +0 -2
  173. package/dist/assets/ChevronDown-eUsCPXcB.js.map +0 -1
  174. package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js +0 -2
  175. package/dist/assets/ChevronDown-ouBxrU-k-eUsCPXcB.js.map +0 -1
  176. package/dist/assets/Circle-8dOehHQf.js +0 -2
  177. package/dist/assets/Circle-8dOehHQf.js.map +0 -1
  178. package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js +0 -2
  179. package/dist/assets/Circle-n3-Wh4HS-8dOehHQf.js.map +0 -1
  180. package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js +0 -2
  181. package/dist/assets/CircleInfo-BhZY3C2Q-CZgYK1h2.js.map +0 -1
  182. package/dist/assets/CircleInfo-D0ktZDko.js +0 -2
  183. package/dist/assets/CircleInfo-D0ktZDko.js.map +0 -1
  184. package/dist/assets/Clock-CudavWaE.js +0 -2
  185. package/dist/assets/Clock-CudavWaE.js.map +0 -1
  186. package/dist/assets/Clock-DF-XMxha-CudavWaE.js +0 -2
  187. package/dist/assets/Clock-DF-XMxha-CudavWaE.js.map +0 -1
  188. package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js +0 -2
  189. package/dist/assets/ClockFill-Bd0t48q7-CcfHiJtH.js.map +0 -1
  190. package/dist/assets/ClockFill-yWs52y_e.js +0 -2
  191. package/dist/assets/ClockFill-yWs52y_e.js.map +0 -1
  192. package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js +0 -2
  193. package/dist/assets/CloudSlash-B-zJBjaD-CxVyp-Ac.js.map +0 -1
  194. package/dist/assets/CloudSlash-D18Hl3VW.js +0 -2
  195. package/dist/assets/CloudSlash-D18Hl3VW.js.map +0 -1
  196. package/dist/assets/Collapse-BOxZH5-e.js +0 -2
  197. package/dist/assets/Collapse-BOxZH5-e.js.map +0 -1
  198. package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js +0 -2
  199. package/dist/assets/Collapse-DRDB8Czs-CGcuZQgy.js.map +0 -1
  200. package/dist/assets/Connect-Dme-qfKq-CgniLji8.js +0 -2
  201. package/dist/assets/Connect-Dme-qfKq-CgniLji8.js.map +0 -1
  202. package/dist/assets/Connect-laqJZT3s.js +0 -2
  203. package/dist/assets/Connect-laqJZT3s.js.map +0 -1
  204. package/dist/assets/Copy-CkOtWZ6m.js +0 -2
  205. package/dist/assets/Copy-CkOtWZ6m.js.map +0 -1
  206. package/dist/assets/Copy-ms9-7m7Y-CkOtWZ6m.js +0 -2
  207. package/dist/assets/Copy-ms9-7m7Y-CkOtWZ6m.js.map +0 -1
  208. package/dist/assets/CrossCircle-B6ZawoOx-z5-kkOo3.js +0 -2
  209. package/dist/assets/CrossCircle-B6ZawoOx-z5-kkOo3.js.map +0 -1
  210. package/dist/assets/CrossCircle-Bp9diEe9.js +0 -2
  211. package/dist/assets/CrossCircle-Bp9diEe9.js.map +0 -1
  212. package/dist/assets/Danger-CLu7nxgz.js +0 -2
  213. package/dist/assets/Danger-CLu7nxgz.js.map +0 -1
  214. package/dist/assets/Danger-KM8BZjue-CLu7nxgz.js +0 -2
  215. package/dist/assets/Danger-KM8BZjue-CLu7nxgz.js.map +0 -1
  216. package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js +0 -2
  217. package/dist/assets/Discord-CAS0Cj7s-CcsBWpnf.js.map +0 -1
  218. package/dist/assets/Discord-CcPWRT8g.js +0 -2
  219. package/dist/assets/Discord-CcPWRT8g.js.map +0 -1
  220. package/dist/assets/Drive-CzahDx9j.js +0 -2
  221. package/dist/assets/Drive-CzahDx9j.js.map +0 -1
  222. package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js +0 -2
  223. package/dist/assets/Drive-GMcgBcIY-CzahDx9j.js.map +0 -1
  224. package/dist/assets/Edit-D9GlgGu8.js +0 -2
  225. package/dist/assets/Edit-D9GlgGu8.js.map +0 -1
  226. package/dist/assets/Edit-Dr-ZiMSE-D9GlgGu8.js +0 -2
  227. package/dist/assets/Edit-Dr-ZiMSE-D9GlgGu8.js.map +0 -1
  228. package/dist/assets/Ellipsis-DWNUJYUI.js +0 -2
  229. package/dist/assets/Ellipsis-DWNUJYUI.js.map +0 -1
  230. package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js +0 -2
  231. package/dist/assets/Ellipsis-XK8AwMEC-BuVBeYhB.js.map +0 -1
  232. package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js +0 -2
  233. package/dist/assets/Error-BmIZ2ZUy-CphzuMLn.js.map +0 -1
  234. package/dist/assets/Error-FBAhqFT5.js +0 -2
  235. package/dist/assets/Error-FBAhqFT5.js.map +0 -1
  236. package/dist/assets/Exclamation-BGFGsVRw.js +0 -2
  237. package/dist/assets/Exclamation-BGFGsVRw.js.map +0 -1
  238. package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js +0 -2
  239. package/dist/assets/Exclamation-CVsNS_QS-DLccamql.js.map +0 -1
  240. package/dist/assets/File-Ba7ClyaL-BU1g1wjO.js +0 -2
  241. package/dist/assets/File-Ba7ClyaL-BU1g1wjO.js.map +0 -1
  242. package/dist/assets/File-DWKl25DR.js +0 -2
  243. package/dist/assets/File-DWKl25DR.js.map +0 -1
  244. package/dist/assets/FilesEarmark-BTL53WSf.js +0 -2
  245. package/dist/assets/FilesEarmark-BTL53WSf.js.map +0 -1
  246. package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js +0 -2
  247. package/dist/assets/FilesEarmark-CyrCQy8E-Bhut4E02.js.map +0 -1
  248. package/dist/assets/FolderClose-BVMKeKvW.js +0 -2
  249. package/dist/assets/FolderClose-BVMKeKvW.js.map +0 -1
  250. package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js +0 -2
  251. package/dist/assets/FolderClose-DG_qHisc-CH6NoBuu.js.map +0 -1
  252. package/dist/assets/FolderOpen-DT55_X9N.js +0 -2
  253. package/dist/assets/FolderOpen-DT55_X9N.js.map +0 -1
  254. package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js +0 -2
  255. package/dist/assets/FolderOpen-kDoWFkJO-Cciutkdg.js.map +0 -1
  256. package/dist/assets/FolderPlus-C2G5PVs-.js +0 -2
  257. package/dist/assets/FolderPlus-C2G5PVs-.js.map +0 -1
  258. package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js +0 -2
  259. package/dist/assets/FolderPlus-CSBSl9lZ-CifD0ek9.js.map +0 -1
  260. package/dist/assets/Forum-Cfgyizyn.js +0 -2
  261. package/dist/assets/Forum-Cfgyizyn.js.map +0 -1
  262. package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js +0 -2
  263. package/dist/assets/Forum-DZ-CkLFh-BwabccAX.js.map +0 -1
  264. package/dist/assets/Gear-CoQ9O06k.js +0 -2
  265. package/dist/assets/Gear-CoQ9O06k.js.map +0 -1
  266. package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js +0 -2
  267. package/dist/assets/Gear-cUlHJ4q6-B9R2l_9_.js.map +0 -1
  268. package/dist/assets/Github-0PLiINY0-CjkZIHCO.js +0 -2
  269. package/dist/assets/Github-0PLiINY0-CjkZIHCO.js.map +0 -1
  270. package/dist/assets/Github-CjkZIHCO.js +0 -2
  271. package/dist/assets/Github-CjkZIHCO.js.map +0 -1
  272. package/dist/assets/Globe-CIYqVkpa-CL530H46.js +0 -2
  273. package/dist/assets/Globe-CIYqVkpa-CL530H46.js.map +0 -1
  274. package/dist/assets/Globe-Dy2otZRk.js +0 -2
  275. package/dist/assets/Globe-Dy2otZRk.js.map +0 -1
  276. package/dist/assets/GlobeWww-Ci7aa5CE.js +0 -2
  277. package/dist/assets/GlobeWww-Ci7aa5CE.js.map +0 -1
  278. package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js +0 -2
  279. package/dist/assets/GlobeWww-DN4yKujh-Ci7aa5CE.js.map +0 -1
  280. package/dist/assets/Hdd-CP-hFB7d.js +0 -2
  281. package/dist/assets/Hdd-CP-hFB7d.js.map +0 -1
  282. package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js +0 -2
  283. package/dist/assets/Hdd-Dn_LdJIh-CJ6x9Bve.js.map +0 -1
  284. package/dist/assets/History-BP4SmaS_-P4WBKyqX.js +0 -2
  285. package/dist/assets/History-BP4SmaS_-P4WBKyqX.js.map +0 -1
  286. package/dist/assets/History-CmOiP5qa.js +0 -2
  287. package/dist/assets/History-CmOiP5qa.js.map +0 -1
  288. package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js +0 -2
  289. package/dist/assets/InfoSquare-C98JaLiz-yPcGR71f.js.map +0 -1
  290. package/dist/assets/InfoSquare-DbYZrwmg.js +0 -2
  291. package/dist/assets/InfoSquare-DbYZrwmg.js.map +0 -1
  292. package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js +0 -2
  293. package/dist/assets/Link-BF7aZjVu-CXIVQOz6.js.map +0 -1
  294. package/dist/assets/Link-CXIVQOz6.js +0 -2
  295. package/dist/assets/Link-CXIVQOz6.js.map +0 -1
  296. package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js +0 -2
  297. package/dist/assets/Linkedin-DJwIkS6q-Dkb5Tp_Z.js.map +0 -1
  298. package/dist/assets/Linkedin-exhl1yGN.js +0 -2
  299. package/dist/assets/Linkedin-exhl1yGN.js.map +0 -1
  300. package/dist/assets/Lock-DWdDRi_O.js +0 -2
  301. package/dist/assets/Lock-DWdDRi_O.js.map +0 -1
  302. package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js +0 -2
  303. package/dist/assets/Lock-PyaFHdNS-D_qxRTye.js.map +0 -1
  304. package/dist/assets/M-ByQIo8bX.js +0 -2
  305. package/dist/assets/M-ByQIo8bX.js.map +0 -1
  306. package/dist/assets/M-DozhhPMY-DBQw97P_.js +0 -2
  307. package/dist/assets/M-DozhhPMY-DBQw97P_.js.map +0 -1
  308. package/dist/assets/PackageManager-B-MUWliB-bW01ZQSP.js +0 -2
  309. package/dist/assets/PackageManager-B-MUWliB-bW01ZQSP.js.map +0 -1
  310. package/dist/assets/PackageManager-D6Ia8zHs.js +0 -2
  311. package/dist/assets/PackageManager-D6Ia8zHs.js.map +0 -1
  312. package/dist/assets/Pencil-D7lvxXIP-D830iveq.js +0 -2
  313. package/dist/assets/Pencil-D7lvxXIP-D830iveq.js.map +0 -1
  314. package/dist/assets/Pencil-D830iveq.js +0 -2
  315. package/dist/assets/Pencil-D830iveq.js.map +0 -1
  316. package/dist/assets/People-B1tewG8c.js +0 -2
  317. package/dist/assets/People-B1tewG8c.js.map +0 -1
  318. package/dist/assets/People-CUB8LYKf-CyJmMqcw.js +0 -2
  319. package/dist/assets/People-CUB8LYKf-CyJmMqcw.js.map +0 -1
  320. package/dist/assets/Person-BPRmm67U.js +0 -2
  321. package/dist/assets/Person-BPRmm67U.js.map +0 -1
  322. package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js +0 -2
  323. package/dist/assets/Person-DuL4PQzm-ttQR0nPy.js.map +0 -1
  324. package/dist/assets/Pin-D53eCMAz.js +0 -2
  325. package/dist/assets/Pin-D53eCMAz.js.map +0 -1
  326. package/dist/assets/Pin-DF70btCU-D53eCMAz.js +0 -2
  327. package/dist/assets/Pin-DF70btCU-D53eCMAz.js.map +0 -1
  328. package/dist/assets/PinFilled-CMXfFW67.js +0 -2
  329. package/dist/assets/PinFilled-CMXfFW67.js.map +0 -1
  330. package/dist/assets/PinFilled-vImzS0do-CMXfFW67.js +0 -2
  331. package/dist/assets/PinFilled-vImzS0do-CMXfFW67.js.map +0 -1
  332. package/dist/assets/Plus-DPFWGJM4-BztpK8li.js +0 -2
  333. package/dist/assets/Plus-DPFWGJM4-BztpK8li.js.map +0 -1
  334. package/dist/assets/Plus-XUIm1wNw.js +0 -2
  335. package/dist/assets/Plus-XUIm1wNw.js.map +0 -1
  336. package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js +0 -2
  337. package/dist/assets/PlusCircle-BEnWRjHa-w5zztKGx.js.map +0 -1
  338. package/dist/assets/PlusCircle-D1IRYULb.js +0 -2
  339. package/dist/assets/PlusCircle-D1IRYULb.js.map +0 -1
  340. package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js +0 -2
  341. package/dist/assets/PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js.map +0 -1
  342. package/dist/assets/PowerhouseLogoSmall-DF1uUwIC.js +0 -2
  343. package/dist/assets/PowerhouseLogoSmall-DF1uUwIC.js.map +0 -1
  344. package/dist/assets/Project-BlXuclr0-EsBam9d0.js +0 -2
  345. package/dist/assets/Project-BlXuclr0-EsBam9d0.js.map +0 -1
  346. package/dist/assets/Project-EsBam9d0.js +0 -2
  347. package/dist/assets/Project-EsBam9d0.js.map +0 -1
  348. package/dist/assets/QuestionSquare-B6O9Le7r-CDaw1i6L.js +0 -2
  349. package/dist/assets/QuestionSquare-B6O9Le7r-CDaw1i6L.js.map +0 -1
  350. package/dist/assets/QuestionSquare-CDaw1i6L.js +0 -2
  351. package/dist/assets/QuestionSquare-CDaw1i6L.js.map +0 -1
  352. package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js +0 -2
  353. package/dist/assets/RedoArrow-BJeEsiph-BbidqIFP.js.map +0 -1
  354. package/dist/assets/RedoArrow-DM-fqhEP.js +0 -2
  355. package/dist/assets/RedoArrow-DM-fqhEP.js.map +0 -1
  356. package/dist/assets/Reload-6C2CYgrl-DPZbA7yl.js +0 -2
  357. package/dist/assets/Reload-6C2CYgrl-DPZbA7yl.js.map +0 -1
  358. package/dist/assets/Reload-DPZbA7yl.js +0 -2
  359. package/dist/assets/Reload-DPZbA7yl.js.map +0 -1
  360. package/dist/assets/Renown-6m7hx37h-CItksi2j.js +0 -2
  361. package/dist/assets/Renown-6m7hx37h-CItksi2j.js.map +0 -1
  362. package/dist/assets/Renown-CItksi2j.js +0 -2
  363. package/dist/assets/Renown-CItksi2j.js.map +0 -1
  364. package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js +0 -2
  365. package/dist/assets/RenownHover-CQ0TZHZv-cYQgnwQW.js.map +0 -1
  366. package/dist/assets/RenownHover-cYQgnwQW.js +0 -2
  367. package/dist/assets/RenownHover-cYQgnwQW.js.map +0 -1
  368. package/dist/assets/Ring-BivnmVc5.js +0 -2
  369. package/dist/assets/Ring-BivnmVc5.js.map +0 -1
  370. package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js +0 -2
  371. package/dist/assets/Ring-DKv0gnwT-CDHLz87h.js.map +0 -1
  372. package/dist/assets/Save-BBxj68pn-BkUvn89C.js +0 -2
  373. package/dist/assets/Save-BBxj68pn-BkUvn89C.js.map +0 -1
  374. package/dist/assets/Save-BWCZPY82.js +0 -2
  375. package/dist/assets/Save-BWCZPY82.js.map +0 -1
  376. package/dist/assets/Search-BiEcSbcf.js +0 -2
  377. package/dist/assets/Search-BiEcSbcf.js.map +0 -1
  378. package/dist/assets/Search-YUJuRBLe-CecGUkZA.js +0 -2
  379. package/dist/assets/Search-YUJuRBLe-CecGUkZA.js.map +0 -1
  380. package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js +0 -2
  381. package/dist/assets/Server-Bfkkjui1-lBan_3Dm.js.map +0 -1
  382. package/dist/assets/Server-cAzmNxsS.js +0 -2
  383. package/dist/assets/Server-cAzmNxsS.js.map +0 -1
  384. package/dist/assets/Settings-Cca-sV-_.js +0 -2
  385. package/dist/assets/Settings-Cca-sV-_.js.map +0 -1
  386. package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js +0 -2
  387. package/dist/assets/Settings-mbbylBS5-Cca-sV-_.js.map +0 -1
  388. package/dist/assets/Synced-CjieGKOk.js +0 -2
  389. package/dist/assets/Synced-CjieGKOk.js.map +0 -1
  390. package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js +0 -2
  391. package/dist/assets/Synced-DKJXzPiw-Cui8pDsS.js.map +0 -1
  392. package/dist/assets/Syncing-KnDBLSYe.js +0 -2
  393. package/dist/assets/Syncing-KnDBLSYe.js.map +0 -1
  394. package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js +0 -2
  395. package/dist/assets/Syncing-aT9WSMFf-2VhhyCcX.js.map +0 -1
  396. package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js +0 -2
  397. package/dist/assets/Trash-CgSbHk-P-DIYkVMER.js.map +0 -1
  398. package/dist/assets/Trash-DIHOD5wQ.js +0 -2
  399. package/dist/assets/Trash-DIHOD5wQ.js.map +0 -1
  400. package/dist/assets/TrashFill-CG3humXp.js +0 -2
  401. package/dist/assets/TrashFill-CG3humXp.js.map +0 -1
  402. package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js +0 -2
  403. package/dist/assets/TrashFill-DN50ercb-Oqx67xXN.js.map +0 -1
  404. package/dist/assets/TreeViewSlash-BywCsx5o-CUTTXZi-.js +0 -2
  405. package/dist/assets/TreeViewSlash-BywCsx5o-CUTTXZi-.js.map +0 -1
  406. package/dist/assets/TreeViewSlash-CKJADIpa.js +0 -2
  407. package/dist/assets/TreeViewSlash-CKJADIpa.js.map +0 -1
  408. package/dist/assets/TriangleDown-Boh-WZzH.js +0 -2
  409. package/dist/assets/TriangleDown-Boh-WZzH.js.map +0 -1
  410. package/dist/assets/TriangleDown-eCXwUfu8-F-V79AL3.js +0 -2
  411. package/dist/assets/TriangleDown-eCXwUfu8-F-V79AL3.js.map +0 -1
  412. package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js +0 -2
  413. package/dist/assets/VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js.map +0 -1
  414. package/dist/assets/VariantArrowLeft-Dl1-3L5q.js +0 -2
  415. package/dist/assets/VariantArrowLeft-Dl1-3L5q.js.map +0 -1
  416. package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js +0 -2
  417. package/dist/assets/VerticalDots-C8QYf7et-CCxZfvjq.js.map +0 -1
  418. package/dist/assets/VerticalDots-CCZxgZM8.js +0 -2
  419. package/dist/assets/VerticalDots-CCZxgZM8.js.map +0 -1
  420. package/dist/assets/WarningFill-CRRaW3Oz.js +0 -2
  421. package/dist/assets/WarningFill-CRRaW3Oz.js.map +0 -1
  422. package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js +0 -2
  423. package/dist/assets/WarningFill-WowAvi5P-D5XCckM6.js.map +0 -1
  424. package/dist/assets/XTwitter-CW6IaHUb.js +0 -2
  425. package/dist/assets/XTwitter-CW6IaHUb.js.map +0 -1
  426. package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js +0 -2
  427. package/dist/assets/XTwitter-k3Pt8itk-mvLk8TKx.js.map +0 -1
  428. package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js +0 -2
  429. package/dist/assets/Xmark-8qnJCs2Y-CZ3t0Fap.js.map +0 -1
  430. package/dist/assets/Xmark-CZ3t0Fap.js +0 -2
  431. package/dist/assets/Xmark-CZ3t0Fap.js.map +0 -1
  432. package/dist/assets/XmarkLight-BkhBFy51.js +0 -2
  433. package/dist/assets/XmarkLight-BkhBFy51.js.map +0 -1
  434. package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js +0 -2
  435. package/dist/assets/XmarkLight-GHzDR5_F-CloMvuzt.js.map +0 -1
  436. package/dist/assets/Youtube-h-Dc9pri.js +0 -2
  437. package/dist/assets/Youtube-h-Dc9pri.js.map +0 -1
  438. package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js +0 -2
  439. package/dist/assets/Youtube-i8V0IXUU-Bkiwoayp.js.map +0 -1
  440. package/dist/assets/app-DKrzRA2f.js +0 -449
  441. package/dist/assets/app-DKrzRA2f.js.map +0 -1
  442. package/dist/assets/app-loader-DH_VGIVv.css +0 -1
  443. package/dist/assets/app-loader-mj_poB3V.js +0 -3
  444. package/dist/assets/app-loader-mj_poB3V.js.map +0 -1
  445. package/dist/assets/browser-BbIPlSaA.js +0 -2
  446. package/dist/assets/browser-BbIPlSaA.js.map +0 -1
  447. package/dist/assets/browser-DtMtdCgJ.js +0 -7
  448. package/dist/assets/browser-DtMtdCgJ.js.map +0 -1
  449. package/dist/assets/ccip-DUUHdwDo.js +0 -2
  450. package/dist/assets/ccip-DUUHdwDo.js.map +0 -1
  451. package/dist/assets/content-DFQJzB7I.js +0 -7
  452. package/dist/assets/content-DFQJzB7I.js.map +0 -1
  453. package/dist/assets/editor-Dms2goxJ.js +0 -346
  454. package/dist/assets/editor-Dms2goxJ.js.map +0 -1
  455. package/dist/assets/getEnsName-DoyRgFOP.js +0 -35
  456. package/dist/assets/getEnsName-DoyRgFOP.js.map +0 -1
  457. package/dist/assets/index-Bg4jiu9P.js +0 -3
  458. package/dist/assets/index-Bg4jiu9P.js.map +0 -1
  459. package/dist/assets/index-CLu1C_is-jUM7ckQa.js +0 -12
  460. package/dist/assets/index-CLu1C_is-jUM7ckQa.js.map +0 -1
  461. package/dist/assets/index-q_KV5Ymp.js +0 -16
  462. package/dist/assets/index-q_KV5Ymp.js.map +0 -1
  463. package/dist/assets/isAddressEqual-H3jvLfD0.js +0 -2
  464. package/dist/assets/isAddressEqual-H3jvLfD0.js.map +0 -1
  465. package/dist/assets/json-m8fnOd5g.js +0 -3
  466. package/dist/assets/json-m8fnOd5g.js.map +0 -1
  467. package/dist/assets/main.Bp4zjrbL.js +0 -2
  468. package/dist/assets/main.Bp4zjrbL.js.map +0 -1
  469. package/dist/assets/root-R8rJ5_ai.js +0 -17
  470. package/dist/assets/root-R8rJ5_ai.js.map +0 -1
  471. package/dist/assets/router-DX6s3TD2.js +0 -12
  472. package/dist/assets/router-DX6s3TD2.js.map +0 -1
  473. package/dist/assets/useUiNodes-BqBkjrKn.js +0 -107
  474. package/dist/assets/useUiNodes-BqBkjrKn.js.map +0 -1
  475. package/dist/service-worker.js.map +0 -1
  476. package/dist/studio/cli.js +0 -6
  477. package/dist/studio/helpers.d.ts +0 -2
  478. package/dist/studio/hmr.js +0 -10
  479. package/dist/studio/index.d.ts +0 -19
  480. package/dist/studio/index.js +0 -624
  481. package/dist/studio/server.d.ts +0 -7
  482. package/dist/studio/vite-plugins/base.d.ts +0 -14
  483. package/dist/studio/vite-plugins/external-packages.d.ts +0 -5
  484. package/dist/studio/vite-plugins/hmr.d.ts +0 -2
  485. package/dist/studio/vite-plugins/studio.d.ts +0 -3
@@ -1,346 +0,0 @@
1
- import{_ as __vitePreload}from"./main.Bp4zjrbL.js";import{jsx,Fragment,jsxs}from"react/jsx-runtime";import{cj as h$3,bO as index,c5 as applyMixins,b$ as BaseActions,cc as BaseDocument}from"./app-DKrzRA2f.js";import*as React from"react";import React__default,{forwardRef,useLayoutEffect,useEffect,useState,useMemo,Suspense,lazy,useRef,useCallback,useImperativeHandle,createContext,memo,useContext,useId}from"react";import{P as P$5}from"./json-m8fnOd5g.js";import*as ReactDOM from"react-dom";import ReactDOM__default from"react-dom";import{a as actions}from"./content-DFQJzB7I.js";import"./app-loader-mj_poB3V.js";import"./useUiNodes-BqBkjrKn.js";import"./getEnsName-DoyRgFOP.js";var B$3=Object.defineProperty,N$3=(Ws,ws,oi)=>ws in Ws?B$3(Ws,ws,{enumerable:!0,configurable:!0,writable:!0,value:oi}):Ws[ws]=oi,h$2=(Ws,ws,oi)=>N$3(Ws,typeof ws!="symbol"?ws+"":ws,oi);const _$3=Ws=>Ws!=null;h$3.any().refine(Ws=>_$3(Ws));const g$1=h$3.enum(["CRY","HEART","LAUGH","THUMBS_DOWN","THUMBS_UP"]);function E$1(){return h$3.object({messageId:h$3.string(),reactedBy:h$3.string(),type:g$1})}function I$3(){return h$3.object({content:h$3.string(),messageId:h$3.string(),sender:S$3(),sentAt:h$3.string().datetime()})}function y$3(){return h$3.object({description:h$3.string()})}function D$4(){return h$3.object({name:h$3.string()})}function f$3(){return h$3.object({messageId:h$3.string(),senderId:h$3.string(),type:g$1})}function S$3(){return h$3.object({__typename:h$3.literal("Sender").optional(),avatarUrl:h$3.string().url().nullable(),id:h$3.string(),name:h$3.string().nullable()})}let z$6=class extends Error{constructor(ws="MessageContentCannotBeEmpty"){super(ws),h$2(this,"errorCode","MessageContentCannotBeEmpty")}};const d$1={addMessageOperation(Ws,ws,oi){if(ws.input.content==="")throw new z$6;Ws.messages.push({id:ws.input.messageId,content:ws.input.content,sender:ws.input.sender,sentAt:ws.input.sentAt,reactions:[]})},addEmojiReactionOperation(Ws,ws,oi){const si=Ws.messages.find(ai=>ai.id===ws.input.messageId);if(!si)throw new Error("Message not found");const ii=si.reactions||[];ii.find(ai=>ai.type===ws.input.type)?si.reactions=ii.map(ai=>ai.type===ws.input.type?{...ai,reactedBy:[...ai.reactedBy,ws.input.reactedBy]}:ai):si.reactions=[...ii,{reactedBy:[ws.input.reactedBy],type:ws.input.type}],Ws.messages=Ws.messages.map(ai=>ai.id===si.id?si:ai)},removeEmojiReactionOperation(Ws,ws,oi){Ws.messages=Ws.messages.map(si=>(si.id===ws.input.messageId&&(si.reactions=(si.reactions||[]).map(ii=>ii.type===ws.input.type?{...ii,reactedBy:ii.reactedBy.filter(ai=>ai!==ws.input.senderId)}:ii)),si))},editChatNameOperation(Ws,ws,oi){Ws.name=ws.input.name||""},editChatDescriptionOperation(Ws,ws,oi){Ws.description=ws.input.description||""}},G$5=(Ws,ws,oi)=>{if(index.isBaseAction(ws))return Ws;switch(ws.type){case"ADD_MESSAGE":I$3().parse(ws.input),d$1.addMessageOperation(Ws[ws.scope],ws,oi);break;case"ADD_EMOJI_REACTION":E$1().parse(ws.input),d$1.addEmojiReactionOperation(Ws[ws.scope],ws,oi);break;case"REMOVE_EMOJI_REACTION":f$3().parse(ws.input),d$1.removeEmojiReactionOperation(Ws[ws.scope],ws,oi);break;case"EDIT_CHAT_NAME":D$4().parse(ws.input),d$1.editChatNameOperation(Ws[ws.scope],ws,oi);break;case"EDIT_CHAT_DESCRIPTION":y$3().parse(ws.input),d$1.editChatDescriptionOperation(Ws[ws.scope],ws,oi);break;default:return Ws}},m$3=index.createReducer(G$5),L$3={id:"",name:"",description:"",createdAt:"2024-12-03T14:13:08.862Z",createdBy:"",messages:[]},J$6={},c$2={fileExtension:".phdm",createState(Ws){return{global:{...L$3,...Ws==null?void 0:Ws.global},local:{...J$6,...Ws==null?void 0:Ws.local}}},createExtendedState(Ws){return index.createExtendedState({...Ws,documentType:"powerhouse/chat-room"},c$2.createState)},createDocument(Ws){return index.createDocument(c$2.createExtendedState(Ws),c$2.createState)},saveToFile(Ws,ws,oi){return index.saveToFile(Ws,ws,".phdm",oi)},saveToFileHandle(Ws,ws){return index.saveToFileHandle(Ws,ws)},loadFromFile(Ws){return index.loadFromFile(Ws,m$3)},loadFromInput(Ws){return index.loadFromInput(Ws,m$3)}},{createAction:p$3}=index,C$6=Ws=>p$3("ADD_MESSAGE",{...Ws},void 0,I$3,"global"),O$3=Ws=>p$3("ADD_EMOJI_REACTION",{...Ws},void 0,E$1,"global"),M$4=Ws=>p$3("REMOVE_EMOJI_REACTION",{...Ws},void 0,f$3,"global"),j$2=Ws=>p$3("EDIT_CHAT_NAME",{...Ws},void 0,D$4,"global"),x$4=Ws=>p$3("EDIT_CHAT_DESCRIPTION",{...Ws},void 0,y$3,"global");let P$4=class extends BaseDocument{addMessage(ws){return this.dispatch(C$6(ws))}addEmojiReaction(ws){return this.dispatch(O$3(ws))}removeEmojiReaction(ws){return this.dispatch(M$4(ws))}editChatName(ws){return this.dispatch(j$2(ws))}editChatDescription(ws){return this.dispatch(x$4(ws))}};const u$3=class qf extends BaseDocument{constructor(ws,oi){super(m$3,c$2.createDocument(ws),oi)}saveToFile(ws,oi){return super.saveToFile(ws,qf.fileExtension,oi)}loadFromFile(ws){return super.loadFromFile(ws)}static async fromFile(ws){const oi=new this;return await oi.loadFromFile(ws),oi}};h$2(u$3,"fileExtension",".phdm");let l$2=u$3;applyMixins(l$2,[P$4]);const V$2=Object.freeze(Object.defineProperty({__proto__:null,addEmojiReaction:O$3,addMessage:C$6,editChatDescription:x$4,editChatName:j$2,removeEmojiReaction:M$4},Symbol.toStringTag,{value:"Module"})),Y$3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));({...c$2,...Y$3});({...BaseActions,...V$2});var It$2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ud(Ws){return Ws&&Ws.__esModule&&Object.prototype.hasOwnProperty.call(Ws,"default")?Ws.default:Ws}var hn$1,br$2;function mi(){if(br$2)return hn$1;br$2=1;var Ws="Expected a function",ws=NaN,oi="[object Symbol]",si=/^\s+|\s+$/g,ii=/^[-+]0x[0-9a-f]+$/i,ai=/^0b[01]+$/i,li=/^0o[0-7]+$/i,ci=parseInt,ui=typeof It$2=="object"&&It$2&&It$2.Object===Object&&It$2,di=typeof self=="object"&&self&&self.Object===Object&&self,hi=ui||di||Function("return this")(),pi=Object.prototype,ha=pi.toString,ga=Math.max,va=Math.min,ba=function(){return hi.Date.now()};function wa(gd,Ed,Od){var Nd,Pd,Ld,rf,kd,Md,Td=0,wd=!1,Cd=!1,sf=!0;if(typeof gd!="function")throw new TypeError(Ws);Ed=ku(Ed)||0,xa(Od)&&(wd=!!Od.leading,Cd="maxWait"in Od,Ld=Cd?ga(ku(Od.maxWait)||0,Ed):Ld,sf="trailing"in Od?!!Od.trailing:sf);function of(uf){var mf=Nd,yf=Pd;return Nd=Pd=void 0,Td=uf,rf=gd.apply(yf,mf),rf}function Wd(uf){return Td=uf,kd=setTimeout(xd,Ed),wd?of(uf):rf}function df(uf){var mf=uf-Md,yf=uf-Td,Sf=Ed-mf;return Cd?va(Sf,Ld-yf):Sf}function hf(uf){var mf=uf-Md,yf=uf-Td;return Md===void 0||mf>=Ed||mf<0||Cd&&yf>=Ld}function xd(){var uf=ba();if(hf(uf))return Fd(uf);kd=setTimeout(xd,df(uf))}function Fd(uf){return kd=void 0,sf&&Nd?of(uf):(Nd=Pd=void 0,rf)}function Vd(){kd!==void 0&&clearTimeout(kd),Td=0,Nd=Md=Pd=kd=void 0}function af(){return kd===void 0?rf:Fd(ba())}function ff(){var uf=ba(),mf=hf(uf);if(Nd=arguments,Pd=this,Md=uf,mf){if(kd===void 0)return Wd(Md);if(Cd)return kd=setTimeout(xd,Ed),of(Md)}return kd===void 0&&(kd=setTimeout(xd,Ed)),rf}return ff.cancel=Vd,ff.flush=af,ff}function xa(gd){var Ed=typeof gd;return!!gd&&(Ed=="object"||Ed=="function")}function Ca(gd){return!!gd&&typeof gd=="object"}function el(gd){return typeof gd=="symbol"||Ca(gd)&&ha.call(gd)==oi}function ku(gd){if(typeof gd=="number")return gd;if(el(gd))return ws;if(xa(gd)){var Ed=typeof gd.valueOf=="function"?gd.valueOf():gd;gd=xa(Ed)?Ed+"":Ed}if(typeof gd!="string")return gd===0?gd:+gd;gd=gd.replace(si,"");var Od=ai.test(gd);return Od||li.test(gd)?ci(gd.slice(2),Od?2:8):ii.test(gd)?ws:+gd}return hn$1=wa,hn$1}mi();var Pt$2=Ws=>Ws.type==="checkbox",Ye$2=Ws=>Ws instanceof Date,de$2=Ws=>Ws==null;const oo=Ws=>typeof Ws=="object";var re$1=Ws=>!de$2(Ws)&&!Array.isArray(Ws)&&oo(Ws)&&!Ye$2(Ws),so$1=Ws=>re$1(Ws)&&Ws.target?Pt$2(Ws.target)?Ws.target.checked:Ws.target.value:Ws,gi=Ws=>Ws.substring(0,Ws.search(/\.\d+(\.|$)/))||Ws,io$1=(Ws,ws)=>Ws.has(gi(ws)),vi=Ws=>{const ws=Ws.constructor&&Ws.constructor.prototype;return re$1(ws)&&ws.hasOwnProperty("isPrototypeOf")},Un$1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function pe$1(Ws){let ws;const oi=Array.isArray(Ws),si=typeof FileList<"u"?Ws instanceof FileList:!1;if(Ws instanceof Date)ws=new Date(Ws);else if(Ws instanceof Set)ws=new Set(Ws);else if(!(Un$1&&(Ws instanceof Blob||si))&&(oi||re$1(Ws)))if(ws=oi?[]:{},!oi&&!vi(Ws))ws=Ws;else for(const ii in Ws)Ws.hasOwnProperty(ii)&&(ws[ii]=pe$1(Ws[ii]));else return Ws;return ws}var nn$1=Ws=>Array.isArray(Ws)?Ws.filter(Boolean):[],ne$2=Ws=>Ws===void 0,k$6=(Ws,ws,oi)=>{if(!ws||!re$1(Ws))return oi;const si=nn$1(ws.split(/[,[\].]+?/)).reduce((ii,ai)=>de$2(ii)?ii:ii[ai],Ws);return ne$2(si)||si===Ws?ne$2(Ws[ws])?oi:Ws[ws]:si},be$2=Ws=>typeof Ws=="boolean",Wn$2=Ws=>/^\w*$/.test(Ws),ao$1=Ws=>nn$1(Ws.replace(/["|']|\]/g,"").split(/\.|\[/)),J$5=(Ws,ws,oi)=>{let si=-1;const ii=Wn$2(ws)?[ws]:ao$1(ws),ai=ii.length,li=ai-1;for(;++si<ai;){const ci=ii[si];let ui=oi;if(si!==li){const di=Ws[ci];ui=re$1(di)||Array.isArray(di)?di:isNaN(+ii[si+1])?{}:[]}if(ci==="__proto__"||ci==="constructor"||ci==="prototype")return;Ws[ci]=ui,Ws=Ws[ci]}return Ws};const jt$2={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xe$2={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ie$2={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},co$1=React__default.createContext(null),$n$2=()=>React__default.useContext(co$1),$d=Ws=>{const{children:ws,...oi}=Ws;return React__default.createElement(co$1.Provider,{value:oi},ws)};var lo$1=(Ws,ws,oi,si=!0)=>{const ii={defaultValues:ws._defaultValues};for(const ai in Ws)Object.defineProperty(ii,ai,{get:()=>{const li=ai;return ws._proxyFormState[li]!==xe$2.all&&(ws._proxyFormState[li]=!si||xe$2.all),oi&&(oi[li]=!0),Ws[li]}});return ii},me$2=Ws=>re$1(Ws)&&!Object.keys(Ws).length,uo$1=(Ws,ws,oi,si)=>{oi(Ws);const{name:ii,...ai}=Ws;return me$2(ai)||Object.keys(ai).length>=Object.keys(ws).length||Object.keys(ai).find(li=>ws[li]===(!si||xe$2.all))},xt$1=Ws=>Array.isArray(Ws)?Ws:[Ws],fo$1=(Ws,ws,oi)=>!Ws||!ws||Ws===ws||xt$1(Ws).some(si=>si&&(oi?si===ws:si.startsWith(ws)||ws.startsWith(si)));function zn$2(Ws){const ws=React__default.useRef(Ws);ws.current=Ws,React__default.useEffect(()=>{const oi=!Ws.disabled&&ws.current.subject&&ws.current.subject.subscribe({next:ws.current.next});return()=>{oi&&oi.unsubscribe()}},[Ws.disabled])}function yi$1(Ws){const ws=$n$2(),{control:oi=ws.control,disabled:si,name:ii,exact:ai}=Ws,[li,ci]=React__default.useState(oi._formState),ui=React__default.useRef(!0),di=React__default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),hi=React__default.useRef(ii);return hi.current=ii,zn$2({disabled:si,next:pi=>ui.current&&fo$1(hi.current,pi.name,ai)&&uo$1(pi,di.current,oi._updateFormState)&&ci({...oi._formState,...pi}),subject:oi._subjects.state}),React__default.useEffect(()=>(ui.current=!0,di.current.isValid&&oi._updateValid(!0),()=>{ui.current=!1}),[oi]),React__default.useMemo(()=>lo$1(li,oi,di.current,!1),[li,oi])}var Te$2=Ws=>typeof Ws=="string",po$1=(Ws,ws,oi,si,ii)=>Te$2(Ws)?(si&&ws.watch.add(Ws),k$6(oi,Ws,ii)):Array.isArray(Ws)?Ws.map(ai=>(si&&ws.watch.add(ai),k$6(oi,ai))):(si&&(ws.watchAll=!0),oi);function bi(Ws){const ws=$n$2(),{control:oi=ws.control,name:si,defaultValue:ii,disabled:ai,exact:li}=Ws,ci=React__default.useRef(si);ci.current=si,zn$2({disabled:ai,subject:oi._subjects.values,next:hi=>{fo$1(ci.current,hi.name,li)&&di(pe$1(po$1(ci.current,oi._names,hi.values||oi._formValues,!1,ii)))}});const[ui,di]=React__default.useState(oi._getWatch(si,ii));return React__default.useEffect(()=>oi._removeUnmounted()),ui}function wi(Ws){const ws=$n$2(),{name:oi,disabled:si,control:ii=ws.control,shouldUnregister:ai}=Ws,li=io$1(ii._names.array,oi),ci=bi({control:ii,name:oi,defaultValue:k$6(ii._formValues,oi,k$6(ii._defaultValues,oi,Ws.defaultValue)),exact:!0}),ui=yi$1({control:ii,name:oi,exact:!0}),di=React__default.useRef(ii.register(oi,{...Ws.rules,value:ci,...be$2(Ws.disabled)?{disabled:Ws.disabled}:{}})),hi=React__default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!k$6(ui.errors,oi)},isDirty:{enumerable:!0,get:()=>!!k$6(ui.dirtyFields,oi)},isTouched:{enumerable:!0,get:()=>!!k$6(ui.touchedFields,oi)},isValidating:{enumerable:!0,get:()=>!!k$6(ui.validatingFields,oi)},error:{enumerable:!0,get:()=>k$6(ui.errors,oi)}}),[ui,oi]),pi=React__default.useMemo(()=>({name:oi,value:ci,...be$2(si)||ui.disabled?{disabled:ui.disabled||si}:{},onChange:ha=>di.current.onChange({target:{value:so$1(ha),name:oi},type:jt$2.CHANGE}),onBlur:()=>di.current.onBlur({target:{value:k$6(ii._formValues,oi),name:oi},type:jt$2.BLUR}),ref:ha=>{const ga=k$6(ii._fields,oi);ga&&ha&&(ga._f.ref={focus:()=>ha.focus(),select:()=>ha.select(),setCustomValidity:va=>ha.setCustomValidity(va),reportValidity:()=>ha.reportValidity()})}}),[oi,ii._formValues,si,ui.disabled,ci,ii._fields]);return React__default.useEffect(()=>{const ha=ii._options.shouldUnregister||ai,ga=(va,ba)=>{const wa=k$6(ii._fields,va);wa&&wa._f&&(wa._f.mount=ba)};if(ga(oi,!0),ha){const va=pe$1(k$6(ii._options.defaultValues,oi));J$5(ii._defaultValues,oi,va),ne$2(k$6(ii._formValues,oi))&&J$5(ii._formValues,oi,va)}return!li&&ii.register(oi),()=>{(li?ha&&!ii._state.action:ha)?ii.unregister(oi):ga(oi,!1)}},[oi,ii,li,ai]),React__default.useEffect(()=>{ii._updateDisabledField({disabled:si,fields:ii._fields,name:oi})},[si,oi,ii]),React__default.useMemo(()=>({field:pi,formState:ui,fieldState:hi}),[pi,ui,hi])}const zd=Ws=>Ws.render(wi(Ws));var xi=(Ws,ws,oi,si,ii)=>ws?{...oi[Ws],types:{...oi[Ws]&&oi[Ws].types?oi[Ws].types:{},[si]:ii||!0}}:{},wr$2=Ws=>({isOnSubmit:!Ws||Ws===xe$2.onSubmit,isOnBlur:Ws===xe$2.onBlur,isOnChange:Ws===xe$2.onChange,isOnAll:Ws===xe$2.all,isOnTouch:Ws===xe$2.onTouched}),xr$2=(Ws,ws,oi)=>!oi&&(ws.watchAll||ws.watch.has(Ws)||[...ws.watch].some(si=>Ws.startsWith(si)&&/^\.\w+/.test(Ws.slice(si.length))));const Ct$2=(Ws,ws,oi,si)=>{for(const ii of oi||Object.keys(Ws)){const ai=k$6(Ws,ii);if(ai){const{_f:li,...ci}=ai;if(li){if(li.refs&&li.refs[0]&&ws(li.refs[0],ii)&&!si||li.ref&&ws(li.ref,li.name)&&!si)return!0;if(Ct$2(ci,ws))break}else if(re$1(ci)&&Ct$2(ci,ws))break}}};var Ci=(Ws,ws,oi)=>{const si=xt$1(k$6(Ws,oi));return J$5(si,"root",ws[oi]),J$5(Ws,oi,si),Ws},Gn$1=Ws=>Ws.type==="file",_e$2=Ws=>typeof Ws=="function",Ht$1=Ws=>{if(!Un$1)return!1;const ws=Ws?Ws.ownerDocument:0;return Ws instanceof(ws&&ws.defaultView?ws.defaultView.HTMLElement:HTMLElement)},Wt$2=Ws=>Te$2(Ws),jn$2=Ws=>Ws.type==="radio",Kt$1=Ws=>Ws instanceof RegExp;const Cr$2={value:!1,isValid:!1},Sr$2={value:!0,isValid:!0};var mo$1=Ws=>{if(Array.isArray(Ws)){if(Ws.length>1){const ws=Ws.filter(oi=>oi&&oi.checked&&!oi.disabled).map(oi=>oi.value);return{value:ws,isValid:!!ws.length}}return Ws[0].checked&&!Ws[0].disabled?Ws[0].attributes&&!ne$2(Ws[0].attributes.value)?ne$2(Ws[0].value)||Ws[0].value===""?Sr$2:{value:Ws[0].value,isValid:!0}:Sr$2:Cr$2}return Cr$2};const Er$2={isValid:!1,value:null};var ho$1=Ws=>Array.isArray(Ws)?Ws.reduce((ws,oi)=>oi&&oi.checked&&!oi.disabled?{isValid:!0,value:oi.value}:ws,Er$2):Er$2;function Ar$2(Ws,ws,oi="validate"){if(Wt$2(Ws)||Array.isArray(Ws)&&Ws.every(Wt$2)||be$2(Ws)&&!Ws)return{type:oi,message:Wt$2(Ws)?Ws:"",ref:ws}}var et$2=Ws=>re$1(Ws)&&!Kt$1(Ws)?Ws:{value:Ws,message:""},Rr$2=async(Ws,ws,oi,si,ii,ai)=>{const{ref:li,refs:ci,required:ui,maxLength:di,minLength:hi,min:pi,max:ha,pattern:ga,validate:va,name:ba,valueAsNumber:wa,mount:xa}=Ws._f,Ca=k$6(oi,ba);if(!xa||ws.has(ba))return{};const el=ci?ci[0]:li,ku=kd=>{ii&&el.reportValidity&&(el.setCustomValidity(be$2(kd)?"":kd||""),el.reportValidity())},gd={},Ed=jn$2(li),Od=Pt$2(li),Nd=Ed||Od,Pd=(wa||Gn$1(li))&&ne$2(li.value)&&ne$2(Ca)||Ht$1(li)&&li.value===""||Ca===""||Array.isArray(Ca)&&!Ca.length,Ld=xi.bind(null,ba,si,gd),rf=(kd,Md,Td,wd=Ie$2.maxLength,Cd=Ie$2.minLength)=>{const sf=kd?Md:Td;gd[ba]={type:kd?wd:Cd,message:sf,ref:li,...Ld(kd?wd:Cd,sf)}};if(ai?!Array.isArray(Ca)||!Ca.length:ui&&(!Nd&&(Pd||de$2(Ca))||be$2(Ca)&&!Ca||Od&&!mo$1(ci).isValid||Ed&&!ho$1(ci).isValid)){const{value:kd,message:Md}=Wt$2(ui)?{value:!!ui,message:ui}:et$2(ui);if(kd&&(gd[ba]={type:Ie$2.required,message:Md,ref:el,...Ld(Ie$2.required,Md)},!si))return ku(Md),gd}if(!Pd&&(!de$2(pi)||!de$2(ha))){let kd,Md;const Td=et$2(ha),wd=et$2(pi);if(!de$2(Ca)&&!isNaN(Ca)){const Cd=li.valueAsNumber||Ca&&+Ca;de$2(Td.value)||(kd=Cd>Td.value),de$2(wd.value)||(Md=Cd<wd.value)}else{const Cd=li.valueAsDate||new Date(Ca),sf=df=>new Date(new Date().toDateString()+" "+df),of=li.type=="time",Wd=li.type=="week";Te$2(Td.value)&&Ca&&(kd=of?sf(Ca)>sf(Td.value):Wd?Ca>Td.value:Cd>new Date(Td.value)),Te$2(wd.value)&&Ca&&(Md=of?sf(Ca)<sf(wd.value):Wd?Ca<wd.value:Cd<new Date(wd.value))}if((kd||Md)&&(rf(!!kd,Td.message,wd.message,Ie$2.max,Ie$2.min),!si))return ku(gd[ba].message),gd}if((di||hi)&&!Pd&&(Te$2(Ca)||ai&&Array.isArray(Ca))){const kd=et$2(di),Md=et$2(hi),Td=!de$2(kd.value)&&Ca.length>+kd.value,wd=!de$2(Md.value)&&Ca.length<+Md.value;if((Td||wd)&&(rf(Td,kd.message,Md.message),!si))return ku(gd[ba].message),gd}if(ga&&!Pd&&Te$2(Ca)){const{value:kd,message:Md}=et$2(ga);if(Kt$1(kd)&&!Ca.match(kd)&&(gd[ba]={type:Ie$2.pattern,message:Md,ref:li,...Ld(Ie$2.pattern,Md)},!si))return ku(Md),gd}if(va){if(_e$2(va)){const kd=await va(Ca,oi),Md=Ar$2(kd,el);if(Md&&(gd[ba]={...Md,...Ld(Ie$2.validate,Md.message)},!si))return ku(Md.message),gd}else if(re$1(va)){let kd={};for(const Md in va){if(!me$2(kd)&&!si)break;const Td=Ar$2(await va[Md](Ca,oi),el,Md);Td&&(kd={...Td,...Ld(Md,Td.message)},ku(Td.message),si&&(gd[ba]=kd))}if(!me$2(kd)&&(gd[ba]={ref:el,...kd},!si))return gd}}return ku(!0),gd};function Si(Ws,ws){const oi=ws.slice(0,-1).length;let si=0;for(;si<oi;)Ws=ne$2(Ws)?si++:Ws[ws[si++]];return Ws}function Ei(Ws){for(const ws in Ws)if(Ws.hasOwnProperty(ws)&&!ne$2(Ws[ws]))return!1;return!0}function oe$3(Ws,ws){const oi=Array.isArray(ws)?ws:Wn$2(ws)?[ws]:ao$1(ws),si=oi.length===1?Ws:Si(Ws,oi),ii=oi.length-1,ai=oi[ii];return si&&delete si[ai],ii!==0&&(re$1(si)&&me$2(si)||Array.isArray(si)&&Ei(si))&&oe$3(Ws,oi.slice(0,-1)),Ws}var gn$1=()=>{let Ws=[];return{get observers(){return Ws},next:ws=>{for(const oi of Ws)oi.next&&oi.next(ws)},subscribe:ws=>(Ws.push(ws),{unsubscribe:()=>{Ws=Ws.filter(oi=>oi!==ws)}}),unsubscribe:()=>{Ws=[]}}},Tn$1=Ws=>de$2(Ws)||!oo(Ws);function Ge$2(Ws,ws){if(Tn$1(Ws)||Tn$1(ws))return Ws===ws;if(Ye$2(Ws)&&Ye$2(ws))return Ws.getTime()===ws.getTime();const oi=Object.keys(Ws),si=Object.keys(ws);if(oi.length!==si.length)return!1;for(const ii of oi){const ai=Ws[ii];if(!si.includes(ii))return!1;if(ii!=="ref"){const li=ws[ii];if(Ye$2(ai)&&Ye$2(li)||re$1(ai)&&re$1(li)||Array.isArray(ai)&&Array.isArray(li)?!Ge$2(ai,li):ai!==li)return!1}}return!0}var go$1=Ws=>Ws.type==="select-multiple",Ai=Ws=>jn$2(Ws)||Pt$2(Ws),vn$2=Ws=>Ht$1(Ws)&&Ws.isConnected,vo=Ws=>{for(const ws in Ws)if(_e$2(Ws[ws]))return!0;return!1};function Yt$1(Ws,ws={}){const oi=Array.isArray(Ws);if(re$1(Ws)||oi)for(const si in Ws)Array.isArray(Ws[si])||re$1(Ws[si])&&!vo(Ws[si])?(ws[si]=Array.isArray(Ws[si])?[]:{},Yt$1(Ws[si],ws[si])):de$2(Ws[si])||(ws[si]=!0);return ws}function yo(Ws,ws,oi){const si=Array.isArray(Ws);if(re$1(Ws)||si)for(const ii in Ws)Array.isArray(Ws[ii])||re$1(Ws[ii])&&!vo(Ws[ii])?ne$2(ws)||Tn$1(oi[ii])?oi[ii]=Array.isArray(Ws[ii])?Yt$1(Ws[ii],[]):{...Yt$1(Ws[ii])}:yo(Ws[ii],de$2(ws)?{}:ws[ii],oi[ii]):oi[ii]=!Ge$2(Ws[ii],ws[ii]);return oi}var gt$2=(Ws,ws)=>yo(Ws,ws,Yt$1(ws)),bo=(Ws,{valueAsNumber:ws,valueAsDate:oi,setValueAs:si})=>ne$2(Ws)?Ws:ws?Ws===""?NaN:Ws&&+Ws:oi&&Te$2(Ws)?new Date(Ws):si?si(Ws):Ws;function yn$2(Ws){const ws=Ws.ref;return Gn$1(ws)?ws.files:jn$2(ws)?ho$1(Ws.refs).value:go$1(ws)?[...ws.selectedOptions].map(({value:oi})=>oi):Pt$2(ws)?mo$1(Ws.refs).value:bo(ne$2(ws.value)?Ws.ref.value:ws.value,Ws)}var Ri=(Ws,ws,oi,si)=>{const ii={};for(const ai of Ws){const li=k$6(ws,ai);li&&J$5(ii,ai,li._f)}return{criteriaMode:oi,names:[...Ws],fields:ii,shouldUseNativeValidation:si}},vt$2=Ws=>ne$2(Ws)?Ws:Kt$1(Ws)?Ws.source:re$1(Ws)?Kt$1(Ws.value)?Ws.value.source:Ws.value:Ws;const Mr$2="AsyncFunction";var Mi$1=Ws=>!!Ws&&!!Ws.validate&&!!(_e$2(Ws.validate)&&Ws.validate.constructor.name===Mr$2||re$1(Ws.validate)&&Object.values(Ws.validate).find(ws=>ws.constructor.name===Mr$2)),_i$1=Ws=>Ws.mount&&(Ws.required||Ws.min||Ws.max||Ws.maxLength||Ws.minLength||Ws.pattern||Ws.validate);function _r$2(Ws,ws,oi){const si=k$6(Ws,oi);if(si||Wn$2(oi))return{error:si,name:oi};const ii=oi.split(".");for(;ii.length;){const ai=ii.join("."),li=k$6(ws,ai),ci=k$6(Ws,ai);if(li&&!Array.isArray(li)&&oi!==ai)return{name:oi};if(ci&&ci.type)return{name:ai,error:ci};ii.pop()}return{name:oi}}var Pi=(Ws,ws,oi,si,ii)=>ii.isOnAll?!1:!oi&&ii.isOnTouch?!(ws||Ws):(oi?si.isOnBlur:ii.isOnBlur)?!Ws:(oi?si.isOnChange:ii.isOnChange)?Ws:!0,Ti=(Ws,ws)=>!nn$1(k$6(Ws,ws)).length&&oe$3(Ws,ws);const ki$1={mode:xe$2.onSubmit,reValidateMode:xe$2.onChange,shouldFocusError:!0};function Oi(Ws={}){let ws={...ki$1,...Ws},oi={submitCount:0,isDirty:!1,isLoading:_e$2(ws.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:ws.errors||{},disabled:ws.disabled||!1},si={},ii=re$1(ws.defaultValues)||re$1(ws.values)?pe$1(ws.defaultValues||ws.values)||{}:{},ai=ws.shouldUnregister?{}:pe$1(ii),li={action:!1,mount:!1,watch:!1},ci={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ui,di=0;const hi={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},pi={values:gn$1(),array:gn$1(),state:gn$1()},ha=wr$2(ws.mode),ga=wr$2(ws.reValidateMode),va=ws.criteriaMode===xe$2.all,ba=_d=>Dd=>{clearTimeout(di),di=setTimeout(_d,Dd)},wa=async _d=>{if(!ws.disabled&&(hi.isValid||_d)){const Dd=ws.resolver?me$2((await Nd()).errors):await Ld(si,!0);Dd!==oi.isValid&&pi.state.next({isValid:Dd})}},xa=(_d,Dd)=>{!ws.disabled&&(hi.isValidating||hi.validatingFields)&&((_d||Array.from(ci.mount)).forEach(tf=>{tf&&(Dd?J$5(oi.validatingFields,tf,Dd):oe$3(oi.validatingFields,tf))}),pi.state.next({validatingFields:oi.validatingFields,isValidating:!me$2(oi.validatingFields)}))},Ca=(_d,Dd=[],tf,vd,Sd=!0,Id=!0)=>{if(vd&&tf&&!ws.disabled){if(li.action=!0,Id&&Array.isArray(k$6(si,_d))){const Bd=tf(k$6(si,_d),vd.argA,vd.argB);Sd&&J$5(si,_d,Bd)}if(Id&&Array.isArray(k$6(oi.errors,_d))){const Bd=tf(k$6(oi.errors,_d),vd.argA,vd.argB);Sd&&J$5(oi.errors,_d,Bd),Ti(oi.errors,_d)}if(hi.touchedFields&&Id&&Array.isArray(k$6(oi.touchedFields,_d))){const Bd=tf(k$6(oi.touchedFields,_d),vd.argA,vd.argB);Sd&&J$5(oi.touchedFields,_d,Bd)}hi.dirtyFields&&(oi.dirtyFields=gt$2(ii,ai)),pi.state.next({name:_d,isDirty:kd(_d,Dd),dirtyFields:oi.dirtyFields,errors:oi.errors,isValid:oi.isValid})}else J$5(ai,_d,Dd)},el=(_d,Dd)=>{J$5(oi.errors,_d,Dd),pi.state.next({errors:oi.errors})},ku=_d=>{oi.errors=_d,pi.state.next({errors:oi.errors,isValid:!1})},gd=(_d,Dd,tf,vd)=>{const Sd=k$6(si,_d);if(Sd){const Id=k$6(ai,_d,ne$2(tf)?k$6(ii,_d):tf);ne$2(Id)||vd&&vd.defaultChecked||Dd?J$5(ai,_d,Dd?Id:yn$2(Sd._f)):wd(_d,Id),li.mount&&wa()}},Ed=(_d,Dd,tf,vd,Sd)=>{let Id=!1,Bd=!1;const nf={name:_d};if(!ws.disabled){const lf=!!(k$6(si,_d)&&k$6(si,_d)._f&&k$6(si,_d)._f.disabled);if(!tf||vd){hi.isDirty&&(Bd=oi.isDirty,oi.isDirty=nf.isDirty=kd(),Id=Bd!==nf.isDirty);const pf=lf||Ge$2(k$6(ii,_d),Dd);Bd=!!(!lf&&k$6(oi.dirtyFields,_d)),pf||lf?oe$3(oi.dirtyFields,_d):J$5(oi.dirtyFields,_d,!0),nf.dirtyFields=oi.dirtyFields,Id=Id||hi.dirtyFields&&Bd!==!pf}if(tf){const pf=k$6(oi.touchedFields,_d);pf||(J$5(oi.touchedFields,_d,tf),nf.touchedFields=oi.touchedFields,Id=Id||hi.touchedFields&&pf!==tf)}Id&&Sd&&pi.state.next(nf)}return Id?nf:{}},Od=(_d,Dd,tf,vd)=>{const Sd=k$6(oi.errors,_d),Id=hi.isValid&&be$2(Dd)&&oi.isValid!==Dd;if(ws.delayError&&tf?(ui=ba(()=>el(_d,tf)),ui(ws.delayError)):(clearTimeout(di),ui=null,tf?J$5(oi.errors,_d,tf):oe$3(oi.errors,_d)),(tf?!Ge$2(Sd,tf):Sd)||!me$2(vd)||Id){const Bd={...vd,...Id&&be$2(Dd)?{isValid:Dd}:{},errors:oi.errors,name:_d};oi={...oi,...Bd},pi.state.next(Bd)}},Nd=async _d=>{xa(_d,!0);const Dd=await ws.resolver(ai,ws.context,Ri(_d||ci.mount,si,ws.criteriaMode,ws.shouldUseNativeValidation));return xa(_d),Dd},Pd=async _d=>{const{errors:Dd}=await Nd(_d);if(_d)for(const tf of _d){const vd=k$6(Dd,tf);vd?J$5(oi.errors,tf,vd):oe$3(oi.errors,tf)}else oi.errors=Dd;return Dd},Ld=async(_d,Dd,tf={valid:!0})=>{for(const vd in _d){const Sd=_d[vd];if(Sd){const{_f:Id,...Bd}=Sd;if(Id){const nf=ci.array.has(Id.name),lf=Sd._f&&Mi$1(Sd._f);lf&&hi.validatingFields&&xa([vd],!0);const pf=await Rr$2(Sd,ci.disabled,ai,va,ws.shouldUseNativeValidation&&!Dd,nf);if(lf&&hi.validatingFields&&xa([vd]),pf[Id.name]&&(tf.valid=!1,Dd))break;!Dd&&(k$6(pf,Id.name)?nf?Ci(oi.errors,pf,Id.name):J$5(oi.errors,Id.name,pf[Id.name]):oe$3(oi.errors,Id.name))}!me$2(Bd)&&await Ld(Bd,Dd,tf)}}return tf.valid},rf=()=>{for(const _d of ci.unMount){const Dd=k$6(si,_d);Dd&&(Dd._f.refs?Dd._f.refs.every(tf=>!vn$2(tf)):!vn$2(Dd._f.ref))&&ff(_d)}ci.unMount=new Set},kd=(_d,Dd)=>!ws.disabled&&(_d&&Dd&&J$5(ai,_d,Dd),!Ge$2(hf(),ii)),Md=(_d,Dd,tf)=>po$1(_d,ci,{...li.mount?ai:ne$2(Dd)?ii:Te$2(_d)?{[_d]:Dd}:Dd},tf,Dd),Td=_d=>nn$1(k$6(li.mount?ai:ii,_d,ws.shouldUnregister?k$6(ii,_d,[]):[])),wd=(_d,Dd,tf={})=>{const vd=k$6(si,_d);let Sd=Dd;if(vd){const Id=vd._f;Id&&(!Id.disabled&&J$5(ai,_d,bo(Dd,Id)),Sd=Ht$1(Id.ref)&&de$2(Dd)?"":Dd,go$1(Id.ref)?[...Id.ref.options].forEach(Bd=>Bd.selected=Sd.includes(Bd.value)):Id.refs?Pt$2(Id.ref)?Id.refs.length>1?Id.refs.forEach(Bd=>(!Bd.defaultChecked||!Bd.disabled)&&(Bd.checked=Array.isArray(Sd)?!!Sd.find(nf=>nf===Bd.value):Sd===Bd.value)):Id.refs[0]&&(Id.refs[0].checked=!!Sd):Id.refs.forEach(Bd=>Bd.checked=Bd.value===Sd):Gn$1(Id.ref)?Id.ref.value="":(Id.ref.value=Sd,Id.ref.type||pi.values.next({name:_d,values:{...ai}})))}(tf.shouldDirty||tf.shouldTouch)&&Ed(_d,Sd,tf.shouldTouch,tf.shouldDirty,!0),tf.shouldValidate&&df(_d)},Cd=(_d,Dd,tf)=>{for(const vd in Dd){const Sd=Dd[vd],Id=`${_d}.${vd}`,Bd=k$6(si,Id);(ci.array.has(_d)||re$1(Sd)||Bd&&!Bd._f)&&!Ye$2(Sd)?Cd(Id,Sd,tf):wd(Id,Sd,tf)}},sf=(_d,Dd,tf={})=>{const vd=k$6(si,_d),Sd=ci.array.has(_d),Id=pe$1(Dd);J$5(ai,_d,Id),Sd?(pi.array.next({name:_d,values:{...ai}}),(hi.isDirty||hi.dirtyFields)&&tf.shouldDirty&&pi.state.next({name:_d,dirtyFields:gt$2(ii,ai),isDirty:kd(_d,Id)})):vd&&!vd._f&&!de$2(Id)?Cd(_d,Id,tf):wd(_d,Id,tf),xr$2(_d,ci)&&pi.state.next({...oi}),pi.values.next({name:li.mount?_d:void 0,values:{...ai}})},of=async _d=>{li.mount=!0;const Dd=_d.target;let tf=Dd.name,vd=!0;const Sd=k$6(si,tf),Id=()=>Dd.type?yn$2(Sd._f):so$1(_d),Bd=nf=>{vd=Number.isNaN(nf)||Ye$2(nf)&&isNaN(nf.getTime())||Ge$2(nf,k$6(ai,tf,nf))};if(Sd){let nf,lf;const pf=Id(),gf=_d.type===jt$2.BLUR||_d.type===jt$2.FOCUS_OUT,vf=!_i$1(Sd._f)&&!ws.resolver&&!k$6(oi.errors,tf)&&!Sd._f.deps||Pi(gf,k$6(oi.touchedFields,tf),oi.isSubmitted,ga,ha),bf=xr$2(tf,ci,gf);J$5(ai,tf,pf),gf?(Sd._f.onBlur&&Sd._f.onBlur(_d),ui&&ui(0)):Sd._f.onChange&&Sd._f.onChange(_d);const If=Ed(tf,pf,gf,!1),Af=!me$2(If)||bf;if(!gf&&pi.values.next({name:tf,type:_d.type,values:{...ai}}),vf)return hi.isValid&&(ws.mode==="onBlur"&&gf?wa():gf||wa()),Af&&pi.state.next({name:tf,...bf?{}:If});if(!gf&&bf&&pi.state.next({...oi}),ws.resolver){const{errors:$f}=await Nd([tf]);if(Bd(pf),vd){const Cf=_r$2(oi.errors,si,tf),kf=_r$2($f,si,Cf.name||tf);nf=kf.error,tf=kf.name,lf=me$2($f)}}else xa([tf],!0),nf=(await Rr$2(Sd,ci.disabled,ai,va,ws.shouldUseNativeValidation))[tf],xa([tf]),Bd(pf),vd&&(nf?lf=!1:hi.isValid&&(lf=await Ld(si,!0)));vd&&(Sd._f.deps&&df(Sd._f.deps),Od(tf,lf,nf,If))}},Wd=(_d,Dd)=>{if(k$6(oi.errors,Dd)&&_d.focus)return _d.focus(),1},df=async(_d,Dd={})=>{let tf,vd;const Sd=xt$1(_d);if(ws.resolver){const Id=await Pd(ne$2(_d)?_d:Sd);tf=me$2(Id),vd=_d?!Sd.some(Bd=>k$6(Id,Bd)):tf}else _d?(vd=(await Promise.all(Sd.map(async Id=>{const Bd=k$6(si,Id);return await Ld(Bd&&Bd._f?{[Id]:Bd}:Bd)}))).every(Boolean),!(!vd&&!oi.isValid)&&wa()):vd=tf=await Ld(si);return pi.state.next({...!Te$2(_d)||hi.isValid&&tf!==oi.isValid?{}:{name:_d},...ws.resolver||!_d?{isValid:tf}:{},errors:oi.errors}),Dd.shouldFocus&&!vd&&Ct$2(si,Wd,_d?Sd:ci.mount),vd},hf=_d=>{const Dd={...li.mount?ai:ii};return ne$2(_d)?Dd:Te$2(_d)?k$6(Dd,_d):_d.map(tf=>k$6(Dd,tf))},xd=(_d,Dd)=>({invalid:!!k$6((Dd||oi).errors,_d),isDirty:!!k$6((Dd||oi).dirtyFields,_d),error:k$6((Dd||oi).errors,_d),isValidating:!!k$6(oi.validatingFields,_d),isTouched:!!k$6((Dd||oi).touchedFields,_d)}),Fd=_d=>{_d&&xt$1(_d).forEach(Dd=>oe$3(oi.errors,Dd)),pi.state.next({errors:_d?oi.errors:{}})},Vd=(_d,Dd,tf)=>{const vd=(k$6(si,_d,{_f:{}})._f||{}).ref,Sd=k$6(oi.errors,_d)||{},{ref:Id,message:Bd,type:nf,...lf}=Sd;J$5(oi.errors,_d,{...lf,...Dd,ref:vd}),pi.state.next({name:_d,errors:oi.errors,isValid:!1}),tf&&tf.shouldFocus&&vd&&vd.focus&&vd.focus()},af=(_d,Dd)=>_e$2(_d)?pi.values.subscribe({next:tf=>_d(Md(void 0,Dd),tf)}):Md(_d,Dd,!0),ff=(_d,Dd={})=>{for(const tf of _d?xt$1(_d):ci.mount)ci.mount.delete(tf),ci.array.delete(tf),Dd.keepValue||(oe$3(si,tf),oe$3(ai,tf)),!Dd.keepError&&oe$3(oi.errors,tf),!Dd.keepDirty&&oe$3(oi.dirtyFields,tf),!Dd.keepTouched&&oe$3(oi.touchedFields,tf),!Dd.keepIsValidating&&oe$3(oi.validatingFields,tf),!ws.shouldUnregister&&!Dd.keepDefaultValue&&oe$3(ii,tf);pi.values.next({values:{...ai}}),pi.state.next({...oi,...Dd.keepDirty?{isDirty:kd()}:{}}),!Dd.keepIsValid&&wa()},uf=({disabled:_d,name:Dd,field:tf,fields:vd})=>{(be$2(_d)&&li.mount||_d||ci.disabled.has(Dd))&&(_d?ci.disabled.add(Dd):ci.disabled.delete(Dd),Ed(Dd,yn$2(tf?tf._f:k$6(vd,Dd)._f),!1,!1,!0))},mf=(_d,Dd={})=>{let tf=k$6(si,_d);const vd=be$2(Dd.disabled)||be$2(ws.disabled);return J$5(si,_d,{...tf||{},_f:{...tf&&tf._f?tf._f:{ref:{name:_d}},name:_d,mount:!0,...Dd}}),ci.mount.add(_d),tf?uf({field:tf,disabled:be$2(Dd.disabled)?Dd.disabled:ws.disabled,name:_d}):gd(_d,!0,Dd.value),{...vd?{disabled:Dd.disabled||ws.disabled}:{},...ws.progressive?{required:!!Dd.required,min:vt$2(Dd.min),max:vt$2(Dd.max),minLength:vt$2(Dd.minLength),maxLength:vt$2(Dd.maxLength),pattern:vt$2(Dd.pattern)}:{},name:_d,onChange:of,onBlur:of,ref:Sd=>{if(Sd){mf(_d,Dd),tf=k$6(si,_d);const Id=ne$2(Sd.value)&&Sd.querySelectorAll&&Sd.querySelectorAll("input,select,textarea")[0]||Sd,Bd=Ai(Id),nf=tf._f.refs||[];if(Bd?nf.find(lf=>lf===Id):Id===tf._f.ref)return;J$5(si,_d,{_f:{...tf._f,...Bd?{refs:[...nf.filter(vn$2),Id,...Array.isArray(k$6(ii,_d))?[{}]:[]],ref:{type:Id.type,name:_d}}:{ref:Id}}}),gd(_d,!1,void 0,Id)}else tf=k$6(si,_d,{}),tf._f&&(tf._f.mount=!1),(ws.shouldUnregister||Dd.shouldUnregister)&&!(io$1(ci.array,_d)&&li.action)&&ci.unMount.add(_d)}}},yf=()=>ws.shouldFocusError&&Ct$2(si,Wd,ci.mount),Sf=_d=>{be$2(_d)&&(pi.state.next({disabled:_d}),Ct$2(si,(Dd,tf)=>{const vd=k$6(si,tf);vd&&(Dd.disabled=vd._f.disabled||_d,Array.isArray(vd._f.refs)&&vd._f.refs.forEach(Sd=>{Sd.disabled=vd._f.disabled||_d}))},0,!1))},Of=(_d,Dd)=>async tf=>{let vd;tf&&(tf.preventDefault&&tf.preventDefault(),tf.persist&&tf.persist());let Sd=pe$1(ai);if(ci.disabled.size)for(const Id of ci.disabled)J$5(Sd,Id,void 0);if(pi.state.next({isSubmitting:!0}),ws.resolver){const{errors:Id,values:Bd}=await Nd();oi.errors=Id,Sd=Bd}else await Ld(si);if(oe$3(oi.errors,"root"),me$2(oi.errors)){pi.state.next({errors:{}});try{await _d(Sd,tf)}catch(Id){vd=Id}}else Dd&&await Dd({...oi.errors},tf),yf(),setTimeout(yf);if(pi.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:me$2(oi.errors)&&!vd,submitCount:oi.submitCount+1,errors:oi.errors}),vd)throw vd},wf=(_d,Dd={})=>{k$6(si,_d)&&(ne$2(Dd.defaultValue)?sf(_d,pe$1(k$6(ii,_d))):(sf(_d,Dd.defaultValue),J$5(ii,_d,pe$1(Dd.defaultValue))),Dd.keepTouched||oe$3(oi.touchedFields,_d),Dd.keepDirty||(oe$3(oi.dirtyFields,_d),oi.isDirty=Dd.defaultValue?kd(_d,pe$1(k$6(ii,_d))):kd()),Dd.keepError||(oe$3(oi.errors,_d),hi.isValid&&wa()),pi.state.next({...oi}))},Ef=(_d,Dd={})=>{const tf=_d?pe$1(_d):ii,vd=pe$1(tf),Sd=me$2(_d),Id=Sd?ii:vd;if(Dd.keepDefaultValues||(ii=tf),!Dd.keepValues){if(Dd.keepDirtyValues){const Bd=new Set([...ci.mount,...Object.keys(gt$2(ii,ai))]);for(const nf of Array.from(Bd))k$6(oi.dirtyFields,nf)?J$5(Id,nf,k$6(ai,nf)):sf(nf,k$6(Id,nf))}else{if(Un$1&&ne$2(_d))for(const Bd of ci.mount){const nf=k$6(si,Bd);if(nf&&nf._f){const lf=Array.isArray(nf._f.refs)?nf._f.refs[0]:nf._f.ref;if(Ht$1(lf)){const pf=lf.closest("form");if(pf){pf.reset();break}}}}si={}}ai=ws.shouldUnregister?Dd.keepDefaultValues?pe$1(ii):{}:pe$1(Id),pi.array.next({values:{...Id}}),pi.values.next({values:{...Id}})}ci={mount:Dd.keepDirtyValues?ci.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},li.mount=!hi.isValid||!!Dd.keepIsValid||!!Dd.keepDirtyValues,li.watch=!!ws.shouldUnregister,pi.state.next({submitCount:Dd.keepSubmitCount?oi.submitCount:0,isDirty:Sd?!1:Dd.keepDirty?oi.isDirty:!!(Dd.keepDefaultValues&&!Ge$2(_d,ii)),isSubmitted:Dd.keepIsSubmitted?oi.isSubmitted:!1,dirtyFields:Sd?{}:Dd.keepDirtyValues?Dd.keepDefaultValues&&ai?gt$2(ii,ai):oi.dirtyFields:Dd.keepDefaultValues&&_d?gt$2(ii,_d):Dd.keepDirty?oi.dirtyFields:{},touchedFields:Dd.keepTouched?oi.touchedFields:{},errors:Dd.keepErrors?oi.errors:{},isSubmitSuccessful:Dd.keepIsSubmitSuccessful?oi.isSubmitSuccessful:!1,isSubmitting:!1})},xf=(_d,Dd)=>Ef(_e$2(_d)?_d(ai):_d,Dd);return{control:{register:mf,unregister:ff,getFieldState:xd,handleSubmit:Of,setError:Vd,_executeSchema:Nd,_getWatch:Md,_getDirty:kd,_updateValid:wa,_removeUnmounted:rf,_updateFieldArray:Ca,_updateDisabledField:uf,_getFieldArray:Td,_reset:Ef,_resetDefaultValues:()=>_e$2(ws.defaultValues)&&ws.defaultValues().then(_d=>{xf(_d,ws.resetOptions),pi.state.next({isLoading:!1})}),_updateFormState:_d=>{oi={...oi,..._d}},_disableForm:Sf,_subjects:pi,_proxyFormState:hi,_setErrors:ku,get _fields(){return si},get _formValues(){return ai},get _state(){return li},set _state(_d){li=_d},get _defaultValues(){return ii},get _names(){return ci},set _names(_d){ci=_d},get _formState(){return oi},set _formState(_d){oi=_d},get _options(){return ws},set _options(_d){ws={...ws,..._d}}},trigger:df,register:mf,handleSubmit:Of,watch:af,setValue:sf,getValues:hf,reset:xf,resetField:wf,clearErrors:Fd,unregister:ff,setError:Vd,setFocus:(_d,Dd={})=>{const tf=k$6(si,_d),vd=tf&&tf._f;if(vd){const Sd=vd.refs?vd.refs[0]:vd.ref;Sd.focus&&(Sd.focus(),Dd.shouldSelect&&_e$2(Sd.select)&&Sd.select())}},getFieldState:xd}}function Gd(Ws={}){const ws=React__default.useRef(void 0),oi=React__default.useRef(void 0),[si,ii]=React__default.useState({isDirty:!1,isValidating:!1,isLoading:_e$2(Ws.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:Ws.errors||{},disabled:Ws.disabled||!1,defaultValues:_e$2(Ws.defaultValues)?void 0:Ws.defaultValues});ws.current||(ws.current={...Oi(Ws),formState:si});const ai=ws.current.control;return ai._options=Ws,zn$2({subject:ai._subjects.state,next:li=>{uo$1(li,ai._proxyFormState,ai._updateFormState,!0)&&ii({...ai._formState})}}),React__default.useEffect(()=>ai._disableForm(Ws.disabled),[ai,Ws.disabled]),React__default.useEffect(()=>{if(ai._proxyFormState.isDirty){const li=ai._getDirty();li!==si.isDirty&&ai._subjects.state.next({isDirty:li})}},[ai,si.isDirty]),React__default.useEffect(()=>{Ws.values&&!Ge$2(Ws.values,oi.current)?(ai._reset(Ws.values,ai._options.resetOptions),oi.current=Ws.values,ii(li=>({...li}))):ai._resetDefaultValues()},[Ws.values,ai]),React__default.useEffect(()=>{Ws.errors&&ai._setErrors(Ws.errors)},[Ws.errors,ai]),React__default.useEffect(()=>{ai._state.mount||(ai._updateValid(),ai._state.mount=!0),ai._state.watch&&(ai._state.watch=!1,ai._subjects.state.next({...ai._formState})),ai._removeUnmounted()}),React__default.useEffect(()=>{Ws.shouldUnregister&&ai._subjects.values.next({values:ai._getWatch()})},[Ws.shouldUnregister,ai]),ws.current.formState=lo$1(si,ai),ws.current}function Pr$2(Ws,ws){if(typeof Ws=="function")return Ws(ws);Ws!=null&&(Ws.current=ws)}function rn$1(...Ws){return ws=>{let oi=!1;const si=Ws.map(ii=>{const ai=Pr$2(ii,ws);return!oi&&typeof ai=="function"&&(oi=!0),ai});if(oi)return()=>{for(let ii=0;ii<si.length;ii++){const ai=si[ii];typeof ai=="function"?ai():Pr$2(Ws[ii],null)}}}}function ge$2(...Ws){return React.useCallback(rn$1(...Ws),Ws)}var St$2=React.forwardRef((Ws,ws)=>{const{children:oi,...si}=Ws,ii=React.Children.toArray(oi),ai=ii.find(Ii);if(ai){const li=ai.props.children,ci=ii.map(ui=>ui===ai?React.Children.count(li)>1?React.Children.only(null):React.isValidElement(li)?li.props.children:null:ui);return jsx(kn$1,{...si,ref:ws,children:React.isValidElement(li)?React.cloneElement(li,void 0,ci):null})}return jsx(kn$1,{...si,ref:ws,children:oi})});St$2.displayName="Slot";var kn$1=React.forwardRef((Ws,ws)=>{const{children:oi,...si}=Ws;if(React.isValidElement(oi)){const ii=Ni(oi);return React.cloneElement(oi,{...Fi(si,oi.props),ref:ws?rn$1(ws,ii):ii})}return React.Children.count(oi)>1?React.Children.only(null):null});kn$1.displayName="SlotClone";var Di$1=({children:Ws})=>jsx(Fragment,{children:Ws});function Ii(Ws){return React.isValidElement(Ws)&&Ws.type===Di$1}function Fi(Ws,ws){const oi={...ws};for(const si in ws){const ii=Ws[si],ai=ws[si];/^on[A-Z]/.test(si)?ii&&ai?oi[si]=(...li)=>{ai(...li),ii(...li)}:ii&&(oi[si]=ii):si==="style"?oi[si]={...ii,...ai}:si==="className"&&(oi[si]=[ii,ai].filter(Boolean).join(" "))}return{...Ws,...oi}}function Ni(Ws){var ws,oi;let si=(ws=Object.getOwnPropertyDescriptor(Ws.props,"ref"))==null?void 0:ws.get,ii=si&&"isReactWarning"in si&&si.isReactWarning;return ii?Ws.ref:(si=(oi=Object.getOwnPropertyDescriptor(Ws,"ref"))==null?void 0:oi.get,ii=si&&"isReactWarning"in si&&si.isReactWarning,ii?Ws.props.ref:Ws.props.ref||Ws.ref)}var Li$1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],se$2=Li$1.reduce((Ws,ws)=>{const oi=React.forwardRef((si,ii)=>{const{asChild:ai,...li}=si,ci=ai?St$2:ws;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsx(ci,{...li,ref:ii})});return oi.displayName=`Primitive.${ws}`,{...Ws,[ws]:oi}},{});function wo$1(Ws,ws){Ws&&ReactDOM.flushSync(()=>Ws.dispatchEvent(ws))}function xo(Ws){var ws,oi,si="";if(typeof Ws=="string"||typeof Ws=="number")si+=Ws;else if(typeof Ws=="object")if(Array.isArray(Ws)){var ii=Ws.length;for(ws=0;ws<ii;ws++)Ws[ws]&&(oi=xo(Ws[ws]))&&(si&&(si+=" "),si+=oi)}else for(oi in Ws)Ws[oi]&&(si&&(si+=" "),si+=oi);return si}function jd(){for(var Ws,ws,oi=0,si="",ii=arguments.length;oi<ii;oi++)(Ws=arguments[oi])&&(ws=xo(Ws))&&(si&&(si+=" "),si+=ws);return si}const Hn$1="-",Vi=Ws=>{const ws=Ui(Ws),{conflictingClassGroups:oi,conflictingClassGroupModifiers:si}=Ws;return{getClassGroupId:ii=>{const ai=ii.split(Hn$1);return ai[0]===""&&ai.length!==1&&ai.shift(),Co(ai,ws)||Bi(ii)},getConflictingClassGroupIds:(ii,ai)=>{const li=oi[ii]||[];return ai&&si[ii]?[...li,...si[ii]]:li}}},Co=(Ws,ws)=>{var oi;if(Ws.length===0)return ws.classGroupId;const si=Ws[0],ii=ws.nextPart.get(si),ai=ii?Co(Ws.slice(1),ii):void 0;if(ai)return ai;if(ws.validators.length===0)return;const li=Ws.join(Hn$1);return(oi=ws.validators.find(({validator:ci})=>ci(li)))==null?void 0:oi.classGroupId},Tr$2=/^\[(.+)\]$/,Bi=Ws=>{if(Tr$2.test(Ws)){const ws=Tr$2.exec(Ws)[1],oi=ws==null?void 0:ws.substring(0,ws.indexOf(":"));if(oi)return"arbitrary.."+oi}},Ui=Ws=>{const{theme:ws,prefix:oi}=Ws,si={nextPart:new Map,validators:[]};return $i(Object.entries(Ws.classGroups),oi).forEach(([ii,ai])=>{On$2(ai,si,ii,ws)}),si},On$2=(Ws,ws,oi,si)=>{Ws.forEach(ii=>{if(typeof ii=="string"){const ai=ii===""?ws:kr$2(ws,ii);ai.classGroupId=oi;return}if(typeof ii=="function"){if(Wi(ii)){On$2(ii(si),ws,oi,si);return}ws.validators.push({validator:ii,classGroupId:oi});return}Object.entries(ii).forEach(([ai,li])=>{On$2(li,kr$2(ws,ai),oi,si)})})},kr$2=(Ws,ws)=>{let oi=Ws;return ws.split(Hn$1).forEach(si=>{oi.nextPart.has(si)||oi.nextPart.set(si,{nextPart:new Map,validators:[]}),oi=oi.nextPart.get(si)}),oi},Wi=Ws=>Ws.isThemeGetter,$i=(Ws,ws)=>ws?Ws.map(([oi,si])=>{const ii=si.map(ai=>typeof ai=="string"?ws+ai:typeof ai=="object"?Object.fromEntries(Object.entries(ai).map(([li,ci])=>[ws+li,ci])):ai);return[oi,ii]}):Ws,zi=Ws=>{if(Ws<1)return{get:()=>{},set:()=>{}};let ws=0,oi=new Map,si=new Map;const ii=(ai,li)=>{oi.set(ai,li),ws++,ws>Ws&&(ws=0,si=oi,oi=new Map)};return{get(ai){let li=oi.get(ai);if(li!==void 0)return li;if((li=si.get(ai))!==void 0)return ii(ai,li),li},set(ai,li){oi.has(ai)?oi.set(ai,li):ii(ai,li)}}},So="!",Gi=Ws=>{const{separator:ws,experimentalParseClassName:oi}=Ws,si=ws.length===1,ii=ws[0],ai=ws.length,li=ci=>{const ui=[];let di=0,hi=0,pi;for(let wa=0;wa<ci.length;wa++){let xa=ci[wa];if(di===0){if(xa===ii&&(si||ci.slice(wa,wa+ai)===ws)){ui.push(ci.slice(hi,wa)),hi=wa+ai;continue}if(xa==="/"){pi=wa;continue}}xa==="["?di++:xa==="]"&&di--}const ha=ui.length===0?ci:ci.substring(hi),ga=ha.startsWith(So),va=ga?ha.substring(1):ha,ba=pi&&pi>hi?pi-hi:void 0;return{modifiers:ui,hasImportantModifier:ga,baseClassName:va,maybePostfixModifierPosition:ba}};return oi?ci=>oi({className:ci,parseClassName:li}):li},ji$1=Ws=>{if(Ws.length<=1)return Ws;const ws=[];let oi=[];return Ws.forEach(si=>{si[0]==="["?(ws.push(...oi.sort(),si),oi=[]):oi.push(si)}),ws.push(...oi.sort()),ws},Hi=Ws=>({cache:zi(Ws.cacheSize),parseClassName:Gi(Ws),...Vi(Ws)}),Ki=/\s+/,Yi=(Ws,ws)=>{const{parseClassName:oi,getClassGroupId:si,getConflictingClassGroupIds:ii}=ws,ai=[],li=Ws.trim().split(Ki);let ci="";for(let ui=li.length-1;ui>=0;ui-=1){const di=li[ui],{modifiers:hi,hasImportantModifier:pi,baseClassName:ha,maybePostfixModifierPosition:ga}=oi(di);let va=!!ga,ba=si(va?ha.substring(0,ga):ha);if(!ba){if(!va){ci=di+(ci.length>0?" "+ci:ci);continue}if(ba=si(ha),!ba){ci=di+(ci.length>0?" "+ci:ci);continue}va=!1}const wa=ji$1(hi).join(":"),xa=pi?wa+So:wa,Ca=xa+ba;if(ai.includes(Ca))continue;ai.push(Ca);const el=ii(ba,va);for(let ku=0;ku<el.length;++ku){const gd=el[ku];ai.push(xa+gd)}ci=di+(ci.length>0?" "+ci:ci)}return ci};function Xi(){let Ws=0,ws,oi,si="";for(;Ws<arguments.length;)(ws=arguments[Ws++])&&(oi=Eo$1(ws))&&(si&&(si+=" "),si+=oi);return si}const Eo$1=Ws=>{if(typeof Ws=="string")return Ws;let ws,oi="";for(let si=0;si<Ws.length;si++)Ws[si]&&(ws=Eo$1(Ws[si]))&&(oi&&(oi+=" "),oi+=ws);return oi};function qi(Ws,...ws){let oi,si,ii,ai=li;function li(ui){const di=ws.reduce((hi,pi)=>pi(hi),Ws());return oi=Hi(di),si=oi.cache.get,ii=oi.cache.set,ai=ci,ci(ui)}function ci(ui){const di=si(ui);if(di)return di;const hi=Yi(ui,oi);return ii(ui,hi),hi}return function(){return ai(Xi.apply(null,arguments))}}const ee$1=Ws=>{const ws=oi=>oi[Ws]||[];return ws.isThemeGetter=!0,ws},Ao=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zi=/^\d+\/\d+$/,Qi=new Set(["px","full","screen"]),Ji=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ea=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ta=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,na=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ra=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fe$2=Ws=>ot$1(Ws)||Qi.has(Ws)||Zi.test(Ws),We$2=Ws=>ct$1(Ws,"length",da$1),ot$1=Ws=>!!Ws&&!Number.isNaN(Number(Ws)),bn$1=Ws=>ct$1(Ws,"number",ot$1),yt$1=Ws=>!!Ws&&Number.isInteger(Number(Ws)),oa=Ws=>Ws.endsWith("%")&&ot$1(Ws.slice(0,-1)),z$5=Ws=>Ao.test(Ws),$e$2=Ws=>Ji.test(Ws),sa=new Set(["length","size","percentage"]),ia=Ws=>ct$1(Ws,sa,Ro),aa=Ws=>ct$1(Ws,"position",Ro),ca=new Set(["image","url"]),la=Ws=>ct$1(Ws,ca,pa$1),ua$1=Ws=>ct$1(Ws,"",fa$1),bt$2=()=>!0,ct$1=(Ws,ws,oi)=>{const si=Ao.exec(Ws);return si?si[1]?typeof ws=="string"?si[1]===ws:ws.has(si[1]):oi(si[2]):!1},da$1=Ws=>ea.test(Ws)&&!ta.test(Ws),Ro=()=>!1,fa$1=Ws=>na.test(Ws),pa$1=Ws=>ra.test(Ws),ma$1=()=>{const Ws=ee$1("colors"),ws=ee$1("spacing"),oi=ee$1("blur"),si=ee$1("brightness"),ii=ee$1("borderColor"),ai=ee$1("borderRadius"),li=ee$1("borderSpacing"),ci=ee$1("borderWidth"),ui=ee$1("contrast"),di=ee$1("grayscale"),hi=ee$1("hueRotate"),pi=ee$1("invert"),ha=ee$1("gap"),ga=ee$1("gradientColorStops"),va=ee$1("gradientColorStopPositions"),ba=ee$1("inset"),wa=ee$1("margin"),xa=ee$1("opacity"),Ca=ee$1("padding"),el=ee$1("saturate"),ku=ee$1("scale"),gd=ee$1("sepia"),Ed=ee$1("skew"),Od=ee$1("space"),Nd=ee$1("translate"),Pd=()=>["auto","contain","none"],Ld=()=>["auto","hidden","clip","visible","scroll"],rf=()=>["auto",z$5,ws],kd=()=>[z$5,ws],Md=()=>["",Fe$2,We$2],Td=()=>["auto",ot$1,z$5],wd=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Cd=()=>["solid","dashed","dotted","double","none"],sf=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],of=()=>["start","end","center","between","around","evenly","stretch"],Wd=()=>["","0",z$5],df=()=>["auto","avoid","all","avoid-page","page","left","right","column"],hf=()=>[ot$1,z$5];return{cacheSize:500,separator:":",theme:{colors:[bt$2],spacing:[Fe$2,We$2],blur:["none","",$e$2,z$5],brightness:hf(),borderColor:[Ws],borderRadius:["none","","full",$e$2,z$5],borderSpacing:kd(),borderWidth:Md(),contrast:hf(),grayscale:Wd(),hueRotate:hf(),invert:Wd(),gap:kd(),gradientColorStops:[Ws],gradientColorStopPositions:[oa,We$2],inset:rf(),margin:rf(),opacity:hf(),padding:kd(),saturate:hf(),scale:hf(),sepia:Wd(),skew:hf(),space:kd(),translate:kd()},classGroups:{aspect:[{aspect:["auto","square","video",z$5]}],container:["container"],columns:[{columns:[$e$2]}],"break-after":[{"break-after":df()}],"break-before":[{"break-before":df()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...wd(),z$5]}],overflow:[{overflow:Ld()}],"overflow-x":[{"overflow-x":Ld()}],"overflow-y":[{"overflow-y":Ld()}],overscroll:[{overscroll:Pd()}],"overscroll-x":[{"overscroll-x":Pd()}],"overscroll-y":[{"overscroll-y":Pd()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[ba]}],"inset-x":[{"inset-x":[ba]}],"inset-y":[{"inset-y":[ba]}],start:[{start:[ba]}],end:[{end:[ba]}],top:[{top:[ba]}],right:[{right:[ba]}],bottom:[{bottom:[ba]}],left:[{left:[ba]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yt$1,z$5]}],basis:[{basis:rf()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z$5]}],grow:[{grow:Wd()}],shrink:[{shrink:Wd()}],order:[{order:["first","last","none",yt$1,z$5]}],"grid-cols":[{"grid-cols":[bt$2]}],"col-start-end":[{col:["auto",{span:["full",yt$1,z$5]},z$5]}],"col-start":[{"col-start":Td()}],"col-end":[{"col-end":Td()}],"grid-rows":[{"grid-rows":[bt$2]}],"row-start-end":[{row:["auto",{span:[yt$1,z$5]},z$5]}],"row-start":[{"row-start":Td()}],"row-end":[{"row-end":Td()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",z$5]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z$5]}],gap:[{gap:[ha]}],"gap-x":[{"gap-x":[ha]}],"gap-y":[{"gap-y":[ha]}],"justify-content":[{justify:["normal",...of()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...of(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...of(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[Ca]}],px:[{px:[Ca]}],py:[{py:[Ca]}],ps:[{ps:[Ca]}],pe:[{pe:[Ca]}],pt:[{pt:[Ca]}],pr:[{pr:[Ca]}],pb:[{pb:[Ca]}],pl:[{pl:[Ca]}],m:[{m:[wa]}],mx:[{mx:[wa]}],my:[{my:[wa]}],ms:[{ms:[wa]}],me:[{me:[wa]}],mt:[{mt:[wa]}],mr:[{mr:[wa]}],mb:[{mb:[wa]}],ml:[{ml:[wa]}],"space-x":[{"space-x":[Od]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Od]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z$5,ws]}],"min-w":[{"min-w":[z$5,ws,"min","max","fit"]}],"max-w":[{"max-w":[z$5,ws,"none","full","min","max","fit","prose",{screen:[$e$2]},$e$2]}],h:[{h:[z$5,ws,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z$5,ws,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z$5,ws,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z$5,ws,"auto","min","max","fit"]}],"font-size":[{text:["base",$e$2,We$2]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bn$1]}],"font-family":[{font:[bt$2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z$5]}],"line-clamp":[{"line-clamp":["none",ot$1,bn$1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fe$2,z$5]}],"list-image":[{"list-image":["none",z$5]}],"list-style-type":[{list:["none","disc","decimal",z$5]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[Ws]}],"placeholder-opacity":[{"placeholder-opacity":[xa]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[Ws]}],"text-opacity":[{"text-opacity":[xa]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Cd(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fe$2,We$2]}],"underline-offset":[{"underline-offset":["auto",Fe$2,z$5]}],"text-decoration-color":[{decoration:[Ws]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:kd()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z$5]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z$5]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[xa]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...wd(),aa]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ia]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},la]}],"bg-color":[{bg:[Ws]}],"gradient-from-pos":[{from:[va]}],"gradient-via-pos":[{via:[va]}],"gradient-to-pos":[{to:[va]}],"gradient-from":[{from:[ga]}],"gradient-via":[{via:[ga]}],"gradient-to":[{to:[ga]}],rounded:[{rounded:[ai]}],"rounded-s":[{"rounded-s":[ai]}],"rounded-e":[{"rounded-e":[ai]}],"rounded-t":[{"rounded-t":[ai]}],"rounded-r":[{"rounded-r":[ai]}],"rounded-b":[{"rounded-b":[ai]}],"rounded-l":[{"rounded-l":[ai]}],"rounded-ss":[{"rounded-ss":[ai]}],"rounded-se":[{"rounded-se":[ai]}],"rounded-ee":[{"rounded-ee":[ai]}],"rounded-es":[{"rounded-es":[ai]}],"rounded-tl":[{"rounded-tl":[ai]}],"rounded-tr":[{"rounded-tr":[ai]}],"rounded-br":[{"rounded-br":[ai]}],"rounded-bl":[{"rounded-bl":[ai]}],"border-w":[{border:[ci]}],"border-w-x":[{"border-x":[ci]}],"border-w-y":[{"border-y":[ci]}],"border-w-s":[{"border-s":[ci]}],"border-w-e":[{"border-e":[ci]}],"border-w-t":[{"border-t":[ci]}],"border-w-r":[{"border-r":[ci]}],"border-w-b":[{"border-b":[ci]}],"border-w-l":[{"border-l":[ci]}],"border-opacity":[{"border-opacity":[xa]}],"border-style":[{border:[...Cd(),"hidden"]}],"divide-x":[{"divide-x":[ci]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[ci]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[xa]}],"divide-style":[{divide:Cd()}],"border-color":[{border:[ii]}],"border-color-x":[{"border-x":[ii]}],"border-color-y":[{"border-y":[ii]}],"border-color-s":[{"border-s":[ii]}],"border-color-e":[{"border-e":[ii]}],"border-color-t":[{"border-t":[ii]}],"border-color-r":[{"border-r":[ii]}],"border-color-b":[{"border-b":[ii]}],"border-color-l":[{"border-l":[ii]}],"divide-color":[{divide:[ii]}],"outline-style":[{outline:["",...Cd()]}],"outline-offset":[{"outline-offset":[Fe$2,z$5]}],"outline-w":[{outline:[Fe$2,We$2]}],"outline-color":[{outline:[Ws]}],"ring-w":[{ring:Md()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[Ws]}],"ring-opacity":[{"ring-opacity":[xa]}],"ring-offset-w":[{"ring-offset":[Fe$2,We$2]}],"ring-offset-color":[{"ring-offset":[Ws]}],shadow:[{shadow:["","inner","none",$e$2,ua$1]}],"shadow-color":[{shadow:[bt$2]}],opacity:[{opacity:[xa]}],"mix-blend":[{"mix-blend":[...sf(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":sf()}],filter:[{filter:["","none"]}],blur:[{blur:[oi]}],brightness:[{brightness:[si]}],contrast:[{contrast:[ui]}],"drop-shadow":[{"drop-shadow":["","none",$e$2,z$5]}],grayscale:[{grayscale:[di]}],"hue-rotate":[{"hue-rotate":[hi]}],invert:[{invert:[pi]}],saturate:[{saturate:[el]}],sepia:[{sepia:[gd]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[oi]}],"backdrop-brightness":[{"backdrop-brightness":[si]}],"backdrop-contrast":[{"backdrop-contrast":[ui]}],"backdrop-grayscale":[{"backdrop-grayscale":[di]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[hi]}],"backdrop-invert":[{"backdrop-invert":[pi]}],"backdrop-opacity":[{"backdrop-opacity":[xa]}],"backdrop-saturate":[{"backdrop-saturate":[el]}],"backdrop-sepia":[{"backdrop-sepia":[gd]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[li]}],"border-spacing-x":[{"border-spacing-x":[li]}],"border-spacing-y":[{"border-spacing-y":[li]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z$5]}],duration:[{duration:hf()}],ease:[{ease:["linear","in","out","in-out",z$5]}],delay:[{delay:hf()}],animate:[{animate:["none","spin","ping","pulse","bounce",z$5]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[ku]}],"scale-x":[{"scale-x":[ku]}],"scale-y":[{"scale-y":[ku]}],rotate:[{rotate:[yt$1,z$5]}],"translate-x":[{"translate-x":[Nd]}],"translate-y":[{"translate-y":[Nd]}],"skew-x":[{"skew-x":[Ed]}],"skew-y":[{"skew-y":[Ed]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z$5]}],accent:[{accent:["auto",Ws]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z$5]}],"caret-color":[{caret:[Ws]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":kd()}],"scroll-mx":[{"scroll-mx":kd()}],"scroll-my":[{"scroll-my":kd()}],"scroll-ms":[{"scroll-ms":kd()}],"scroll-me":[{"scroll-me":kd()}],"scroll-mt":[{"scroll-mt":kd()}],"scroll-mr":[{"scroll-mr":kd()}],"scroll-mb":[{"scroll-mb":kd()}],"scroll-ml":[{"scroll-ml":kd()}],"scroll-p":[{"scroll-p":kd()}],"scroll-px":[{"scroll-px":kd()}],"scroll-py":[{"scroll-py":kd()}],"scroll-ps":[{"scroll-ps":kd()}],"scroll-pe":[{"scroll-pe":kd()}],"scroll-pt":[{"scroll-pt":kd()}],"scroll-pr":[{"scroll-pr":kd()}],"scroll-pb":[{"scroll-pb":kd()}],"scroll-pl":[{"scroll-pl":kd()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z$5]}],fill:[{fill:[Ws,"none"]}],"stroke-w":[{stroke:[Fe$2,We$2,bn$1]}],stroke:[{stroke:[Ws,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Hd=qi(ma$1);function Sa(Ws){return Ws?typeof Ws=="number"?{width:Ws.toString()+"px",height:Ws.toString()+"px"}:{width:Ws,height:Ws}:{}}const Ea=(Ws,ws,oi)=>{const si=Ws[ws];return si?typeof si=="function"?si():Promise.resolve(si):new Promise((ii,ai)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(ai.bind(null,new Error("Unknown variable dynamic import: "+ws+(ws.split("/").length!==oi?". Note that variables only represent file names one level deep.":""))))})};function Aa(Ws){return jsx("div",{style:{width:Ws.width,height:Ws.height}})}function Ra(Ws){try{return lazy(()=>Ea(Object.assign({"../../../assets/icon-components/ArrowFilledRight.tsx":()=>__vitePreload(()=>import("./ArrowFilledRight-blx8xu7X-D3d8PUWh.js"),[]),"../../../assets/icon-components/ArrowLeft.tsx":()=>__vitePreload(()=>import("./ArrowLeft-7pYNK4eX-8ZR_YHAJ.js"),[]),"../../../assets/icon-components/ArrowUp.tsx":()=>__vitePreload(()=>import("./ArrowUp-Bbr_dwo_-C5ppCQo4.js"),[]),"../../../assets/icon-components/BarChart.tsx":()=>__vitePreload(()=>import("./BarChart-B0G05Nfd-CHDJ7OaJ.js"),[]),"../../../assets/icon-components/BaseArrowLeft.tsx":()=>__vitePreload(()=>import("./BaseArrowLeft-DBzhFHMt-Dkbf2sWs.js"),[]),"../../../assets/icon-components/BaseArrowRight.tsx":()=>__vitePreload(()=>import("./BaseArrowRight-DYQTBWAs-CkkPllYm.js"),[]),"../../../assets/icon-components/Braces.tsx":()=>__vitePreload(()=>import("./Braces-N-sH2Zyc-3LcexUsR.js"),[]),"../../../assets/icon-components/Branch.tsx":()=>__vitePreload(()=>import("./Branch-CWdBw1_P-CmGdOXsI.js"),[]),"../../../assets/icon-components/BrickGlobe.tsx":()=>__vitePreload(()=>import("./BrickGlobe-67zaG6_H-DP0By6z_.js"),[]),"../../../assets/icon-components/Briefcase.tsx":()=>__vitePreload(()=>import("./Briefcase-CedW3KRR-DO5_k15F.js"),[]),"../../../assets/icon-components/Calendar.tsx":()=>__vitePreload(()=>import("./Calendar-C-6HV96D-YetudWvP.js"),[]),"../../../assets/icon-components/CalendarTime.tsx":()=>__vitePreload(()=>import("./CalendarTime-Bhjzlgn_-BVlYgNLL.js"),[]),"../../../assets/icon-components/Caret.tsx":()=>__vitePreload(()=>import("./Caret-Ep0j0fz2-By3ojfim.js"),[]),"../../../assets/icon-components/CaretDown.tsx":()=>__vitePreload(()=>import("./CaretDown-3X7LFYBf-C43xdKg8.js"),[]),"../../../assets/icon-components/CaretLeft.tsx":()=>__vitePreload(()=>import("./CaretLeft-Df3E-68c-wke5zKLt.js"),[]),"../../../assets/icon-components/CaretRight.tsx":()=>__vitePreload(()=>import("./CaretRight-DSVWUSka-Cx0Mkcqa.js"),[]),"../../../assets/icon-components/CaretSort.tsx":()=>__vitePreload(()=>import("./CaretSort-BkGdLETT-DVOzEEqR.js"),[]),"../../../assets/icon-components/Check.tsx":()=>__vitePreload(()=>import("./Check-DV-U4AEq-B582NMZp.js"),[]),"../../../assets/icon-components/CheckCircle.tsx":()=>__vitePreload(()=>import("./CheckCircle-DI5fEgGd-CVF4LDhR.js"),[]),"../../../assets/icon-components/CheckCircleFill.tsx":()=>__vitePreload(()=>import("./CheckCircleFill-C-F0v5mB-BSW1YMqM.js"),[]),"../../../assets/icon-components/Checkmark.tsx":()=>__vitePreload(()=>import("./Checkmark-BXnfChpo-CyQitGI2.js"),[]),"../../../assets/icon-components/ChevronDown.tsx":()=>__vitePreload(()=>import("./ChevronDown-ouBxrU-k-eUsCPXcB.js"),[]),"../../../assets/icon-components/Circle.tsx":()=>__vitePreload(()=>import("./Circle-n3-Wh4HS-8dOehHQf.js"),[]),"../../../assets/icon-components/CircleInfo.tsx":()=>__vitePreload(()=>import("./CircleInfo-BhZY3C2Q-CZgYK1h2.js"),[]),"../../../assets/icon-components/Clock.tsx":()=>__vitePreload(()=>import("./Clock-DF-XMxha-CudavWaE.js"),[]),"../../../assets/icon-components/ClockFill.tsx":()=>__vitePreload(()=>import("./ClockFill-Bd0t48q7-CcfHiJtH.js"),[]),"../../../assets/icon-components/CloudSlash.tsx":()=>__vitePreload(()=>import("./CloudSlash-B-zJBjaD-CxVyp-Ac.js"),[]),"../../../assets/icon-components/Collapse.tsx":()=>__vitePreload(()=>import("./Collapse-DRDB8Czs-CGcuZQgy.js"),[]),"../../../assets/icon-components/Connect.tsx":()=>__vitePreload(()=>import("./Connect-Dme-qfKq-CgniLji8.js"),[]),"../../../assets/icon-components/Copy.tsx":()=>__vitePreload(()=>import("./Copy-ms9-7m7Y-CkOtWZ6m.js"),[]),"../../../assets/icon-components/CrossCircle.tsx":()=>__vitePreload(()=>import("./CrossCircle-B6ZawoOx-z5-kkOo3.js"),[]),"../../../assets/icon-components/Danger.tsx":()=>__vitePreload(()=>import("./Danger-KM8BZjue-CLu7nxgz.js"),[]),"../../../assets/icon-components/Discord.tsx":()=>__vitePreload(()=>import("./Discord-CAS0Cj7s-CcsBWpnf.js"),[]),"../../../assets/icon-components/Drive.tsx":()=>__vitePreload(()=>import("./Drive-GMcgBcIY-CzahDx9j.js"),[]),"../../../assets/icon-components/Edit.tsx":()=>__vitePreload(()=>import("./Edit-Dr-ZiMSE-D9GlgGu8.js"),[]),"../../../assets/icon-components/Ellipsis.tsx":()=>__vitePreload(()=>import("./Ellipsis-XK8AwMEC-BuVBeYhB.js"),[]),"../../../assets/icon-components/Error.tsx":()=>__vitePreload(()=>import("./Error-BmIZ2ZUy-CphzuMLn.js"),[]),"../../../assets/icon-components/Exclamation.tsx":()=>__vitePreload(()=>import("./Exclamation-CVsNS_QS-DLccamql.js"),[]),"../../../assets/icon-components/File.tsx":()=>__vitePreload(()=>import("./File-Ba7ClyaL-BU1g1wjO.js"),[]),"../../../assets/icon-components/FilesEarmark.tsx":()=>__vitePreload(()=>import("./FilesEarmark-CyrCQy8E-Bhut4E02.js"),[]),"../../../assets/icon-components/FolderClose.tsx":()=>__vitePreload(()=>import("./FolderClose-DG_qHisc-CH6NoBuu.js"),[]),"../../../assets/icon-components/FolderOpen.tsx":()=>__vitePreload(()=>import("./FolderOpen-kDoWFkJO-Cciutkdg.js"),[]),"../../../assets/icon-components/FolderPlus.tsx":()=>__vitePreload(()=>import("./FolderPlus-CSBSl9lZ-CifD0ek9.js"),[]),"../../../assets/icon-components/Forum.tsx":()=>__vitePreload(()=>import("./Forum-DZ-CkLFh-BwabccAX.js"),[]),"../../../assets/icon-components/Gear.tsx":()=>__vitePreload(()=>import("./Gear-cUlHJ4q6-B9R2l_9_.js"),[]),"../../../assets/icon-components/Github.tsx":()=>__vitePreload(()=>import("./Github-0PLiINY0-CjkZIHCO.js"),[]),"../../../assets/icon-components/Globe.tsx":()=>__vitePreload(()=>import("./Globe-CIYqVkpa-CL530H46.js"),[]),"../../../assets/icon-components/GlobeWww.tsx":()=>__vitePreload(()=>import("./GlobeWww-DN4yKujh-Ci7aa5CE.js"),[]),"../../../assets/icon-components/Hdd.tsx":()=>__vitePreload(()=>import("./Hdd-Dn_LdJIh-CJ6x9Bve.js"),[]),"../../../assets/icon-components/History.tsx":()=>__vitePreload(()=>import("./History-BP4SmaS_-P4WBKyqX.js"),[]),"../../../assets/icon-components/InfoSquare.tsx":()=>__vitePreload(()=>import("./InfoSquare-C98JaLiz-yPcGR71f.js"),[]),"../../../assets/icon-components/Link.tsx":()=>__vitePreload(()=>import("./Link-BF7aZjVu-CXIVQOz6.js"),[]),"../../../assets/icon-components/Linkedin.tsx":()=>__vitePreload(()=>import("./Linkedin-DJwIkS6q-Dkb5Tp_Z.js"),[]),"../../../assets/icon-components/Lock.tsx":()=>__vitePreload(()=>import("./Lock-PyaFHdNS-D_qxRTye.js"),[]),"../../../assets/icon-components/M.tsx":()=>__vitePreload(()=>import("./M-DozhhPMY-DBQw97P_.js"),[]),"../../../assets/icon-components/PackageManager.tsx":()=>__vitePreload(()=>import("./PackageManager-B-MUWliB-bW01ZQSP.js"),[]),"../../../assets/icon-components/Pencil.tsx":()=>__vitePreload(()=>import("./Pencil-D7lvxXIP-D830iveq.js"),[]),"../../../assets/icon-components/People.tsx":()=>__vitePreload(()=>import("./People-CUB8LYKf-CyJmMqcw.js"),[]),"../../../assets/icon-components/Person.tsx":()=>__vitePreload(()=>import("./Person-DuL4PQzm-ttQR0nPy.js"),[]),"../../../assets/icon-components/Pin.tsx":()=>__vitePreload(()=>import("./Pin-DF70btCU-D53eCMAz.js"),[]),"../../../assets/icon-components/PinFilled.tsx":()=>__vitePreload(()=>import("./PinFilled-vImzS0do-CMXfFW67.js"),[]),"../../../assets/icon-components/Plus.tsx":()=>__vitePreload(()=>import("./Plus-DPFWGJM4-BztpK8li.js"),[]),"../../../assets/icon-components/PlusCircle.tsx":()=>__vitePreload(()=>import("./PlusCircle-BEnWRjHa-w5zztKGx.js"),[]),"../../../assets/icon-components/PowerhouseLogoSmall.tsx":()=>__vitePreload(()=>import("./PowerhouseLogoSmall-CmO95IAS-CDGLkst3.js"),[]),"../../../assets/icon-components/Project.tsx":()=>__vitePreload(()=>import("./Project-BlXuclr0-EsBam9d0.js"),[]),"../../../assets/icon-components/QuestionSquare.tsx":()=>__vitePreload(()=>import("./QuestionSquare-B6O9Le7r-CDaw1i6L.js"),[]),"../../../assets/icon-components/RedoArrow.tsx":()=>__vitePreload(()=>import("./RedoArrow-BJeEsiph-BbidqIFP.js"),[]),"../../../assets/icon-components/Reload.tsx":()=>__vitePreload(()=>import("./Reload-6C2CYgrl-DPZbA7yl.js"),[]),"../../../assets/icon-components/Renown.tsx":()=>__vitePreload(()=>import("./Renown-6m7hx37h-CItksi2j.js"),[]),"../../../assets/icon-components/RenownHover.tsx":()=>__vitePreload(()=>import("./RenownHover-CQ0TZHZv-cYQgnwQW.js"),[]),"../../../assets/icon-components/Ring.tsx":()=>__vitePreload(()=>import("./Ring-DKv0gnwT-CDHLz87h.js"),[]),"../../../assets/icon-components/Save.tsx":()=>__vitePreload(()=>import("./Save-BBxj68pn-BkUvn89C.js"),[]),"../../../assets/icon-components/Search.tsx":()=>__vitePreload(()=>import("./Search-YUJuRBLe-CecGUkZA.js"),[]),"../../../assets/icon-components/Server.tsx":()=>__vitePreload(()=>import("./Server-Bfkkjui1-lBan_3Dm.js"),[]),"../../../assets/icon-components/Settings.tsx":()=>__vitePreload(()=>import("./Settings-mbbylBS5-Cca-sV-_.js"),[]),"../../../assets/icon-components/Synced.tsx":()=>__vitePreload(()=>import("./Synced-DKJXzPiw-Cui8pDsS.js"),[]),"../../../assets/icon-components/Syncing.tsx":()=>__vitePreload(()=>import("./Syncing-aT9WSMFf-2VhhyCcX.js"),[]),"../../../assets/icon-components/Trash.tsx":()=>__vitePreload(()=>import("./Trash-CgSbHk-P-DIYkVMER.js"),[]),"../../../assets/icon-components/TrashFill.tsx":()=>__vitePreload(()=>import("./TrashFill-DN50ercb-Oqx67xXN.js"),[]),"../../../assets/icon-components/TreeViewSlash.tsx":()=>__vitePreload(()=>import("./TreeViewSlash-BywCsx5o-CUTTXZi-.js"),[]),"../../../assets/icon-components/TriangleDown.tsx":()=>__vitePreload(()=>import("./TriangleDown-eCXwUfu8-F-V79AL3.js"),[]),"../../../assets/icon-components/VariantArrowLeft.tsx":()=>__vitePreload(()=>import("./VariantArrowLeft-CnuX59_e-6Zt_Q3tm.js"),[]),"../../../assets/icon-components/VerticalDots.tsx":()=>__vitePreload(()=>import("./VerticalDots-C8QYf7et-CCxZfvjq.js"),[]),"../../../assets/icon-components/WarningFill.tsx":()=>__vitePreload(()=>import("./WarningFill-WowAvi5P-D5XCckM6.js"),[]),"../../../assets/icon-components/XTwitter.tsx":()=>__vitePreload(()=>import("./XTwitter-k3Pt8itk-mvLk8TKx.js"),[]),"../../../assets/icon-components/Xmark.tsx":()=>__vitePreload(()=>import("./Xmark-8qnJCs2Y-CZ3t0Fap.js"),[]),"../../../assets/icon-components/XmarkLight.tsx":()=>__vitePreload(()=>import("./XmarkLight-GHzDR5_F-CloMvuzt.js"),[]),"../../../assets/icon-components/Youtube.tsx":()=>__vitePreload(()=>import("./Youtube-i8V0IXUU-Bkiwoayp.js"),[])}),`../../../assets/icon-components/${Ws}.tsx`,6))}catch(ws){return console.error(ws),Aa}}function Kd({name:Ws,size:ws=24,color:oi,style:si,...ii}){const ai=Sa(ws),li={color:oi,...ai,style:si},ci=useMemo(()=>Ra(Ws),[Ws]);return jsx(Suspense,{fallback:jsx("div",{"data-testid":"icon-fallback",style:ai}),name:"icon-component",children:jsx(ci,{...ii,style:li})})}const Ma=["top","right","bottom","left"],je$2=Math.min,ve$2=Math.max,Xt$1=Math.round,Ft$2=Math.floor,ke$2=Ws=>({x:Ws,y:Ws}),_a$1={left:"right",right:"left",bottom:"top",top:"bottom"},Pa={start:"end",end:"start"};function Dn$2(Ws,ws,oi){return ve$2(Ws,je$2(ws,oi))}function Ne$1(Ws,ws){return typeof Ws=="function"?Ws(ws):Ws}function Le$2(Ws){return Ws.split("-")[0]}function lt$2(Ws){return Ws.split("-")[1]}function Kn$2(Ws){return Ws==="x"?"y":"x"}function Yn$2(Ws){return Ws==="y"?"height":"width"}function He$2(Ws){return["top","bottom"].includes(Le$2(Ws))?"y":"x"}function Xn$1(Ws){return Kn$2(He$2(Ws))}function Ta(Ws,ws,oi){oi===void 0&&(oi=!1);const si=lt$2(Ws),ii=Xn$1(Ws),ai=Yn$2(ii);let li=ii==="x"?si===(oi?"end":"start")?"right":"left":si==="start"?"bottom":"top";return ws.reference[ai]>ws.floating[ai]&&(li=qt$1(li)),[li,qt$1(li)]}function ka(Ws){const ws=qt$1(Ws);return[In$2(Ws),ws,In$2(ws)]}function In$2(Ws){return Ws.replace(/start|end/g,ws=>Pa[ws])}function Oa(Ws,ws,oi){const si=["left","right"],ii=["right","left"],ai=["top","bottom"],li=["bottom","top"];switch(Ws){case"top":case"bottom":return oi?ws?ii:si:ws?si:ii;case"left":case"right":return ws?ai:li;default:return[]}}function Da(Ws,ws,oi,si){const ii=lt$2(Ws);let ai=Oa(Le$2(Ws),oi==="start",si);return ii&&(ai=ai.map(li=>li+"-"+ii),ws&&(ai=ai.concat(ai.map(In$2)))),ai}function qt$1(Ws){return Ws.replace(/left|right|bottom|top/g,ws=>_a$1[ws])}function Ia(Ws){return{top:0,right:0,bottom:0,left:0,...Ws}}function Mo(Ws){return typeof Ws!="number"?Ia(Ws):{top:Ws,right:Ws,bottom:Ws,left:Ws}}function Zt$1(Ws){const{x:ws,y:oi,width:si,height:ii}=Ws;return{width:si,height:ii,top:oi,left:ws,right:ws+si,bottom:oi+ii,x:ws,y:oi}}function Dr$1(Ws,ws,oi){let{reference:si,floating:ii}=Ws;const ai=He$2(ws),li=Xn$1(ws),ci=Yn$2(li),ui=Le$2(ws),di=ai==="y",hi=si.x+si.width/2-ii.width/2,pi=si.y+si.height/2-ii.height/2,ha=si[ci]/2-ii[ci]/2;let ga;switch(ui){case"top":ga={x:hi,y:si.y-ii.height};break;case"bottom":ga={x:hi,y:si.y+si.height};break;case"right":ga={x:si.x+si.width,y:pi};break;case"left":ga={x:si.x-ii.width,y:pi};break;default:ga={x:si.x,y:si.y}}switch(lt$2(ws)){case"start":ga[li]-=ha*(oi&&di?-1:1);break;case"end":ga[li]+=ha*(oi&&di?-1:1);break}return ga}const Fa=async(Ws,ws,oi)=>{const{placement:si="bottom",strategy:ii="absolute",middleware:ai=[],platform:li}=oi,ci=ai.filter(Boolean),ui=await(li.isRTL==null?void 0:li.isRTL(ws));let di=await li.getElementRects({reference:Ws,floating:ws,strategy:ii}),{x:hi,y:pi}=Dr$1(di,si,ui),ha=si,ga={},va=0;for(let ba=0;ba<ci.length;ba++){const{name:wa,fn:xa}=ci[ba],{x:Ca,y:el,data:ku,reset:gd}=await xa({x:hi,y:pi,initialPlacement:si,placement:ha,strategy:ii,middlewareData:ga,rects:di,platform:li,elements:{reference:Ws,floating:ws}});hi=Ca??hi,pi=el??pi,ga={...ga,[wa]:{...ga[wa],...ku}},gd&&va<=50&&(va++,typeof gd=="object"&&(gd.placement&&(ha=gd.placement),gd.rects&&(di=gd.rects===!0?await li.getElementRects({reference:Ws,floating:ws,strategy:ii}):gd.rects),{x:hi,y:pi}=Dr$1(di,ha,ui)),ba=-1)}return{x:hi,y:pi,placement:ha,strategy:ii,middlewareData:ga}};async function Et$2(Ws,ws){var oi;ws===void 0&&(ws={});const{x:si,y:ii,platform:ai,rects:li,elements:ci,strategy:ui}=Ws,{boundary:di="clippingAncestors",rootBoundary:hi="viewport",elementContext:pi="floating",altBoundary:ha=!1,padding:ga=0}=Ne$1(ws,Ws),va=Mo(ga),ba=ci[ha?pi==="floating"?"reference":"floating":pi],wa=Zt$1(await ai.getClippingRect({element:(oi=await(ai.isElement==null?void 0:ai.isElement(ba)))==null||oi?ba:ba.contextElement||await(ai.getDocumentElement==null?void 0:ai.getDocumentElement(ci.floating)),boundary:di,rootBoundary:hi,strategy:ui})),xa=pi==="floating"?{x:si,y:ii,width:li.floating.width,height:li.floating.height}:li.reference,Ca=await(ai.getOffsetParent==null?void 0:ai.getOffsetParent(ci.floating)),el=await(ai.isElement==null?void 0:ai.isElement(Ca))?await(ai.getScale==null?void 0:ai.getScale(Ca))||{x:1,y:1}:{x:1,y:1},ku=Zt$1(ai.convertOffsetParentRelativeRectToViewportRelativeRect?await ai.convertOffsetParentRelativeRectToViewportRelativeRect({elements:ci,rect:xa,offsetParent:Ca,strategy:ui}):xa);return{top:(wa.top-ku.top+va.top)/el.y,bottom:(ku.bottom-wa.bottom+va.bottom)/el.y,left:(wa.left-ku.left+va.left)/el.x,right:(ku.right-wa.right+va.right)/el.x}}const Na=Ws=>({name:"arrow",options:Ws,async fn(ws){const{x:oi,y:si,placement:ii,rects:ai,platform:li,elements:ci,middlewareData:ui}=ws,{element:di,padding:hi=0}=Ne$1(Ws,ws)||{};if(di==null)return{};const pi=Mo(hi),ha={x:oi,y:si},ga=Xn$1(ii),va=Yn$2(ga),ba=await li.getDimensions(di),wa=ga==="y",xa=wa?"top":"left",Ca=wa?"bottom":"right",el=wa?"clientHeight":"clientWidth",ku=ai.reference[va]+ai.reference[ga]-ha[ga]-ai.floating[va],gd=ha[ga]-ai.reference[ga],Ed=await(li.getOffsetParent==null?void 0:li.getOffsetParent(di));let Od=Ed?Ed[el]:0;(!Od||!await(li.isElement==null?void 0:li.isElement(Ed)))&&(Od=ci.floating[el]||ai.floating[va]);const Nd=ku/2-gd/2,Pd=Od/2-ba[va]/2-1,Ld=je$2(pi[xa],Pd),rf=je$2(pi[Ca],Pd),kd=Ld,Md=Od-ba[va]-rf,Td=Od/2-ba[va]/2+Nd,wd=Dn$2(kd,Td,Md),Cd=!ui.arrow&&lt$2(ii)!=null&&Td!==wd&&ai.reference[va]/2-(Td<kd?Ld:rf)-ba[va]/2<0,sf=Cd?Td<kd?Td-kd:Td-Md:0;return{[ga]:ha[ga]+sf,data:{[ga]:wd,centerOffset:Td-wd-sf,...Cd&&{alignmentOffset:sf}},reset:Cd}}}),La=function(Ws){return Ws===void 0&&(Ws={}),{name:"flip",options:Ws,async fn(ws){var oi,si;const{placement:ii,middlewareData:ai,rects:li,initialPlacement:ci,platform:ui,elements:di}=ws,{mainAxis:hi=!0,crossAxis:pi=!0,fallbackPlacements:ha,fallbackStrategy:ga="bestFit",fallbackAxisSideDirection:va="none",flipAlignment:ba=!0,...wa}=Ne$1(Ws,ws);if((oi=ai.arrow)!=null&&oi.alignmentOffset)return{};const xa=Le$2(ii),Ca=He$2(ci),el=Le$2(ci)===ci,ku=await(ui.isRTL==null?void 0:ui.isRTL(di.floating)),gd=ha||(el||!ba?[qt$1(ci)]:ka(ci)),Ed=va!=="none";!ha&&Ed&&gd.push(...Da(ci,ba,va,ku));const Od=[ci,...gd],Nd=await Et$2(ws,wa),Pd=[];let Ld=((si=ai.flip)==null?void 0:si.overflows)||[];if(hi&&Pd.push(Nd[xa]),pi){const Td=Ta(ii,li,ku);Pd.push(Nd[Td[0]],Nd[Td[1]])}if(Ld=[...Ld,{placement:ii,overflows:Pd}],!Pd.every(Td=>Td<=0)){var rf,kd;const Td=(((rf=ai.flip)==null?void 0:rf.index)||0)+1,wd=Od[Td];if(wd)return{data:{index:Td,overflows:Ld},reset:{placement:wd}};let Cd=(kd=Ld.filter(sf=>sf.overflows[0]<=0).sort((sf,of)=>sf.overflows[1]-of.overflows[1])[0])==null?void 0:kd.placement;if(!Cd)switch(ga){case"bestFit":{var Md;const sf=(Md=Ld.filter(of=>{if(Ed){const Wd=He$2(of.placement);return Wd===Ca||Wd==="y"}return!0}).map(of=>[of.placement,of.overflows.filter(Wd=>Wd>0).reduce((Wd,df)=>Wd+df,0)]).sort((of,Wd)=>of[1]-Wd[1])[0])==null?void 0:Md[0];sf&&(Cd=sf);break}case"initialPlacement":Cd=ci;break}if(ii!==Cd)return{reset:{placement:Cd}}}return{}}}};function Ir$1(Ws,ws){return{top:Ws.top-ws.height,right:Ws.right-ws.width,bottom:Ws.bottom-ws.height,left:Ws.left-ws.width}}function Fr$2(Ws){return Ma.some(ws=>Ws[ws]>=0)}const Va=function(Ws){return Ws===void 0&&(Ws={}),{name:"hide",options:Ws,async fn(ws){const{rects:oi}=ws,{strategy:si="referenceHidden",...ii}=Ne$1(Ws,ws);switch(si){case"referenceHidden":{const ai=await Et$2(ws,{...ii,elementContext:"reference"}),li=Ir$1(ai,oi.reference);return{data:{referenceHiddenOffsets:li,referenceHidden:Fr$2(li)}}}case"escaped":{const ai=await Et$2(ws,{...ii,altBoundary:!0}),li=Ir$1(ai,oi.floating);return{data:{escapedOffsets:li,escaped:Fr$2(li)}}}default:return{}}}}};async function Ba(Ws,ws){const{placement:oi,platform:si,elements:ii}=Ws,ai=await(si.isRTL==null?void 0:si.isRTL(ii.floating)),li=Le$2(oi),ci=lt$2(oi),ui=He$2(oi)==="y",di=["left","top"].includes(li)?-1:1,hi=ai&&ui?-1:1,pi=Ne$1(ws,Ws);let{mainAxis:ha,crossAxis:ga,alignmentAxis:va}=typeof pi=="number"?{mainAxis:pi,crossAxis:0,alignmentAxis:null}:{mainAxis:pi.mainAxis||0,crossAxis:pi.crossAxis||0,alignmentAxis:pi.alignmentAxis};return ci&&typeof va=="number"&&(ga=ci==="end"?va*-1:va),ui?{x:ga*hi,y:ha*di}:{x:ha*di,y:ga*hi}}const Ua=function(Ws){return Ws===void 0&&(Ws=0),{name:"offset",options:Ws,async fn(ws){var oi,si;const{x:ii,y:ai,placement:li,middlewareData:ci}=ws,ui=await Ba(ws,Ws);return li===((oi=ci.offset)==null?void 0:oi.placement)&&(si=ci.arrow)!=null&&si.alignmentOffset?{}:{x:ii+ui.x,y:ai+ui.y,data:{...ui,placement:li}}}}},Wa=function(Ws){return Ws===void 0&&(Ws={}),{name:"shift",options:Ws,async fn(ws){const{x:oi,y:si,placement:ii}=ws,{mainAxis:ai=!0,crossAxis:li=!1,limiter:ci={fn:wa=>{let{x:xa,y:Ca}=wa;return{x:xa,y:Ca}}},...ui}=Ne$1(Ws,ws),di={x:oi,y:si},hi=await Et$2(ws,ui),pi=He$2(Le$2(ii)),ha=Kn$2(pi);let ga=di[ha],va=di[pi];if(ai){const wa=ha==="y"?"top":"left",xa=ha==="y"?"bottom":"right",Ca=ga+hi[wa],el=ga-hi[xa];ga=Dn$2(Ca,ga,el)}if(li){const wa=pi==="y"?"top":"left",xa=pi==="y"?"bottom":"right",Ca=va+hi[wa],el=va-hi[xa];va=Dn$2(Ca,va,el)}const ba=ci.fn({...ws,[ha]:ga,[pi]:va});return{...ba,data:{x:ba.x-oi,y:ba.y-si,enabled:{[ha]:ai,[pi]:li}}}}}},$a=function(Ws){return Ws===void 0&&(Ws={}),{options:Ws,fn(ws){const{x:oi,y:si,placement:ii,rects:ai,middlewareData:li}=ws,{offset:ci=0,mainAxis:ui=!0,crossAxis:di=!0}=Ne$1(Ws,ws),hi={x:oi,y:si},pi=He$2(ii),ha=Kn$2(pi);let ga=hi[ha],va=hi[pi];const ba=Ne$1(ci,ws),wa=typeof ba=="number"?{mainAxis:ba,crossAxis:0}:{mainAxis:0,crossAxis:0,...ba};if(ui){const el=ha==="y"?"height":"width",ku=ai.reference[ha]-ai.floating[el]+wa.mainAxis,gd=ai.reference[ha]+ai.reference[el]-wa.mainAxis;ga<ku?ga=ku:ga>gd&&(ga=gd)}if(di){var xa,Ca;const el=ha==="y"?"width":"height",ku=["top","left"].includes(Le$2(ii)),gd=ai.reference[pi]-ai.floating[el]+(ku&&((xa=li.offset)==null?void 0:xa[pi])||0)+(ku?0:wa.crossAxis),Ed=ai.reference[pi]+ai.reference[el]+(ku?0:((Ca=li.offset)==null?void 0:Ca[pi])||0)-(ku?wa.crossAxis:0);va<gd?va=gd:va>Ed&&(va=Ed)}return{[ha]:ga,[pi]:va}}}},za=function(Ws){return Ws===void 0&&(Ws={}),{name:"size",options:Ws,async fn(ws){var oi,si;const{placement:ii,rects:ai,platform:li,elements:ci}=ws,{apply:ui=()=>{},...di}=Ne$1(Ws,ws),hi=await Et$2(ws,di),pi=Le$2(ii),ha=lt$2(ii),ga=He$2(ii)==="y",{width:va,height:ba}=ai.floating;let wa,xa;pi==="top"||pi==="bottom"?(wa=pi,xa=ha===(await(li.isRTL==null?void 0:li.isRTL(ci.floating))?"start":"end")?"left":"right"):(xa=pi,wa=ha==="end"?"top":"bottom");const Ca=ba-hi.top-hi.bottom,el=va-hi.left-hi.right,ku=je$2(ba-hi[wa],Ca),gd=je$2(va-hi[xa],el),Ed=!ws.middlewareData.shift;let Od=ku,Nd=gd;if((oi=ws.middlewareData.shift)!=null&&oi.enabled.x&&(Nd=el),(si=ws.middlewareData.shift)!=null&&si.enabled.y&&(Od=Ca),Ed&&!ha){const Ld=ve$2(hi.left,0),rf=ve$2(hi.right,0),kd=ve$2(hi.top,0),Md=ve$2(hi.bottom,0);ga?Nd=va-2*(Ld!==0||rf!==0?Ld+rf:ve$2(hi.left,hi.right)):Od=ba-2*(kd!==0||Md!==0?kd+Md:ve$2(hi.top,hi.bottom))}await ui({...ws,availableWidth:Nd,availableHeight:Od});const Pd=await li.getDimensions(ci.floating);return va!==Pd.width||ba!==Pd.height?{reset:{rects:!0}}:{}}}};function on$1(){return typeof window<"u"}function ut$1(Ws){return _o(Ws)?(Ws.nodeName||"").toLowerCase():"#document"}function ye$2(Ws){var ws;return(Ws==null||(ws=Ws.ownerDocument)==null?void 0:ws.defaultView)||window}function De$2(Ws){var ws;return(ws=(_o(Ws)?Ws.ownerDocument:Ws.document)||window.document)==null?void 0:ws.documentElement}function _o(Ws){return on$1()?Ws instanceof Node||Ws instanceof ye$2(Ws).Node:!1}function Ce$2(Ws){return on$1()?Ws instanceof Element||Ws instanceof ye$2(Ws).Element:!1}function Oe$2(Ws){return on$1()?Ws instanceof HTMLElement||Ws instanceof ye$2(Ws).HTMLElement:!1}function Nr$2(Ws){return!on$1()||typeof ShadowRoot>"u"?!1:Ws instanceof ShadowRoot||Ws instanceof ye$2(Ws).ShadowRoot}function Tt$1(Ws){const{overflow:ws,overflowX:oi,overflowY:si,display:ii}=Se$2(Ws);return/auto|scroll|overlay|hidden|clip/.test(ws+si+oi)&&!["inline","contents"].includes(ii)}function Ga(Ws){return["table","td","th"].includes(ut$1(Ws))}function sn$1(Ws){return[":popover-open",":modal"].some(ws=>{try{return Ws.matches(ws)}catch{return!1}})}function qn$2(Ws){const ws=Zn$1(),oi=Ce$2(Ws)?Se$2(Ws):Ws;return["transform","translate","scale","rotate","perspective"].some(si=>oi[si]?oi[si]!=="none":!1)||(oi.containerType?oi.containerType!=="normal":!1)||!ws&&(oi.backdropFilter?oi.backdropFilter!=="none":!1)||!ws&&(oi.filter?oi.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(si=>(oi.willChange||"").includes(si))||["paint","layout","strict","content"].some(si=>(oi.contain||"").includes(si))}function ja(Ws){let ws=Ke$2(Ws);for(;Oe$2(ws)&&!at$2(ws);){if(qn$2(ws))return ws;if(sn$1(ws))return null;ws=Ke$2(ws)}return null}function Zn$1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function at$2(Ws){return["html","body","#document"].includes(ut$1(Ws))}function Se$2(Ws){return ye$2(Ws).getComputedStyle(Ws)}function an$1(Ws){return Ce$2(Ws)?{scrollLeft:Ws.scrollLeft,scrollTop:Ws.scrollTop}:{scrollLeft:Ws.scrollX,scrollTop:Ws.scrollY}}function Ke$2(Ws){if(ut$1(Ws)==="html")return Ws;const ws=Ws.assignedSlot||Ws.parentNode||Nr$2(Ws)&&Ws.host||De$2(Ws);return Nr$2(ws)?ws.host:ws}function Po(Ws){const ws=Ke$2(Ws);return at$2(ws)?Ws.ownerDocument?Ws.ownerDocument.body:Ws.body:Oe$2(ws)&&Tt$1(ws)?ws:Po(ws)}function At$2(Ws,ws,oi){var si;ws===void 0&&(ws=[]),oi===void 0&&(oi=!0);const ii=Po(Ws),ai=ii===((si=Ws.ownerDocument)==null?void 0:si.body),li=ye$2(ii);if(ai){const ci=Fn$2(li);return ws.concat(li,li.visualViewport||[],Tt$1(ii)?ii:[],ci&&oi?At$2(ci):[])}return ws.concat(ii,At$2(ii,[],oi))}function Fn$2(Ws){return Ws.parent&&Object.getPrototypeOf(Ws.parent)?Ws.frameElement:null}function To(Ws){const ws=Se$2(Ws);let oi=parseFloat(ws.width)||0,si=parseFloat(ws.height)||0;const ii=Oe$2(Ws),ai=ii?Ws.offsetWidth:oi,li=ii?Ws.offsetHeight:si,ci=Xt$1(oi)!==ai||Xt$1(si)!==li;return ci&&(oi=ai,si=li),{width:oi,height:si,$:ci}}function Qn$2(Ws){return Ce$2(Ws)?Ws:Ws.contextElement}function st$1(Ws){const ws=Qn$2(Ws);if(!Oe$2(ws))return ke$2(1);const oi=ws.getBoundingClientRect(),{width:si,height:ii,$:ai}=To(ws);let li=(ai?Xt$1(oi.width):oi.width)/si,ci=(ai?Xt$1(oi.height):oi.height)/ii;return(!li||!Number.isFinite(li))&&(li=1),(!ci||!Number.isFinite(ci))&&(ci=1),{x:li,y:ci}}const Ha=ke$2(0);function ko(Ws){const ws=ye$2(Ws);return!Zn$1()||!ws.visualViewport?Ha:{x:ws.visualViewport.offsetLeft,y:ws.visualViewport.offsetTop}}function Ka(Ws,ws,oi){return ws===void 0&&(ws=!1),!oi||ws&&oi!==ye$2(Ws)?!1:ws}function qe$1(Ws,ws,oi,si){ws===void 0&&(ws=!1),oi===void 0&&(oi=!1);const ii=Ws.getBoundingClientRect(),ai=Qn$2(Ws);let li=ke$2(1);ws&&(si?Ce$2(si)&&(li=st$1(si)):li=st$1(Ws));const ci=Ka(ai,oi,si)?ko(ai):ke$2(0);let ui=(ii.left+ci.x)/li.x,di=(ii.top+ci.y)/li.y,hi=ii.width/li.x,pi=ii.height/li.y;if(ai){const ha=ye$2(ai),ga=si&&Ce$2(si)?ye$2(si):si;let va=ha,ba=Fn$2(va);for(;ba&&si&&ga!==va;){const wa=st$1(ba),xa=ba.getBoundingClientRect(),Ca=Se$2(ba),el=xa.left+(ba.clientLeft+parseFloat(Ca.paddingLeft))*wa.x,ku=xa.top+(ba.clientTop+parseFloat(Ca.paddingTop))*wa.y;ui*=wa.x,di*=wa.y,hi*=wa.x,pi*=wa.y,ui+=el,di+=ku,va=ye$2(ba),ba=Fn$2(va)}}return Zt$1({width:hi,height:pi,x:ui,y:di})}function Jn$2(Ws,ws){const oi=an$1(Ws).scrollLeft;return ws?ws.left+oi:qe$1(De$2(Ws)).left+oi}function Oo(Ws,ws,oi){oi===void 0&&(oi=!1);const si=Ws.getBoundingClientRect(),ii=si.left+ws.scrollLeft-(oi?0:Jn$2(Ws,si)),ai=si.top+ws.scrollTop;return{x:ii,y:ai}}function Ya(Ws){let{elements:ws,rect:oi,offsetParent:si,strategy:ii}=Ws;const ai=ii==="fixed",li=De$2(si),ci=ws?sn$1(ws.floating):!1;if(si===li||ci&&ai)return oi;let ui={scrollLeft:0,scrollTop:0},di=ke$2(1);const hi=ke$2(0),pi=Oe$2(si);if((pi||!pi&&!ai)&&((ut$1(si)!=="body"||Tt$1(li))&&(ui=an$1(si)),Oe$2(si))){const ga=qe$1(si);di=st$1(si),hi.x=ga.x+si.clientLeft,hi.y=ga.y+si.clientTop}const ha=li&&!pi&&!ai?Oo(li,ui,!0):ke$2(0);return{width:oi.width*di.x,height:oi.height*di.y,x:oi.x*di.x-ui.scrollLeft*di.x+hi.x+ha.x,y:oi.y*di.y-ui.scrollTop*di.y+hi.y+ha.y}}function Xa(Ws){return Array.from(Ws.getClientRects())}function qa(Ws){const ws=De$2(Ws),oi=an$1(Ws),si=Ws.ownerDocument.body,ii=ve$2(ws.scrollWidth,ws.clientWidth,si.scrollWidth,si.clientWidth),ai=ve$2(ws.scrollHeight,ws.clientHeight,si.scrollHeight,si.clientHeight);let li=-oi.scrollLeft+Jn$2(Ws);const ci=-oi.scrollTop;return Se$2(si).direction==="rtl"&&(li+=ve$2(ws.clientWidth,si.clientWidth)-ii),{width:ii,height:ai,x:li,y:ci}}function Za$1(Ws,ws){const oi=ye$2(Ws),si=De$2(Ws),ii=oi.visualViewport;let ai=si.clientWidth,li=si.clientHeight,ci=0,ui=0;if(ii){ai=ii.width,li=ii.height;const di=Zn$1();(!di||di&&ws==="fixed")&&(ci=ii.offsetLeft,ui=ii.offsetTop)}return{width:ai,height:li,x:ci,y:ui}}function Qa$1(Ws,ws){const oi=qe$1(Ws,!0,ws==="fixed"),si=oi.top+Ws.clientTop,ii=oi.left+Ws.clientLeft,ai=Oe$2(Ws)?st$1(Ws):ke$2(1),li=Ws.clientWidth*ai.x,ci=Ws.clientHeight*ai.y,ui=ii*ai.x,di=si*ai.y;return{width:li,height:ci,x:ui,y:di}}function Lr$2(Ws,ws,oi){let si;if(ws==="viewport")si=Za$1(Ws,oi);else if(ws==="document")si=qa(De$2(Ws));else if(Ce$2(ws))si=Qa$1(ws,oi);else{const ii=ko(Ws);si={x:ws.x-ii.x,y:ws.y-ii.y,width:ws.width,height:ws.height}}return Zt$1(si)}function Do$1(Ws,ws){const oi=Ke$2(Ws);return oi===ws||!Ce$2(oi)||at$2(oi)?!1:Se$2(oi).position==="fixed"||Do$1(oi,ws)}function Ja$1(Ws,ws){const oi=ws.get(Ws);if(oi)return oi;let si=At$2(Ws,[],!1).filter(ci=>Ce$2(ci)&&ut$1(ci)!=="body"),ii=null;const ai=Se$2(Ws).position==="fixed";let li=ai?Ke$2(Ws):Ws;for(;Ce$2(li)&&!at$2(li);){const ci=Se$2(li),ui=qn$2(li);!ui&&ci.position==="fixed"&&(ii=null),(ai?!ui&&!ii:!ui&&ci.position==="static"&&ii&&["absolute","fixed"].includes(ii.position)||Tt$1(li)&&!ui&&Do$1(Ws,li))?si=si.filter(di=>di!==li):ii=ci,li=Ke$2(li)}return ws.set(Ws,si),si}function ec(Ws){let{element:ws,boundary:oi,rootBoundary:si,strategy:ii}=Ws;const ai=[...oi==="clippingAncestors"?sn$1(ws)?[]:Ja$1(ws,this._c):[].concat(oi),si],li=ai[0],ci=ai.reduce((ui,di)=>{const hi=Lr$2(ws,di,ii);return ui.top=ve$2(hi.top,ui.top),ui.right=je$2(hi.right,ui.right),ui.bottom=je$2(hi.bottom,ui.bottom),ui.left=ve$2(hi.left,ui.left),ui},Lr$2(ws,li,ii));return{width:ci.right-ci.left,height:ci.bottom-ci.top,x:ci.left,y:ci.top}}function tc(Ws){const{width:ws,height:oi}=To(Ws);return{width:ws,height:oi}}function nc(Ws,ws,oi){const si=Oe$2(ws),ii=De$2(ws),ai=oi==="fixed",li=qe$1(Ws,!0,ai,ws);let ci={scrollLeft:0,scrollTop:0};const ui=ke$2(0);if(si||!si&&!ai)if((ut$1(ws)!=="body"||Tt$1(ii))&&(ci=an$1(ws)),si){const ha=qe$1(ws,!0,ai,ws);ui.x=ha.x+ws.clientLeft,ui.y=ha.y+ws.clientTop}else ii&&(ui.x=Jn$2(ii));const di=ii&&!si&&!ai?Oo(ii,ci):ke$2(0),hi=li.left+ci.scrollLeft-ui.x-di.x,pi=li.top+ci.scrollTop-ui.y-di.y;return{x:hi,y:pi,width:li.width,height:li.height}}function wn$1(Ws){return Se$2(Ws).position==="static"}function Vr$2(Ws,ws){if(!Oe$2(Ws)||Se$2(Ws).position==="fixed")return null;if(ws)return ws(Ws);let oi=Ws.offsetParent;return De$2(Ws)===oi&&(oi=oi.ownerDocument.body),oi}function Io(Ws,ws){const oi=ye$2(Ws);if(sn$1(Ws))return oi;if(!Oe$2(Ws)){let ii=Ke$2(Ws);for(;ii&&!at$2(ii);){if(Ce$2(ii)&&!wn$1(ii))return ii;ii=Ke$2(ii)}return oi}let si=Vr$2(Ws,ws);for(;si&&Ga(si)&&wn$1(si);)si=Vr$2(si,ws);return si&&at$2(si)&&wn$1(si)&&!qn$2(si)?oi:si||ja(Ws)||oi}const rc=async function(Ws){const ws=this.getOffsetParent||Io,oi=this.getDimensions,si=await oi(Ws.floating);return{reference:nc(Ws.reference,await ws(Ws.floating),Ws.strategy),floating:{x:0,y:0,width:si.width,height:si.height}}};function oc(Ws){return Se$2(Ws).direction==="rtl"}const sc={convertOffsetParentRelativeRectToViewportRelativeRect:Ya,getDocumentElement:De$2,getClippingRect:ec,getOffsetParent:Io,getElementRects:rc,getClientRects:Xa,getDimensions:tc,getScale:st$1,isElement:Ce$2,isRTL:oc};function Fo(Ws,ws){return Ws.x===ws.x&&Ws.y===ws.y&&Ws.width===ws.width&&Ws.height===ws.height}function ic(Ws,ws){let oi=null,si;const ii=De$2(Ws);function ai(){var ci;clearTimeout(si),(ci=oi)==null||ci.disconnect(),oi=null}function li(ci,ui){ci===void 0&&(ci=!1),ui===void 0&&(ui=1),ai();const di=Ws.getBoundingClientRect(),{left:hi,top:pi,width:ha,height:ga}=di;if(ci||ws(),!ha||!ga)return;const va=Ft$2(pi),ba=Ft$2(ii.clientWidth-(hi+ha)),wa=Ft$2(ii.clientHeight-(pi+ga)),xa=Ft$2(hi),Ca={rootMargin:-va+"px "+-ba+"px "+-wa+"px "+-xa+"px",threshold:ve$2(0,je$2(1,ui))||1};let el=!0;function ku(gd){const Ed=gd[0].intersectionRatio;if(Ed!==ui){if(!el)return li();Ed?li(!1,Ed):si=setTimeout(()=>{li(!1,1e-7)},1e3)}Ed===1&&!Fo(di,Ws.getBoundingClientRect())&&li(),el=!1}try{oi=new IntersectionObserver(ku,{...Ca,root:ii.ownerDocument})}catch{oi=new IntersectionObserver(ku,Ca)}oi.observe(Ws)}return li(!0),ai}function ac(Ws,ws,oi,si){si===void 0&&(si={});const{ancestorScroll:ii=!0,ancestorResize:ai=!0,elementResize:li=typeof ResizeObserver=="function",layoutShift:ci=typeof IntersectionObserver=="function",animationFrame:ui=!1}=si,di=Qn$2(Ws),hi=ii||ai?[...di?At$2(di):[],...At$2(ws)]:[];hi.forEach(xa=>{ii&&xa.addEventListener("scroll",oi,{passive:!0}),ai&&xa.addEventListener("resize",oi)});const pi=di&&ci?ic(di,oi):null;let ha=-1,ga=null;li&&(ga=new ResizeObserver(xa=>{let[Ca]=xa;Ca&&Ca.target===di&&ga&&(ga.unobserve(ws),cancelAnimationFrame(ha),ha=requestAnimationFrame(()=>{var el;(el=ga)==null||el.observe(ws)})),oi()}),di&&!ui&&ga.observe(di),ga.observe(ws));let va,ba=ui?qe$1(Ws):null;ui&&wa();function wa(){const xa=qe$1(Ws);ba&&!Fo(ba,xa)&&oi(),ba=xa,va=requestAnimationFrame(wa)}return oi(),()=>{var xa;hi.forEach(Ca=>{ii&&Ca.removeEventListener("scroll",oi),ai&&Ca.removeEventListener("resize",oi)}),pi==null||pi(),(xa=ga)==null||xa.disconnect(),ga=null,ui&&cancelAnimationFrame(va)}}const cc=Ua,lc=Wa,uc=La,dc=za,fc=Va,Br$2=Na,pc=$a,mc=(Ws,ws,oi)=>{const si=new Map,ii={platform:sc,...oi},ai={...ii.platform,_c:si};return Fa(Ws,ws,{...ii,platform:ai})};function Y$2(Ws,ws,{checkForDefaultPrevented:oi=!0}={}){return function(si){if(Ws==null||Ws(si),oi===!1||!si.defaultPrevented)return ws==null?void 0:ws(si)}}function dt$2(Ws,ws=[]){let oi=[];function si(ai,li){const ci=React.createContext(li),ui=oi.length;oi=[...oi,li];const di=pi=>{var ha;const{scope:ga,children:va,...ba}=pi,wa=((ha=ga==null?void 0:ga[Ws])==null?void 0:ha[ui])||ci,xa=React.useMemo(()=>ba,Object.values(ba));return jsx(wa.Provider,{value:xa,children:va})};di.displayName=ai+"Provider";function hi(pi,ha){var ga;const va=((ga=ha==null?void 0:ha[Ws])==null?void 0:ga[ui])||ci,ba=React.useContext(va);if(ba)return ba;if(li!==void 0)return li;throw new Error(`\`${pi}\` must be used within \`${ai}\``)}return[di,hi]}const ii=()=>{const ai=oi.map(li=>React.createContext(li));return function(li){const ci=(li==null?void 0:li[Ws])||ai;return React.useMemo(()=>({[`__scope${Ws}`]:{...li,[Ws]:ci}}),[li,ci])}};return ii.scopeName=Ws,[si,hc(ii,...ws)]}function hc(...Ws){const ws=Ws[0];if(Ws.length===1)return ws;const oi=()=>{const si=Ws.map(ii=>({useScope:ii(),scopeName:ii.scopeName}));return function(ii){const ai=si.reduce((li,{useScope:ci,scopeName:ui})=>{const di=ci(ii)[`__scope${ui}`];return{...li,...di}},{});return React.useMemo(()=>({[`__scope${ws.scopeName}`]:ai}),[ai])}};return oi.scopeName=ws.scopeName,oi}function Ee$2(Ws){const ws=React.useRef(Ws);return React.useEffect(()=>{ws.current=Ws}),React.useMemo(()=>(...oi)=>{var si;return(si=ws.current)==null?void 0:si.call(ws,...oi)},[])}function er$1({prop:Ws,defaultProp:ws,onChange:oi=()=>{}}){const[si,ii]=gc({defaultProp:ws,onChange:oi}),ai=Ws!==void 0,li=ai?Ws:si,ci=Ee$2(oi),ui=React.useCallback(di=>{if(ai){const hi=typeof di=="function"?di(Ws):di;hi!==Ws&&ci(hi)}else ii(di)},[ai,Ws,ii,ci]);return[li,ui]}function gc({defaultProp:Ws,onChange:ws}){const oi=React.useState(Ws),[si]=oi,ii=React.useRef(si),ai=Ee$2(ws);return React.useEffect(()=>{ii.current!==si&&(ai(si),ii.current=si)},[si,ii,ai]),oi}function No$1(Ws){const ws=Ws+"CollectionProvider",[oi,si]=dt$2(ws),[ii,ai]=oi(ws,{collectionRef:{current:null},itemMap:new Map}),li=ga=>{const{scope:va,children:ba}=ga,wa=React__default.useRef(null),xa=React__default.useRef(new Map).current;return jsx(ii,{scope:va,itemMap:xa,collectionRef:wa,children:ba})};li.displayName=ws;const ci=Ws+"CollectionSlot",ui=React__default.forwardRef((ga,va)=>{const{scope:ba,children:wa}=ga,xa=ai(ci,ba),Ca=ge$2(va,xa.collectionRef);return jsx(St$2,{ref:Ca,children:wa})});ui.displayName=ci;const di=Ws+"CollectionItemSlot",hi="data-radix-collection-item",pi=React__default.forwardRef((ga,va)=>{const{scope:ba,children:wa,...xa}=ga,Ca=React__default.useRef(null),el=ge$2(va,Ca),ku=ai(di,ba);return React__default.useEffect(()=>(ku.itemMap.set(Ca,{ref:Ca,...xa}),()=>void ku.itemMap.delete(Ca))),jsx(St$2,{[hi]:"",ref:el,children:wa})});pi.displayName=di;function ha(ga){const va=ai(Ws+"CollectionConsumer",ga);return React__default.useCallback(()=>{const ba=va.collectionRef.current;if(!ba)return[];const wa=Array.from(ba.querySelectorAll(`[${hi}]`));return Array.from(va.itemMap.values()).sort((xa,Ca)=>wa.indexOf(xa.ref.current)-wa.indexOf(Ca.ref.current))},[va.collectionRef,va.itemMap])}return[{Provider:li,Slot:ui,ItemSlot:pi},ha,si]}var vc=React.createContext(void 0);function tr$1(Ws){const ws=React.useContext(vc);return Ws||ws||"ltr"}function yc(Ws,ws=globalThis==null?void 0:globalThis.document){const oi=Ee$2(Ws);React.useEffect(()=>{const si=ii=>{ii.key==="Escape"&&oi(ii)};return ws.addEventListener("keydown",si,{capture:!0}),()=>ws.removeEventListener("keydown",si,{capture:!0})},[oi,ws])}var bc="DismissableLayer",Nn$2="dismissableLayer.update",wc="dismissableLayer.pointerDownOutside",xc="dismissableLayer.focusOutside",Ur$2,Lo=React.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vo$1=React.forwardRef((Ws,ws)=>{const{disableOutsidePointerEvents:oi=!1,onEscapeKeyDown:si,onPointerDownOutside:ii,onFocusOutside:ai,onInteractOutside:li,onDismiss:ci,...ui}=Ws,di=React.useContext(Lo),[hi,pi]=React.useState(null),ha=(hi==null?void 0:hi.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,ga]=React.useState({}),va=ge$2(ws,Od=>pi(Od)),ba=Array.from(di.layers),[wa]=[...di.layersWithOutsidePointerEventsDisabled].slice(-1),xa=ba.indexOf(wa),Ca=hi?ba.indexOf(hi):-1,el=di.layersWithOutsidePointerEventsDisabled.size>0,ku=Ca>=xa,gd=Ec(Od=>{const Nd=Od.target,Pd=[...di.branches].some(Ld=>Ld.contains(Nd));!ku||Pd||(ii==null||ii(Od),li==null||li(Od),Od.defaultPrevented||ci==null||ci())},ha),Ed=Ac(Od=>{const Nd=Od.target;[...di.branches].some(Pd=>Pd.contains(Nd))||(ai==null||ai(Od),li==null||li(Od),Od.defaultPrevented||ci==null||ci())},ha);return yc(Od=>{Ca===di.layers.size-1&&(si==null||si(Od),!Od.defaultPrevented&&ci&&(Od.preventDefault(),ci()))},ha),React.useEffect(()=>{if(hi)return oi&&(di.layersWithOutsidePointerEventsDisabled.size===0&&(Ur$2=ha.body.style.pointerEvents,ha.body.style.pointerEvents="none"),di.layersWithOutsidePointerEventsDisabled.add(hi)),di.layers.add(hi),Wr$2(),()=>{oi&&di.layersWithOutsidePointerEventsDisabled.size===1&&(ha.body.style.pointerEvents=Ur$2)}},[hi,ha,oi,di]),React.useEffect(()=>()=>{hi&&(di.layers.delete(hi),di.layersWithOutsidePointerEventsDisabled.delete(hi),Wr$2())},[hi,di]),React.useEffect(()=>{const Od=()=>ga({});return document.addEventListener(Nn$2,Od),()=>document.removeEventListener(Nn$2,Od)},[]),jsx(se$2.div,{...ui,ref:va,style:{pointerEvents:el?ku?"auto":"none":void 0,...Ws.style},onFocusCapture:Y$2(Ws.onFocusCapture,Ed.onFocusCapture),onBlurCapture:Y$2(Ws.onBlurCapture,Ed.onBlurCapture),onPointerDownCapture:Y$2(Ws.onPointerDownCapture,gd.onPointerDownCapture)})});Vo$1.displayName=bc;var Cc="DismissableLayerBranch",Sc=React.forwardRef((Ws,ws)=>{const oi=React.useContext(Lo),si=React.useRef(null),ii=ge$2(ws,si);return React.useEffect(()=>{const ai=si.current;if(ai)return oi.branches.add(ai),()=>{oi.branches.delete(ai)}},[oi.branches]),jsx(se$2.div,{...Ws,ref:ii})});Sc.displayName=Cc;function Ec(Ws,ws=globalThis==null?void 0:globalThis.document){const oi=Ee$2(Ws),si=React.useRef(!1),ii=React.useRef(()=>{});return React.useEffect(()=>{const ai=ci=>{if(ci.target&&!si.current){let ui=function(){Bo(wc,oi,di,{discrete:!0})};const di={originalEvent:ci};ci.pointerType==="touch"?(ws.removeEventListener("click",ii.current),ii.current=ui,ws.addEventListener("click",ii.current,{once:!0})):ui()}else ws.removeEventListener("click",ii.current);si.current=!1},li=window.setTimeout(()=>{ws.addEventListener("pointerdown",ai)},0);return()=>{window.clearTimeout(li),ws.removeEventListener("pointerdown",ai),ws.removeEventListener("click",ii.current)}},[ws,oi]),{onPointerDownCapture:()=>si.current=!0}}function Ac(Ws,ws=globalThis==null?void 0:globalThis.document){const oi=Ee$2(Ws),si=React.useRef(!1);return React.useEffect(()=>{const ii=ai=>{ai.target&&!si.current&&Bo(xc,oi,{originalEvent:ai},{discrete:!1})};return ws.addEventListener("focusin",ii),()=>ws.removeEventListener("focusin",ii)},[ws,oi]),{onFocusCapture:()=>si.current=!0,onBlurCapture:()=>si.current=!1}}function Wr$2(){const Ws=new CustomEvent(Nn$2);document.dispatchEvent(Ws)}function Bo(Ws,ws,oi,{discrete:si}){const ii=oi.originalEvent.target,ai=new CustomEvent(Ws,{bubbles:!1,cancelable:!0,detail:oi});ws&&ii.addEventListener(Ws,ws,{once:!0}),si?wo$1(ii,ai):ii.dispatchEvent(ai)}var xn$1=0;function Rc(){React.useEffect(()=>{const Ws=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",Ws[0]??$r$2()),document.body.insertAdjacentElement("beforeend",Ws[1]??$r$2()),xn$1++,()=>{xn$1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(ws=>ws.remove()),xn$1--}},[])}function $r$2(){const Ws=document.createElement("span");return Ws.setAttribute("data-radix-focus-guard",""),Ws.tabIndex=0,Ws.style.outline="none",Ws.style.opacity="0",Ws.style.position="fixed",Ws.style.pointerEvents="none",Ws}var Cn$2="focusScope.autoFocusOnMount",Sn$1="focusScope.autoFocusOnUnmount",zr$2={bubbles:!1,cancelable:!0},Mc="FocusScope",Uo$1=React.forwardRef((Ws,ws)=>{const{loop:oi=!1,trapped:si=!1,onMountAutoFocus:ii,onUnmountAutoFocus:ai,...li}=Ws,[ci,ui]=React.useState(null),di=Ee$2(ii),hi=Ee$2(ai),pi=React.useRef(null),ha=ge$2(ws,ba=>ui(ba)),ga=React.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React.useEffect(()=>{if(si){let ba=function(el){if(ga.paused||!ci)return;const ku=el.target;ci.contains(ku)?pi.current=ku:ze$2(pi.current,{select:!0})},wa=function(el){if(ga.paused||!ci)return;const ku=el.relatedTarget;ku!==null&&(ci.contains(ku)||ze$2(pi.current,{select:!0}))},xa=function(el){if(document.activeElement===document.body)for(const ku of el)ku.removedNodes.length>0&&ze$2(ci)};document.addEventListener("focusin",ba),document.addEventListener("focusout",wa);const Ca=new MutationObserver(xa);return ci&&Ca.observe(ci,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",ba),document.removeEventListener("focusout",wa),Ca.disconnect()}}},[si,ci,ga.paused]),React.useEffect(()=>{if(ci){jr$2.add(ga);const ba=document.activeElement;if(!ci.contains(ba)){const wa=new CustomEvent(Cn$2,zr$2);ci.addEventListener(Cn$2,di),ci.dispatchEvent(wa),wa.defaultPrevented||(_c(Dc(Wo$1(ci)),{select:!0}),document.activeElement===ba&&ze$2(ci))}return()=>{ci.removeEventListener(Cn$2,di),setTimeout(()=>{const wa=new CustomEvent(Sn$1,zr$2);ci.addEventListener(Sn$1,hi),ci.dispatchEvent(wa),wa.defaultPrevented||ze$2(ba??document.body,{select:!0}),ci.removeEventListener(Sn$1,hi),jr$2.remove(ga)},0)}}},[ci,di,hi,ga]);const va=React.useCallback(ba=>{if(!oi&&!si||ga.paused)return;const wa=ba.key==="Tab"&&!ba.altKey&&!ba.ctrlKey&&!ba.metaKey,xa=document.activeElement;if(wa&&xa){const Ca=ba.currentTarget,[el,ku]=Pc(Ca);el&&ku?!ba.shiftKey&&xa===ku?(ba.preventDefault(),oi&&ze$2(el,{select:!0})):ba.shiftKey&&xa===el&&(ba.preventDefault(),oi&&ze$2(ku,{select:!0})):xa===Ca&&ba.preventDefault()}},[oi,si,ga.paused]);return jsx(se$2.div,{tabIndex:-1,...li,ref:ha,onKeyDown:va})});Uo$1.displayName=Mc;function _c(Ws,{select:ws=!1}={}){const oi=document.activeElement;for(const si of Ws)if(ze$2(si,{select:ws}),document.activeElement!==oi)return}function Pc(Ws){const ws=Wo$1(Ws),oi=Gr$2(ws,Ws),si=Gr$2(ws.reverse(),Ws);return[oi,si]}function Wo$1(Ws){const ws=[],oi=document.createTreeWalker(Ws,NodeFilter.SHOW_ELEMENT,{acceptNode:si=>{const ii=si.tagName==="INPUT"&&si.type==="hidden";return si.disabled||si.hidden||ii?NodeFilter.FILTER_SKIP:si.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;oi.nextNode();)ws.push(oi.currentNode);return ws}function Gr$2(Ws,ws){for(const oi of Ws)if(!Tc(oi,{upTo:ws}))return oi}function Tc(Ws,{upTo:ws}){if(getComputedStyle(Ws).visibility==="hidden")return!0;for(;Ws;){if(ws!==void 0&&Ws===ws)return!1;if(getComputedStyle(Ws).display==="none")return!0;Ws=Ws.parentElement}return!1}function kc(Ws){return Ws instanceof HTMLInputElement&&"select"in Ws}function ze$2(Ws,{select:ws=!1}={}){if(Ws&&Ws.focus){const oi=document.activeElement;Ws.focus({preventScroll:!0}),Ws!==oi&&kc(Ws)&&ws&&Ws.select()}}var jr$2=Oc();function Oc(){let Ws=[];return{add(ws){const oi=Ws[0];ws!==oi&&(oi==null||oi.pause()),Ws=Hr$2(Ws,ws),Ws.unshift(ws)},remove(ws){var oi;Ws=Hr$2(Ws,ws),(oi=Ws[0])==null||oi.resume()}}}function Hr$2(Ws,ws){const oi=[...Ws],si=oi.indexOf(ws);return si!==-1&&oi.splice(si,1),oi}function Dc(Ws){return Ws.filter(ws=>ws.tagName!=="A")}var Ze$1=globalThis!=null&&globalThis.document?React.useLayoutEffect:()=>{},Ic=React.useId||(()=>{}),Fc=0;function Qt$2(Ws){const[ws,oi]=React.useState(Ic());return Ze$1(()=>{oi(si=>si??String(Fc++))},[Ws]),ws?`radix-${ws}`:""}var $t$2=typeof document<"u"?useLayoutEffect:useEffect;function Jt(Ws,ws){if(Ws===ws)return!0;if(typeof Ws!=typeof ws)return!1;if(typeof Ws=="function"&&Ws.toString()===ws.toString())return!0;let oi,si,ii;if(Ws&&ws&&typeof Ws=="object"){if(Array.isArray(Ws)){if(oi=Ws.length,oi!==ws.length)return!1;for(si=oi;si--!==0;)if(!Jt(Ws[si],ws[si]))return!1;return!0}if(ii=Object.keys(Ws),oi=ii.length,oi!==Object.keys(ws).length)return!1;for(si=oi;si--!==0;)if(!{}.hasOwnProperty.call(ws,ii[si]))return!1;for(si=oi;si--!==0;){const ai=ii[si];if(!(ai==="_owner"&&Ws.$$typeof)&&!Jt(Ws[ai],ws[ai]))return!1}return!0}return Ws!==Ws&&ws!==ws}function $o$2(Ws){return typeof window>"u"?1:(Ws.ownerDocument.defaultView||window).devicePixelRatio||1}function Kr$2(Ws,ws){const oi=$o$2(Ws);return Math.round(ws*oi)/oi}function En$1(Ws){const ws=React.useRef(Ws);return $t$2(()=>{ws.current=Ws}),ws}function Nc(Ws){Ws===void 0&&(Ws={});const{placement:ws="bottom",strategy:oi="absolute",middleware:si=[],platform:ii,elements:{reference:ai,floating:li}={},transform:ci=!0,whileElementsMounted:ui,open:di}=Ws,[hi,pi]=React.useState({x:0,y:0,strategy:oi,placement:ws,middlewareData:{},isPositioned:!1}),[ha,ga]=React.useState(si);Jt(ha,si)||ga(si);const[va,ba]=React.useState(null),[wa,xa]=React.useState(null),Ca=React.useCallback(of=>{of!==Ed.current&&(Ed.current=of,ba(of))},[]),el=React.useCallback(of=>{of!==Od.current&&(Od.current=of,xa(of))},[]),ku=ai||va,gd=li||wa,Ed=React.useRef(null),Od=React.useRef(null),Nd=React.useRef(hi),Pd=ui!=null,Ld=En$1(ui),rf=En$1(ii),kd=En$1(di),Md=React.useCallback(()=>{if(!Ed.current||!Od.current)return;const of={placement:ws,strategy:oi,middleware:ha};rf.current&&(of.platform=rf.current),mc(Ed.current,Od.current,of).then(Wd=>{const df={...Wd,isPositioned:kd.current!==!1};Td.current&&!Jt(Nd.current,df)&&(Nd.current=df,ReactDOM.flushSync(()=>{pi(df)}))})},[ha,ws,oi,rf,kd]);$t$2(()=>{di===!1&&Nd.current.isPositioned&&(Nd.current.isPositioned=!1,pi(of=>({...of,isPositioned:!1})))},[di]);const Td=React.useRef(!1);$t$2(()=>(Td.current=!0,()=>{Td.current=!1}),[]),$t$2(()=>{if(ku&&(Ed.current=ku),gd&&(Od.current=gd),ku&&gd){if(Ld.current)return Ld.current(ku,gd,Md);Md()}},[ku,gd,Md,Ld,Pd]);const wd=React.useMemo(()=>({reference:Ed,floating:Od,setReference:Ca,setFloating:el}),[Ca,el]),Cd=React.useMemo(()=>({reference:ku,floating:gd}),[ku,gd]),sf=React.useMemo(()=>{const of={position:oi,left:0,top:0};if(!Cd.floating)return of;const Wd=Kr$2(Cd.floating,hi.x),df=Kr$2(Cd.floating,hi.y);return ci?{...of,transform:"translate("+Wd+"px, "+df+"px)",...$o$2(Cd.floating)>=1.5&&{willChange:"transform"}}:{position:oi,left:Wd,top:df}},[oi,ci,Cd.floating,hi.x,hi.y]);return React.useMemo(()=>({...hi,update:Md,refs:wd,elements:Cd,floatingStyles:sf}),[hi,Md,wd,Cd,sf])}const Lc=Ws=>{function ws(oi){return{}.hasOwnProperty.call(oi,"current")}return{name:"arrow",options:Ws,fn(oi){const{element:si,padding:ii}=typeof Ws=="function"?Ws(oi):Ws;return si&&ws(si)?si.current!=null?Br$2({element:si.current,padding:ii}).fn(oi):{}:si?Br$2({element:si,padding:ii}).fn(oi):{}}}},Vc=(Ws,ws)=>({...cc(Ws),options:[Ws,ws]}),Bc=(Ws,ws)=>({...lc(Ws),options:[Ws,ws]}),Uc=(Ws,ws)=>({...pc(Ws),options:[Ws,ws]}),Wc=(Ws,ws)=>({...uc(Ws),options:[Ws,ws]}),$c=(Ws,ws)=>({...dc(Ws),options:[Ws,ws]}),zc=(Ws,ws)=>({...fc(Ws),options:[Ws,ws]}),Gc=(Ws,ws)=>({...Lc(Ws),options:[Ws,ws]});var jc="Arrow",zo=React.forwardRef((Ws,ws)=>{const{children:oi,width:si=10,height:ii=5,...ai}=Ws;return jsx(se$2.svg,{...ai,ref:ws,width:si,height:ii,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:Ws.asChild?oi:jsx("polygon",{points:"0,0 30,0 15,10"})})});zo.displayName=jc;var Hc=zo;function Kc(Ws){const[ws,oi]=React.useState(void 0);return Ze$1(()=>{if(Ws){oi({width:Ws.offsetWidth,height:Ws.offsetHeight});const si=new ResizeObserver(ii=>{if(!Array.isArray(ii)||!ii.length)return;const ai=ii[0];let li,ci;if("borderBoxSize"in ai){const ui=ai.borderBoxSize,di=Array.isArray(ui)?ui[0]:ui;li=di.inlineSize,ci=di.blockSize}else li=Ws.offsetWidth,ci=Ws.offsetHeight;oi({width:li,height:ci})});return si.observe(Ws,{box:"border-box"}),()=>si.unobserve(Ws)}else oi(void 0)},[Ws]),ws}var nr$1="Popper",[Go$1,jo]=dt$2(nr$1),[Yc,Ho$1]=Go$1(nr$1),Yo$1="PopperAnchor",Xo$1=React.forwardRef((Ws,ws)=>{const{__scopePopper:oi,virtualRef:si,...ii}=Ws,ai=Ho$1(Yo$1,oi),li=React.useRef(null),ci=ge$2(ws,li);return React.useEffect(()=>{ai.onAnchorChange((si==null?void 0:si.current)||li.current)}),si?null:jsx(se$2.div,{...ii,ref:ci})});Xo$1.displayName=Yo$1;var rr$1="PopperContent",[Xc,qc]=Go$1(rr$1),qo=React.forwardRef((Ws,ws)=>{var oi,si,ii,ai,li,ci;const{__scopePopper:ui,side:di="bottom",sideOffset:hi=0,align:pi="center",alignOffset:ha=0,arrowPadding:ga=0,avoidCollisions:va=!0,collisionBoundary:ba=[],collisionPadding:wa=0,sticky:xa="partial",hideWhenDetached:Ca=!1,updatePositionStrategy:el="optimized",onPlaced:ku,...gd}=Ws,Ed=Ho$1(rr$1,ui),[Od,Nd]=React.useState(null),Pd=ge$2(ws,Ef=>Nd(Ef)),[Ld,rf]=React.useState(null),kd=Kc(Ld),Md=(kd==null?void 0:kd.width)??0,Td=(kd==null?void 0:kd.height)??0,wd=di+(pi!=="center"?"-"+pi:""),Cd=typeof wa=="number"?wa:{top:0,right:0,bottom:0,left:0,...wa},sf=Array.isArray(ba)?ba:[ba],of=sf.length>0,Wd={padding:Cd,boundary:sf.filter(Qc),altBoundary:of},{refs:df,floatingStyles:hf,placement:xd,isPositioned:Fd,middlewareData:Vd}=Nc({strategy:"fixed",placement:wd,whileElementsMounted:(...Ef)=>ac(...Ef,{animationFrame:el==="always"}),elements:{reference:Ed.anchor},middleware:[Vc({mainAxis:hi+Td,alignmentAxis:ha}),va&&Bc({mainAxis:!0,crossAxis:!1,limiter:xa==="partial"?Uc():void 0,...Wd}),va&&Wc({...Wd}),$c({...Wd,apply:({elements:Ef,rects:xf,availableWidth:_d,availableHeight:Dd})=>{const{width:tf,height:vd}=xf.reference,Sd=Ef.floating.style;Sd.setProperty("--radix-popper-available-width",`${_d}px`),Sd.setProperty("--radix-popper-available-height",`${Dd}px`),Sd.setProperty("--radix-popper-anchor-width",`${tf}px`),Sd.setProperty("--radix-popper-anchor-height",`${vd}px`)}}),Ld&&Gc({element:Ld,padding:ga}),Jc({arrowWidth:Md,arrowHeight:Td}),Ca&&zc({strategy:"referenceHidden",...Wd})]}),[af,ff]=Jo$1(xd),uf=Ee$2(ku);Ze$1(()=>{Fd&&(uf==null||uf())},[Fd,uf]);const mf=(oi=Vd.arrow)==null?void 0:oi.x,yf=(si=Vd.arrow)==null?void 0:si.y,Sf=((ii=Vd.arrow)==null?void 0:ii.centerOffset)!==0,[Of,wf]=React.useState();return Ze$1(()=>{Od&&wf(window.getComputedStyle(Od).zIndex)},[Od]),jsx("div",{ref:df.setFloating,"data-radix-popper-content-wrapper":"",style:{...hf,transform:Fd?hf.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Of,"--radix-popper-transform-origin":[(ai=Vd.transformOrigin)==null?void 0:ai.x,(li=Vd.transformOrigin)==null?void 0:li.y].join(" "),...((ci=Vd.hide)==null?void 0:ci.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:Ws.dir,children:jsx(Xc,{scope:ui,placedSide:af,onArrowChange:rf,arrowX:mf,arrowY:yf,shouldHideArrow:Sf,children:jsx(se$2.div,{"data-side":af,"data-align":ff,...gd,ref:Pd,style:{...gd.style,animation:Fd?void 0:"none"}})})})});qo.displayName=rr$1;var Zo$1="PopperArrow",Zc={top:"bottom",right:"left",bottom:"top",left:"right"},Qo=React.forwardRef(function(Ws,ws){const{__scopePopper:oi,...si}=Ws,ii=qc(Zo$1,oi),ai=Zc[ii.placedSide];return jsx("span",{ref:ii.onArrowChange,style:{position:"absolute",left:ii.arrowX,top:ii.arrowY,[ai]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[ii.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[ii.placedSide],visibility:ii.shouldHideArrow?"hidden":void 0},children:jsx(Hc,{...si,ref:ws,style:{...si.style,display:"block"}})})});Qo.displayName=Zo$1;function Qc(Ws){return Ws!==null}var Jc=Ws=>({name:"transformOrigin",options:Ws,fn(ws){var oi,si,ii;const{placement:ai,rects:li,middlewareData:ci}=ws,ui=((oi=ci.arrow)==null?void 0:oi.centerOffset)!==0,di=ui?0:Ws.arrowWidth,hi=ui?0:Ws.arrowHeight,[pi,ha]=Jo$1(ai),ga={start:"0%",center:"50%",end:"100%"}[ha],va=(((si=ci.arrow)==null?void 0:si.x)??0)+di/2,ba=(((ii=ci.arrow)==null?void 0:ii.y)??0)+hi/2;let wa="",xa="";return pi==="bottom"?(wa=ui?ga:`${va}px`,xa=`${-hi}px`):pi==="top"?(wa=ui?ga:`${va}px`,xa=`${li.floating.height+hi}px`):pi==="right"?(wa=`${-hi}px`,xa=ui?ga:`${ba}px`):pi==="left"&&(wa=`${li.floating.width+hi}px`,xa=ui?ga:`${ba}px`),{data:{x:wa,y:xa}}}});function Jo$1(Ws){const[ws,oi="center"]=Ws.split("-");return[ws,oi]}var tl=Xo$1,nl=qo,rl=Qo,ol="Portal",es$1=React.forwardRef((Ws,ws)=>{var oi;const{container:si,...ii}=Ws,[ai,li]=React.useState(!1);Ze$1(()=>li(!0),[]);const ci=si||ai&&((oi=globalThis==null?void 0:globalThis.document)==null?void 0:oi.body);return ci?ReactDOM__default.createPortal(jsx(se$2.div,{...ii,ref:ws}),ci):null});es$1.displayName=ol;function sl(Ws,ws){return React.useReducer((oi,si)=>ws[oi][si]??oi,Ws)}var ft$2=Ws=>{const{present:ws,children:oi}=Ws,si=il(ws),ii=typeof oi=="function"?oi({present:si.isPresent}):React.Children.only(oi),ai=ge$2(si.ref,al(ii));return typeof oi=="function"||si.isPresent?React.cloneElement(ii,{ref:ai}):null};ft$2.displayName="Presence";function il(Ws){const[ws,oi]=React.useState(),si=React.useRef({}),ii=React.useRef(Ws),ai=React.useRef("none"),li=Ws?"mounted":"unmounted",[ci,ui]=sl(li,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React.useEffect(()=>{const di=Nt$2(si.current);ai.current=ci==="mounted"?di:"none"},[ci]),Ze$1(()=>{const di=si.current,hi=ii.current;if(hi!==Ws){const pi=ai.current,ha=Nt$2(di);Ws?ui("MOUNT"):ha==="none"||(di==null?void 0:di.display)==="none"?ui("UNMOUNT"):ui(hi&&pi!==ha?"ANIMATION_OUT":"UNMOUNT"),ii.current=Ws}},[Ws,ui]),Ze$1(()=>{if(ws){let di;const hi=ws.ownerDocument.defaultView??window,pi=ga=>{const va=Nt$2(si.current).includes(ga.animationName);if(ga.target===ws&&va&&(ui("ANIMATION_END"),!ii.current)){const ba=ws.style.animationFillMode;ws.style.animationFillMode="forwards",di=hi.setTimeout(()=>{ws.style.animationFillMode==="forwards"&&(ws.style.animationFillMode=ba)})}},ha=ga=>{ga.target===ws&&(ai.current=Nt$2(si.current))};return ws.addEventListener("animationstart",ha),ws.addEventListener("animationcancel",pi),ws.addEventListener("animationend",pi),()=>{hi.clearTimeout(di),ws.removeEventListener("animationstart",ha),ws.removeEventListener("animationcancel",pi),ws.removeEventListener("animationend",pi)}}else ui("ANIMATION_END")},[ws,ui]),{isPresent:["mounted","unmountSuspended"].includes(ci),ref:React.useCallback(di=>{di&&(si.current=getComputedStyle(di)),oi(di)},[])}}function Nt$2(Ws){return(Ws==null?void 0:Ws.animationName)||"none"}function al(Ws){var ws,oi;let si=(ws=Object.getOwnPropertyDescriptor(Ws.props,"ref"))==null?void 0:ws.get,ii=si&&"isReactWarning"in si&&si.isReactWarning;return ii?Ws.ref:(si=(oi=Object.getOwnPropertyDescriptor(Ws,"ref"))==null?void 0:oi.get,ii=si&&"isReactWarning"in si&&si.isReactWarning,ii?Ws.props.ref:Ws.props.ref||Ws.ref)}var An$2="rovingFocusGroup.onEntryFocus",cl={bubbles:!1,cancelable:!0},cn$2="RovingFocusGroup",[Ln$2,ts$1,ll]=No$1(cn$2),[ul,ln$1]=dt$2(cn$2,[ll]),[dl,fl]=ul(cn$2),ns=React.forwardRef((Ws,ws)=>jsx(Ln$2.Provider,{scope:Ws.__scopeRovingFocusGroup,children:jsx(Ln$2.Slot,{scope:Ws.__scopeRovingFocusGroup,children:jsx(pl,{...Ws,ref:ws})})}));ns.displayName=cn$2;var pl=React.forwardRef((Ws,ws)=>{const{__scopeRovingFocusGroup:oi,orientation:si,loop:ii=!1,dir:ai,currentTabStopId:li,defaultCurrentTabStopId:ci,onCurrentTabStopIdChange:ui,onEntryFocus:di,preventScrollOnEntryFocus:hi=!1,...pi}=Ws,ha=React.useRef(null),ga=ge$2(ws,ha),va=tr$1(ai),[ba=null,wa]=er$1({prop:li,defaultProp:ci,onChange:ui}),[xa,Ca]=React.useState(!1),el=Ee$2(di),ku=ts$1(oi),gd=React.useRef(!1),[Ed,Od]=React.useState(0);return React.useEffect(()=>{const Nd=ha.current;if(Nd)return Nd.addEventListener(An$2,el),()=>Nd.removeEventListener(An$2,el)},[el]),jsx(dl,{scope:oi,orientation:si,dir:va,loop:ii,currentTabStopId:ba,onItemFocus:React.useCallback(Nd=>wa(Nd),[wa]),onItemShiftTab:React.useCallback(()=>Ca(!0),[]),onFocusableItemAdd:React.useCallback(()=>Od(Nd=>Nd+1),[]),onFocusableItemRemove:React.useCallback(()=>Od(Nd=>Nd-1),[]),children:jsx(se$2.div,{tabIndex:xa||Ed===0?-1:0,"data-orientation":si,...pi,ref:ga,style:{outline:"none",...Ws.style},onMouseDown:Y$2(Ws.onMouseDown,()=>{gd.current=!0}),onFocus:Y$2(Ws.onFocus,Nd=>{const Pd=!gd.current;if(Nd.target===Nd.currentTarget&&Pd&&!xa){const Ld=new CustomEvent(An$2,cl);if(Nd.currentTarget.dispatchEvent(Ld),!Ld.defaultPrevented){const rf=ku().filter(wd=>wd.focusable),kd=rf.find(wd=>wd.active),Md=rf.find(wd=>wd.id===ba),Td=[kd,Md,...rf].filter(Boolean).map(wd=>wd.ref.current);ss$1(Td,hi)}}gd.current=!1}),onBlur:Y$2(Ws.onBlur,()=>Ca(!1))})})}),rs$1="RovingFocusGroupItem",os$1=React.forwardRef((Ws,ws)=>{const{__scopeRovingFocusGroup:oi,focusable:si=!0,active:ii=!1,tabStopId:ai,...li}=Ws,ci=Qt$2(),ui=ai||ci,di=fl(rs$1,oi),hi=di.currentTabStopId===ui,pi=ts$1(oi),{onFocusableItemAdd:ha,onFocusableItemRemove:ga}=di;return React.useEffect(()=>{if(si)return ha(),()=>ga()},[si,ha,ga]),jsx(Ln$2.ItemSlot,{scope:oi,id:ui,focusable:si,active:ii,children:jsx(se$2.span,{tabIndex:hi?0:-1,"data-orientation":di.orientation,...li,ref:ws,onMouseDown:Y$2(Ws.onMouseDown,va=>{si?di.onItemFocus(ui):va.preventDefault()}),onFocus:Y$2(Ws.onFocus,()=>di.onItemFocus(ui)),onKeyDown:Y$2(Ws.onKeyDown,va=>{if(va.key==="Tab"&&va.shiftKey){di.onItemShiftTab();return}if(va.target!==va.currentTarget)return;const ba=gl(va,di.orientation,di.dir);if(ba!==void 0){if(va.metaKey||va.ctrlKey||va.altKey||va.shiftKey)return;va.preventDefault();let wa=pi().filter(xa=>xa.focusable).map(xa=>xa.ref.current);if(ba==="last")wa.reverse();else if(ba==="prev"||ba==="next"){ba==="prev"&&wa.reverse();const xa=wa.indexOf(va.currentTarget);wa=di.loop?vl(wa,xa+1):wa.slice(xa+1)}setTimeout(()=>ss$1(wa))}})})})});os$1.displayName=rs$1;var ml={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hl(Ws,ws){return ws!=="rtl"?Ws:Ws==="ArrowLeft"?"ArrowRight":Ws==="ArrowRight"?"ArrowLeft":Ws}function gl(Ws,ws,oi){const si=hl(Ws.key,oi);if(!(ws==="vertical"&&["ArrowLeft","ArrowRight"].includes(si))&&!(ws==="horizontal"&&["ArrowUp","ArrowDown"].includes(si)))return ml[si]}function ss$1(Ws,ws=!1){const oi=document.activeElement;for(const si of Ws)if(si===oi||(si.focus({preventScroll:ws}),document.activeElement!==oi))return}function vl(Ws,ws){return Ws.map((oi,si)=>Ws[(ws+si)%Ws.length])}var is=ns,as=os$1,yl=function(Ws){if(typeof document>"u")return null;var ws=Array.isArray(Ws)?Ws[0]:Ws;return ws.ownerDocument.body},tt$2=new WeakMap,Lt$2=new WeakMap,Vt$1={},Rn$1=0,cs$1=function(Ws){return Ws&&(Ws.host||cs$1(Ws.parentNode))},bl=function(Ws,ws){return ws.map(function(oi){if(Ws.contains(oi))return oi;var si=cs$1(oi);return si&&Ws.contains(si)?si:(console.error("aria-hidden",oi,"in not contained inside",Ws,". Doing nothing"),null)}).filter(function(oi){return!!oi})},wl=function(Ws,ws,oi,si){var ii=bl(ws,Array.isArray(Ws)?Ws:[Ws]);Vt$1[oi]||(Vt$1[oi]=new WeakMap);var ai=Vt$1[oi],li=[],ci=new Set,ui=new Set(ii),di=function(pi){!pi||ci.has(pi)||(ci.add(pi),di(pi.parentNode))};ii.forEach(di);var hi=function(pi){!pi||ui.has(pi)||Array.prototype.forEach.call(pi.children,function(ha){if(ci.has(ha))hi(ha);else try{var ga=ha.getAttribute(si),va=ga!==null&&ga!=="false",ba=(tt$2.get(ha)||0)+1,wa=(ai.get(ha)||0)+1;tt$2.set(ha,ba),ai.set(ha,wa),li.push(ha),ba===1&&va&&Lt$2.set(ha,!0),wa===1&&ha.setAttribute(oi,"true"),va||ha.setAttribute(si,"true")}catch(xa){console.error("aria-hidden: cannot operate on ",ha,xa)}})};return hi(ws),ci.clear(),Rn$1++,function(){li.forEach(function(pi){var ha=tt$2.get(pi)-1,ga=ai.get(pi)-1;tt$2.set(pi,ha),ai.set(pi,ga),ha||(Lt$2.has(pi)||pi.removeAttribute(si),Lt$2.delete(pi)),ga||pi.removeAttribute(oi)}),Rn$1--,Rn$1||(tt$2=new WeakMap,tt$2=new WeakMap,Lt$2=new WeakMap,Vt$1={})}},xl=function(Ws,ws,oi){oi===void 0&&(oi="data-aria-hidden");var si=Array.from(Array.isArray(Ws)?Ws:[Ws]),ii=yl(Ws);return ii?(si.push.apply(si,Array.from(ii.querySelectorAll("[aria-live]"))),wl(si,ii,oi,"aria-hidden")):function(){return null}},Pe$2=function(){return Pe$2=Object.assign||function(Ws){for(var ws,oi=1,si=arguments.length;oi<si;oi++){ws=arguments[oi];for(var ii in ws)Object.prototype.hasOwnProperty.call(ws,ii)&&(Ws[ii]=ws[ii])}return Ws},Pe$2.apply(this,arguments)};function ls$1(Ws,ws){var oi={};for(var si in Ws)Object.prototype.hasOwnProperty.call(Ws,si)&&ws.indexOf(si)<0&&(oi[si]=Ws[si]);if(Ws!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ii=0,si=Object.getOwnPropertySymbols(Ws);ii<si.length;ii++)ws.indexOf(si[ii])<0&&Object.prototype.propertyIsEnumerable.call(Ws,si[ii])&&(oi[si[ii]]=Ws[si[ii]]);return oi}function Cl(Ws,ws,oi){for(var si=0,ii=ws.length,ai;si<ii;si++)(ai||!(si in ws))&&(ai||(ai=Array.prototype.slice.call(ws,0,si)),ai[si]=ws[si]);return Ws.concat(ai||Array.prototype.slice.call(ws))}var zt$2="right-scroll-bar-position",Gt$2="width-before-scroll-bar",Sl="with-scroll-bars-hidden",El="--removed-body-scroll-bar-size";function Mn$2(Ws,ws){return typeof Ws=="function"?Ws(ws):Ws&&(Ws.current=ws),Ws}function Al(Ws,ws){var oi=useState(function(){return{value:Ws,callback:ws,facade:{get current(){return oi.value},set current(si){var ii=oi.value;ii!==si&&(oi.value=si,oi.callback(si,ii))}}}})[0];return oi.callback=ws,oi.facade}var Rl=typeof window<"u"?React.useLayoutEffect:React.useEffect,Yr$2=new WeakMap;function Ml(Ws,ws){var oi=Al(null,function(si){return Ws.forEach(function(ii){return Mn$2(ii,si)})});return Rl(function(){var si=Yr$2.get(oi);if(si){var ii=new Set(si),ai=new Set(Ws),li=oi.current;ii.forEach(function(ci){ai.has(ci)||Mn$2(ci,null)}),ai.forEach(function(ci){ii.has(ci)||Mn$2(ci,li)})}Yr$2.set(oi,Ws)},[Ws]),oi}function _l(Ws){return Ws}function Pl(Ws,ws){ws===void 0&&(ws=_l);var oi=[],si=!1,ii={read:function(){if(si)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return oi.length?oi[oi.length-1]:Ws},useMedium:function(ai){var li=ws(ai,si);return oi.push(li),function(){oi=oi.filter(function(ci){return ci!==li})}},assignSyncMedium:function(ai){for(si=!0;oi.length;){var li=oi;oi=[],li.forEach(ai)}oi={push:function(ci){return ai(ci)},filter:function(){return oi}}},assignMedium:function(ai){si=!0;var li=[];if(oi.length){var ci=oi;oi=[],ci.forEach(ai),li=oi}var ui=function(){var hi=li;li=[],hi.forEach(ai)},di=function(){return Promise.resolve().then(ui)};di(),oi={push:function(hi){li.push(hi),di()},filter:function(hi){return li=li.filter(hi),oi}}}};return ii}function Tl(Ws){Ws===void 0&&(Ws={});var ws=Pl(null);return ws.options=Pe$2({async:!0,ssr:!1},Ws),ws}var us=function(Ws){var ws=Ws.sideCar,oi=ls$1(Ws,["sideCar"]);if(!ws)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var si=ws.read();if(!si)throw new Error("Sidecar medium not found");return React.createElement(si,Pe$2({},oi))};us.isSideCarExport=!0;function kl(Ws,ws){return Ws.useMedium(ws),us}var ds$1=Tl(),_n$2=function(){},un$1=React.forwardRef(function(Ws,ws){var oi=React.useRef(null),si=React.useState({onScrollCapture:_n$2,onWheelCapture:_n$2,onTouchMoveCapture:_n$2}),ii=si[0],ai=si[1],li=Ws.forwardProps,ci=Ws.children,ui=Ws.className,di=Ws.removeScrollBar,hi=Ws.enabled,pi=Ws.shards,ha=Ws.sideCar,ga=Ws.noIsolation,va=Ws.inert,ba=Ws.allowPinchZoom,wa=Ws.as,xa=wa===void 0?"div":wa,Ca=Ws.gapMode,el=ls$1(Ws,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),ku=ha,gd=Ml([oi,ws]),Ed=Pe$2(Pe$2({},el),ii);return React.createElement(React.Fragment,null,hi&&React.createElement(ku,{sideCar:ds$1,removeScrollBar:di,shards:pi,noIsolation:ga,inert:va,setCallbacks:ai,allowPinchZoom:!!ba,lockRef:oi,gapMode:Ca}),li?React.cloneElement(React.Children.only(ci),Pe$2(Pe$2({},Ed),{ref:gd})):React.createElement(xa,Pe$2({},Ed,{className:ui,ref:gd}),ci))});un$1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};un$1.classNames={fullWidth:Gt$2,zeroRight:zt$2};var Ol=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dl(){if(!document)return null;var Ws=document.createElement("style");Ws.type="text/css";var ws=Ol();return ws&&Ws.setAttribute("nonce",ws),Ws}function Il(Ws,ws){Ws.styleSheet?Ws.styleSheet.cssText=ws:Ws.appendChild(document.createTextNode(ws))}function Fl(Ws){var ws=document.head||document.getElementsByTagName("head")[0];ws.appendChild(Ws)}var Nl=function(){var Ws=0,ws=null;return{add:function(oi){Ws==0&&(ws=Dl())&&(Il(ws,oi),Fl(ws)),Ws++},remove:function(){Ws--,!Ws&&ws&&(ws.parentNode&&ws.parentNode.removeChild(ws),ws=null)}}},Ll=function(){var Ws=Nl();return function(ws,oi){React.useEffect(function(){return Ws.add(ws),function(){Ws.remove()}},[ws&&oi])}},fs=function(){var Ws=Ll(),ws=function(oi){var si=oi.styles,ii=oi.dynamic;return Ws(si,ii),null};return ws},Vl={left:0,top:0,right:0,gap:0},Pn$2=function(Ws){return parseInt(Ws||"",10)||0},Bl=function(Ws){var ws=window.getComputedStyle(document.body),oi=ws[Ws==="padding"?"paddingLeft":"marginLeft"],si=ws[Ws==="padding"?"paddingTop":"marginTop"],ii=ws[Ws==="padding"?"paddingRight":"marginRight"];return[Pn$2(oi),Pn$2(si),Pn$2(ii)]},Ul=function(Ws){if(Ws===void 0&&(Ws="margin"),typeof window>"u")return Vl;var ws=Bl(Ws),oi=document.documentElement.clientWidth,si=window.innerWidth;return{left:ws[0],top:ws[1],right:ws[2],gap:Math.max(0,si-oi+ws[2]-ws[0])}},Wl=fs(),it="data-scroll-locked",$l=function(Ws,ws,oi,si){var ii=Ws.left,ai=Ws.top,li=Ws.right,ci=Ws.gap;return oi===void 0&&(oi="margin"),`
2
- .`.concat(Sl,` {
3
- overflow: hidden `).concat(si,`;
4
- padding-right: `).concat(ci,"px ").concat(si,`;
5
- }
6
- body[`).concat(it,`] {
7
- overflow: hidden `).concat(si,`;
8
- overscroll-behavior: contain;
9
- `).concat([ws&&"position: relative ".concat(si,";"),oi==="margin"&&`
10
- padding-left: `.concat(ii,`px;
11
- padding-top: `).concat(ai,`px;
12
- padding-right: `).concat(li,`px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: `).concat(ci,"px ").concat(si,`;
16
- `),oi==="padding"&&"padding-right: ".concat(ci,"px ").concat(si,";")].filter(Boolean).join(""),`
17
- }
18
-
19
- .`).concat(zt$2,` {
20
- right: `).concat(ci,"px ").concat(si,`;
21
- }
22
-
23
- .`).concat(Gt$2,` {
24
- margin-right: `).concat(ci,"px ").concat(si,`;
25
- }
26
-
27
- .`).concat(zt$2," .").concat(zt$2,` {
28
- right: 0 `).concat(si,`;
29
- }
30
-
31
- .`).concat(Gt$2," .").concat(Gt$2,` {
32
- margin-right: 0 `).concat(si,`;
33
- }
34
-
35
- body[`).concat(it,`] {
36
- `).concat(El,": ").concat(ci,`px;
37
- }
38
- `)},Xr$2=function(){var Ws=parseInt(document.body.getAttribute(it)||"0",10);return isFinite(Ws)?Ws:0},zl=function(){React.useEffect(function(){return document.body.setAttribute(it,(Xr$2()+1).toString()),function(){var Ws=Xr$2()-1;Ws<=0?document.body.removeAttribute(it):document.body.setAttribute(it,Ws.toString())}},[])},Gl=function(Ws){var ws=Ws.noRelative,oi=Ws.noImportant,si=Ws.gapMode,ii=si===void 0?"margin":si;zl();var ai=React.useMemo(function(){return Ul(ii)},[ii]);return React.createElement(Wl,{styles:$l(ai,!ws,ii,oi?"":"!important")})},Vn$1=!1;if(typeof window<"u")try{var Bt$2=Object.defineProperty({},"passive",{get:function(){return Vn$1=!0,!0}});window.addEventListener("test",Bt$2,Bt$2),window.removeEventListener("test",Bt$2,Bt$2)}catch{Vn$1=!1}var nt$2=Vn$1?{passive:!1}:!1,jl=function(Ws){return Ws.tagName==="TEXTAREA"},ps$1=function(Ws,ws){if(!(Ws instanceof Element))return!1;var oi=window.getComputedStyle(Ws);return oi[ws]!=="hidden"&&!(oi.overflowY===oi.overflowX&&!jl(Ws)&&oi[ws]==="visible")},Hl=function(Ws){return ps$1(Ws,"overflowY")},Kl=function(Ws){return ps$1(Ws,"overflowX")},qr$2=function(Ws,ws){var oi=ws.ownerDocument,si=ws;do{typeof ShadowRoot<"u"&&si instanceof ShadowRoot&&(si=si.host);var ii=ms(Ws,si);if(ii){var ai=hs$1(Ws,si),li=ai[1],ci=ai[2];if(li>ci)return!0}si=si.parentNode}while(si&&si!==oi.body);return!1},Yl=function(Ws){var ws=Ws.scrollTop,oi=Ws.scrollHeight,si=Ws.clientHeight;return[ws,oi,si]},Xl=function(Ws){var ws=Ws.scrollLeft,oi=Ws.scrollWidth,si=Ws.clientWidth;return[ws,oi,si]},ms=function(Ws,ws){return Ws==="v"?Hl(ws):Kl(ws)},hs$1=function(Ws,ws){return Ws==="v"?Yl(ws):Xl(ws)},ql=function(Ws,ws){return Ws==="h"&&ws==="rtl"?-1:1},Zl=function(Ws,ws,oi,si,ii){var ai=ql(Ws,window.getComputedStyle(ws).direction),li=ai*si,ci=oi.target,ui=ws.contains(ci),di=!1,hi=li>0,pi=0,ha=0;do{var ga=hs$1(Ws,ci),va=ga[0],ba=ga[1],wa=ga[2],xa=ba-wa-ai*va;(va||xa)&&ms(Ws,ci)&&(pi+=xa,ha+=va),ci instanceof ShadowRoot?ci=ci.host:ci=ci.parentNode}while(!ui&&ci!==document.body||ui&&(ws.contains(ci)||ws===ci));return(hi&&Math.abs(pi)<1||!hi&&Math.abs(ha)<1)&&(di=!0),di},Ut$2=function(Ws){return"changedTouches"in Ws?[Ws.changedTouches[0].clientX,Ws.changedTouches[0].clientY]:[0,0]},Zr$2=function(Ws){return[Ws.deltaX,Ws.deltaY]},Qr$1=function(Ws){return Ws&&"current"in Ws?Ws.current:Ws},Ql=function(Ws,ws){return Ws[0]===ws[0]&&Ws[1]===ws[1]},Jl=function(Ws){return`
39
- .block-interactivity-`.concat(Ws,` {pointer-events: none;}
40
- .allow-interactivity-`).concat(Ws,` {pointer-events: all;}
41
- `)},eu=0,rt$1=[];function tu(Ws){var ws=React.useRef([]),oi=React.useRef([0,0]),si=React.useRef(),ii=React.useState(eu++)[0],ai=React.useState(fs)[0],li=React.useRef(Ws);React.useEffect(function(){li.current=Ws},[Ws]),React.useEffect(function(){if(Ws.inert){document.body.classList.add("block-interactivity-".concat(ii));var ba=Cl([Ws.lockRef.current],(Ws.shards||[]).map(Qr$1)).filter(Boolean);return ba.forEach(function(wa){return wa.classList.add("allow-interactivity-".concat(ii))}),function(){document.body.classList.remove("block-interactivity-".concat(ii)),ba.forEach(function(wa){return wa.classList.remove("allow-interactivity-".concat(ii))})}}},[Ws.inert,Ws.lockRef.current,Ws.shards]);var ci=React.useCallback(function(ba,wa){if("touches"in ba&&ba.touches.length===2||ba.type==="wheel"&&ba.ctrlKey)return!li.current.allowPinchZoom;var xa=Ut$2(ba),Ca=oi.current,el="deltaX"in ba?ba.deltaX:Ca[0]-xa[0],ku="deltaY"in ba?ba.deltaY:Ca[1]-xa[1],gd,Ed=ba.target,Od=Math.abs(el)>Math.abs(ku)?"h":"v";if("touches"in ba&&Od==="h"&&Ed.type==="range")return!1;var Nd=qr$2(Od,Ed);if(!Nd)return!0;if(Nd?gd=Od:(gd=Od==="v"?"h":"v",Nd=qr$2(Od,Ed)),!Nd)return!1;if(!si.current&&"changedTouches"in ba&&(el||ku)&&(si.current=gd),!gd)return!0;var Pd=si.current||gd;return Zl(Pd,wa,ba,Pd==="h"?el:ku)},[]),ui=React.useCallback(function(ba){var wa=ba;if(!(!rt$1.length||rt$1[rt$1.length-1]!==ai)){var xa="deltaY"in wa?Zr$2(wa):Ut$2(wa),Ca=ws.current.filter(function(gd){return gd.name===wa.type&&(gd.target===wa.target||wa.target===gd.shadowParent)&&Ql(gd.delta,xa)})[0];if(Ca&&Ca.should){wa.cancelable&&wa.preventDefault();return}if(!Ca){var el=(li.current.shards||[]).map(Qr$1).filter(Boolean).filter(function(gd){return gd.contains(wa.target)}),ku=el.length>0?ci(wa,el[0]):!li.current.noIsolation;ku&&wa.cancelable&&wa.preventDefault()}}},[]),di=React.useCallback(function(ba,wa,xa,Ca){var el={name:ba,delta:wa,target:xa,should:Ca,shadowParent:nu(xa)};ws.current.push(el),setTimeout(function(){ws.current=ws.current.filter(function(ku){return ku!==el})},1)},[]),hi=React.useCallback(function(ba){oi.current=Ut$2(ba),si.current=void 0},[]),pi=React.useCallback(function(ba){di(ba.type,Zr$2(ba),ba.target,ci(ba,Ws.lockRef.current))},[]),ha=React.useCallback(function(ba){di(ba.type,Ut$2(ba),ba.target,ci(ba,Ws.lockRef.current))},[]);React.useEffect(function(){return rt$1.push(ai),Ws.setCallbacks({onScrollCapture:pi,onWheelCapture:pi,onTouchMoveCapture:ha}),document.addEventListener("wheel",ui,nt$2),document.addEventListener("touchmove",ui,nt$2),document.addEventListener("touchstart",hi,nt$2),function(){rt$1=rt$1.filter(function(ba){return ba!==ai}),document.removeEventListener("wheel",ui,nt$2),document.removeEventListener("touchmove",ui,nt$2),document.removeEventListener("touchstart",hi,nt$2)}},[]);var ga=Ws.removeScrollBar,va=Ws.inert;return React.createElement(React.Fragment,null,va?React.createElement(ai,{styles:Jl(ii)}):null,ga?React.createElement(Gl,{gapMode:Ws.gapMode}):null)}function nu(Ws){for(var ws=null;Ws!==null;)Ws instanceof ShadowRoot&&(ws=Ws.host,Ws=Ws.host),Ws=Ws.parentNode;return ws}const ru=kl(ds$1,tu);var gs=React.forwardRef(function(Ws,ws){return React.createElement(un$1,Pe$2({},Ws,{ref:ws,sideCar:ru}))});gs.classNames=un$1.classNames;var Bn$1=["Enter"," "],ou=["ArrowDown","PageUp","Home"],vs=["ArrowUp","PageDown","End"],su=[...ou,...vs],iu={ltr:[...Bn$1,"ArrowRight"],rtl:[...Bn$1,"ArrowLeft"]},au={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kt$2="Menu",[Rt$2,cu,lu]=No$1(kt$2),[Qe$1,ys]=dt$2(kt$2,[lu,jo,ln$1]),dn$1=jo(),bs=ln$1(),[uu,Je$2]=Qe$1(kt$2),[du,Ot$1]=Qe$1(kt$2),fu="MenuAnchor",or$2=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,...si}=Ws,ii=dn$1(oi);return jsx(tl,{...ii,...si,ref:ws})});or$2.displayName=fu;var sr$1="MenuPortal",[pu,xs$1]=Qe$1(sr$1,{forceMount:void 0}),Cs$1=Ws=>{const{__scopeMenu:ws,forceMount:oi,children:si,container:ii}=Ws,ai=Je$2(sr$1,ws);return jsx(pu,{scope:ws,forceMount:oi,children:jsx(ft$2,{present:oi||ai.open,children:jsx(es$1,{asChild:!0,container:ii,children:si})})})};Cs$1.displayName=sr$1;var we$1="MenuContent",[mu,ir$1]=Qe$1(we$1),Ss$1=React.forwardRef((Ws,ws)=>{const oi=xs$1(we$1,Ws.__scopeMenu),{forceMount:si=oi.forceMount,...ii}=Ws,ai=Je$2(we$1,Ws.__scopeMenu),li=Ot$1(we$1,Ws.__scopeMenu);return jsx(Rt$2.Provider,{scope:Ws.__scopeMenu,children:jsx(ft$2,{present:si||ai.open,children:jsx(Rt$2.Slot,{scope:Ws.__scopeMenu,children:li.modal?jsx(hu,{...ii,ref:ws}):jsx(gu,{...ii,ref:ws})})})})}),hu=React.forwardRef((Ws,ws)=>{const oi=Je$2(we$1,Ws.__scopeMenu),si=React.useRef(null),ii=ge$2(ws,si);return React.useEffect(()=>{const ai=si.current;if(ai)return xl(ai)},[]),jsx(ar$1,{...Ws,ref:ii,trapFocus:oi.open,disableOutsidePointerEvents:oi.open,disableOutsideScroll:!0,onFocusOutside:Y$2(Ws.onFocusOutside,ai=>ai.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>oi.onOpenChange(!1)})}),gu=React.forwardRef((Ws,ws)=>{const oi=Je$2(we$1,Ws.__scopeMenu);return jsx(ar$1,{...Ws,ref:ws,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>oi.onOpenChange(!1)})}),ar$1=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,loop:si=!1,trapFocus:ii,onOpenAutoFocus:ai,onCloseAutoFocus:li,disableOutsidePointerEvents:ci,onEntryFocus:ui,onEscapeKeyDown:di,onPointerDownOutside:hi,onFocusOutside:pi,onInteractOutside:ha,onDismiss:ga,disableOutsideScroll:va,...ba}=Ws,wa=Je$2(we$1,oi),xa=Ot$1(we$1,oi),Ca=dn$1(oi),el=bs(oi),ku=cu(oi),[gd,Ed]=React.useState(null),Od=React.useRef(null),Nd=ge$2(ws,Od,wa.onContentChange),Pd=React.useRef(0),Ld=React.useRef(""),rf=React.useRef(0),kd=React.useRef(null),Md=React.useRef("right"),Td=React.useRef(0),wd=va?gs:React.Fragment,Cd=va?{as:St$2,allowPinchZoom:!0}:void 0,sf=Wd=>{var df,hf;const xd=Ld.current+Wd,Fd=ku().filter(yf=>!yf.disabled),Vd=document.activeElement,af=(df=Fd.find(yf=>yf.ref.current===Vd))==null?void 0:df.textValue,ff=Fd.map(yf=>yf.textValue),uf=_u(ff,xd,af),mf=(hf=Fd.find(yf=>yf.textValue===uf))==null?void 0:hf.ref.current;(function yf(Sf){Ld.current=Sf,window.clearTimeout(Pd.current),Sf!==""&&(Pd.current=window.setTimeout(()=>yf(""),1e3))})(xd),mf&&setTimeout(()=>mf.focus())};React.useEffect(()=>()=>window.clearTimeout(Pd.current),[]),Rc();const of=React.useCallback(Wd=>{var df,hf;return Md.current===((df=kd.current)==null?void 0:df.side)&&Tu(Wd,(hf=kd.current)==null?void 0:hf.area)},[]);return jsx(mu,{scope:oi,searchRef:Ld,onItemEnter:React.useCallback(Wd=>{of(Wd)&&Wd.preventDefault()},[of]),onItemLeave:React.useCallback(Wd=>{var df;of(Wd)||((df=Od.current)==null||df.focus(),Ed(null))},[of]),onTriggerLeave:React.useCallback(Wd=>{of(Wd)&&Wd.preventDefault()},[of]),pointerGraceTimerRef:rf,onPointerGraceIntentChange:React.useCallback(Wd=>{kd.current=Wd},[]),children:jsx(wd,{...Cd,children:jsx(Uo$1,{asChild:!0,trapped:ii,onMountAutoFocus:Y$2(ai,Wd=>{var df;Wd.preventDefault(),(df=Od.current)==null||df.focus({preventScroll:!0})}),onUnmountAutoFocus:li,children:jsx(Vo$1,{asChild:!0,disableOutsidePointerEvents:ci,onEscapeKeyDown:di,onPointerDownOutside:hi,onFocusOutside:pi,onInteractOutside:ha,onDismiss:ga,children:jsx(is,{asChild:!0,...el,dir:xa.dir,orientation:"vertical",loop:si,currentTabStopId:gd,onCurrentTabStopIdChange:Ed,onEntryFocus:Y$2(ui,Wd=>{xa.isUsingKeyboardRef.current||Wd.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsx(nl,{role:"menu","aria-orientation":"vertical","data-state":Bs(wa.open),"data-radix-menu-content":"",dir:xa.dir,...Ca,...ba,ref:Nd,style:{outline:"none",...ba.style},onKeyDown:Y$2(ba.onKeyDown,Wd=>{const df=Wd.target.closest("[data-radix-menu-content]")===Wd.currentTarget,hf=Wd.ctrlKey||Wd.altKey||Wd.metaKey,xd=Wd.key.length===1;df&&(Wd.key==="Tab"&&Wd.preventDefault(),!hf&&xd&&sf(Wd.key));const Fd=Od.current;if(Wd.target!==Fd||!su.includes(Wd.key))return;Wd.preventDefault();const Vd=ku().filter(af=>!af.disabled).map(af=>af.ref.current);vs.includes(Wd.key)&&Vd.reverse(),Ru(Vd)}),onBlur:Y$2(Ws.onBlur,Wd=>{Wd.currentTarget.contains(Wd.target)||(window.clearTimeout(Pd.current),Ld.current="")}),onPointerMove:Y$2(Ws.onPointerMove,Mt$2(Wd=>{const df=Wd.target,hf=Td.current!==Wd.clientX;if(Wd.currentTarget.contains(df)&&hf){const xd=Wd.clientX>Td.current?"right":"left";Md.current=xd,Td.current=Wd.clientX}}))})})})})})})});Ss$1.displayName=we$1;var vu="MenuGroup",cr$1=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,...si}=Ws;return jsx(se$2.div,{role:"group",...si,ref:ws})});cr$1.displayName=vu;var yu="MenuLabel",Es=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,...si}=Ws;return jsx(se$2.div,{...si,ref:ws})});Es.displayName=yu;var en$1="MenuItem",Jr$2="menu.itemSelect",fn$1=React.forwardRef((Ws,ws)=>{const{disabled:oi=!1,onSelect:si,...ii}=Ws,ai=React.useRef(null),li=Ot$1(en$1,Ws.__scopeMenu),ci=ir$1(en$1,Ws.__scopeMenu),ui=ge$2(ws,ai),di=React.useRef(!1),hi=()=>{const pi=ai.current;if(!oi&&pi){const ha=new CustomEvent(Jr$2,{bubbles:!0,cancelable:!0});pi.addEventListener(Jr$2,ga=>si==null?void 0:si(ga),{once:!0}),wo$1(pi,ha),ha.defaultPrevented?di.current=!1:li.onClose()}};return jsx(As,{...ii,ref:ui,disabled:oi,onClick:Y$2(Ws.onClick,hi),onPointerDown:pi=>{var ha;(ha=Ws.onPointerDown)==null||ha.call(Ws,pi),di.current=!0},onPointerUp:Y$2(Ws.onPointerUp,pi=>{var ha;di.current||(ha=pi.currentTarget)==null||ha.click()}),onKeyDown:Y$2(Ws.onKeyDown,pi=>{const ha=ci.searchRef.current!=="";oi||ha&&pi.key===" "||Bn$1.includes(pi.key)&&(pi.currentTarget.click(),pi.preventDefault())})})});fn$1.displayName=en$1;var As=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,disabled:si=!1,textValue:ii,...ai}=Ws,li=ir$1(en$1,oi),ci=bs(oi),ui=React.useRef(null),di=ge$2(ws,ui),[hi,pi]=React.useState(!1),[ha,ga]=React.useState("");return React.useEffect(()=>{const va=ui.current;va&&ga((va.textContent??"").trim())},[ai.children]),jsx(Rt$2.ItemSlot,{scope:oi,disabled:si,textValue:ii??ha,children:jsx(as,{asChild:!0,...ci,focusable:!si,children:jsx(se$2.div,{role:"menuitem","data-highlighted":hi?"":void 0,"aria-disabled":si||void 0,"data-disabled":si?"":void 0,...ai,ref:di,onPointerMove:Y$2(Ws.onPointerMove,Mt$2(va=>{si?li.onItemLeave(va):(li.onItemEnter(va),va.defaultPrevented||va.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y$2(Ws.onPointerLeave,Mt$2(va=>li.onItemLeave(va))),onFocus:Y$2(Ws.onFocus,()=>pi(!0)),onBlur:Y$2(Ws.onBlur,()=>pi(!1))})})})}),bu="MenuCheckboxItem",Rs=React.forwardRef((Ws,ws)=>{const{checked:oi=!1,onCheckedChange:si,...ii}=Ws;return jsx(ks$1,{scope:Ws.__scopeMenu,checked:oi,children:jsx(fn$1,{role:"menuitemcheckbox","aria-checked":tn$1(oi)?"mixed":oi,...ii,ref:ws,"data-state":ur$2(oi),onSelect:Y$2(ii.onSelect,()=>si==null?void 0:si(tn$1(oi)?!0:!oi),{checkForDefaultPrevented:!1})})})});Rs.displayName=bu;var Ms$1="MenuRadioGroup",[wu,xu]=Qe$1(Ms$1,{value:void 0,onValueChange:()=>{}}),_s$1=React.forwardRef((Ws,ws)=>{const{value:oi,onValueChange:si,...ii}=Ws,ai=Ee$2(si);return jsx(wu,{scope:Ws.__scopeMenu,value:oi,onValueChange:ai,children:jsx(cr$1,{...ii,ref:ws})})});_s$1.displayName=Ms$1;var Ps="MenuRadioItem",Ts$1=React.forwardRef((Ws,ws)=>{const{value:oi,...si}=Ws,ii=xu(Ps,Ws.__scopeMenu),ai=oi===ii.value;return jsx(ks$1,{scope:Ws.__scopeMenu,checked:ai,children:jsx(fn$1,{role:"menuitemradio","aria-checked":ai,...si,ref:ws,"data-state":ur$2(ai),onSelect:Y$2(si.onSelect,()=>{var li;return(li=ii.onValueChange)==null?void 0:li.call(ii,oi)},{checkForDefaultPrevented:!1})})})});Ts$1.displayName=Ps;var lr$1="MenuItemIndicator",[ks$1,Cu]=Qe$1(lr$1,{checked:!1}),Os$1=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,forceMount:si,...ii}=Ws,ai=Cu(lr$1,oi);return jsx(ft$2,{present:si||tn$1(ai.checked)||ai.checked===!0,children:jsx(se$2.span,{...ii,ref:ws,"data-state":ur$2(ai.checked)})})});Os$1.displayName=lr$1;var Su="MenuSeparator",Ds$1=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,...si}=Ws;return jsx(se$2.div,{role:"separator","aria-orientation":"horizontal",...si,ref:ws})});Ds$1.displayName=Su;var Eu="MenuArrow",Is$1=React.forwardRef((Ws,ws)=>{const{__scopeMenu:oi,...si}=Ws,ii=dn$1(oi);return jsx(rl,{...ii,...si,ref:ws})});Is$1.displayName=Eu;var Au="MenuSub",[Yd,Fs]=Qe$1(Au),wt$2="MenuSubTrigger",Ns$1=React.forwardRef((Ws,ws)=>{const oi=Je$2(wt$2,Ws.__scopeMenu),si=Ot$1(wt$2,Ws.__scopeMenu),ii=Fs(wt$2,Ws.__scopeMenu),ai=ir$1(wt$2,Ws.__scopeMenu),li=React.useRef(null),{pointerGraceTimerRef:ci,onPointerGraceIntentChange:ui}=ai,di={__scopeMenu:Ws.__scopeMenu},hi=React.useCallback(()=>{li.current&&window.clearTimeout(li.current),li.current=null},[]);return React.useEffect(()=>hi,[hi]),React.useEffect(()=>{const pi=ci.current;return()=>{window.clearTimeout(pi),ui(null)}},[ci,ui]),jsx(or$2,{asChild:!0,...di,children:jsx(As,{id:ii.triggerId,"aria-haspopup":"menu","aria-expanded":oi.open,"aria-controls":ii.contentId,"data-state":Bs(oi.open),...Ws,ref:rn$1(ws,ii.onTriggerChange),onClick:pi=>{var ha;(ha=Ws.onClick)==null||ha.call(Ws,pi),!(Ws.disabled||pi.defaultPrevented)&&(pi.currentTarget.focus(),oi.open||oi.onOpenChange(!0))},onPointerMove:Y$2(Ws.onPointerMove,Mt$2(pi=>{ai.onItemEnter(pi),!pi.defaultPrevented&&!Ws.disabled&&!oi.open&&!li.current&&(ai.onPointerGraceIntentChange(null),li.current=window.setTimeout(()=>{oi.onOpenChange(!0),hi()},100))})),onPointerLeave:Y$2(Ws.onPointerLeave,Mt$2(pi=>{var ha,ga;hi();const va=(ha=oi.content)==null?void 0:ha.getBoundingClientRect();if(va){const ba=(ga=oi.content)==null?void 0:ga.dataset.side,wa=ba==="right",xa=wa?-5:5,Ca=va[wa?"left":"right"],el=va[wa?"right":"left"];ai.onPointerGraceIntentChange({area:[{x:pi.clientX+xa,y:pi.clientY},{x:Ca,y:va.top},{x:el,y:va.top},{x:el,y:va.bottom},{x:Ca,y:va.bottom}],side:ba}),window.clearTimeout(ci.current),ci.current=window.setTimeout(()=>ai.onPointerGraceIntentChange(null),300)}else{if(ai.onTriggerLeave(pi),pi.defaultPrevented)return;ai.onPointerGraceIntentChange(null)}})),onKeyDown:Y$2(Ws.onKeyDown,pi=>{var ha;const ga=ai.searchRef.current!=="";Ws.disabled||ga&&pi.key===" "||iu[si.dir].includes(pi.key)&&(oi.onOpenChange(!0),(ha=oi.content)==null||ha.focus(),pi.preventDefault())})})})});Ns$1.displayName=wt$2;var Ls$1="MenuSubContent",Vs=React.forwardRef((Ws,ws)=>{const oi=xs$1(we$1,Ws.__scopeMenu),{forceMount:si=oi.forceMount,...ii}=Ws,ai=Je$2(we$1,Ws.__scopeMenu),li=Ot$1(we$1,Ws.__scopeMenu),ci=Fs(Ls$1,Ws.__scopeMenu),ui=React.useRef(null),di=ge$2(ws,ui);return jsx(Rt$2.Provider,{scope:Ws.__scopeMenu,children:jsx(ft$2,{present:si||ai.open,children:jsx(Rt$2.Slot,{scope:Ws.__scopeMenu,children:jsx(ar$1,{id:ci.contentId,"aria-labelledby":ci.triggerId,...ii,ref:di,align:"start",side:li.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:hi=>{var pi;li.isUsingKeyboardRef.current&&((pi=ui.current)==null||pi.focus()),hi.preventDefault()},onCloseAutoFocus:hi=>hi.preventDefault(),onFocusOutside:Y$2(Ws.onFocusOutside,hi=>{hi.target!==ci.trigger&&ai.onOpenChange(!1)}),onEscapeKeyDown:Y$2(Ws.onEscapeKeyDown,hi=>{li.onClose(),hi.preventDefault()}),onKeyDown:Y$2(Ws.onKeyDown,hi=>{var pi;const ha=hi.currentTarget.contains(hi.target),ga=au[li.dir].includes(hi.key);ha&&ga&&(ai.onOpenChange(!1),(pi=ci.trigger)==null||pi.focus(),hi.preventDefault())})})})})})});Vs.displayName=Ls$1;function Bs(Ws){return Ws?"open":"closed"}function tn$1(Ws){return Ws==="indeterminate"}function ur$2(Ws){return tn$1(Ws)?"indeterminate":Ws?"checked":"unchecked"}function Ru(Ws){const ws=document.activeElement;for(const oi of Ws)if(oi===ws||(oi.focus(),document.activeElement!==ws))return}function Mu(Ws,ws){return Ws.map((oi,si)=>Ws[(ws+si)%Ws.length])}function _u(Ws,ws,oi){const si=ws.length>1&&Array.from(ws).every(ci=>ci===ws[0])?ws[0]:ws,ii=oi?Ws.indexOf(oi):-1;let ai=Mu(Ws,Math.max(ii,0));si.length===1&&(ai=ai.filter(ci=>ci!==oi));const li=ai.find(ci=>ci.toLowerCase().startsWith(si.toLowerCase()));return li!==oi?li:void 0}function Pu(Ws,ws){const{x:oi,y:si}=Ws;let ii=!1;for(let ai=0,li=ws.length-1;ai<ws.length;li=ai++){const ci=ws[ai].x,ui=ws[ai].y,di=ws[li].x,hi=ws[li].y;ui>si!=hi>si&&oi<(di-ci)*(si-ui)/(hi-ui)+ci&&(ii=!ii)}return ii}function Tu(Ws,ws){if(!ws)return!1;const oi={x:Ws.clientX,y:Ws.clientY};return Pu(oi,ws)}function Mt$2(Ws){return ws=>ws.pointerType==="mouse"?Ws(ws):void 0}var Ou=or$2,Du=Cs$1,Iu=Ss$1,Fu=cr$1,Nu=Es,Lu=fn$1,Vu=Rs,Bu=_s$1,Uu=Ts$1,Wu=Os$1,$u=Ds$1,zu=Is$1,Gu=Ns$1,ju=Vs,dr$1="DropdownMenu",[Hu,Xd]=dt$2(dr$1,[ys]),fe$2=ys(),[Ku,Us]=Hu(dr$1),$s="DropdownMenuTrigger",zs=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,disabled:si=!1,...ii}=Ws,ai=Us($s,oi),li=fe$2(oi);return jsx(Ou,{asChild:!0,...li,children:jsx(se$2.button,{type:"button",id:ai.triggerId,"aria-haspopup":"menu","aria-expanded":ai.open,"aria-controls":ai.open?ai.contentId:void 0,"data-state":ai.open?"open":"closed","data-disabled":si?"":void 0,disabled:si,...ii,ref:rn$1(ws,ai.triggerRef),onPointerDown:Y$2(Ws.onPointerDown,ci=>{!si&&ci.button===0&&ci.ctrlKey===!1&&(ai.onOpenToggle(),ai.open||ci.preventDefault())}),onKeyDown:Y$2(Ws.onKeyDown,ci=>{si||(["Enter"," "].includes(ci.key)&&ai.onOpenToggle(),ci.key==="ArrowDown"&&ai.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(ci.key)&&ci.preventDefault())})})})});zs.displayName=$s;var Yu="DropdownMenuPortal",Gs$1=Ws=>{const{__scopeDropdownMenu:ws,...oi}=Ws,si=fe$2(ws);return jsx(Du,{...si,...oi})};Gs$1.displayName=Yu;var js$1="DropdownMenuContent",Hs=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=Us(js$1,oi),ai=fe$2(oi),li=React.useRef(!1);return jsx(Iu,{id:ii.contentId,"aria-labelledby":ii.triggerId,...ai,...si,ref:ws,onCloseAutoFocus:Y$2(Ws.onCloseAutoFocus,ci=>{var ui;li.current||(ui=ii.triggerRef.current)==null||ui.focus(),li.current=!1,ci.preventDefault()}),onInteractOutside:Y$2(Ws.onInteractOutside,ci=>{const ui=ci.detail.originalEvent,di=ui.button===0&&ui.ctrlKey===!0,hi=ui.button===2||di;(!ii.modal||hi)&&(li.current=!0)}),style:{...Ws.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Hs.displayName=js$1;var Xu="DropdownMenuGroup",qu=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Fu,{...ii,...si,ref:ws})});qu.displayName=Xu;var Zu="DropdownMenuLabel",Qu=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Nu,{...ii,...si,ref:ws})});Qu.displayName=Zu;var Ju="DropdownMenuItem",Ks=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Lu,{...ii,...si,ref:ws})});Ks.displayName=Ju;var ed="DropdownMenuCheckboxItem",td=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Vu,{...ii,...si,ref:ws})});td.displayName=ed;var nd="DropdownMenuRadioGroup",rd=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Bu,{...ii,...si,ref:ws})});rd.displayName=nd;var od="DropdownMenuRadioItem",sd=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Uu,{...ii,...si,ref:ws})});sd.displayName=od;var id="DropdownMenuItemIndicator",ad=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Wu,{...ii,...si,ref:ws})});ad.displayName=id;var cd="DropdownMenuSeparator",ld=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx($u,{...ii,...si,ref:ws})});ld.displayName=cd;var ud="DropdownMenuArrow",dd=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(zu,{...ii,...si,ref:ws})});dd.displayName=ud;var fd="DropdownMenuSubTrigger",pd=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(Gu,{...ii,...si,ref:ws})});pd.displayName=fd;var md="DropdownMenuSubContent",hd=React.forwardRef((Ws,ws)=>{const{__scopeDropdownMenu:oi,...si}=Ws,ii=fe$2(oi);return jsx(ju,{...ii,...si,ref:ws,style:{...Ws.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hd.displayName=md;var yd=Gs$1,bd=Hs;forwardRef(function({children:Ws,...ws},oi){return jsx(yd,{children:jsx(bd,{...ws,ref:oi,children:Ws})})});var fr$2="Tabs",[Ad,qd]=dt$2(fr$2,[ln$1]),Ys=ln$1(),[Rd,pr$1]=Ad(fr$2),Xs=React.forwardRef((Ws,ws)=>{const{__scopeTabs:oi,value:si,onValueChange:ii,defaultValue:ai,orientation:li="horizontal",dir:ci,activationMode:ui="automatic",...di}=Ws,hi=tr$1(ci),[pi,ha]=er$1({prop:si,onChange:ii,defaultProp:ai});return jsx(Rd,{scope:oi,baseId:Qt$2(),value:pi,onValueChange:ha,orientation:li,dir:hi,activationMode:ui,children:jsx(se$2.div,{dir:hi,"data-orientation":li,...di,ref:ws})})});Xs.displayName=fr$2;var qs$1="TabsList",Zs=React.forwardRef((Ws,ws)=>{const{__scopeTabs:oi,loop:si=!0,...ii}=Ws,ai=pr$1(qs$1,oi),li=Ys(oi);return jsx(is,{asChild:!0,...li,orientation:ai.orientation,dir:ai.dir,loop:si,children:jsx(se$2.div,{role:"tablist","aria-orientation":ai.orientation,...ii,ref:ws})})});Zs.displayName=qs$1;var Qs="TabsTrigger",Js=React.forwardRef((Ws,ws)=>{const{__scopeTabs:oi,value:si,disabled:ii=!1,...ai}=Ws,li=pr$1(Qs,oi),ci=Ys(oi),ui=ni(li.baseId,si),di=ri(li.baseId,si),hi=si===li.value;return jsx(as,{asChild:!0,...ci,focusable:!ii,active:hi,children:jsx(se$2.button,{type:"button",role:"tab","aria-selected":hi,"aria-controls":di,"data-state":hi?"active":"inactive","data-disabled":ii?"":void 0,disabled:ii,id:ui,...ai,ref:ws,onMouseDown:Y$2(Ws.onMouseDown,pi=>{!ii&&pi.button===0&&pi.ctrlKey===!1?li.onValueChange(si):pi.preventDefault()}),onKeyDown:Y$2(Ws.onKeyDown,pi=>{[" ","Enter"].includes(pi.key)&&li.onValueChange(si)}),onFocus:Y$2(Ws.onFocus,()=>{const pi=li.activationMode!=="manual";!hi&&!ii&&pi&&li.onValueChange(si)})})})});Js.displayName=Qs;var ei="TabsContent",ti=React.forwardRef((Ws,ws)=>{const{__scopeTabs:oi,value:si,forceMount:ii,children:ai,...li}=Ws,ci=pr$1(ei,oi),ui=ni(ci.baseId,si),di=ri(ci.baseId,si),hi=si===ci.value,pi=React.useRef(hi);return React.useEffect(()=>{const ha=requestAnimationFrame(()=>pi.current=!1);return()=>cancelAnimationFrame(ha)},[]),jsx(ft$2,{present:ii||hi,children:({present:ha})=>jsx(se$2.div,{"data-state":hi?"active":"inactive","data-orientation":ci.orientation,role:"tabpanel","aria-labelledby":ui,hidden:!ha,id:di,tabIndex:0,...li,ref:ws,style:{...Ws.style,animationDuration:pi.current?"0s":void 0},children:ha&&ai})})});ti.displayName=ei;function ni(Ws,ws){return`${Ws}-trigger-${ws}`}function ri(Ws,ws){return`${Ws}-content-${ws}`}var Zd=Xs,Qd=Zs,Jd=Js,ef=ti;function devAssert$1(Ws,ws){if(!!!Ws)throw new Error(ws)}function isObjectLike$1(Ws){return typeof Ws=="object"&&Ws!==null}function invariant$2(Ws,ws){if(!!!Ws)throw new Error("Unexpected invariant triggered.")}const LineRegExp$1=/\r\n|[\n\r]/g;function getLocation$2(Ws,ws){let oi=0,si=1;for(const ii of Ws.body.matchAll(LineRegExp$1)){if(typeof ii.index=="number"||invariant$2(!1),ii.index>=ws)break;oi=ii.index+ii[0].length,si+=1}return{line:si,column:ws+1-oi}}function printLocation$1(Ws){return printSourceLocation$1(Ws.source,getLocation$2(Ws.source,Ws.start))}function printSourceLocation$1(Ws,ws){const oi=Ws.locationOffset.column-1,si="".padStart(oi)+Ws.body,ii=ws.line-1,ai=Ws.locationOffset.line-1,li=ws.line+ai,ci=ws.line===1?oi:0,ui=ws.column+ci,di=`${Ws.name}:${li}:${ui}
42
- `,hi=si.split(/\r\n|[\n\r]/g),pi=hi[ii];if(pi.length>120){const ha=Math.floor(ui/80),ga=ui%80,va=[];for(let ba=0;ba<pi.length;ba+=80)va.push(pi.slice(ba,ba+80));return di+printPrefixedLines$1([[`${li} |`,va[0]],...va.slice(1,ha+1).map(ba=>["|",ba]),["|","^".padStart(ga)],["|",va[ha+1]]])}return di+printPrefixedLines$1([[`${li-1} |`,hi[ii-1]],[`${li} |`,pi],["|","^".padStart(ui)],[`${li+1} |`,hi[ii+1]]])}function printPrefixedLines$1(Ws){const ws=Ws.filter(([si,ii])=>ii!==void 0),oi=Math.max(...ws.map(([si])=>si.length));return ws.map(([si,ii])=>si.padStart(oi)+(ii?" "+ii:"")).join(`
43
- `)}function toNormalizedOptions$1(Ws){const ws=Ws[0];return ws==null||"kind"in ws||"length"in ws?{nodes:ws,source:Ws[1],positions:Ws[2],path:Ws[3],originalError:Ws[4],extensions:Ws[5]}:ws}let GraphQLError$1=class Gf extends Error{constructor(ws,...oi){var si,ii,ai;const{nodes:li,source:ci,positions:ui,path:di,originalError:hi,extensions:pi}=toNormalizedOptions$1(oi);super(ws),this.name="GraphQLError",this.path=di??void 0,this.originalError=hi??void 0,this.nodes=undefinedIfEmpty$1(Array.isArray(li)?li:li?[li]:void 0);const ha=undefinedIfEmpty$1((si=this.nodes)===null||si===void 0?void 0:si.map(va=>va.loc).filter(va=>va!=null));this.source=ci??(ha==null||(ii=ha[0])===null||ii===void 0?void 0:ii.source),this.positions=ui??(ha==null?void 0:ha.map(va=>va.start)),this.locations=ui&&ci?ui.map(va=>getLocation$2(ci,va)):ha==null?void 0:ha.map(va=>getLocation$2(va.source,va.start));const ga=isObjectLike$1(hi==null?void 0:hi.extensions)?hi==null?void 0:hi.extensions:void 0;this.extensions=(ai=pi??ga)!==null&&ai!==void 0?ai:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),hi!=null&&hi.stack?Object.defineProperty(this,"stack",{value:hi.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Gf):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let ws=this.message;if(this.nodes)for(const oi of this.nodes)oi.loc&&(ws+=`
44
-
45
- `+printLocation$1(oi.loc));else if(this.source&&this.locations)for(const oi of this.locations)ws+=`
46
-
47
- `+printSourceLocation$1(this.source,oi);return ws}toJSON(){const ws={message:this.message};return this.locations!=null&&(ws.locations=this.locations),this.path!=null&&(ws.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(ws.extensions=this.extensions),ws}};function undefinedIfEmpty$1(Ws){return Ws===void 0||Ws.length===0?void 0:Ws}var Kind$1;(function(Ws){Ws.NAME="Name",Ws.DOCUMENT="Document",Ws.OPERATION_DEFINITION="OperationDefinition",Ws.VARIABLE_DEFINITION="VariableDefinition",Ws.SELECTION_SET="SelectionSet",Ws.FIELD="Field",Ws.ARGUMENT="Argument",Ws.FRAGMENT_SPREAD="FragmentSpread",Ws.INLINE_FRAGMENT="InlineFragment",Ws.FRAGMENT_DEFINITION="FragmentDefinition",Ws.VARIABLE="Variable",Ws.INT="IntValue",Ws.FLOAT="FloatValue",Ws.STRING="StringValue",Ws.BOOLEAN="BooleanValue",Ws.NULL="NullValue",Ws.ENUM="EnumValue",Ws.LIST="ListValue",Ws.OBJECT="ObjectValue",Ws.OBJECT_FIELD="ObjectField",Ws.DIRECTIVE="Directive",Ws.NAMED_TYPE="NamedType",Ws.LIST_TYPE="ListType",Ws.NON_NULL_TYPE="NonNullType",Ws.SCHEMA_DEFINITION="SchemaDefinition",Ws.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Ws.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Ws.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Ws.FIELD_DEFINITION="FieldDefinition",Ws.INPUT_VALUE_DEFINITION="InputValueDefinition",Ws.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Ws.UNION_TYPE_DEFINITION="UnionTypeDefinition",Ws.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Ws.ENUM_VALUE_DEFINITION="EnumValueDefinition",Ws.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Ws.DIRECTIVE_DEFINITION="DirectiveDefinition",Ws.SCHEMA_EXTENSION="SchemaExtension",Ws.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Ws.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Ws.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Ws.UNION_TYPE_EXTENSION="UnionTypeExtension",Ws.ENUM_TYPE_EXTENSION="EnumTypeExtension",Ws.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind$1||(Kind$1={}));function isDigit$2(Ws){return Ws>=48&&Ws<=57}function isLetter$1(Ws){return Ws>=97&&Ws<=122||Ws>=65&&Ws<=90}function isNameStart$1(Ws){return isLetter$1(Ws)||Ws===95}function isNameContinue$1(Ws){return isLetter$1(Ws)||isDigit$2(Ws)||Ws===95}const MAX_ARRAY_LENGTH$1=10,MAX_RECURSIVE_DEPTH$1=2;function inspect$1(Ws){return formatValue$1(Ws,[])}function formatValue$1(Ws,ws){switch(typeof Ws){case"string":return JSON.stringify(Ws);case"function":return Ws.name?`[function ${Ws.name}]`:"[function]";case"object":return formatObjectValue$1(Ws,ws);default:return String(Ws)}}function formatObjectValue$1(Ws,ws){if(Ws===null)return"null";if(ws.includes(Ws))return"[Circular]";const oi=[...ws,Ws];if(isJSONable$1(Ws)){const si=Ws.toJSON();if(si!==Ws)return typeof si=="string"?si:formatValue$1(si,oi)}else if(Array.isArray(Ws))return formatArray$1(Ws,oi);return formatObject$1(Ws,oi)}function isJSONable$1(Ws){return typeof Ws.toJSON=="function"}function formatObject$1(Ws,ws){const oi=Object.entries(Ws);return oi.length===0?"{}":ws.length>MAX_RECURSIVE_DEPTH$1?"["+getObjectTag$1(Ws)+"]":"{ "+oi.map(([ii,ai])=>ii+": "+formatValue$1(ai,ws)).join(", ")+" }"}function formatArray$1(Ws,ws){if(Ws.length===0)return"[]";if(ws.length>MAX_RECURSIVE_DEPTH$1)return"[Array]";const oi=Math.min(MAX_ARRAY_LENGTH$1,Ws.length),si=Ws.length-oi,ii=[];for(let ai=0;ai<oi;++ai)ii.push(formatValue$1(Ws[ai],ws));return si===1?ii.push("... 1 more item"):si>1&&ii.push(`... ${si} more items`),"["+ii.join(", ")+"]"}function getObjectTag$1(Ws){const ws=Object.prototype.toString.call(Ws).replace(/^\[object /,"").replace(/]$/,"");if(ws==="Object"&&typeof Ws.constructor=="function"){const oi=Ws.constructor.name;if(typeof oi=="string"&&oi!=="")return oi}return ws}function identityFunc$1(Ws){return Ws}function keyValMap$1(Ws,ws,oi){const si=Object.create(null);for(const ii of Ws)si[ws(ii)]=oi(ii);return si}function toObjMap$1(Ws){if(Ws==null)return Object.create(null);if(Object.getPrototypeOf(Ws)===null)return Ws;const ws=Object.create(null);for(const[oi,si]of Object.entries(Ws))ws[oi]=si;return ws}function valueFromASTUntyped$1(Ws,ws){switch(Ws.kind){case Kind$1.NULL:return null;case Kind$1.INT:return parseInt(Ws.value,10);case Kind$1.FLOAT:return parseFloat(Ws.value);case Kind$1.STRING:case Kind$1.ENUM:case Kind$1.BOOLEAN:return Ws.value;case Kind$1.LIST:return Ws.values.map(oi=>valueFromASTUntyped$1(oi,ws));case Kind$1.OBJECT:return keyValMap$1(Ws.fields,oi=>oi.name.value,oi=>valueFromASTUntyped$1(oi.value,ws));case Kind$1.VARIABLE:return ws==null?void 0:ws[Ws.name.value]}}function assertName$1(Ws){if(Ws!=null||devAssert$1(!1,"Must provide name."),typeof Ws=="string"||devAssert$1(!1,"Expected name to be a string."),Ws.length===0)throw new GraphQLError$1("Expected name to be a non-empty string.");for(let ws=1;ws<Ws.length;++ws)if(!isNameContinue$1(Ws.charCodeAt(ws)))throw new GraphQLError$1(`Names must only contain [_a-zA-Z0-9] but "${Ws}" does not.`);if(!isNameStart$1(Ws.charCodeAt(0)))throw new GraphQLError$1(`Names must start with [_a-zA-Z] but "${Ws}" does not.`);return Ws}let GraphQLScalarType$1=class{constructor(ws){var oi,si,ii,ai;const li=(oi=ws.parseValue)!==null&&oi!==void 0?oi:identityFunc$1;this.name=assertName$1(ws.name),this.description=ws.description,this.specifiedByURL=ws.specifiedByURL,this.serialize=(si=ws.serialize)!==null&&si!==void 0?si:identityFunc$1,this.parseValue=li,this.parseLiteral=(ii=ws.parseLiteral)!==null&&ii!==void 0?ii:(ci,ui)=>li(valueFromASTUntyped$1(ci,ui)),this.extensions=toObjMap$1(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(ai=ws.extensionASTNodes)!==null&&ai!==void 0?ai:[],ws.specifiedByURL==null||typeof ws.specifiedByURL=="string"||devAssert$1(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect$1(ws.specifiedByURL)}.`),ws.serialize==null||typeof ws.serialize=="function"||devAssert$1(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),ws.parseLiteral&&(typeof ws.parseValue=="function"&&typeof ws.parseLiteral=="function"||devAssert$1(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};var util;(function(Ws){Ws.assertEqual=ii=>ii;function ws(ii){}Ws.assertIs=ws;function oi(ii){throw new Error}Ws.assertNever=oi,Ws.arrayToEnum=ii=>{const ai={};for(const li of ii)ai[li]=li;return ai},Ws.getValidEnumValues=ii=>{const ai=Ws.objectKeys(ii).filter(ci=>typeof ii[ii[ci]]!="number"),li={};for(const ci of ai)li[ci]=ii[ci];return Ws.objectValues(li)},Ws.objectValues=ii=>Ws.objectKeys(ii).map(function(ai){return ii[ai]}),Ws.objectKeys=typeof Object.keys=="function"?ii=>Object.keys(ii):ii=>{const ai=[];for(const li in ii)Object.prototype.hasOwnProperty.call(ii,li)&&ai.push(li);return ai},Ws.find=(ii,ai)=>{for(const li of ii)if(ai(li))return li},Ws.isInteger=typeof Number.isInteger=="function"?ii=>Number.isInteger(ii):ii=>typeof ii=="number"&&isFinite(ii)&&Math.floor(ii)===ii;function si(ii,ai=" | "){return ii.map(li=>typeof li=="string"?`'${li}'`:li).join(ai)}Ws.joinValues=si,Ws.jsonStringifyReplacer=(ii,ai)=>typeof ai=="bigint"?ai.toString():ai})(util||(util={}));var objectUtil;(function(Ws){Ws.mergeShapes=(ws,oi)=>({...ws,...oi})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=Ws=>{switch(typeof Ws){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(Ws)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(Ws)?ZodParsedType.array:Ws===null?ZodParsedType.null:Ws.then&&typeof Ws.then=="function"&&Ws.catch&&typeof Ws.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&Ws instanceof Map?ZodParsedType.map:typeof Set<"u"&&Ws instanceof Set?ZodParsedType.set:typeof Date<"u"&&Ws instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=Ws=>JSON.stringify(Ws,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(ws){super(),this.issues=[],this.addIssue=si=>{this.issues=[...this.issues,si]},this.addIssues=(si=[])=>{this.issues=[...this.issues,...si]};const oi=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,oi):this.__proto__=oi,this.name="ZodError",this.issues=ws}format(ws){const oi=ws||function(ai){return ai.message},si={_errors:[]},ii=ai=>{for(const li of ai.issues)if(li.code==="invalid_union")li.unionErrors.map(ii);else if(li.code==="invalid_return_type")ii(li.returnTypeError);else if(li.code==="invalid_arguments")ii(li.argumentsError);else if(li.path.length===0)si._errors.push(oi(li));else{let ci=si,ui=0;for(;ui<li.path.length;){const di=li.path[ui];ui===li.path.length-1?(ci[di]=ci[di]||{_errors:[]},ci[di]._errors.push(oi(li))):ci[di]=ci[di]||{_errors:[]},ci=ci[di],ui++}}};return ii(this),si}static assert(ws){if(!(ws instanceof ZodError))throw new Error(`Not a ZodError: ${ws}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(ws=oi=>oi.message){const oi={},si=[];for(const ii of this.issues)ii.path.length>0?(oi[ii.path[0]]=oi[ii.path[0]]||[],oi[ii.path[0]].push(ws(ii))):si.push(ws(ii));return{formErrors:si,fieldErrors:oi}}get formErrors(){return this.flatten()}}ZodError.create=Ws=>new ZodError(Ws);const errorMap=(Ws,ws)=>{let oi;switch(Ws.code){case ZodIssueCode.invalid_type:Ws.received===ZodParsedType.undefined?oi="Required":oi=`Expected ${Ws.expected}, received ${Ws.received}`;break;case ZodIssueCode.invalid_literal:oi=`Invalid literal value, expected ${JSON.stringify(Ws.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:oi=`Unrecognized key(s) in object: ${util.joinValues(Ws.keys,", ")}`;break;case ZodIssueCode.invalid_union:oi="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:oi=`Invalid discriminator value. Expected ${util.joinValues(Ws.options)}`;break;case ZodIssueCode.invalid_enum_value:oi=`Invalid enum value. Expected ${util.joinValues(Ws.options)}, received '${Ws.received}'`;break;case ZodIssueCode.invalid_arguments:oi="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:oi="Invalid function return type";break;case ZodIssueCode.invalid_date:oi="Invalid date";break;case ZodIssueCode.invalid_string:typeof Ws.validation=="object"?"includes"in Ws.validation?(oi=`Invalid input: must include "${Ws.validation.includes}"`,typeof Ws.validation.position=="number"&&(oi=`${oi} at one or more positions greater than or equal to ${Ws.validation.position}`)):"startsWith"in Ws.validation?oi=`Invalid input: must start with "${Ws.validation.startsWith}"`:"endsWith"in Ws.validation?oi=`Invalid input: must end with "${Ws.validation.endsWith}"`:util.assertNever(Ws.validation):Ws.validation!=="regex"?oi=`Invalid ${Ws.validation}`:oi="Invalid";break;case ZodIssueCode.too_small:Ws.type==="array"?oi=`Array must contain ${Ws.exact?"exactly":Ws.inclusive?"at least":"more than"} ${Ws.minimum} element(s)`:Ws.type==="string"?oi=`String must contain ${Ws.exact?"exactly":Ws.inclusive?"at least":"over"} ${Ws.minimum} character(s)`:Ws.type==="number"?oi=`Number must be ${Ws.exact?"exactly equal to ":Ws.inclusive?"greater than or equal to ":"greater than "}${Ws.minimum}`:Ws.type==="date"?oi=`Date must be ${Ws.exact?"exactly equal to ":Ws.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(Ws.minimum))}`:oi="Invalid input";break;case ZodIssueCode.too_big:Ws.type==="array"?oi=`Array must contain ${Ws.exact?"exactly":Ws.inclusive?"at most":"less than"} ${Ws.maximum} element(s)`:Ws.type==="string"?oi=`String must contain ${Ws.exact?"exactly":Ws.inclusive?"at most":"under"} ${Ws.maximum} character(s)`:Ws.type==="number"?oi=`Number must be ${Ws.exact?"exactly":Ws.inclusive?"less than or equal to":"less than"} ${Ws.maximum}`:Ws.type==="bigint"?oi=`BigInt must be ${Ws.exact?"exactly":Ws.inclusive?"less than or equal to":"less than"} ${Ws.maximum}`:Ws.type==="date"?oi=`Date must be ${Ws.exact?"exactly":Ws.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(Ws.maximum))}`:oi="Invalid input";break;case ZodIssueCode.custom:oi="Invalid input";break;case ZodIssueCode.invalid_intersection_types:oi="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:oi=`Number must be a multiple of ${Ws.multipleOf}`;break;case ZodIssueCode.not_finite:oi="Number must be finite";break;default:oi=ws.defaultError,util.assertNever(Ws)}return{message:oi}};let overrideErrorMap=errorMap;function setErrorMap(Ws){overrideErrorMap=Ws}function getErrorMap(){return overrideErrorMap}const makeIssue=Ws=>{const{data:ws,path:oi,errorMaps:si,issueData:ii}=Ws,ai=[...oi,...ii.path||[]],li={...ii,path:ai};if(ii.message!==void 0)return{...ii,path:ai,message:ii.message};let ci="";const ui=si.filter(di=>!!di).slice().reverse();for(const di of ui)ci=di(li,{data:ws,defaultError:ci}).message;return{...ii,path:ai,message:ci}},EMPTY_PATH=[];function addIssueToContext(Ws,ws){const oi=getErrorMap(),si=makeIssue({issueData:ws,data:Ws.data,path:Ws.path,errorMaps:[Ws.common.contextualErrorMap,Ws.schemaErrorMap,oi,oi===errorMap?void 0:errorMap].filter(ii=>!!ii)});Ws.common.issues.push(si)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(ws,oi){const si=[];for(const ii of oi){if(ii.status==="aborted")return INVALID;ii.status==="dirty"&&ws.dirty(),si.push(ii.value)}return{status:ws.value,value:si}}static async mergeObjectAsync(ws,oi){const si=[];for(const ii of oi){const ai=await ii.key,li=await ii.value;si.push({key:ai,value:li})}return ParseStatus.mergeObjectSync(ws,si)}static mergeObjectSync(ws,oi){const si={};for(const ii of oi){const{key:ai,value:li}=ii;if(ai.status==="aborted"||li.status==="aborted")return INVALID;ai.status==="dirty"&&ws.dirty(),li.status==="dirty"&&ws.dirty(),ai.value!=="__proto__"&&(typeof li.value<"u"||ii.alwaysSet)&&(si[ai.value]=li.value)}return{status:ws.value,value:si}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=Ws=>({status:"dirty",value:Ws}),OK=Ws=>({status:"valid",value:Ws}),isAborted=Ws=>Ws.status==="aborted",isDirty=Ws=>Ws.status==="dirty",isValid=Ws=>Ws.status==="valid",isAsync=Ws=>typeof Promise<"u"&&Ws instanceof Promise;function __classPrivateFieldGet(Ws,ws,oi,si){if(typeof ws=="function"?Ws!==ws||!0:!ws.has(Ws))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ws.get(Ws)}function __classPrivateFieldSet(Ws,ws,oi,si,ii){if(typeof ws=="function"?Ws!==ws||!0:!ws.has(Ws))throw new TypeError("Cannot write private member to an object whose class did not declare it");return ws.set(Ws,oi),oi}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(Ws){Ws.errToObj=ws=>typeof ws=="string"?{message:ws}:ws||{},Ws.toString=ws=>typeof ws=="string"?ws:ws==null?void 0:ws.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(ws,oi,si,ii){this._cachedPath=[],this.parent=ws,this.data=oi,this._path=si,this._key=ii}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(Ws,ws)=>{if(isValid(ws))return{success:!0,data:ws.value};if(!Ws.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const oi=new ZodError(Ws.common.issues);return this._error=oi,this._error}}};function processCreateParams(Ws){if(!Ws)return{};const{errorMap:ws,invalid_type_error:oi,required_error:si,description:ii}=Ws;if(ws&&(oi||si))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return ws?{errorMap:ws,description:ii}:{errorMap:(li,ci)=>{var ui,di;const{message:hi}=Ws;return li.code==="invalid_enum_value"?{message:hi??ci.defaultError}:typeof ci.data>"u"?{message:(ui=hi??si)!==null&&ui!==void 0?ui:ci.defaultError}:li.code!=="invalid_type"?{message:ci.defaultError}:{message:(di=hi??oi)!==null&&di!==void 0?di:ci.defaultError}},description:ii}}class ZodType{get description(){return this._def.description}_getType(ws){return getParsedType(ws.data)}_getOrReturnCtx(ws,oi){return oi||{common:ws.parent.common,data:ws.data,parsedType:getParsedType(ws.data),schemaErrorMap:this._def.errorMap,path:ws.path,parent:ws.parent}}_processInputParams(ws){return{status:new ParseStatus,ctx:{common:ws.parent.common,data:ws.data,parsedType:getParsedType(ws.data),schemaErrorMap:this._def.errorMap,path:ws.path,parent:ws.parent}}}_parseSync(ws){const oi=this._parse(ws);if(isAsync(oi))throw new Error("Synchronous parse encountered promise.");return oi}_parseAsync(ws){const oi=this._parse(ws);return Promise.resolve(oi)}parse(ws,oi){const si=this.safeParse(ws,oi);if(si.success)return si.data;throw si.error}safeParse(ws,oi){var si;const ii={common:{issues:[],async:(si=oi==null?void 0:oi.async)!==null&&si!==void 0?si:!1,contextualErrorMap:oi==null?void 0:oi.errorMap},path:(oi==null?void 0:oi.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ws,parsedType:getParsedType(ws)},ai=this._parseSync({data:ws,path:ii.path,parent:ii});return handleResult(ii,ai)}"~validate"(ws){var oi,si;const ii={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:ws,parsedType:getParsedType(ws)};if(!this["~standard"].async)try{const ai=this._parseSync({data:ws,path:[],parent:ii});return isValid(ai)?{value:ai.value}:{issues:ii.common.issues}}catch(ai){!((si=(oi=ai==null?void 0:ai.message)===null||oi===void 0?void 0:oi.toLowerCase())===null||si===void 0)&&si.includes("encountered")&&(this["~standard"].async=!0),ii.common={issues:[],async:!0}}return this._parseAsync({data:ws,path:[],parent:ii}).then(ai=>isValid(ai)?{value:ai.value}:{issues:ii.common.issues})}async parseAsync(ws,oi){const si=await this.safeParseAsync(ws,oi);if(si.success)return si.data;throw si.error}async safeParseAsync(ws,oi){const si={common:{issues:[],contextualErrorMap:oi==null?void 0:oi.errorMap,async:!0},path:(oi==null?void 0:oi.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:ws,parsedType:getParsedType(ws)},ii=this._parse({data:ws,path:si.path,parent:si}),ai=await(isAsync(ii)?ii:Promise.resolve(ii));return handleResult(si,ai)}refine(ws,oi){const si=ii=>typeof oi=="string"||typeof oi>"u"?{message:oi}:typeof oi=="function"?oi(ii):oi;return this._refinement((ii,ai)=>{const li=ws(ii),ci=()=>ai.addIssue({code:ZodIssueCode.custom,...si(ii)});return typeof Promise<"u"&&li instanceof Promise?li.then(ui=>ui?!0:(ci(),!1)):li?!0:(ci(),!1)})}refinement(ws,oi){return this._refinement((si,ii)=>ws(si)?!0:(ii.addIssue(typeof oi=="function"?oi(si,ii):oi),!1))}_refinement(ws){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:ws}})}superRefine(ws){return this._refinement(ws)}constructor(ws){this.spa=this.safeParseAsync,this._def=ws,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:oi=>this["~validate"](oi)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(ws){return ZodUnion.create([this,ws],this._def)}and(ws){return ZodIntersection.create(this,ws,this._def)}transform(ws){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:ws}})}default(ws){const oi=typeof ws=="function"?ws:()=>ws;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:oi,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(ws){const oi=typeof ws=="function"?ws:()=>ws;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:oi,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(ws){const oi=this.constructor;return new oi({...this._def,description:ws})}pipe(ws){return ZodPipeline.create(this,ws)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(Ws){let ws="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return Ws.precision?ws=`${ws}\\.\\d{${Ws.precision}}`:Ws.precision==null&&(ws=`${ws}(\\.\\d+)?`),ws}function timeRegex(Ws){return new RegExp(`^${timeRegexSource(Ws)}$`)}function datetimeRegex(Ws){let ws=`${dateRegexSource}T${timeRegexSource(Ws)}`;const oi=[];return oi.push(Ws.local?"Z?":"Z"),Ws.offset&&oi.push("([+-]\\d{2}:?\\d{2})"),ws=`${ws}(${oi.join("|")})`,new RegExp(`^${ws}$`)}function isValidIP(Ws,ws){return!!((ws==="v4"||!ws)&&ipv4Regex.test(Ws)||(ws==="v6"||!ws)&&ipv6Regex.test(Ws))}function isValidJWT(Ws,ws){if(!jwtRegex.test(Ws))return!1;try{const[oi]=Ws.split("."),si=oi.replace(/-/g,"+").replace(/_/g,"/").padEnd(oi.length+(4-oi.length%4)%4,"="),ii=JSON.parse(atob(si));return!(typeof ii!="object"||ii===null||!ii.typ||!ii.alg||ws&&ii.alg!==ws)}catch{return!1}}function isValidCidr(Ws,ws){return!!((ws==="v4"||!ws)&&ipv4CidrRegex.test(Ws)||(ws==="v6"||!ws)&&ipv6CidrRegex.test(Ws))}class ZodString extends ZodType{_parse(ws){if(this._def.coerce&&(ws.data=String(ws.data)),this._getType(ws)!==ZodParsedType.string){const ai=this._getOrReturnCtx(ws);return addIssueToContext(ai,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ai.parsedType}),INVALID}const si=new ParseStatus;let ii;for(const ai of this._def.checks)if(ai.kind==="min")ws.data.length<ai.value&&(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.too_small,minimum:ai.value,type:"string",inclusive:!0,exact:!1,message:ai.message}),si.dirty());else if(ai.kind==="max")ws.data.length>ai.value&&(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.too_big,maximum:ai.value,type:"string",inclusive:!0,exact:!1,message:ai.message}),si.dirty());else if(ai.kind==="length"){const li=ws.data.length>ai.value,ci=ws.data.length<ai.value;(li||ci)&&(ii=this._getOrReturnCtx(ws,ii),li?addIssueToContext(ii,{code:ZodIssueCode.too_big,maximum:ai.value,type:"string",inclusive:!0,exact:!0,message:ai.message}):ci&&addIssueToContext(ii,{code:ZodIssueCode.too_small,minimum:ai.value,type:"string",inclusive:!0,exact:!0,message:ai.message}),si.dirty())}else if(ai.kind==="email")emailRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"email",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"emoji",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="uuid")uuidRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"uuid",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="nanoid")nanoidRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="cuid")cuidRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"cuid",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="cuid2")cuid2Regex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="ulid")ulidRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"ulid",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty());else if(ai.kind==="url")try{new URL(ws.data)}catch{ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"url",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()}else ai.kind==="regex"?(ai.regex.lastIndex=0,ai.regex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"regex",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty())):ai.kind==="trim"?ws.data=ws.data.trim():ai.kind==="includes"?ws.data.includes(ai.value,ai.position)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:{includes:ai.value,position:ai.position},message:ai.message}),si.dirty()):ai.kind==="toLowerCase"?ws.data=ws.data.toLowerCase():ai.kind==="toUpperCase"?ws.data=ws.data.toUpperCase():ai.kind==="startsWith"?ws.data.startsWith(ai.value)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:{startsWith:ai.value},message:ai.message}),si.dirty()):ai.kind==="endsWith"?ws.data.endsWith(ai.value)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:{endsWith:ai.value},message:ai.message}),si.dirty()):ai.kind==="datetime"?datetimeRegex(ai).test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:"datetime",message:ai.message}),si.dirty()):ai.kind==="date"?dateRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:"date",message:ai.message}),si.dirty()):ai.kind==="time"?timeRegex(ai).test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.invalid_string,validation:"time",message:ai.message}),si.dirty()):ai.kind==="duration"?durationRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"duration",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):ai.kind==="ip"?isValidIP(ws.data,ai.version)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"ip",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):ai.kind==="jwt"?isValidJWT(ws.data,ai.alg)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"jwt",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):ai.kind==="cidr"?isValidCidr(ws.data,ai.version)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"cidr",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):ai.kind==="base64"?base64Regex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"base64",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):ai.kind==="base64url"?base64urlRegex.test(ws.data)||(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{validation:"base64url",code:ZodIssueCode.invalid_string,message:ai.message}),si.dirty()):util.assertNever(ai);return{status:si.value,value:ws.data}}_regex(ws,oi,si){return this.refinement(ii=>ws.test(ii),{validation:oi,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(si)})}_addCheck(ws){return new ZodString({...this._def,checks:[...this._def.checks,ws]})}email(ws){return this._addCheck({kind:"email",...errorUtil.errToObj(ws)})}url(ws){return this._addCheck({kind:"url",...errorUtil.errToObj(ws)})}emoji(ws){return this._addCheck({kind:"emoji",...errorUtil.errToObj(ws)})}uuid(ws){return this._addCheck({kind:"uuid",...errorUtil.errToObj(ws)})}nanoid(ws){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(ws)})}cuid(ws){return this._addCheck({kind:"cuid",...errorUtil.errToObj(ws)})}cuid2(ws){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(ws)})}ulid(ws){return this._addCheck({kind:"ulid",...errorUtil.errToObj(ws)})}base64(ws){return this._addCheck({kind:"base64",...errorUtil.errToObj(ws)})}base64url(ws){return this._addCheck({kind:"base64url",...errorUtil.errToObj(ws)})}jwt(ws){return this._addCheck({kind:"jwt",...errorUtil.errToObj(ws)})}ip(ws){return this._addCheck({kind:"ip",...errorUtil.errToObj(ws)})}cidr(ws){return this._addCheck({kind:"cidr",...errorUtil.errToObj(ws)})}datetime(ws){var oi,si;return typeof ws=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:ws}):this._addCheck({kind:"datetime",precision:typeof(ws==null?void 0:ws.precision)>"u"?null:ws==null?void 0:ws.precision,offset:(oi=ws==null?void 0:ws.offset)!==null&&oi!==void 0?oi:!1,local:(si=ws==null?void 0:ws.local)!==null&&si!==void 0?si:!1,...errorUtil.errToObj(ws==null?void 0:ws.message)})}date(ws){return this._addCheck({kind:"date",message:ws})}time(ws){return typeof ws=="string"?this._addCheck({kind:"time",precision:null,message:ws}):this._addCheck({kind:"time",precision:typeof(ws==null?void 0:ws.precision)>"u"?null:ws==null?void 0:ws.precision,...errorUtil.errToObj(ws==null?void 0:ws.message)})}duration(ws){return this._addCheck({kind:"duration",...errorUtil.errToObj(ws)})}regex(ws,oi){return this._addCheck({kind:"regex",regex:ws,...errorUtil.errToObj(oi)})}includes(ws,oi){return this._addCheck({kind:"includes",value:ws,position:oi==null?void 0:oi.position,...errorUtil.errToObj(oi==null?void 0:oi.message)})}startsWith(ws,oi){return this._addCheck({kind:"startsWith",value:ws,...errorUtil.errToObj(oi)})}endsWith(ws,oi){return this._addCheck({kind:"endsWith",value:ws,...errorUtil.errToObj(oi)})}min(ws,oi){return this._addCheck({kind:"min",value:ws,...errorUtil.errToObj(oi)})}max(ws,oi){return this._addCheck({kind:"max",value:ws,...errorUtil.errToObj(oi)})}length(ws,oi){return this._addCheck({kind:"length",value:ws,...errorUtil.errToObj(oi)})}nonempty(ws){return this.min(1,errorUtil.errToObj(ws))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(ws=>ws.kind==="datetime")}get isDate(){return!!this._def.checks.find(ws=>ws.kind==="date")}get isTime(){return!!this._def.checks.find(ws=>ws.kind==="time")}get isDuration(){return!!this._def.checks.find(ws=>ws.kind==="duration")}get isEmail(){return!!this._def.checks.find(ws=>ws.kind==="email")}get isURL(){return!!this._def.checks.find(ws=>ws.kind==="url")}get isEmoji(){return!!this._def.checks.find(ws=>ws.kind==="emoji")}get isUUID(){return!!this._def.checks.find(ws=>ws.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(ws=>ws.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(ws=>ws.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(ws=>ws.kind==="cuid2")}get isULID(){return!!this._def.checks.find(ws=>ws.kind==="ulid")}get isIP(){return!!this._def.checks.find(ws=>ws.kind==="ip")}get isCIDR(){return!!this._def.checks.find(ws=>ws.kind==="cidr")}get isBase64(){return!!this._def.checks.find(ws=>ws.kind==="base64")}get isBase64url(){return!!this._def.checks.find(ws=>ws.kind==="base64url")}get minLength(){let ws=null;for(const oi of this._def.checks)oi.kind==="min"&&(ws===null||oi.value>ws)&&(ws=oi.value);return ws}get maxLength(){let ws=null;for(const oi of this._def.checks)oi.kind==="max"&&(ws===null||oi.value<ws)&&(ws=oi.value);return ws}}ZodString.create=Ws=>{var ws;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(ws=Ws==null?void 0:Ws.coerce)!==null&&ws!==void 0?ws:!1,...processCreateParams(Ws)})};function floatSafeRemainder(Ws,ws){const oi=(Ws.toString().split(".")[1]||"").length,si=(ws.toString().split(".")[1]||"").length,ii=oi>si?oi:si,ai=parseInt(Ws.toFixed(ii).replace(".","")),li=parseInt(ws.toFixed(ii).replace(".",""));return ai%li/Math.pow(10,ii)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(ws){if(this._def.coerce&&(ws.data=Number(ws.data)),this._getType(ws)!==ZodParsedType.number){const ai=this._getOrReturnCtx(ws);return addIssueToContext(ai,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ai.parsedType}),INVALID}let si;const ii=new ParseStatus;for(const ai of this._def.checks)ai.kind==="int"?util.isInteger(ws.data)||(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:ai.message}),ii.dirty()):ai.kind==="min"?(ai.inclusive?ws.data<ai.value:ws.data<=ai.value)&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.too_small,minimum:ai.value,type:"number",inclusive:ai.inclusive,exact:!1,message:ai.message}),ii.dirty()):ai.kind==="max"?(ai.inclusive?ws.data>ai.value:ws.data>=ai.value)&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.too_big,maximum:ai.value,type:"number",inclusive:ai.inclusive,exact:!1,message:ai.message}),ii.dirty()):ai.kind==="multipleOf"?floatSafeRemainder(ws.data,ai.value)!==0&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.not_multiple_of,multipleOf:ai.value,message:ai.message}),ii.dirty()):ai.kind==="finite"?Number.isFinite(ws.data)||(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.not_finite,message:ai.message}),ii.dirty()):util.assertNever(ai);return{status:ii.value,value:ws.data}}gte(ws,oi){return this.setLimit("min",ws,!0,errorUtil.toString(oi))}gt(ws,oi){return this.setLimit("min",ws,!1,errorUtil.toString(oi))}lte(ws,oi){return this.setLimit("max",ws,!0,errorUtil.toString(oi))}lt(ws,oi){return this.setLimit("max",ws,!1,errorUtil.toString(oi))}setLimit(ws,oi,si,ii){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:ws,value:oi,inclusive:si,message:errorUtil.toString(ii)}]})}_addCheck(ws){return new ZodNumber({...this._def,checks:[...this._def.checks,ws]})}int(ws){return this._addCheck({kind:"int",message:errorUtil.toString(ws)})}positive(ws){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(ws)})}negative(ws){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(ws)})}nonpositive(ws){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(ws)})}nonnegative(ws){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(ws)})}multipleOf(ws,oi){return this._addCheck({kind:"multipleOf",value:ws,message:errorUtil.toString(oi)})}finite(ws){return this._addCheck({kind:"finite",message:errorUtil.toString(ws)})}safe(ws){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(ws)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(ws)})}get minValue(){let ws=null;for(const oi of this._def.checks)oi.kind==="min"&&(ws===null||oi.value>ws)&&(ws=oi.value);return ws}get maxValue(){let ws=null;for(const oi of this._def.checks)oi.kind==="max"&&(ws===null||oi.value<ws)&&(ws=oi.value);return ws}get isInt(){return!!this._def.checks.find(ws=>ws.kind==="int"||ws.kind==="multipleOf"&&util.isInteger(ws.value))}get isFinite(){let ws=null,oi=null;for(const si of this._def.checks){if(si.kind==="finite"||si.kind==="int"||si.kind==="multipleOf")return!0;si.kind==="min"?(oi===null||si.value>oi)&&(oi=si.value):si.kind==="max"&&(ws===null||si.value<ws)&&(ws=si.value)}return Number.isFinite(oi)&&Number.isFinite(ws)}}ZodNumber.create=Ws=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(Ws==null?void 0:Ws.coerce)||!1,...processCreateParams(Ws)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(ws){if(this._def.coerce)try{ws.data=BigInt(ws.data)}catch{return this._getInvalidInput(ws)}if(this._getType(ws)!==ZodParsedType.bigint)return this._getInvalidInput(ws);let si;const ii=new ParseStatus;for(const ai of this._def.checks)ai.kind==="min"?(ai.inclusive?ws.data<ai.value:ws.data<=ai.value)&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.too_small,type:"bigint",minimum:ai.value,inclusive:ai.inclusive,message:ai.message}),ii.dirty()):ai.kind==="max"?(ai.inclusive?ws.data>ai.value:ws.data>=ai.value)&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.too_big,type:"bigint",maximum:ai.value,inclusive:ai.inclusive,message:ai.message}),ii.dirty()):ai.kind==="multipleOf"?ws.data%ai.value!==BigInt(0)&&(si=this._getOrReturnCtx(ws,si),addIssueToContext(si,{code:ZodIssueCode.not_multiple_of,multipleOf:ai.value,message:ai.message}),ii.dirty()):util.assertNever(ai);return{status:ii.value,value:ws.data}}_getInvalidInput(ws){const oi=this._getOrReturnCtx(ws);return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:oi.parsedType}),INVALID}gte(ws,oi){return this.setLimit("min",ws,!0,errorUtil.toString(oi))}gt(ws,oi){return this.setLimit("min",ws,!1,errorUtil.toString(oi))}lte(ws,oi){return this.setLimit("max",ws,!0,errorUtil.toString(oi))}lt(ws,oi){return this.setLimit("max",ws,!1,errorUtil.toString(oi))}setLimit(ws,oi,si,ii){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:ws,value:oi,inclusive:si,message:errorUtil.toString(ii)}]})}_addCheck(ws){return new ZodBigInt({...this._def,checks:[...this._def.checks,ws]})}positive(ws){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ws)})}negative(ws){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(ws)})}nonpositive(ws){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ws)})}nonnegative(ws){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(ws)})}multipleOf(ws,oi){return this._addCheck({kind:"multipleOf",value:ws,message:errorUtil.toString(oi)})}get minValue(){let ws=null;for(const oi of this._def.checks)oi.kind==="min"&&(ws===null||oi.value>ws)&&(ws=oi.value);return ws}get maxValue(){let ws=null;for(const oi of this._def.checks)oi.kind==="max"&&(ws===null||oi.value<ws)&&(ws=oi.value);return ws}}ZodBigInt.create=Ws=>{var ws;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(ws=Ws==null?void 0:Ws.coerce)!==null&&ws!==void 0?ws:!1,...processCreateParams(Ws)})};class ZodBoolean extends ZodType{_parse(ws){if(this._def.coerce&&(ws.data=!!ws.data),this._getType(ws)!==ZodParsedType.boolean){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:si.parsedType}),INVALID}return OK(ws.data)}}ZodBoolean.create=Ws=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(Ws==null?void 0:Ws.coerce)||!1,...processCreateParams(Ws)});class ZodDate extends ZodType{_parse(ws){if(this._def.coerce&&(ws.data=new Date(ws.data)),this._getType(ws)!==ZodParsedType.date){const ai=this._getOrReturnCtx(ws);return addIssueToContext(ai,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ai.parsedType}),INVALID}if(isNaN(ws.data.getTime())){const ai=this._getOrReturnCtx(ws);return addIssueToContext(ai,{code:ZodIssueCode.invalid_date}),INVALID}const si=new ParseStatus;let ii;for(const ai of this._def.checks)ai.kind==="min"?ws.data.getTime()<ai.value&&(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.too_small,message:ai.message,inclusive:!0,exact:!1,minimum:ai.value,type:"date"}),si.dirty()):ai.kind==="max"?ws.data.getTime()>ai.value&&(ii=this._getOrReturnCtx(ws,ii),addIssueToContext(ii,{code:ZodIssueCode.too_big,message:ai.message,inclusive:!0,exact:!1,maximum:ai.value,type:"date"}),si.dirty()):util.assertNever(ai);return{status:si.value,value:new Date(ws.data.getTime())}}_addCheck(ws){return new ZodDate({...this._def,checks:[...this._def.checks,ws]})}min(ws,oi){return this._addCheck({kind:"min",value:ws.getTime(),message:errorUtil.toString(oi)})}max(ws,oi){return this._addCheck({kind:"max",value:ws.getTime(),message:errorUtil.toString(oi)})}get minDate(){let ws=null;for(const oi of this._def.checks)oi.kind==="min"&&(ws===null||oi.value>ws)&&(ws=oi.value);return ws!=null?new Date(ws):null}get maxDate(){let ws=null;for(const oi of this._def.checks)oi.kind==="max"&&(ws===null||oi.value<ws)&&(ws=oi.value);return ws!=null?new Date(ws):null}}ZodDate.create=Ws=>new ZodDate({checks:[],coerce:(Ws==null?void 0:Ws.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(Ws)});class ZodSymbol extends ZodType{_parse(ws){if(this._getType(ws)!==ZodParsedType.symbol){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:si.parsedType}),INVALID}return OK(ws.data)}}ZodSymbol.create=Ws=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(Ws)});class ZodUndefined extends ZodType{_parse(ws){if(this._getType(ws)!==ZodParsedType.undefined){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:si.parsedType}),INVALID}return OK(ws.data)}}ZodUndefined.create=Ws=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(Ws)});class ZodNull extends ZodType{_parse(ws){if(this._getType(ws)!==ZodParsedType.null){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:si.parsedType}),INVALID}return OK(ws.data)}}ZodNull.create=Ws=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(Ws)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(ws){return OK(ws.data)}}ZodAny.create=Ws=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(Ws)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(ws){return OK(ws.data)}}ZodUnknown.create=Ws=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(Ws)});class ZodNever extends ZodType{_parse(ws){const oi=this._getOrReturnCtx(ws);return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:oi.parsedType}),INVALID}}ZodNever.create=Ws=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(Ws)});class ZodVoid extends ZodType{_parse(ws){if(this._getType(ws)!==ZodParsedType.undefined){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:si.parsedType}),INVALID}return OK(ws.data)}}ZodVoid.create=Ws=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(Ws)});class ZodArray extends ZodType{_parse(ws){const{ctx:oi,status:si}=this._processInputParams(ws),ii=this._def;if(oi.parsedType!==ZodParsedType.array)return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:oi.parsedType}),INVALID;if(ii.exactLength!==null){const li=oi.data.length>ii.exactLength.value,ci=oi.data.length<ii.exactLength.value;(li||ci)&&(addIssueToContext(oi,{code:li?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:ci?ii.exactLength.value:void 0,maximum:li?ii.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:ii.exactLength.message}),si.dirty())}if(ii.minLength!==null&&oi.data.length<ii.minLength.value&&(addIssueToContext(oi,{code:ZodIssueCode.too_small,minimum:ii.minLength.value,type:"array",inclusive:!0,exact:!1,message:ii.minLength.message}),si.dirty()),ii.maxLength!==null&&oi.data.length>ii.maxLength.value&&(addIssueToContext(oi,{code:ZodIssueCode.too_big,maximum:ii.maxLength.value,type:"array",inclusive:!0,exact:!1,message:ii.maxLength.message}),si.dirty()),oi.common.async)return Promise.all([...oi.data].map((li,ci)=>ii.type._parseAsync(new ParseInputLazyPath(oi,li,oi.path,ci)))).then(li=>ParseStatus.mergeArray(si,li));const ai=[...oi.data].map((li,ci)=>ii.type._parseSync(new ParseInputLazyPath(oi,li,oi.path,ci)));return ParseStatus.mergeArray(si,ai)}get element(){return this._def.type}min(ws,oi){return new ZodArray({...this._def,minLength:{value:ws,message:errorUtil.toString(oi)}})}max(ws,oi){return new ZodArray({...this._def,maxLength:{value:ws,message:errorUtil.toString(oi)}})}length(ws,oi){return new ZodArray({...this._def,exactLength:{value:ws,message:errorUtil.toString(oi)}})}nonempty(ws){return this.min(1,ws)}}ZodArray.create=(Ws,ws)=>new ZodArray({type:Ws,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(ws)});function deepPartialify(Ws){if(Ws instanceof ZodObject){const ws={};for(const oi in Ws.shape){const si=Ws.shape[oi];ws[oi]=ZodOptional.create(deepPartialify(si))}return new ZodObject({...Ws._def,shape:()=>ws})}else return Ws instanceof ZodArray?new ZodArray({...Ws._def,type:deepPartialify(Ws.element)}):Ws instanceof ZodOptional?ZodOptional.create(deepPartialify(Ws.unwrap())):Ws instanceof ZodNullable?ZodNullable.create(deepPartialify(Ws.unwrap())):Ws instanceof ZodTuple?ZodTuple.create(Ws.items.map(ws=>deepPartialify(ws))):Ws}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const ws=this._def.shape(),oi=util.objectKeys(ws);return this._cached={shape:ws,keys:oi}}_parse(ws){if(this._getType(ws)!==ZodParsedType.object){const di=this._getOrReturnCtx(ws);return addIssueToContext(di,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:di.parsedType}),INVALID}const{status:si,ctx:ii}=this._processInputParams(ws),{shape:ai,keys:li}=this._getCached(),ci=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const di in ii.data)li.includes(di)||ci.push(di);const ui=[];for(const di of li){const hi=ai[di],pi=ii.data[di];ui.push({key:{status:"valid",value:di},value:hi._parse(new ParseInputLazyPath(ii,pi,ii.path,di)),alwaysSet:di in ii.data})}if(this._def.catchall instanceof ZodNever){const di=this._def.unknownKeys;if(di==="passthrough")for(const hi of ci)ui.push({key:{status:"valid",value:hi},value:{status:"valid",value:ii.data[hi]}});else if(di==="strict")ci.length>0&&(addIssueToContext(ii,{code:ZodIssueCode.unrecognized_keys,keys:ci}),si.dirty());else if(di!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const di=this._def.catchall;for(const hi of ci){const pi=ii.data[hi];ui.push({key:{status:"valid",value:hi},value:di._parse(new ParseInputLazyPath(ii,pi,ii.path,hi)),alwaysSet:hi in ii.data})}}return ii.common.async?Promise.resolve().then(async()=>{const di=[];for(const hi of ui){const pi=await hi.key,ha=await hi.value;di.push({key:pi,value:ha,alwaysSet:hi.alwaysSet})}return di}).then(di=>ParseStatus.mergeObjectSync(si,di)):ParseStatus.mergeObjectSync(si,ui)}get shape(){return this._def.shape()}strict(ws){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...ws!==void 0?{errorMap:(oi,si)=>{var ii,ai,li,ci;const ui=(li=(ai=(ii=this._def).errorMap)===null||ai===void 0?void 0:ai.call(ii,oi,si).message)!==null&&li!==void 0?li:si.defaultError;return oi.code==="unrecognized_keys"?{message:(ci=errorUtil.errToObj(ws).message)!==null&&ci!==void 0?ci:ui}:{message:ui}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(ws){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...ws})})}merge(ws){return new ZodObject({unknownKeys:ws._def.unknownKeys,catchall:ws._def.catchall,shape:()=>({...this._def.shape(),...ws._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(ws,oi){return this.augment({[ws]:oi})}catchall(ws){return new ZodObject({...this._def,catchall:ws})}pick(ws){const oi={};return util.objectKeys(ws).forEach(si=>{ws[si]&&this.shape[si]&&(oi[si]=this.shape[si])}),new ZodObject({...this._def,shape:()=>oi})}omit(ws){const oi={};return util.objectKeys(this.shape).forEach(si=>{ws[si]||(oi[si]=this.shape[si])}),new ZodObject({...this._def,shape:()=>oi})}deepPartial(){return deepPartialify(this)}partial(ws){const oi={};return util.objectKeys(this.shape).forEach(si=>{const ii=this.shape[si];ws&&!ws[si]?oi[si]=ii:oi[si]=ii.optional()}),new ZodObject({...this._def,shape:()=>oi})}required(ws){const oi={};return util.objectKeys(this.shape).forEach(si=>{if(ws&&!ws[si])oi[si]=this.shape[si];else{let ai=this.shape[si];for(;ai instanceof ZodOptional;)ai=ai._def.innerType;oi[si]=ai}}),new ZodObject({...this._def,shape:()=>oi})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(Ws,ws)=>new ZodObject({shape:()=>Ws,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ws)});ZodObject.strictCreate=(Ws,ws)=>new ZodObject({shape:()=>Ws,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ws)});ZodObject.lazycreate=(Ws,ws)=>new ZodObject({shape:Ws,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(ws)});class ZodUnion extends ZodType{_parse(ws){const{ctx:oi}=this._processInputParams(ws),si=this._def.options;function ii(ai){for(const ci of ai)if(ci.result.status==="valid")return ci.result;for(const ci of ai)if(ci.result.status==="dirty")return oi.common.issues.push(...ci.ctx.common.issues),ci.result;const li=ai.map(ci=>new ZodError(ci.ctx.common.issues));return addIssueToContext(oi,{code:ZodIssueCode.invalid_union,unionErrors:li}),INVALID}if(oi.common.async)return Promise.all(si.map(async ai=>{const li={...oi,common:{...oi.common,issues:[]},parent:null};return{result:await ai._parseAsync({data:oi.data,path:oi.path,parent:li}),ctx:li}})).then(ii);{let ai;const li=[];for(const ui of si){const di={...oi,common:{...oi.common,issues:[]},parent:null},hi=ui._parseSync({data:oi.data,path:oi.path,parent:di});if(hi.status==="valid")return hi;hi.status==="dirty"&&!ai&&(ai={result:hi,ctx:di}),di.common.issues.length&&li.push(di.common.issues)}if(ai)return oi.common.issues.push(...ai.ctx.common.issues),ai.result;const ci=li.map(ui=>new ZodError(ui));return addIssueToContext(oi,{code:ZodIssueCode.invalid_union,unionErrors:ci}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(Ws,ws)=>new ZodUnion({options:Ws,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(ws)});const getDiscriminator=Ws=>Ws instanceof ZodLazy?getDiscriminator(Ws.schema):Ws instanceof ZodEffects?getDiscriminator(Ws.innerType()):Ws instanceof ZodLiteral?[Ws.value]:Ws instanceof ZodEnum?Ws.options:Ws instanceof ZodNativeEnum?util.objectValues(Ws.enum):Ws instanceof ZodDefault?getDiscriminator(Ws._def.innerType):Ws instanceof ZodUndefined?[void 0]:Ws instanceof ZodNull?[null]:Ws instanceof ZodOptional?[void 0,...getDiscriminator(Ws.unwrap())]:Ws instanceof ZodNullable?[null,...getDiscriminator(Ws.unwrap())]:Ws instanceof ZodBranded||Ws instanceof ZodReadonly?getDiscriminator(Ws.unwrap()):Ws instanceof ZodCatch?getDiscriminator(Ws._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(ws){const{ctx:oi}=this._processInputParams(ws);if(oi.parsedType!==ZodParsedType.object)return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:oi.parsedType}),INVALID;const si=this.discriminator,ii=oi.data[si],ai=this.optionsMap.get(ii);return ai?oi.common.async?ai._parseAsync({data:oi.data,path:oi.path,parent:oi}):ai._parseSync({data:oi.data,path:oi.path,parent:oi}):(addIssueToContext(oi,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[si]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(ws,oi,si){const ii=new Map;for(const ai of oi){const li=getDiscriminator(ai.shape[ws]);if(!li.length)throw new Error(`A discriminator value for key \`${ws}\` could not be extracted from all schema options`);for(const ci of li){if(ii.has(ci))throw new Error(`Discriminator property ${String(ws)} has duplicate value ${String(ci)}`);ii.set(ci,ai)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:ws,options:oi,optionsMap:ii,...processCreateParams(si)})}}function mergeValues(Ws,ws){const oi=getParsedType(Ws),si=getParsedType(ws);if(Ws===ws)return{valid:!0,data:Ws};if(oi===ZodParsedType.object&&si===ZodParsedType.object){const ii=util.objectKeys(ws),ai=util.objectKeys(Ws).filter(ci=>ii.indexOf(ci)!==-1),li={...Ws,...ws};for(const ci of ai){const ui=mergeValues(Ws[ci],ws[ci]);if(!ui.valid)return{valid:!1};li[ci]=ui.data}return{valid:!0,data:li}}else if(oi===ZodParsedType.array&&si===ZodParsedType.array){if(Ws.length!==ws.length)return{valid:!1};const ii=[];for(let ai=0;ai<Ws.length;ai++){const li=Ws[ai],ci=ws[ai],ui=mergeValues(li,ci);if(!ui.valid)return{valid:!1};ii.push(ui.data)}return{valid:!0,data:ii}}else return oi===ZodParsedType.date&&si===ZodParsedType.date&&+Ws==+ws?{valid:!0,data:Ws}:{valid:!1}}class ZodIntersection extends ZodType{_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws),ii=(ai,li)=>{if(isAborted(ai)||isAborted(li))return INVALID;const ci=mergeValues(ai.value,li.value);return ci.valid?((isDirty(ai)||isDirty(li))&&oi.dirty(),{status:oi.value,value:ci.data}):(addIssueToContext(si,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return si.common.async?Promise.all([this._def.left._parseAsync({data:si.data,path:si.path,parent:si}),this._def.right._parseAsync({data:si.data,path:si.path,parent:si})]).then(([ai,li])=>ii(ai,li)):ii(this._def.left._parseSync({data:si.data,path:si.path,parent:si}),this._def.right._parseSync({data:si.data,path:si.path,parent:si}))}}ZodIntersection.create=(Ws,ws,oi)=>new ZodIntersection({left:Ws,right:ws,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(oi)});class ZodTuple extends ZodType{_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws);if(si.parsedType!==ZodParsedType.array)return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:si.parsedType}),INVALID;if(si.data.length<this._def.items.length)return addIssueToContext(si,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&si.data.length>this._def.items.length&&(addIssueToContext(si,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oi.dirty());const ai=[...si.data].map((li,ci)=>{const ui=this._def.items[ci]||this._def.rest;return ui?ui._parse(new ParseInputLazyPath(si,li,si.path,ci)):null}).filter(li=>!!li);return si.common.async?Promise.all(ai).then(li=>ParseStatus.mergeArray(oi,li)):ParseStatus.mergeArray(oi,ai)}get items(){return this._def.items}rest(ws){return new ZodTuple({...this._def,rest:ws})}}ZodTuple.create=(Ws,ws)=>{if(!Array.isArray(Ws))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:Ws,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(ws)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws);if(si.parsedType!==ZodParsedType.object)return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:si.parsedType}),INVALID;const ii=[],ai=this._def.keyType,li=this._def.valueType;for(const ci in si.data)ii.push({key:ai._parse(new ParseInputLazyPath(si,ci,si.path,ci)),value:li._parse(new ParseInputLazyPath(si,si.data[ci],si.path,ci)),alwaysSet:ci in si.data});return si.common.async?ParseStatus.mergeObjectAsync(oi,ii):ParseStatus.mergeObjectSync(oi,ii)}get element(){return this._def.valueType}static create(ws,oi,si){return oi instanceof ZodType?new ZodRecord({keyType:ws,valueType:oi,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(si)}):new ZodRecord({keyType:ZodString.create(),valueType:ws,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(oi)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws);if(si.parsedType!==ZodParsedType.map)return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:si.parsedType}),INVALID;const ii=this._def.keyType,ai=this._def.valueType,li=[...si.data.entries()].map(([ci,ui],di)=>({key:ii._parse(new ParseInputLazyPath(si,ci,si.path,[di,"key"])),value:ai._parse(new ParseInputLazyPath(si,ui,si.path,[di,"value"]))}));if(si.common.async){const ci=new Map;return Promise.resolve().then(async()=>{for(const ui of li){const di=await ui.key,hi=await ui.value;if(di.status==="aborted"||hi.status==="aborted")return INVALID;(di.status==="dirty"||hi.status==="dirty")&&oi.dirty(),ci.set(di.value,hi.value)}return{status:oi.value,value:ci}})}else{const ci=new Map;for(const ui of li){const di=ui.key,hi=ui.value;if(di.status==="aborted"||hi.status==="aborted")return INVALID;(di.status==="dirty"||hi.status==="dirty")&&oi.dirty(),ci.set(di.value,hi.value)}return{status:oi.value,value:ci}}}}ZodMap.create=(Ws,ws,oi)=>new ZodMap({valueType:ws,keyType:Ws,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(oi)});class ZodSet extends ZodType{_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws);if(si.parsedType!==ZodParsedType.set)return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:si.parsedType}),INVALID;const ii=this._def;ii.minSize!==null&&si.data.size<ii.minSize.value&&(addIssueToContext(si,{code:ZodIssueCode.too_small,minimum:ii.minSize.value,type:"set",inclusive:!0,exact:!1,message:ii.minSize.message}),oi.dirty()),ii.maxSize!==null&&si.data.size>ii.maxSize.value&&(addIssueToContext(si,{code:ZodIssueCode.too_big,maximum:ii.maxSize.value,type:"set",inclusive:!0,exact:!1,message:ii.maxSize.message}),oi.dirty());const ai=this._def.valueType;function li(ui){const di=new Set;for(const hi of ui){if(hi.status==="aborted")return INVALID;hi.status==="dirty"&&oi.dirty(),di.add(hi.value)}return{status:oi.value,value:di}}const ci=[...si.data.values()].map((ui,di)=>ai._parse(new ParseInputLazyPath(si,ui,si.path,di)));return si.common.async?Promise.all(ci).then(ui=>li(ui)):li(ci)}min(ws,oi){return new ZodSet({...this._def,minSize:{value:ws,message:errorUtil.toString(oi)}})}max(ws,oi){return new ZodSet({...this._def,maxSize:{value:ws,message:errorUtil.toString(oi)}})}size(ws,oi){return this.min(ws,oi).max(ws,oi)}nonempty(ws){return this.min(1,ws)}}ZodSet.create=(Ws,ws)=>new ZodSet({valueType:Ws,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(ws)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(ws){const{ctx:oi}=this._processInputParams(ws);if(oi.parsedType!==ZodParsedType.function)return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:oi.parsedType}),INVALID;function si(ci,ui){return makeIssue({data:ci,path:oi.path,errorMaps:[oi.common.contextualErrorMap,oi.schemaErrorMap,getErrorMap(),errorMap].filter(di=>!!di),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:ui}})}function ii(ci,ui){return makeIssue({data:ci,path:oi.path,errorMaps:[oi.common.contextualErrorMap,oi.schemaErrorMap,getErrorMap(),errorMap].filter(di=>!!di),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:ui}})}const ai={errorMap:oi.common.contextualErrorMap},li=oi.data;if(this._def.returns instanceof ZodPromise){const ci=this;return OK(async function(...ui){const di=new ZodError([]),hi=await ci._def.args.parseAsync(ui,ai).catch(ga=>{throw di.addIssue(si(ui,ga)),di}),pi=await Reflect.apply(li,this,hi);return await ci._def.returns._def.type.parseAsync(pi,ai).catch(ga=>{throw di.addIssue(ii(pi,ga)),di})})}else{const ci=this;return OK(function(...ui){const di=ci._def.args.safeParse(ui,ai);if(!di.success)throw new ZodError([si(ui,di.error)]);const hi=Reflect.apply(li,this,di.data),pi=ci._def.returns.safeParse(hi,ai);if(!pi.success)throw new ZodError([ii(hi,pi.error)]);return pi.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...ws){return new ZodFunction({...this._def,args:ZodTuple.create(ws).rest(ZodUnknown.create())})}returns(ws){return new ZodFunction({...this._def,returns:ws})}implement(ws){return this.parse(ws)}strictImplement(ws){return this.parse(ws)}static create(ws,oi,si){return new ZodFunction({args:ws||ZodTuple.create([]).rest(ZodUnknown.create()),returns:oi||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(si)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(ws){const{ctx:oi}=this._processInputParams(ws);return this._def.getter()._parse({data:oi.data,path:oi.path,parent:oi})}}ZodLazy.create=(Ws,ws)=>new ZodLazy({getter:Ws,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(ws)});class ZodLiteral extends ZodType{_parse(ws){if(ws.data!==this._def.value){const oi=this._getOrReturnCtx(ws);return addIssueToContext(oi,{received:oi.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:ws.data}}get value(){return this._def.value}}ZodLiteral.create=(Ws,ws)=>new ZodLiteral({value:Ws,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(ws)});function createZodEnum(Ws,ws){return new ZodEnum({values:Ws,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(ws)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(ws){if(typeof ws.data!="string"){const oi=this._getOrReturnCtx(ws),si=this._def.values;return addIssueToContext(oi,{expected:util.joinValues(si),received:oi.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(ws.data)){const oi=this._getOrReturnCtx(ws),si=this._def.values;return addIssueToContext(oi,{received:oi.data,code:ZodIssueCode.invalid_enum_value,options:si}),INVALID}return OK(ws.data)}get options(){return this._def.values}get enum(){const ws={};for(const oi of this._def.values)ws[oi]=oi;return ws}get Values(){const ws={};for(const oi of this._def.values)ws[oi]=oi;return ws}get Enum(){const ws={};for(const oi of this._def.values)ws[oi]=oi;return ws}extract(ws,oi=this._def){return ZodEnum.create(ws,{...this._def,...oi})}exclude(ws,oi=this._def){return ZodEnum.create(this.options.filter(si=>!ws.includes(si)),{...this._def,...oi})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(ws){const oi=util.getValidEnumValues(this._def.values),si=this._getOrReturnCtx(ws);if(si.parsedType!==ZodParsedType.string&&si.parsedType!==ZodParsedType.number){const ii=util.objectValues(oi);return addIssueToContext(si,{expected:util.joinValues(ii),received:si.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(ws.data)){const ii=util.objectValues(oi);return addIssueToContext(si,{received:si.data,code:ZodIssueCode.invalid_enum_value,options:ii}),INVALID}return OK(ws.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(Ws,ws)=>new ZodNativeEnum({values:Ws,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(ws)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(ws){const{ctx:oi}=this._processInputParams(ws);if(oi.parsedType!==ZodParsedType.promise&&oi.common.async===!1)return addIssueToContext(oi,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:oi.parsedType}),INVALID;const si=oi.parsedType===ZodParsedType.promise?oi.data:Promise.resolve(oi.data);return OK(si.then(ii=>this._def.type.parseAsync(ii,{path:oi.path,errorMap:oi.common.contextualErrorMap})))}}ZodPromise.create=(Ws,ws)=>new ZodPromise({type:Ws,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(ws)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws),ii=this._def.effect||null,ai={addIssue:li=>{addIssueToContext(si,li),li.fatal?oi.abort():oi.dirty()},get path(){return si.path}};if(ai.addIssue=ai.addIssue.bind(ai),ii.type==="preprocess"){const li=ii.transform(si.data,ai);if(si.common.async)return Promise.resolve(li).then(async ci=>{if(oi.value==="aborted")return INVALID;const ui=await this._def.schema._parseAsync({data:ci,path:si.path,parent:si});return ui.status==="aborted"?INVALID:ui.status==="dirty"||oi.value==="dirty"?DIRTY(ui.value):ui});{if(oi.value==="aborted")return INVALID;const ci=this._def.schema._parseSync({data:li,path:si.path,parent:si});return ci.status==="aborted"?INVALID:ci.status==="dirty"||oi.value==="dirty"?DIRTY(ci.value):ci}}if(ii.type==="refinement"){const li=ci=>{const ui=ii.refinement(ci,ai);if(si.common.async)return Promise.resolve(ui);if(ui instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ci};if(si.common.async===!1){const ci=this._def.schema._parseSync({data:si.data,path:si.path,parent:si});return ci.status==="aborted"?INVALID:(ci.status==="dirty"&&oi.dirty(),li(ci.value),{status:oi.value,value:ci.value})}else return this._def.schema._parseAsync({data:si.data,path:si.path,parent:si}).then(ci=>ci.status==="aborted"?INVALID:(ci.status==="dirty"&&oi.dirty(),li(ci.value).then(()=>({status:oi.value,value:ci.value}))))}if(ii.type==="transform")if(si.common.async===!1){const li=this._def.schema._parseSync({data:si.data,path:si.path,parent:si});if(!isValid(li))return li;const ci=ii.transform(li.value,ai);if(ci instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:oi.value,value:ci}}else return this._def.schema._parseAsync({data:si.data,path:si.path,parent:si}).then(li=>isValid(li)?Promise.resolve(ii.transform(li.value,ai)).then(ci=>({status:oi.value,value:ci})):li);util.assertNever(ii)}}ZodEffects.create=(Ws,ws,oi)=>new ZodEffects({schema:Ws,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:ws,...processCreateParams(oi)});ZodEffects.createWithPreprocess=(Ws,ws,oi)=>new ZodEffects({schema:ws,effect:{type:"preprocess",transform:Ws},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(oi)});class ZodOptional extends ZodType{_parse(ws){return this._getType(ws)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(ws)}unwrap(){return this._def.innerType}}ZodOptional.create=(Ws,ws)=>new ZodOptional({innerType:Ws,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(ws)});class ZodNullable extends ZodType{_parse(ws){return this._getType(ws)===ZodParsedType.null?OK(null):this._def.innerType._parse(ws)}unwrap(){return this._def.innerType}}ZodNullable.create=(Ws,ws)=>new ZodNullable({innerType:Ws,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(ws)});class ZodDefault extends ZodType{_parse(ws){const{ctx:oi}=this._processInputParams(ws);let si=oi.data;return oi.parsedType===ZodParsedType.undefined&&(si=this._def.defaultValue()),this._def.innerType._parse({data:si,path:oi.path,parent:oi})}removeDefault(){return this._def.innerType}}ZodDefault.create=(Ws,ws)=>new ZodDefault({innerType:Ws,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof ws.default=="function"?ws.default:()=>ws.default,...processCreateParams(ws)});class ZodCatch extends ZodType{_parse(ws){const{ctx:oi}=this._processInputParams(ws),si={...oi,common:{...oi.common,issues:[]}},ii=this._def.innerType._parse({data:si.data,path:si.path,parent:{...si}});return isAsync(ii)?ii.then(ai=>({status:"valid",value:ai.status==="valid"?ai.value:this._def.catchValue({get error(){return new ZodError(si.common.issues)},input:si.data})})):{status:"valid",value:ii.status==="valid"?ii.value:this._def.catchValue({get error(){return new ZodError(si.common.issues)},input:si.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(Ws,ws)=>new ZodCatch({innerType:Ws,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof ws.catch=="function"?ws.catch:()=>ws.catch,...processCreateParams(ws)});class ZodNaN extends ZodType{_parse(ws){if(this._getType(ws)!==ZodParsedType.nan){const si=this._getOrReturnCtx(ws);return addIssueToContext(si,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:si.parsedType}),INVALID}return{status:"valid",value:ws.data}}}ZodNaN.create=Ws=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(Ws)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(ws){const{ctx:oi}=this._processInputParams(ws),si=oi.data;return this._def.type._parse({data:si,path:oi.path,parent:oi})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(ws){const{status:oi,ctx:si}=this._processInputParams(ws);if(si.common.async)return(async()=>{const ai=await this._def.in._parseAsync({data:si.data,path:si.path,parent:si});return ai.status==="aborted"?INVALID:ai.status==="dirty"?(oi.dirty(),DIRTY(ai.value)):this._def.out._parseAsync({data:ai.value,path:si.path,parent:si})})();{const ii=this._def.in._parseSync({data:si.data,path:si.path,parent:si});return ii.status==="aborted"?INVALID:ii.status==="dirty"?(oi.dirty(),{status:"dirty",value:ii.value}):this._def.out._parseSync({data:ii.value,path:si.path,parent:si})}}static create(ws,oi){return new ZodPipeline({in:ws,out:oi,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(ws){const oi=this._def.innerType._parse(ws),si=ii=>(isValid(ii)&&(ii.value=Object.freeze(ii.value)),ii);return isAsync(oi)?oi.then(ii=>si(ii)):si(oi)}unwrap(){return this._def.innerType}}ZodReadonly.create=(Ws,ws)=>new ZodReadonly({innerType:Ws,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(ws)});function custom(Ws,ws={},oi){return Ws?ZodAny.create().superRefine((si,ii)=>{var ai,li;if(!Ws(si)){const ci=typeof ws=="function"?ws(si):typeof ws=="string"?{message:ws}:ws,ui=(li=(ai=ci.fatal)!==null&&ai!==void 0?ai:oi)!==null&&li!==void 0?li:!0,di=typeof ci=="string"?{message:ci}:ci;ii.addIssue({code:"custom",...di,fatal:ui})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(Ws){Ws.ZodString="ZodString",Ws.ZodNumber="ZodNumber",Ws.ZodNaN="ZodNaN",Ws.ZodBigInt="ZodBigInt",Ws.ZodBoolean="ZodBoolean",Ws.ZodDate="ZodDate",Ws.ZodSymbol="ZodSymbol",Ws.ZodUndefined="ZodUndefined",Ws.ZodNull="ZodNull",Ws.ZodAny="ZodAny",Ws.ZodUnknown="ZodUnknown",Ws.ZodNever="ZodNever",Ws.ZodVoid="ZodVoid",Ws.ZodArray="ZodArray",Ws.ZodObject="ZodObject",Ws.ZodUnion="ZodUnion",Ws.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ws.ZodIntersection="ZodIntersection",Ws.ZodTuple="ZodTuple",Ws.ZodRecord="ZodRecord",Ws.ZodMap="ZodMap",Ws.ZodSet="ZodSet",Ws.ZodFunction="ZodFunction",Ws.ZodLazy="ZodLazy",Ws.ZodLiteral="ZodLiteral",Ws.ZodEnum="ZodEnum",Ws.ZodEffects="ZodEffects",Ws.ZodNativeEnum="ZodNativeEnum",Ws.ZodOptional="ZodOptional",Ws.ZodNullable="ZodNullable",Ws.ZodDefault="ZodDefault",Ws.ZodCatch="ZodCatch",Ws.ZodPromise="ZodPromise",Ws.ZodBranded="ZodBranded",Ws.ZodPipeline="ZodPipeline",Ws.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(Ws,ws={message:`Input not instance of ${Ws.name}`})=>custom(oi=>oi instanceof Ws,ws),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:Ws=>ZodString.create({...Ws,coerce:!0}),number:Ws=>ZodNumber.create({...Ws,coerce:!0}),boolean:Ws=>ZodBoolean.create({...Ws,coerce:!0}),bigint:Ws=>ZodBigInt.create({...Ws,coerce:!0}),date:Ws=>ZodDate.create({...Ws,coerce:!0})},NEVER=INVALID;var z$4=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const type$c="number",typedef$b="scalar Amount_Tokens",schema$b=z$4.number(),stringSchema$b="z.number()",amountTokensValidation=Ws=>{if(typeof Ws!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(Ws)}`);if(!Number.isFinite(Ws))throw new GraphQLError$1(`Value is not a finite number: ${Ws}`);const ws=schema$b.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$c={name:"Amount_Tokens",description:"A custom scalar that represents an amount of tokens",serialize:amountTokensValidation,parseValue:amountTokensValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:Ws});const ws=parseFloat(Ws.value);return amountTokensValidation(ws)}},scalar$b=new GraphQLScalarType$1(config$c),AmountTokens=Object.freeze(Object.defineProperty({__proto__:null,config:config$c,scalar:scalar$b,schema:schema$b,stringSchema:stringSchema$b,type:type$c,typedef:typedef$b},Symbol.toStringTag,{value:"Module"})),type$b="string",typedef$a="scalar EthereumAddress",schema$a=z$4.string().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Invalid Ethereum address format"}),stringSchema$a="z.string().regex(/^0x[a-fA-F0-9]{40}$/, { message: 'Invalid Ethereum address format' })",addressValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema$a.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$b={name:"EthereumAddress",description:'A custom scalar representing an Ethereum address, validated as a 42-character hexadecimal string prefixed with "0x"',serialize:addressValidation,parseValue:addressValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1("some error message",{nodes:Ws});return addressValidation(Ws.value)}},scalar$a=new GraphQLScalarType$1(config$b),EthereumAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$b,scalar:scalar$a,schema:schema$a,stringSchema:stringSchema$a,type:type$b,typedef:typedef$a},Symbol.toStringTag,{value:"Module"})),type$a="number",typedef$9="scalar Amount_Percentage",schema$9=z$4.number(),stringSchema$9="z.number()",amountPercentageValidation=Ws=>{if(typeof Ws!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(Ws)}`);if(!Number.isFinite(Ws))throw new GraphQLError$1(`Value is not a finite number: ${Ws}`);const ws=schema$9.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$a={name:"Amount_Percentage",description:"",serialize:amountPercentageValidation,parseValue:amountPercentageValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.FLOAT)throw new GraphQLError$1("some error message",{nodes:Ws});const ws=parseFloat(Ws.value);return amountPercentageValidation(ws)}},scalar$9=new GraphQLScalarType$1(config$a),AmountPercentage=Object.freeze(Object.defineProperty({__proto__:null,config:config$a,scalar:scalar$9,schema:schema$9,stringSchema:stringSchema$9,type:type$a,typedef:typedef$9},Symbol.toStringTag,{value:"Module"})),type$9="string",typedef$8="scalar EmailAddress",schema$8=z$4.string().email(),stringSchema$8="z.string().email()",emailValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema$8.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$9={name:"EmailAddress",description:"A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/.",serialize:emailValidation,parseValue:emailValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1(`Can only validate strings as email addresses but got a: ${Ws.kind}`,{nodes:Ws});return emailValidation(Ws.value)}},scalar$8=new GraphQLScalarType$1(config$9),EmailAddress=Object.freeze(Object.defineProperty({__proto__:null,config:config$9,scalar:scalar$8,schema:schema$8,stringSchema:stringSchema$8,type:type$9,typedef:typedef$8},Symbol.toStringTag,{value:"Module"})),type$8="string",typedef$7="scalar Date",schema$7=z$4.string().datetime(),stringSchema$7="z.string().datetime()",datetimeValidation$1=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(Ws)}`);const ws=schema$7.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$8={name:"Date",description:"A custom scalar that represents a datetime in ISO 8601 format (Time: 00:00:00)",serialize:datetimeValidation$1,parseValue:datetimeValidation$1,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:Ws});return datetimeValidation$1(Ws.value)}},scalar$7=new GraphQLScalarType$1(config$8),Date$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$8,scalar:scalar$7,schema:schema$7,stringSchema:stringSchema$7,type:type$8,typedef:typedef$7},Symbol.toStringTag,{value:"Module"})),type$7="string",typedef$6="scalar DateTime",schema$6=z$4.string().datetime(),stringSchema$6="z.string().datetime()",datetimeValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(Ws)}`);const ws=schema$6.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$7={name:"DateTime",description:"A custom scalar that represents a datetime in ISO 8601 format",serialize:datetimeValidation,parseValue:datetimeValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:Ws});return datetimeValidation(Ws.value)}},scalar$6=new GraphQLScalarType$1(config$7),DateTime=Object.freeze(Object.defineProperty({__proto__:null,config:config$7,scalar:scalar$6,schema:schema$6,stringSchema:stringSchema$6,type:type$7,typedef:typedef$6},Symbol.toStringTag,{value:"Module"})),type$6="string",typedef$5="scalar URL",schema$5=z$4.string().url(),stringSchema$5="z.string().url()",urlValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not iso string: ${JSON.stringify(Ws)}`);const ws=schema$5.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$6={name:"URL",description:"A custom scalar that represents a URL string",serialize:urlValidation,parseValue:urlValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1("Value is not an string",{nodes:Ws});return urlValidation(Ws.value)}},scalar$5=new GraphQLScalarType$1(config$6),URL$1=Object.freeze(Object.defineProperty({__proto__:null,config:config$6,scalar:scalar$5,schema:schema$5,stringSchema:stringSchema$5,type:type$6,typedef:typedef$5},Symbol.toStringTag,{value:"Module"})),type$5="number",typedef$4="scalar Amount_Money",schema$4=z$4.number(),stringSchema$4="z.number()",amountMoneyValidation=Ws=>{if(typeof Ws!="number")throw new GraphQLError$1(`Value is not number: ${JSON.stringify(Ws)}`);if(!Number.isFinite(Ws))throw new GraphQLError$1(`Value is not a finite number: ${Ws}`);const ws=schema$4.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$5={name:"Amount_Money",description:"A custom scalar that represents a monetary amount in a currency",serialize:amountMoneyValidation,parseValue:amountMoneyValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.FLOAT)throw new GraphQLError$1("Value is not a float type",{nodes:Ws});const ws=parseFloat(Ws.value);return amountMoneyValidation(ws)}},scalar$4=new GraphQLScalarType$1(config$5),AmountMoney=Object.freeze(Object.defineProperty({__proto__:null,config:config$5,scalar:scalar$4,schema:schema$4,stringSchema:stringSchema$4,type:type$5,typedef:typedef$4},Symbol.toStringTag,{value:"Module"})),type$4="string",typedef$3="scalar OLabel",schema$3=z$4.string(),stringSchema$3="z.string()",oLabelValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema$3.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$4={name:"OLabel",description:"A custom scalar that represents a OLabel string",serialize:oLabelValidation,parseValue:oLabelValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${Ws.kind}`,{nodes:Ws});return oLabelValidation(Ws.value)}},scalar$3=new GraphQLScalarType$1(config$4),OLabel=Object.freeze(Object.defineProperty({__proto__:null,config:config$4,scalar:scalar$3,schema:schema$3,stringSchema:stringSchema$3,type:type$4,typedef:typedef$3},Symbol.toStringTag,{value:"Module"})),type$3="string",typedef$2="scalar Currency",schema$2=z$4.string(),stringSchema$2="z.string()",currencyValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema$2.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$3={name:"Currency",description:"A custom scalar that represents a Currency Code string",serialize:currencyValidation,parseValue:currencyValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${Ws.kind}`,{nodes:Ws});return currencyValidation(Ws.value)}},scalar$2=new GraphQLScalarType$1(config$3),Currency=Object.freeze(Object.defineProperty({__proto__:null,config:config$3,scalar:scalar$2,schema:schema$2,stringSchema:stringSchema$2,type:type$3,typedef:typedef$2},Symbol.toStringTag,{value:"Module"})),type$2="string",typedef$1="scalar PHID",schema$1=z$4.string(),stringSchema$1="z.string()",phidlValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema$1.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$2={name:"PHID",description:"A custom scalar that represents a PowerhouseID string",serialize:phidlValidation,parseValue:phidlValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${Ws.kind}`,{nodes:Ws});return phidlValidation(Ws.value)}},scalar$1=new GraphQLScalarType$1(config$2),PHID=Object.freeze(Object.defineProperty({__proto__:null,config:config$2,scalar:scalar$1,schema:schema$1,stringSchema:stringSchema$1,type:type$2,typedef:typedef$1},Symbol.toStringTag,{value:"Module"})),type$1="string",typedef="scalar OID",schema=z$4.string(),stringSchema="z.string()",oIdValidation=Ws=>{if(typeof Ws!="string")throw new GraphQLError$1(`Value is not string: ${JSON.stringify(Ws)}`);const ws=schema.safeParse(Ws);if(ws.success)return ws.data;throw new GraphQLError$1(ws.error.message)},config$1={name:"OID",description:"A custom scalar that represents a OID string",serialize:oIdValidation,parseValue:oIdValidation,parseLiteral:Ws=>{if(Ws.kind!==Kind$1.STRING)throw new GraphQLError$1(`Value is not a valid string: ${Ws.kind}`,{nodes:Ws});return oIdValidation(Ws.value)}},scalar=new GraphQLScalarType$1(config$1),OID=Object.freeze(Object.defineProperty({__proto__:null,config:config$1,scalar,schema,stringSchema,type:type$1,typedef},Symbol.toStringTag,{value:"Module"})),resolvers={AmountTokens:scalar$b,EthereumAddress:scalar$a,AmountPercentage:scalar$9,EmailAddress:scalar$8,Date:scalar$7,DateTime:scalar$6,URL:scalar$5,AmountMoney:scalar$4,OLabel:scalar$3,Currency:scalar$2,PHID:scalar$1,OID:scalar},typeDefs=[typedef$b,typedef$a,typedef$9,typedef$8,typedef$7,typedef$6,typedef$5,typedef$4,typedef$3,typedef$2,typedef$1,typedef],generatorTypeDefs={[config$c.name]:type$c,[config$b.name]:type$b,[config$9.name]:type$9,[config$a.name]:type$a,[config$8.name]:type$8,[config$7.name]:type$7,[config$6.name]:type$6,[config$5.name]:type$5,[config$4.name]:type$4,[config$3.name]:type$3,[config$2.name]:type$2,[config$1.name]:type$1},validationSchema={[config$c.name]:stringSchema$b,[config$b.name]:stringSchema$a,[config$9.name]:stringSchema$8,[config$a.name]:stringSchema$9,[config$8.name]:stringSchema$7,[config$7.name]:stringSchema$6,[config$6.name]:stringSchema$5,[config$5.name]:stringSchema$4,[config$4.name]:stringSchema$3,[config$3.name]:stringSchema$2,[config$2.name]:stringSchema$1,[config$1.name]:stringSchema},customScalars=Object.freeze(Object.defineProperty({__proto__:null,AmountMoney,AmountPercentage,AmountTokens,Currency,DateScalar:Date$1,DateTime,EmailAddress,EthereumAddress,OID,OLabel,PHID,URLScalar:URL$1,generatorTypeDefs,resolvers,typeDefs,validationSchema},Symbol.toStringTag,{value:"Module"}));var define_process_env_default={};function DocumentEditor(Ws){const ws=["document-editor",`${Ws.mode}-mode`];return jsx("div",{className:ws.join(" "),children:Ws.children})}function EditorToolbar(Ws){const ws=Ws.left||[],oi=Ws.center||[],si=Ws.right||[];return jsxs("div",{className:"editor-toolbar",children:[jsx("div",{className:"editor-toolbar--column editor-toolbar--left",children:ws}),jsx("div",{className:"editor-toolbar--column editor-toolbar--center",children:oi}),jsx("div",{className:"editor-toolbar--column editor-toolbar--right",children:si})]})}function EditorWorksheet(Ws){return jsx("div",{className:"editor-worksheet",children:jsx("div",{className:"editor-worksheet--page",children:Ws.children})})}const colorScheme$1={light:{color:"#222222",bgColor:"#FFFFFF",border:"#EEEEEE",shadow:"rgba(128,128,128,0.65)",inputColor:"#222222",inputBg:"#F6F6F6"},dark:{color:"#E6E6E6",bgColor:"#181818",border:"#181818",shadow:"rgba(0, 0, 0, 0.25)",inputColor:"#E6E6E6",inputBg:"#222222"}},typographySizes$1={huge:{fontSize:"36pt",fontWeight:"bold",padding:"6pt",margin:"30pt 0 0 0"},larger:{fontSize:"24pt",fontWeight:"bold",padding:"6pt",margin:"18pt 0 0 0"},large:{fontSize:"18pt",fontWeight:"bold",padding:"6pt",margin:"12pt 0 0 0"},medium:{fontSize:"11pt",fontWeight:"bold",padding:"6pt",margin:"5pt 0 0 0"},small:{fontSize:"10pt",fontWeight:"normal",padding:"6pt",margin:"0"},smaller:{fontSize:"9pt",fontWeight:"normal",padding:"6pt",margin:"0"},tiny:{fontSize:"8pt",fontWeight:"normal",padding:"6pt",margin:"0"}},inputStyle$1=(Ws="light",ws=!1)=>{const oi=colorScheme$1[Ws];return{width:"100%",border:"none",boxSizing:"border-box",backgroundColor:ws?oi.inputBg:oi.bgColor,outline:"none",color:oi.inputColor,resize:"none",fontFamily:"Roboto, sans-serif",overflow:"hidden",lineHeight:"1.5"}};function TextInput(Ws){const[ws,oi]=useState({value:Ws.value||"",hasFocus:!1,pressingEnter:!1});useEffect(()=>{oi(di=>di.value!==Ws.value?{...di,value:Ws.value||""}:di)},[Ws.value]);const si=di=>{di.key==="Enter"&&(oi({...ws,pressingEnter:!0}),di.preventDefault())},ii=di=>{di.key==="Enter"&&(di.target&&Ws.onSubmit&&Ws.onSubmit(di.target.value),Ws.clearOnSubmit?oi({...ws,value:"",pressingEnter:!1}):oi({...ws,pressingEnter:!1}),di.preventDefault()),(di.key==="Backspace"||di.key==="Delete")&&(Ws.onEmpty&&di.target.value.length<1&&Ws.onEmpty(Ws.id||""),di.preventDefault())},ai=di=>{if(!ws.pressingEnter){const hi=di.target;oi({...ws,value:hi.value}),hi.style.height="1px",hi.style.height=hi.scrollHeight+"px"}},li=di=>{var hi;if(oi(pi=>({...pi,hasFocus:di})),!di){const pi=((hi=ci.current)==null?void 0:hi.value)||"",ha=Ws.value||"";pi!=ha&&Ws.onSubmit&&(Ws.onSubmit(pi),Ws.clearOnSubmit&&oi(ga=>({...ga,value:""})))}},ci=useRef(null);useEffect(()=>{const di=()=>{ci.current&&(ci.current.style.height="1px",ci.current.style.height=ci.current.scrollHeight+"px")};return window.addEventListener("resize",di),di(),()=>{window.removeEventListener("resize",di)}});const ui={...inputStyle$1(Ws.theme,ws.hasFocus),...typographySizes$1[Ws.size||"small"]};return jsxs("div",{children:[Ws.horizontalLine?jsx("hr",{style:{borderColor:inputStyle$1(Ws.theme,!1).backgroundColor}},"line"):"",jsx("textarea",{autoFocus:Ws.autoFocus||!1,onBlur:di=>li(!1),onFocus:di=>li(!0),onInput:ai,onKeyDown:si,onKeyUp:ii,placeholder:Ws.placeholder||"",ref:ci,style:ui,value:ws.value},"text")]})}function ToolbarButton(Ws){const ws=Ws.onClick||(()=>{console.log("No onClick handler attached to button.")});return jsx("div",{className:"toolbar-button",onClick:ws,style:{userSelect:"none"},children:Ws.children})}var u$2=Object.defineProperty,a$1=(Ws,ws)=>u$2(Ws,"name",{value:ws,configurable:!0}),y$1=(()=>{let Ws;return typeof window<"u"?Ws=window:typeof globalThis<"u"?Ws=globalThis:typeof global<"u"?Ws=global:typeof self<"u"?Ws=self:Ws={},Ws})(),{LOGLEVEL:b$3}=y$1,t$5={trace:1,debug:2,info:3,warn:4,error:5,silent:10},L$2=b$3,i$4=t$5[L$2]||t$5.info,s$3={trace:a$1((Ws,...ws)=>{i$4<=t$5.trace&&console.trace(Ws,...ws)},"trace"),debug:a$1((Ws,...ws)=>{i$4<=t$5.debug&&console.debug(Ws,...ws)},"debug"),info:a$1((Ws,...ws)=>{i$4<=t$5.info&&console.info(Ws,...ws)},"info"),warn:a$1((Ws,...ws)=>{i$4<=t$5.warn&&console.warn(Ws,...ws)},"warn"),error:a$1((Ws,...ws)=>{i$4<=t$5.error&&console.error(Ws,...ws)},"error"),log:a$1((Ws,...ws)=>{i$4<t$5.silent&&console.log(Ws,...ws)},"log")},c$1=new Set,n$2=a$1(Ws=>(ws,...oi)=>{if(!c$1.has(ws))return c$1.add(ws),s$3[Ws](ws,...oi)},"once");n$2.clear=()=>c$1.clear();n$2.trace=n$2("trace");n$2.debug=n$2("debug");n$2.info=n$2("info");n$2.warn=n$2("warn");n$2.error=n$2("error");n$2.log=n$2("log");var m$2=n$2("warn"),r$3=a$1(Ws=>(...ws)=>{let oi=[];if(ws.length){let si=/<span\s+style=(['"])([^'"]*)\1\s*>/gi,ii=/<\/span>/gi,ai;for(oi.push(ws[0].replace(si,"%c").replace(ii,"%c"));ai=si.exec(ws[0]);)oi.push(ai[2]),oi.push("");for(let li=1;li<ws.length;li++)oi.push(ws[li])}s$3[Ws].apply(s$3,oi)},"pretty");r$3.trace=r$3("trace");r$3.debug=r$3("debug");r$3.info=r$3("info");r$3.warn=r$3("warn");r$3.error=r$3("error");var _$2=(Ws=>(Ws.CHANNEL_WS_DISCONNECT="channelWSDisconnect",Ws.CHANNEL_CREATED="channelCreated",Ws.CONFIG_ERROR="configError",Ws.STORY_INDEX_INVALIDATED="storyIndexInvalidated",Ws.STORY_SPECIFIED="storySpecified",Ws.SET_CONFIG="setConfig",Ws.SET_STORIES="setStories",Ws.SET_INDEX="setIndex",Ws.SET_CURRENT_STORY="setCurrentStory",Ws.CURRENT_STORY_WAS_SET="currentStoryWasSet",Ws.FORCE_RE_RENDER="forceReRender",Ws.FORCE_REMOUNT="forceRemount",Ws.PRELOAD_ENTRIES="preloadStories",Ws.STORY_PREPARED="storyPrepared",Ws.DOCS_PREPARED="docsPrepared",Ws.STORY_CHANGED="storyChanged",Ws.STORY_UNCHANGED="storyUnchanged",Ws.STORY_RENDERED="storyRendered",Ws.STORY_FINISHED="storyFinished",Ws.STORY_MISSING="storyMissing",Ws.STORY_ERRORED="storyErrored",Ws.STORY_THREW_EXCEPTION="storyThrewException",Ws.STORY_RENDER_PHASE_CHANGED="storyRenderPhaseChanged",Ws.PLAY_FUNCTION_THREW_EXCEPTION="playFunctionThrewException",Ws.UNHANDLED_ERRORS_WHILE_PLAYING="unhandledErrorsWhilePlaying",Ws.UPDATE_STORY_ARGS="updateStoryArgs",Ws.STORY_ARGS_UPDATED="storyArgsUpdated",Ws.RESET_STORY_ARGS="resetStoryArgs",Ws.SET_FILTER="setFilter",Ws.SET_GLOBALS="setGlobals",Ws.UPDATE_GLOBALS="updateGlobals",Ws.GLOBALS_UPDATED="globalsUpdated",Ws.REGISTER_SUBSCRIPTION="registerSubscription",Ws.PREVIEW_KEYDOWN="previewKeydown",Ws.PREVIEW_BUILDER_PROGRESS="preview_builder_progress",Ws.SELECT_STORY="selectStory",Ws.STORIES_COLLAPSE_ALL="storiesCollapseAll",Ws.STORIES_EXPAND_ALL="storiesExpandAll",Ws.DOCS_RENDERED="docsRendered",Ws.SHARED_STATE_CHANGED="sharedStateChanged",Ws.SHARED_STATE_SET="sharedStateSet",Ws.NAVIGATE_URL="navigateUrl",Ws.UPDATE_QUERY_PARAMS="updateQueryParams",Ws.REQUEST_WHATS_NEW_DATA="requestWhatsNewData",Ws.RESULT_WHATS_NEW_DATA="resultWhatsNewData",Ws.SET_WHATS_NEW_CACHE="setWhatsNewCache",Ws.TOGGLE_WHATS_NEW_NOTIFICATIONS="toggleWhatsNewNotifications",Ws.TELEMETRY_ERROR="telemetryError",Ws.FILE_COMPONENT_SEARCH_REQUEST="fileComponentSearchRequest",Ws.FILE_COMPONENT_SEARCH_RESPONSE="fileComponentSearchResponse",Ws.SAVE_STORY_REQUEST="saveStoryRequest",Ws.SAVE_STORY_RESPONSE="saveStoryResponse",Ws.ARGTYPES_INFO_REQUEST="argtypesInfoRequest",Ws.ARGTYPES_INFO_RESPONSE="argtypesInfoResponse",Ws.CREATE_NEW_STORYFILE_REQUEST="createNewStoryfileRequest",Ws.CREATE_NEW_STORYFILE_RESPONSE="createNewStoryfileResponse",Ws.TESTING_MODULE_CRASH_REPORT="testingModuleCrashReport",Ws.TESTING_MODULE_PROGRESS_REPORT="testingModuleProgressReport",Ws.TESTING_MODULE_RUN_REQUEST="testingModuleRunRequest",Ws.TESTING_MODULE_RUN_ALL_REQUEST="testingModuleRunAllRequest",Ws.TESTING_MODULE_CANCEL_TEST_RUN_REQUEST="testingModuleCancelTestRunRequest",Ws.TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE="testingModuleCancelTestRunResponse",Ws.TESTING_MODULE_WATCH_MODE_REQUEST="testingModuleWatchModeRequest",Ws.TESTING_MODULE_CONFIG_CHANGE="testingModuleConfigChange",Ws))(_$2||{}),R$2=_$2,{CHANNEL_WS_DISCONNECT:S$2,CHANNEL_CREATED:T$1,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$2,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$4,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_RE_RENDER:L$1,FORCE_REMOUNT:U$2,GLOBALS_UPDATED:P$3,NAVIGATE_URL:G$4,PLAY_FUNCTION_THREW_EXCEPTION:a,UNHANDLED_ERRORS_WHILE_PLAYING:Y$1,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e,PREVIEW_KEYDOWN:H$2,REGISTER_SUBSCRIPTION:d,RESET_STORY_ARGS:W$3,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:M$3,SET_FILTER:p$2,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:g,SHARED_STATE_CHANGED:s$2,SHARED_STATE_SET:y$2,STORIES_COLLAPSE_ALL:c,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:f$2,STORY_CHANGED:Q$1,STORY_ERRORED:x$3,STORY_INDEX_INVALIDATED:m$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_RENDERED:X$2,STORY_FINISHED:q$3,STORY_SPECIFIED:b$2,STORY_THREW_EXCEPTION:K$2,STORY_UNCHANGED:n$1,UPDATE_GLOBALS:j$1,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:z$3,REQUEST_WHATS_NEW_DATA:J$3,RESULT_WHATS_NEW_DATA:Z$1,SET_WHATS_NEW_CACHE:$$2,TOGGLE_WHATS_NEW_NOTIFICATIONS:v$2,TELEMETRY_ERROR:EE,SAVE_STORY_REQUEST:_E,SAVE_STORY_RESPONSE:RE,ARGTYPES_INFO_REQUEST:SE,ARGTYPES_INFO_RESPONSE:TE,TESTING_MODULE_CRASH_REPORT:NE,TESTING_MODULE_PROGRESS_REPORT:OE,TESTING_MODULE_RUN_REQUEST:AE,TESTING_MODULE_RUN_ALL_REQUEST:rE,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:DE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:IE,TESTING_MODULE_WATCH_MODE_REQUEST:CE,TESTING_MODULE_CONFIG_CHANGE:oE}=_$2;const Qn$1=Object.freeze(Object.defineProperty({__proto__:null,ARGTYPES_INFO_REQUEST:SE,ARGTYPES_INFO_RESPONSE:TE,CHANNEL_CREATED:T$1,CHANNEL_WS_DISCONNECT:S$2,CONFIG_ERROR:N$2,CREATE_NEW_STORYFILE_REQUEST:O$2,CREATE_NEW_STORYFILE_RESPONSE:A$1,CURRENT_STORY_WAS_SET:r$2,DOCS_PREPARED:D$3,DOCS_RENDERED:I$2,FILE_COMPONENT_SEARCH_REQUEST:C$4,FILE_COMPONENT_SEARCH_RESPONSE:o$2,FORCE_REMOUNT:U$2,FORCE_RE_RENDER:L$1,GLOBALS_UPDATED:P$3,NAVIGATE_URL:G$4,PLAY_FUNCTION_THREW_EXCEPTION:a,PRELOAD_ENTRIES:t$4,PREVIEW_BUILDER_PROGRESS:e,PREVIEW_KEYDOWN:H$2,REGISTER_SUBSCRIPTION:d,REQUEST_WHATS_NEW_DATA:J$3,RESET_STORY_ARGS:W$3,RESULT_WHATS_NEW_DATA:Z$1,SAVE_STORY_REQUEST:_E,SAVE_STORY_RESPONSE:RE,SELECT_STORY:l$1,SET_CONFIG:i$3,SET_CURRENT_STORY:M$3,SET_FILTER:p$2,SET_GLOBALS:u$1,SET_INDEX:F$3,SET_STORIES:g,SET_WHATS_NEW_CACHE:$$2,SHARED_STATE_CHANGED:s$2,SHARED_STATE_SET:y$2,STORIES_COLLAPSE_ALL:c,STORIES_EXPAND_ALL:h$1,STORY_ARGS_UPDATED:f$2,STORY_CHANGED:Q$1,STORY_ERRORED:x$3,STORY_FINISHED:q$3,STORY_INDEX_INVALIDATED:m$1,STORY_MISSING:V$1,STORY_PREPARED:w$2,STORY_RENDERED:X$2,STORY_RENDER_PHASE_CHANGED:B$2,STORY_SPECIFIED:b$2,STORY_THREW_EXCEPTION:K$2,STORY_UNCHANGED:n$1,TELEMETRY_ERROR:EE,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:DE,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:IE,TESTING_MODULE_CONFIG_CHANGE:oE,TESTING_MODULE_CRASH_REPORT:NE,TESTING_MODULE_PROGRESS_REPORT:OE,TESTING_MODULE_RUN_ALL_REQUEST:rE,TESTING_MODULE_RUN_REQUEST:AE,TESTING_MODULE_WATCH_MODE_REQUEST:CE,TOGGLE_WHATS_NEW_NOTIFICATIONS:v$2,UNHANDLED_ERRORS_WHILE_PLAYING:Y$1,UPDATE_GLOBALS:j$1,UPDATE_QUERY_PARAMS:k$4,UPDATE_STORY_ARGS:z$3,default:R$2},Symbol.toStringTag,{value:"Module"}));var Qt$1=Object.create,st=Object.defineProperty,te$1=Object.getOwnPropertyDescriptor,ee=Object.getOwnPropertyNames,re=Object.getPrototypeOf,ne$1=Object.prototype.hasOwnProperty,i$2=(Ws,ws)=>st(Ws,"name",{value:ws,configurable:!0}),U$1=(Ws=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Ws,{get:(ws,oi)=>(typeof require<"u"?require:ws)[oi]}):Ws)(function(Ws){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Ws+'" is not supported')}),oe$2=(Ws,ws)=>()=>(ws||Ws((ws={exports:{}}).exports,ws),ws.exports),ae=(Ws,ws,oi,si)=>{if(ws&&typeof ws=="object"||typeof ws=="function")for(let ii of ee(ws))!ne$1.call(Ws,ii)&&ii!==oi&&st(Ws,ii,{get:()=>ws[ii],enumerable:!(si=te$1(ws,ii))||si.enumerable});return Ws},ie$3=(Ws,ws,oi)=>(oi=Ws!=null?Qt$1(re(Ws)):{},ae(st(oi,"default",{value:Ws,enumerable:!0}),Ws)),At$1=oe$2((Ws,ws)=>{(function(oi){if(typeof Ws=="object"&&typeof ws<"u")ws.exports=oi();else if(typeof define=="function"&&define.amd)define([],oi);else{var si;typeof window<"u"?si=window:typeof global<"u"?si=global:typeof self<"u"?si=self:si=this,si.memoizerific=oi()}})(function(){return i$2(function oi(si,ii,ai){function li(di,hi){if(!ii[di]){if(!si[di]){var pi=typeof U$1=="function"&&U$1;if(!hi&&pi)return pi(di,!0);if(ci)return ci(di,!0);var ha=new Error("Cannot find module '"+di+"'");throw ha.code="MODULE_NOT_FOUND",ha}var ga=ii[di]={exports:{}};si[di][0].call(ga.exports,function(va){var ba=si[di][1][va];return li(ba||va)},ga,ga.exports,oi,si,ii,ai)}return ii[di].exports}i$2(li,"s");for(var ci=typeof U$1=="function"&&U$1,ui=0;ui<ai.length;ui++)li(ai[ui]);return li},"e")({1:[function(oi,si,ii){si.exports=function(ai){if(typeof Map!="function"||ai){var li=oi("./similar");return new li}else return new Map}},{"./similar":2}],2:[function(oi,si,ii){function ai(){return this.list=[],this.lastItem=void 0,this.size=0,this}i$2(ai,"Similar"),ai.prototype.get=function(li){var ci;if(this.lastItem&&this.isEqual(this.lastItem.key,li))return this.lastItem.val;if(ci=this.indexOf(li),ci>=0)return this.lastItem=this.list[ci],this.list[ci].val},ai.prototype.set=function(li,ci){var ui;return this.lastItem&&this.isEqual(this.lastItem.key,li)?(this.lastItem.val=ci,this):(ui=this.indexOf(li),ui>=0?(this.lastItem=this.list[ui],this.list[ui].val=ci,this):(this.lastItem={key:li,val:ci},this.list.push(this.lastItem),this.size++,this))},ai.prototype.delete=function(li){var ci;if(this.lastItem&&this.isEqual(this.lastItem.key,li)&&(this.lastItem=void 0),ci=this.indexOf(li),ci>=0)return this.size--,this.list.splice(ci,1)[0]},ai.prototype.has=function(li){var ci;return this.lastItem&&this.isEqual(this.lastItem.key,li)?!0:(ci=this.indexOf(li),ci>=0?(this.lastItem=this.list[ci],!0):!1)},ai.prototype.forEach=function(li,ci){var ui;for(ui=0;ui<this.size;ui++)li.call(ci||this,this.list[ui].val,this.list[ui].key,this)},ai.prototype.indexOf=function(li){var ci;for(ci=0;ci<this.size;ci++)if(this.isEqual(this.list[ci].key,li))return ci;return-1},ai.prototype.isEqual=function(li,ci){return li===ci||li!==li&&ci!==ci},si.exports=ai},{}],3:[function(oi,si,ii){var ai=oi("map-or-similar");si.exports=function(di){var hi=new ai(!1),pi=[];return function(ha){var ga=i$2(function(){var va=hi,ba,wa,xa=arguments.length-1,Ca=Array(xa+1),el=!0,ku;if((ga.numArgs||ga.numArgs===0)&&ga.numArgs!==xa+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(ku=0;ku<xa;ku++){if(Ca[ku]={cacheItem:va,arg:arguments[ku]},va.has(arguments[ku])){va=va.get(arguments[ku]);continue}el=!1,ba=new ai(!1),va.set(arguments[ku],ba),va=ba}return el&&(va.has(arguments[xa])?wa=va.get(arguments[xa]):el=!1),el||(wa=ha.apply(null,arguments),va.set(arguments[xa],wa)),di>0&&(Ca[xa]={cacheItem:va,arg:arguments[xa]},el?li(pi,Ca):pi.push(Ca),pi.length>di&&ci(pi.shift())),ga.wasMemoized=el,ga.numArgs=xa+1,wa},"memoizerific");return ga.limit=di,ga.wasMemoized=!1,ga.cache=hi,ga.lru=pi,ga}};function li(di,hi){var pi=di.length,ha=hi.length,ga,va,ba;for(va=0;va<pi;va++){for(ga=!0,ba=0;ba<ha;ba++)if(!ui(di[va][ba].arg,hi[ba].arg)){ga=!1;break}if(ga)break}di.push(di.splice(va,1)[0])}i$2(li,"moveToMostRecentLru");function ci(di){var hi=di.length,pi=di[hi-1],ha,ga;for(pi.cacheItem.delete(pi.arg),ga=hi-2;ga>=0&&(pi=di[ga],ha=pi.cacheItem.get(pi.arg),!ha||!ha.size);ga--)pi.cacheItem.delete(pi.arg)}i$2(ci,"removeCachedResult");function ui(di,hi){return di===hi||di!==di&&hi!==hi}i$2(ui,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),b$1=(()=>{let Ws;return typeof window<"u"?Ws=window:typeof globalThis<"u"?Ws=globalThis:typeof global<"u"?Ws=global:typeof self<"u"?Ws=self:Ws={},Ws})(),se$1=i$2(Ws=>Ws.transports!==void 0,"isMulti"),le=i$2(()=>Math.random().toString(16).slice(2),"generateRandomId"),lt$1=class{constructor(Ws={}){this.sender=le(),this.events={},this.data={},this.transports=[],this.isAsync=Ws.async||!1,se$1(Ws)?(this.transports=Ws.transports||[],this.transports.forEach(ws=>{ws.setHandler(oi=>this.handleEvent(oi))})):this.transports=Ws.transport?[Ws.transport]:[],this.transports.forEach(ws=>{ws.setHandler(oi=>this.handleEvent(oi))})}get hasTransport(){return this.transports.length>0}addListener(Ws,ws){this.events[Ws]=this.events[Ws]||[],this.events[Ws].push(ws)}emit(Ws,...ws){let oi={type:Ws,args:ws,from:this.sender},si={};ws.length>=1&&ws[0]&&ws[0].options&&(si=ws[0].options);let ii=i$2(()=>{this.transports.forEach(ai=>{ai.send(oi,si)}),this.handleEvent(oi)},"handler");this.isAsync?setImmediate(ii):ii()}last(Ws){return this.data[Ws]}eventNames(){return Object.keys(this.events)}listenerCount(Ws){let ws=this.listeners(Ws);return ws?ws.length:0}listeners(Ws){return this.events[Ws]||void 0}once(Ws,ws){let oi=this.onceListener(Ws,ws);this.addListener(Ws,oi)}removeAllListeners(Ws){Ws?this.events[Ws]&&delete this.events[Ws]:this.events={}}removeListener(Ws,ws){let oi=this.listeners(Ws);oi&&(this.events[Ws]=oi.filter(si=>si!==ws))}on(Ws,ws){this.addListener(Ws,ws)}off(Ws,ws){this.removeListener(Ws,ws)}handleEvent(Ws){let ws=this.listeners(Ws.type);ws&&ws.length&&ws.forEach(oi=>{oi.apply(Ws,Ws.args)}),this.data[Ws.type]=Ws.args}onceListener(Ws,ws){let oi=i$2((...si)=>(this.removeListener(Ws,oi),ws(...si)),"onceListener");return oi}};i$2(lt$1,"Channel");var z$2=lt$1,ce=Object.create,St$1=Object.defineProperty,fe$1=Object.getOwnPropertyDescriptor,wt$1=Object.getOwnPropertyNames,ue$1=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty,x$2=i$2((Ws,ws)=>i$2(function(){return ws||(0,Ws[wt$1(Ws)[0]])((ws={exports:{}}).exports,ws),ws.exports},"__require"),"__commonJS"),ye$1=i$2((Ws,ws,oi,si)=>{if(ws&&typeof ws=="object"||typeof ws=="function")for(let ii of wt$1(ws))!pe.call(Ws,ii)&&ii!==oi&&St$1(Ws,ii,{get:i$2(()=>ws[ii],"get"),enumerable:!(si=fe$1(ws,ii))||si.enumerable});return Ws},"__copyProps"),tt$1=i$2((Ws,ws,oi)=>(oi=Ws!=null?ce(ue$1(Ws)):{},ye$1(ws||!Ws||!Ws.__esModule?St$1(oi,"default",{value:Ws,enumerable:!0}):oi,Ws)),"__toESM"),de$1=["bubbles","cancelBubble","cancelable","composed","currentTarget","defaultPrevented","eventPhase","isTrusted","returnValue","srcElement","target","timeStamp","type"],he$1=["detail"];function Et$1(Ws){let ws=de$1.filter(oi=>Ws[oi]!==void 0).reduce((oi,si)=>({...oi,[si]:Ws[si]}),{});return Ws instanceof CustomEvent&&he$1.filter(oi=>Ws[oi]!==void 0).forEach(oi=>{ws[oi]=Ws[oi]}),ws}i$2(Et$1,"extractEventHiddenProperties");var Ut$1=ie$3(At$1()),Tt=x$2({"node_modules/has-symbols/shams.js"(Ws,ws){ws.exports=i$2(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var oi={},si=Symbol("test"),ii=Object(si);if(typeof si=="string"||Object.prototype.toString.call(si)!=="[object Symbol]"||Object.prototype.toString.call(ii)!=="[object Symbol]")return!1;var ai=42;oi[si]=ai;for(si in oi)return!1;if(typeof Object.keys=="function"&&Object.keys(oi).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(oi).length!==0)return!1;var li=Object.getOwnPropertySymbols(oi);if(li.length!==1||li[0]!==si||!Object.prototype.propertyIsEnumerable.call(oi,si))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var ci=Object.getOwnPropertyDescriptor(oi,si);if(ci.value!==ai||ci.enumerable!==!0)return!1}return!0},"hasSymbols")}}),Ft$1=x$2({"node_modules/has-symbols/index.js"(Ws,ws){var oi=typeof Symbol<"u"&&Symbol,si=Tt();ws.exports=i$2(function(){return typeof oi!="function"||typeof Symbol!="function"||typeof oi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:si()},"hasNativeSymbols")}}),ge$1=x$2({"node_modules/function-bind/implementation.js"(Ws,ws){var oi="Function.prototype.bind called on incompatible ",si=Array.prototype.slice,ii=Object.prototype.toString,ai="[object Function]";ws.exports=i$2(function(li){var ci=this;if(typeof ci!="function"||ii.call(ci)!==ai)throw new TypeError(oi+ci);for(var ui=si.call(arguments,1),di,hi=i$2(function(){if(this instanceof di){var ba=ci.apply(this,ui.concat(si.call(arguments)));return Object(ba)===ba?ba:this}else return ci.apply(li,ui.concat(si.call(arguments)))},"binder"),pi=Math.max(0,ci.length-ui.length),ha=[],ga=0;ga<pi;ga++)ha.push("$"+ga);if(di=Function("binder","return function ("+ha.join(",")+"){ return binder.apply(this,arguments); }")(hi),ci.prototype){var va=i$2(function(){},"Empty2");va.prototype=ci.prototype,di.prototype=new va,va.prototype=null}return di},"bind")}}),ut=x$2({"node_modules/function-bind/index.js"(Ws,ws){var oi=ge$1();ws.exports=Function.prototype.bind||oi}}),me$1=x$2({"node_modules/has/src/index.js"(Ws,ws){var oi=ut();ws.exports=oi.call(Function.call,Object.prototype.hasOwnProperty)}}),Nt$1=x$2({"node_modules/get-intrinsic/index.js"(Ws,ws){var oi,si=SyntaxError,ii=Function,ai=TypeError,li=i$2(function(kd){try{return ii('"use strict"; return ('+kd+").constructor;")()}catch{}},"getEvalledConstructor"),ci=Object.getOwnPropertyDescriptor;if(ci)try{ci({},"")}catch{ci=null}var ui=i$2(function(){throw new ai},"throwTypeError"),di=ci?function(){try{return arguments.callee,ui}catch{try{return ci(arguments,"callee").get}catch{return ui}}}():ui,hi=Ft$1()(),pi=Object.getPrototypeOf||function(kd){return kd.__proto__},ha={},ga=typeof Uint8Array>"u"?oi:pi(Uint8Array),va={"%AggregateError%":typeof AggregateError>"u"?oi:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?oi:ArrayBuffer,"%ArrayIteratorPrototype%":hi?pi([][Symbol.iterator]()):oi,"%AsyncFromSyncIteratorPrototype%":oi,"%AsyncFunction%":ha,"%AsyncGenerator%":ha,"%AsyncGeneratorFunction%":ha,"%AsyncIteratorPrototype%":ha,"%Atomics%":typeof Atomics>"u"?oi:Atomics,"%BigInt%":typeof BigInt>"u"?oi:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?oi:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?oi:Float32Array,"%Float64Array%":typeof Float64Array>"u"?oi:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?oi:FinalizationRegistry,"%Function%":ii,"%GeneratorFunction%":ha,"%Int8Array%":typeof Int8Array>"u"?oi:Int8Array,"%Int16Array%":typeof Int16Array>"u"?oi:Int16Array,"%Int32Array%":typeof Int32Array>"u"?oi:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hi?pi(pi([][Symbol.iterator]())):oi,"%JSON%":typeof JSON=="object"?JSON:oi,"%Map%":typeof Map>"u"?oi:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hi?oi:pi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?oi:Promise,"%Proxy%":typeof Proxy>"u"?oi:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?oi:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?oi:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hi?oi:pi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?oi:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hi?pi(""[Symbol.iterator]()):oi,"%Symbol%":hi?Symbol:oi,"%SyntaxError%":si,"%ThrowTypeError%":di,"%TypedArray%":ga,"%TypeError%":ai,"%Uint8Array%":typeof Uint8Array>"u"?oi:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?oi:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?oi:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?oi:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?oi:WeakMap,"%WeakRef%":typeof WeakRef>"u"?oi:WeakRef,"%WeakSet%":typeof WeakSet>"u"?oi:WeakSet},ba=i$2(function kd(Md){var Td;if(Md==="%AsyncFunction%")Td=li("async function () {}");else if(Md==="%GeneratorFunction%")Td=li("function* () {}");else if(Md==="%AsyncGeneratorFunction%")Td=li("async function* () {}");else if(Md==="%AsyncGenerator%"){var wd=kd("%AsyncGeneratorFunction%");wd&&(Td=wd.prototype)}else if(Md==="%AsyncIteratorPrototype%"){var Cd=kd("%AsyncGenerator%");Cd&&(Td=pi(Cd.prototype))}return va[Md]=Td,Td},"doEval2"),wa={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xa=ut(),Ca=me$1(),el=xa.call(Function.call,Array.prototype.concat),ku=xa.call(Function.apply,Array.prototype.splice),gd=xa.call(Function.call,String.prototype.replace),Ed=xa.call(Function.call,String.prototype.slice),Od=xa.call(Function.call,RegExp.prototype.exec),Nd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pd=/\\(\\)?/g,Ld=i$2(function(kd){var Md=Ed(kd,0,1),Td=Ed(kd,-1);if(Md==="%"&&Td!=="%")throw new si("invalid intrinsic syntax, expected closing `%`");if(Td==="%"&&Md!=="%")throw new si("invalid intrinsic syntax, expected opening `%`");var wd=[];return gd(kd,Nd,function(Cd,sf,of,Wd){wd[wd.length]=of?gd(Wd,Pd,"$1"):sf||Cd}),wd},"stringToPath3"),rf=i$2(function(kd,Md){var Td=kd,wd;if(Ca(wa,Td)&&(wd=wa[Td],Td="%"+wd[0]+"%"),Ca(va,Td)){var Cd=va[Td];if(Cd===ha&&(Cd=ba(Td)),typeof Cd>"u"&&!Md)throw new ai("intrinsic "+kd+" exists, but is not available. Please file an issue!");return{alias:wd,name:Td,value:Cd}}throw new si("intrinsic "+kd+" does not exist!")},"getBaseIntrinsic2");ws.exports=i$2(function(kd,Md){if(typeof kd!="string"||kd.length===0)throw new ai("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Md!="boolean")throw new ai('"allowMissing" argument must be a boolean');if(Od(/^%?[^%]*%?$/,kd)===null)throw new si("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Td=Ld(kd),wd=Td.length>0?Td[0]:"",Cd=rf("%"+wd+"%",Md),sf=Cd.name,of=Cd.value,Wd=!1,df=Cd.alias;df&&(wd=df[0],ku(Td,el([0,1],df)));for(var hf=1,xd=!0;hf<Td.length;hf+=1){var Fd=Td[hf],Vd=Ed(Fd,0,1),af=Ed(Fd,-1);if((Vd==='"'||Vd==="'"||Vd==="`"||af==='"'||af==="'"||af==="`")&&Vd!==af)throw new si("property names with quotes must have matching quotes");if((Fd==="constructor"||!xd)&&(Wd=!0),wd+="."+Fd,sf="%"+wd+"%",Ca(va,sf))of=va[sf];else if(of!=null){if(!(Fd in of)){if(!Md)throw new ai("base intrinsic for "+kd+" exists, but the property is not available.");return}if(ci&&hf+1>=Td.length){var ff=ci(of,Fd);xd=!!ff,xd&&"get"in ff&&!("originalValue"in ff.get)?of=ff.get:of=of[Fd]}else xd=Ca(of,Fd),of=of[Fd];xd&&!Wd&&(va[sf]=of)}}return of},"GetIntrinsic")}}),ve$1=x$2({"node_modules/call-bind/index.js"(Ws,ws){var oi=ut(),si=Nt$1(),ii=si("%Function.prototype.apply%"),ai=si("%Function.prototype.call%"),li=si("%Reflect.apply%",!0)||oi.call(ai,ii),ci=si("%Object.getOwnPropertyDescriptor%",!0),ui=si("%Object.defineProperty%",!0),di=si("%Math.max%");if(ui)try{ui({},"a",{value:1})}catch{ui=null}ws.exports=i$2(function(pi){var ha=li(oi,ai,arguments);if(ci&&ui){var ga=ci(ha,"length");ga.configurable&&ui(ha,"length",{value:1+di(0,pi.length-(arguments.length-1))})}return ha},"callBind");var hi=i$2(function(){return li(oi,ii,arguments)},"applyBind2");ui?ui(ws.exports,"apply",{value:hi}):ws.exports.apply=hi}}),_e$1=x$2({"node_modules/call-bind/callBound.js"(Ws,ws){var oi=Nt$1(),si=ve$1(),ii=si(oi("String.prototype.indexOf"));ws.exports=i$2(function(ai,li){var ci=oi(ai,!!li);return typeof ci=="function"&&ii(ai,".prototype.")>-1?si(ci):ci},"callBoundIntrinsic")}}),be$1=x$2({"node_modules/has-tostringtag/shams.js"(Ws,ws){var oi=Tt();ws.exports=i$2(function(){return oi()&&!!Symbol.toStringTag},"hasToStringTagShams")}}),Se$1=x$2({"node_modules/is-regex/index.js"(Ws,ws){var oi=_e$1(),si=be$1()(),ii,ai,li,ci;si&&(ii=oi("Object.prototype.hasOwnProperty"),ai=oi("RegExp.prototype.exec"),li={},ui=i$2(function(){throw li},"throwRegexMarker"),ci={toString:ui,valueOf:ui},typeof Symbol.toPrimitive=="symbol"&&(ci[Symbol.toPrimitive]=ui));var ui,di=oi("Object.prototype.toString"),hi=Object.getOwnPropertyDescriptor,pi="[object RegExp]";ws.exports=i$2(si?function(ha){if(!ha||typeof ha!="object")return!1;var ga=hi(ha,"lastIndex"),va=ga&&ii(ga,"value");if(!va)return!1;try{ai(ha,ci)}catch(ba){return ba===li}}:function(ha){return!ha||typeof ha!="object"&&typeof ha!="function"?!1:di(ha)===pi},"isRegex")}}),we=x$2({"node_modules/is-function/index.js"(Ws,ws){ws.exports=si;var oi=Object.prototype.toString;function si(ii){if(!ii)return!1;var ai=oi.call(ii);return ai==="[object Function]"||typeof ii=="function"&&ai!=="[object RegExp]"||typeof window<"u"&&(ii===window.setTimeout||ii===window.alert||ii===window.confirm||ii===window.prompt)}i$2(si,"isFunction3")}}),Ee$1=x$2({"node_modules/is-symbol/index.js"(Ws,ws){var oi=Object.prototype.toString,si=Ft$1()();si?(ii=Symbol.prototype.toString,ai=/^Symbol\(.*\)$/,li=i$2(function(ci){return typeof ci.valueOf()!="symbol"?!1:ai.test(ii.call(ci))},"isRealSymbolObject"),ws.exports=i$2(function(ci){if(typeof ci=="symbol")return!0;if(oi.call(ci)!=="[object Symbol]")return!1;try{return li(ci)}catch{return!1}},"isSymbol3")):ws.exports=i$2(function(ci){return!1},"isSymbol3");var ii,ai,li}}),Oe$1=tt$1(Se$1()),Ae=tt$1(we()),Pe$1=tt$1(Ee$1());function xe$1(Ws){return Ws!=null&&typeof Ws=="object"&&Array.isArray(Ws)===!1}i$2(xe$1,"isObject");var Ce$1=typeof global=="object"&&global&&global.Object===Object&&global,Ie$1=Ce$1,je$1=typeof self=="object"&&self&&self.Object===Object&&self,Te$1=Ie$1||je$1||Function("return this")(),pt$1=Te$1,Fe$1=pt$1.Symbol,M$2=Fe$1,Rt$1=Object.prototype,Ne=Rt$1.hasOwnProperty,Re=Rt$1.toString,W$2=M$2?M$2.toStringTag:void 0;function Me$1(Ws){var ws=Ne.call(Ws,W$2),oi=Ws[W$2];try{Ws[W$2]=void 0;var si=!0}catch{}var ii=Re.call(Ws);return si&&(ws?Ws[W$2]=oi:delete Ws[W$2]),ii}i$2(Me$1,"getRawTag");var $e$1=Me$1,ke$1=Object.prototype,De$1=ke$1.toString;function Le$1(Ws){return De$1.call(Ws)}i$2(Le$1,"objectToString");var Ue$1=Le$1,ze$1="[object Null]",We$1="[object Undefined]",Pt$1=M$2?M$2.toStringTag:void 0;function Be$1(Ws){return Ws==null?Ws===void 0?We$1:ze$1:Pt$1&&Pt$1 in Object(Ws)?$e$1(Ws):Ue$1(Ws)}i$2(Be$1,"baseGetTag");var Mt$1=Be$1;function He$1(Ws){return Ws!=null&&typeof Ws=="object"}i$2(He$1,"isObjectLike");var qe=He$1,Ge$1="[object Symbol]";function Je$1(Ws){return typeof Ws=="symbol"||qe(Ws)&&Mt$1(Ws)==Ge$1}i$2(Je$1,"isSymbol");var yt=Je$1;function Ve$1(Ws,ws){for(var oi=-1,si=Ws==null?0:Ws.length,ii=Array(si);++oi<si;)ii[oi]=ws(Ws[oi],oi,Ws);return ii}i$2(Ve$1,"arrayMap");var Ke$1=Ve$1,Ye$1=Array.isArray,dt$1=Ye$1,xt=M$2?M$2.prototype:void 0,Ct$1=xt?xt.toString:void 0;function $t$1(Ws){if(typeof Ws=="string")return Ws;if(dt$1(Ws))return Ke$1(Ws,$t$1)+"";if(yt(Ws))return Ct$1?Ct$1.call(Ws):"";var ws=Ws+"";return ws=="0"&&1/Ws==-1/0?"-0":ws}i$2($t$1,"baseToString");var Xe$1=$t$1;function Qe(Ws){var ws=typeof Ws;return Ws!=null&&(ws=="object"||ws=="function")}i$2(Qe,"isObject2");var kt$1=Qe,tr="[object AsyncFunction]",er="[object Function]",rr="[object GeneratorFunction]",nr="[object Proxy]";function or$1(Ws){if(!kt$1(Ws))return!1;var ws=Mt$1(Ws);return ws==er||ws==rr||ws==tr||ws==nr}i$2(or$1,"isFunction");var ar=or$1,ir=pt$1["__core-js_shared__"],ft$1=ir,It$1=function(){var Ws=/[^.]+$/.exec(ft$1&&ft$1.keys&&ft$1.keys.IE_PROTO||"");return Ws?"Symbol(src)_1."+Ws:""}();function sr(Ws){return!!It$1&&It$1 in Ws}i$2(sr,"isMasked");var lr=sr,cr=Function.prototype,fr$1=cr.toString;function ur$1(Ws){if(Ws!=null){try{return fr$1.call(Ws)}catch{}try{return Ws+""}catch{}}return""}i$2(ur$1,"toSource");var pr=ur$1,yr$1=/[\\^$.*+?()[\]{}|]/g,dr=/^\[object .+?Constructor\]$/,hr$1=Function.prototype,gr$1=Object.prototype,mr$1=hr$1.toString,vr$1=gr$1.hasOwnProperty,_r$1=RegExp("^"+mr$1.call(vr$1).replace(yr$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function br$1(Ws){if(!kt$1(Ws)||lr(Ws))return!1;var ws=ar(Ws)?_r$1:dr;return ws.test(pr(Ws))}i$2(br$1,"baseIsNative");var Sr$1=br$1;function wr$1(Ws,ws){return Ws==null?void 0:Ws[ws]}i$2(wr$1,"getValue");var Er$1=wr$1;function Or$1(Ws,ws){var oi=Er$1(Ws,ws);return Sr$1(oi)?oi:void 0}i$2(Or$1,"getNative");var Dt$1=Or$1;function Ar$1(Ws,ws){return Ws===ws||Ws!==Ws&&ws!==ws}i$2(Ar$1,"eq");var Pr$1=Ar$1,xr$1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr$1=/^\w*$/;function Ir(Ws,ws){if(dt$1(Ws))return!1;var oi=typeof Ws;return oi=="number"||oi=="symbol"||oi=="boolean"||Ws==null||yt(Ws)?!0:Cr$1.test(Ws)||!xr$1.test(Ws)||ws!=null&&Ws in Object(ws)}i$2(Ir,"isKey");var jr$1=Ir,Tr$1=Dt$1(Object,"create"),B$1=Tr$1;function Fr$1(){this.__data__=B$1?B$1(null):{},this.size=0}i$2(Fr$1,"hashClear");var Nr$1=Fr$1;function Rr$1(Ws){var ws=this.has(Ws)&&delete this.__data__[Ws];return this.size-=ws?1:0,ws}i$2(Rr$1,"hashDelete");var Mr$1=Rr$1,$r$1="__lodash_hash_undefined__",kr$1=Object.prototype,Dr=kr$1.hasOwnProperty;function Lr$1(Ws){var ws=this.__data__;if(B$1){var oi=ws[Ws];return oi===$r$1?void 0:oi}return Dr.call(ws,Ws)?ws[Ws]:void 0}i$2(Lr$1,"hashGet");var Ur$1=Lr$1,zr$1=Object.prototype,Wr$1=zr$1.hasOwnProperty;function Br$1(Ws){var ws=this.__data__;return B$1?ws[Ws]!==void 0:Wr$1.call(ws,Ws)}i$2(Br$1,"hashHas");var Hr$1=Br$1,qr$1="__lodash_hash_undefined__";function Gr$1(Ws,ws){var oi=this.__data__;return this.size+=this.has(Ws)?0:1,oi[Ws]=B$1&&ws===void 0?qr$1:ws,this}i$2(Gr$1,"hashSet");var Jr$1=Gr$1;function $$1(Ws){var ws=-1,oi=Ws==null?0:Ws.length;for(this.clear();++ws<oi;){var si=Ws[ws];this.set(si[0],si[1])}}i$2($$1,"Hash");$$1.prototype.clear=Nr$1;$$1.prototype.delete=Mr$1;$$1.prototype.get=Ur$1;$$1.prototype.has=Hr$1;$$1.prototype.set=Jr$1;var jt$1=$$1;function Vr$1(){this.__data__=[],this.size=0}i$2(Vr$1,"listCacheClear");var Kr$1=Vr$1;function Yr$1(Ws,ws){for(var oi=Ws.length;oi--;)if(Pr$1(Ws[oi][0],ws))return oi;return-1}i$2(Yr$1,"assocIndexOf");var rt=Yr$1,Zr$1=Array.prototype,Xr$1=Zr$1.splice;function Qr(Ws){var ws=this.__data__,oi=rt(ws,Ws);if(oi<0)return!1;var si=ws.length-1;return oi==si?ws.pop():Xr$1.call(ws,oi,1),--this.size,!0}i$2(Qr,"listCacheDelete");var tn=Qr;function en(Ws){var ws=this.__data__,oi=rt(ws,Ws);return oi<0?void 0:ws[oi][1]}i$2(en,"listCacheGet");var rn=en;function nn(Ws){return rt(this.__data__,Ws)>-1}i$2(nn,"listCacheHas");var on=nn;function an(Ws,ws){var oi=this.__data__,si=rt(oi,Ws);return si<0?(++this.size,oi.push([Ws,ws])):oi[si][1]=ws,this}i$2(an,"listCacheSet");var sn=an;function k$3(Ws){var ws=-1,oi=Ws==null?0:Ws.length;for(this.clear();++ws<oi;){var si=Ws[ws];this.set(si[0],si[1])}}i$2(k$3,"ListCache");k$3.prototype.clear=Kr$1;k$3.prototype.delete=tn;k$3.prototype.get=rn;k$3.prototype.has=on;k$3.prototype.set=sn;var ln=k$3,cn$1=Dt$1(pt$1,"Map"),fn=cn$1;function un(){this.size=0,this.__data__={hash:new jt$1,map:new(fn||ln),string:new jt$1}}i$2(un,"mapCacheClear");var pn=un;function yn$1(Ws){var ws=typeof Ws;return ws=="string"||ws=="number"||ws=="symbol"||ws=="boolean"?Ws!=="__proto__":Ws===null}i$2(yn$1,"isKeyable");var dn=yn$1;function hn(Ws,ws){var oi=Ws.__data__;return dn(ws)?oi[typeof ws=="string"?"string":"hash"]:oi.map}i$2(hn,"getMapData");var nt$1=hn;function gn(Ws){var ws=nt$1(this,Ws).delete(Ws);return this.size-=ws?1:0,ws}i$2(gn,"mapCacheDelete");var mn=gn;function vn$1(Ws){return nt$1(this,Ws).get(Ws)}i$2(vn$1,"mapCacheGet");var _n$1=vn$1;function bn(Ws){return nt$1(this,Ws).has(Ws)}i$2(bn,"mapCacheHas");var Sn=bn;function wn(Ws,ws){var oi=nt$1(this,Ws),si=oi.size;return oi.set(Ws,ws),this.size+=oi.size==si?0:1,this}i$2(wn,"mapCacheSet");var En=wn;function D$2(Ws){var ws=-1,oi=Ws==null?0:Ws.length;for(this.clear();++ws<oi;){var si=Ws[ws];this.set(si[0],si[1])}}i$2(D$2,"MapCache");D$2.prototype.clear=pn;D$2.prototype.delete=mn;D$2.prototype.get=_n$1;D$2.prototype.has=Sn;D$2.prototype.set=En;var Lt$1=D$2,On$1="Expected a function";function ht$1(Ws,ws){if(typeof Ws!="function"||ws!=null&&typeof ws!="function")throw new TypeError(On$1);var oi=i$2(function(){var si=arguments,ii=ws?ws.apply(this,si):si[0],ai=oi.cache;if(ai.has(ii))return ai.get(ii);var li=Ws.apply(this,si);return oi.cache=ai.set(ii,li)||ai,li},"memoized");return oi.cache=new(ht$1.Cache||Lt$1),oi}i$2(ht$1,"memoize");ht$1.Cache=Lt$1;var An$1=ht$1,Pn$1=500;function xn(Ws){var ws=An$1(Ws,function(si){return oi.size===Pn$1&&oi.clear(),si}),oi=ws.cache;return ws}i$2(xn,"memoizeCapped");var Cn$1=xn,In$1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn$1=/\\(\\)?/g,Tn=Cn$1(function(Ws){var ws=[];return Ws.charCodeAt(0)===46&&ws.push(""),Ws.replace(In$1,function(oi,si,ii,ai){ws.push(ii?ai.replace(jn$1,"$1"):si||oi)}),ws}),Fn$1=Tn;function Nn$1(Ws){return Ws==null?"":Xe$1(Ws)}i$2(Nn$1,"toString");var Rn=Nn$1;function Mn$1(Ws,ws){return dt$1(Ws)?Ws:jr$1(Ws,ws)?[Ws]:Fn$1(Rn(Ws))}i$2(Mn$1,"castPath");var $n$1=Mn$1;function Dn$1(Ws){if(typeof Ws=="string"||yt(Ws))return Ws;var ws=Ws+"";return ws=="0"&&1/Ws==-1/0?"-0":ws}i$2(Dn$1,"toKey");var Ln$1=Dn$1;function Un(Ws,ws){ws=$n$1(ws,Ws);for(var oi=0,si=ws.length;Ws!=null&&oi<si;)Ws=Ws[Ln$1(ws[oi++])];return oi&&oi==si?Ws:void 0}i$2(Un,"baseGet");var zn$1=Un;function Wn$1(Ws,ws,oi){var si=Ws==null?void 0:zn$1(Ws,ws);return si===void 0?oi:si}i$2(Wn$1,"get");var Bn=Wn$1,et$1=xe$1,Hn=i$2(Ws=>{let ws=null,oi=!1,si=!1,ii=!1,ai="";if(Ws.indexOf("//")>=0||Ws.indexOf("/*")>=0)for(let li=0;li<Ws.length;li+=1)!ws&&!oi&&!si&&!ii?Ws[li]==='"'||Ws[li]==="'"||Ws[li]==="`"?ws=Ws[li]:Ws[li]==="/"&&Ws[li+1]==="*"?oi=!0:Ws[li]==="/"&&Ws[li+1]==="/"?si=!0:Ws[li]==="/"&&Ws[li+1]!=="/"&&(ii=!0):(ws&&(Ws[li]===ws&&Ws[li-1]!=="\\"||Ws[li]===`
48
- `&&ws!=="`")&&(ws=null),ii&&(Ws[li]==="/"&&Ws[li-1]!=="\\"||Ws[li]===`
49
- `)&&(ii=!1),oi&&Ws[li-1]==="/"&&Ws[li-2]==="*"&&(oi=!1),si&&Ws[li]===`
50
- `&&(si=!1)),!oi&&!si&&(ai+=Ws[li]);else ai=Ws;return ai},"removeCodeComments"),qn$1=(0,Ut$1.default)(1e4)(Ws=>Hn(Ws).replace(/\n\s*/g,"").trim()),Gn=i$2(function(Ws,ws){let oi=ws.slice(0,ws.indexOf("{")),si=ws.slice(ws.indexOf("{"));if(oi.includes("=>")||oi.includes("function"))return ws;let ii=oi;return ii=ii.replace(Ws,"function"),ii+si},"convertShorthandMethods2"),Jn$1=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,H$1=i$2(Ws=>Ws.match(/^[\[\{\"\}].*[\]\}\"]$/),"isJSON");function zt$1(Ws){if(!et$1(Ws))return Ws;let ws=Ws,oi=!1;return typeof Event<"u"&&Ws instanceof Event&&(ws=Et$1(ws),oi=!0),ws=Object.keys(ws).reduce((si,ii)=>{try{ws[ii]&&ws[ii].toJSON,si[ii]=ws[ii]}catch{oi=!0}return si},{}),oi?ws:Ws}i$2(zt$1,"convertUnconventionalData");var Vn=i$2(function(Ws){let ws,oi,si,ii;return i$2(function(ai,li){try{if(ai==="")return ii=[],ws=new Map([[li,"[]"]]),oi=new Map,si=[],li;let ci=oi.get(this)||this;for(;si.length&&ci!==si[0];)si.shift(),ii.pop();if(typeof li=="boolean")return li;if(li===void 0)return Ws.allowUndefined?"_undefined_":void 0;if(li===null)return null;if(typeof li=="number")return li===-1/0?"_-Infinity_":li===1/0?"_Infinity_":Number.isNaN(li)?"_NaN_":li;if(typeof li=="bigint")return`_bigint_${li.toString()}`;if(typeof li=="string")return Jn$1.test(li)?Ws.allowDate?`_date_${li}`:void 0:li;if((0,Oe$1.default)(li))return Ws.allowRegExp?`_regexp_${li.flags}|${li.source}`:void 0;if((0,Ae.default)(li)){if(!Ws.allowFunction)return;let{name:di}=li,hi=li.toString();return hi.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)?`_function_${di}|${(()=>{}).toString()}`:`_function_${di}|${qn$1(Gn(ai,hi))}`}if((0,Pe$1.default)(li)){if(!Ws.allowSymbol)return;let di=Symbol.keyFor(li);return di!==void 0?`_gsymbol_${di}`:`_symbol_${li.toString().slice(7,-1)}`}if(si.length>=Ws.maxDepth)return Array.isArray(li)?`[Array(${li.length})]`:"[Object]";if(li===this)return`_duplicate_${JSON.stringify(ii)}`;if(li instanceof Error&&Ws.allowError)return{__isConvertedError__:!0,errorProperties:{...li.cause?{cause:li.cause}:{},...li,name:li.name,message:li.message,stack:li.stack,"_constructor-name_":li.constructor.name}};if(li.constructor&&li.constructor.name&&li.constructor.name!=="Object"&&!Array.isArray(li)&&!Ws.allowClass)return;let ui=ws.get(li);if(!ui){let di=Array.isArray(li)?li:zt$1(li);if(li.constructor&&li.constructor.name&&li.constructor.name!=="Object"&&!Array.isArray(li)&&Ws.allowClass)try{Object.assign(di,{"_constructor-name_":li.constructor.name})}catch{}return ii.push(ai),si.unshift(di),ws.set(li,JSON.stringify(ii)),li!==di&&oi.set(li,di),di}return`_duplicate_${ui}`}catch{return}},"replace")},"replacer2"),Kn$1=i$2(function reviver(options){let refs=[],root;return i$2(function revive(key,value){if(key===""&&(root=value,refs.forEach(({target:Ws,container:ws,replacement:oi})=>{let si=H$1(oi)?JSON.parse(oi):oi.split(".");si.length===0?ws[Ws]=root:ws[Ws]=Bn(root,si)})),key==="_constructor-name_")return value;if(et$1(value)&&value.__isConvertedError__){let{message:Ws,...ws}=value.errorProperties,oi=new Error(Ws);return Object.assign(oi,ws),oi}if(et$1(value)&&value["_constructor-name_"]&&options.allowFunction){let Ws=value["_constructor-name_"];if(Ws!=="Object"){let ws=new Function(`return function ${Ws.replace(/[^a-zA-Z0-9$_]+/g,"")}(){}`)();Object.setPrototypeOf(value,new ws)}return delete value["_constructor-name_"],value}if(typeof value=="string"&&value.startsWith("_function_")&&options.allowFunction){let[,name,source]=value.match(/_function_([^|]*)\|(.*)/)||[],sourceSanitized=source.replace(/[(\(\))|\\| |\]|`]*$/,"");if(!options.lazyEval)return eval(`(${sourceSanitized})`);let result=i$2((...args)=>{let f=eval(`(${sourceSanitized})`);return f(...args)},"result");return Object.defineProperty(result,"toString",{value:i$2(()=>sourceSanitized,"value")}),Object.defineProperty(result,"name",{value:name}),result}if(typeof value=="string"&&value.startsWith("_regexp_")&&options.allowRegExp){let[,Ws,ws]=value.match(/_regexp_([^|]*)\|(.*)/)||[];return new RegExp(ws,Ws)}return typeof value=="string"&&value.startsWith("_date_")&&options.allowDate?new Date(value.replace("_date_","")):typeof value=="string"&&value.startsWith("_duplicate_")?(refs.push({target:key,container:this,replacement:value.replace(/^_duplicate_/,"")}),null):typeof value=="string"&&value.startsWith("_symbol_")&&options.allowSymbol?Symbol(value.replace("_symbol_","")):typeof value=="string"&&value.startsWith("_gsymbol_")&&options.allowSymbol?Symbol.for(value.replace("_gsymbol_","")):typeof value=="string"&&value==="_-Infinity_"?-1/0:typeof value=="string"&&value==="_Infinity_"?1/0:typeof value=="string"&&value==="_NaN_"?NaN:typeof value=="string"&&value.startsWith("_bigint_")&&typeof BigInt=="function"?BigInt(value.replace("_bigint_","")):value},"revive")},"reviver"),Wt$1={maxDepth:10,space:void 0,allowFunction:!0,allowRegExp:!0,allowDate:!0,allowClass:!0,allowError:!0,allowUndefined:!0,allowSymbol:!0,lazyEval:!0},ot=i$2((Ws,ws={})=>{let oi={...Wt$1,...ws};return JSON.stringify(zt$1(Ws),Vn(oi),ws.space)},"stringify"),Yn$1=i$2(()=>{let Ws=new Map;return i$2(function ws(oi){et$1(oi)&&Object.entries(oi).forEach(([si,ii])=>{ii==="_undefined_"?oi[si]=void 0:Ws.get(ii)||(Ws.set(ii,!0),ws(ii))}),Array.isArray(oi)&&oi.forEach((si,ii)=>{si==="_undefined_"?(Ws.set(si,!0),oi[ii]=void 0):Ws.get(si)||(Ws.set(si,!0),ws(si))})},"mutateUndefined")},"mutator"),at$1=i$2((Ws,ws={})=>{let oi={...Wt$1,...ws},si=JSON.parse(Ws,Kn$1(oi));return Yn$1()(si),si},"parse"),gt$1="Invariant failed";function q$2(Ws,ws){if(!Ws){var oi=typeof ws=="function"?ws():ws,si=oi?"".concat(gt$1,": ").concat(oi):gt$1;throw new Error(si)}}i$2(q$2,"invariant");var Bt$1=i$2(Ws=>{let ws=Array.from(document.querySelectorAll("iframe[data-is-storybook]")),[oi,...si]=ws.filter(ai=>{var li,ci;try{return((li=ai.contentWindow)==null?void 0:li.location.origin)===Ws.source.location.origin&&((ci=ai.contentWindow)==null?void 0:ci.location.pathname)===Ws.source.location.pathname}catch{}try{return ai.contentWindow===Ws.source}catch{}let ui=ai.getAttribute("src"),di;try{if(!ui)return!1;({origin:di}=new URL(ui,document.location.toString()))}catch{return!1}return di===Ws.origin}),ii=oi==null?void 0:oi.getAttribute("src");if(ii&&si.length===0){let{protocol:ai,host:li,pathname:ci}=new URL(ii,document.location.toString());return`${ai}//${li}${ci}`}return si.length>0&&s$3.error("found multiple candidates for event source"),null},"getEventSourceUrl"),{document:mt$1,location:vt$1}=b$1,Gt$1="storybook-channel",to$1={allowFunction:!1,maxDepth:25},_t$1=class{constructor(Ws){if(this.config=Ws,this.connected=!1,this.buffer=[],typeof(b$1==null?void 0:b$1.addEventListener)=="function"&&b$1.addEventListener("message",this.handleEvent.bind(this),!1),Ws.page!=="manager"&&Ws.page!=="preview")throw new Error(`postmsg-channel: "config.page" cannot be "${Ws.page}"`)}setHandler(Ws){this.handler=(...ws)=>{Ws.apply(this,ws),!this.connected&&this.getLocalFrame().length&&(this.flush(),this.connected=!0)}}send(Ws,ws){let{target:oi,allowRegExp:si,allowFunction:ii,allowSymbol:ai,allowDate:li,allowError:ci,allowUndefined:ui,allowClass:di,maxDepth:hi,space:pi,lazyEval:ha}=ws||{},ga=Object.fromEntries(Object.entries({allowRegExp:si,allowFunction:ii,allowSymbol:ai,allowDate:li,allowError:ci,allowUndefined:ui,allowClass:di,maxDepth:hi,space:pi,lazyEval:ha}).filter(([Ca,el])=>typeof el<"u")),va={...to$1,...b$1.CHANNEL_OPTIONS||{},...ga},ba=this.getFrames(oi),wa=new URLSearchParams((vt$1==null?void 0:vt$1.search)||""),xa=ot({key:Gt$1,event:Ws,refId:wa.get("refId")},va);return ba.length?(this.buffer.length&&this.flush(),ba.forEach(Ca=>{try{Ca.postMessage(xa,"*")}catch{s$3.error("sending over postmessage fail")}}),Promise.resolve(null)):new Promise((Ca,el)=>{this.buffer.push({event:Ws,resolve:Ca,reject:el})})}flush(){let{buffer:Ws}=this;this.buffer=[],Ws.forEach(ws=>{this.send(ws.event).then(ws.resolve).catch(ws.reject)})}getFrames(Ws){if(this.config.page==="manager"){let ws=Array.from(mt$1.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")).flatMap(oi=>{try{return oi.contentWindow&&oi.dataset.isStorybook!==void 0&&oi.id===Ws?[oi.contentWindow]:[]}catch{return[]}});return ws!=null&&ws.length?ws:this.getCurrentFrames()}return b$1&&b$1.parent&&b$1.parent!==b$1.self?[b$1.parent]:[]}getCurrentFrames(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll('[data-is-storybook="true"]')).flatMap(Ws=>Ws.contentWindow?[Ws.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}getLocalFrame(){return this.config.page==="manager"?Array.from(mt$1.querySelectorAll("#storybook-preview-iframe")).flatMap(Ws=>Ws.contentWindow?[Ws.contentWindow]:[]):b$1&&b$1.parent?[b$1.parent]:[]}handleEvent(Ws){try{let{data:ws}=Ws,{key:oi,event:si,refId:ii}=typeof ws=="string"&&H$1(ws)?at$1(ws,b$1.CHANNEL_OPTIONS||{}):ws;if(oi===Gt$1){let ai=this.config.page==="manager"?'<span style="color: #37D5D3; background: black"> manager </span>':'<span style="color: #1EA7FD; background: black"> preview </span>',li=Object.values(Qn$1).includes(si.type)?`<span style="color: #FF4785">${si.type}</span>`:`<span style="color: #FFAE00">${si.type}</span>`;if(ii&&(si.refId=ii),si.source=this.config.page==="preview"?Ws.origin:Bt$1(Ws),!si.source){r$3.error(`${ai} received ${li} but was unable to determine the source of the event`);return}let ci=`${ai} received ${li} (${ws.length})`;r$3.debug(vt$1.origin!==si.source?ci:`${ci} <span style="color: gray">(on ${vt$1.origin} from ${si.source})</span>`,...si.args),q$2(this.handler,"ChannelHandler should be set"),this.handler(si)}}catch(ws){s$3.error(ws)}}};i$2(_t$1,"PostMessageTransport");var G$3=_t$1,{WebSocket:eo$1}=b$1,bt$1=class{constructor({url:Ws,onError:ws,page:oi}){this.buffer=[],this.isReady=!1,this.socket=new eo$1(Ws),this.socket.onopen=()=>{this.isReady=!0,this.flush()},this.socket.onmessage=({data:si})=>{let ii=typeof si=="string"&&H$1(si)?at$1(si):si;q$2(this.handler,"WebsocketTransport handler should be set"),this.handler(ii)},this.socket.onerror=si=>{ws&&ws(si)},this.socket.onclose=()=>{q$2(this.handler,"WebsocketTransport handler should be set"),this.handler({type:S$2,args:[],from:oi||"preview"})}}setHandler(Ws){this.handler=Ws}send(Ws){this.isReady?this.sendNow(Ws):this.sendLater(Ws)}sendLater(Ws){this.buffer.push(Ws)}sendNow(Ws){let ws=ot(Ws,{maxDepth:15,allowFunction:!1,...b$1.CHANNEL_OPTIONS});this.socket.send(ws)}flush(){let{buffer:Ws}=this;this.buffer=[],Ws.forEach(ws=>this.send(ws))}};i$2(bt$1,"WebsocketTransport");var J$2=bt$1,{CONFIG_TYPE:ro$1}=b$1;function $o$1({page:Ws,extraTransports:ws=[]}){let oi=[new G$3({page:Ws}),...ws];if(ro$1==="DEVELOPMENT"){let si=window.location.protocol==="http:"?"ws":"wss",{hostname:ii,port:ai}=window.location,li=`${si}://${ii}:${ai}/storybook-server-channel`;oi.push(new J$2({url:li,onError:i$2(()=>{},"onError"),page:Ws}))}return new z$2({transports:oi})}i$2($o$1,"createBrowserChannel");var oe$1=Object.defineProperty,t$3=(Ws,ws)=>oe$1(Ws,"name",{value:ws,configurable:!0});function r$1(Ws){for(var ws=[],oi=1;oi<arguments.length;oi++)ws[oi-1]=arguments[oi];var si=Array.from(typeof Ws=="string"?[Ws]:Ws);si[si.length-1]=si[si.length-1].replace(/\r?\n([\t ]*)$/,"");var ii=si.reduce(function(ci,ui){var di=ui.match(/\n([\t ]+|(?!\s).)/g);return di?ci.concat(di.map(function(hi){var pi,ha;return(ha=(pi=hi.match(/[\t ]/g))===null||pi===void 0?void 0:pi.length)!==null&&ha!==void 0?ha:0})):ci},[]);if(ii.length){var ai=new RegExp(`
51
- [ ]{`+Math.min.apply(Math,ii)+"}","g");si=si.map(function(ci){return ci.replace(ai,`
52
- `)})}si[0]=si[0].replace(/^\r?\n/,"");var li=si[0];return ws.forEach(function(ci,ui){var di=li.match(/(?:^|\n)( *)$/),hi=di?di[1]:"",pi=ci;typeof ci=="string"&&ci.includes(`
53
- `)&&(pi=String(ci).split(`
54
- `).map(function(ha,ga){return ga===0?ha:""+hi+ha}).join(`
55
- `)),li+=pi+si[ui+1]}),li}t$3(r$1,"dedent");function C$3({code:Ws,category:ws}){let oi=String(Ws).padStart(4,"0");return`SB_${ws}_${oi}`}t$3(C$3,"parseErrorCode");var p$1=class Kf extends Error{constructor(ws){super(Kf.getFullMessage(ws)),this.data={},this.fromStorybook=!0,this.category=ws.category,this.documentation=ws.documentation??!1,this.code=ws.code}get fullErrorCode(){return C$3({code:this.code,category:this.category})}get name(){let ws=this.constructor.name;return`${this.fullErrorCode} (${ws})`}static getFullMessage({documentation:ws,code:oi,category:si,message:ii}){let ai;return ws===!0?ai=`https://storybook.js.org/error/${C$3({code:oi,category:si})}`:typeof ws=="string"?ai=ws:Array.isArray(ws)&&(ai=`
56
- ${ws.map(li=>` - ${li}`).join(`
57
- `)}`),`${ii}${ai!=null?`
58
-
59
- More info: ${ai}
60
- `:""}`}};t$3(p$1,"StorybookError");var o$1=p$1,f$1=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:1,message:r$1`
61
- Couldn't find story matching id '${Ws.storyId}' after HMR.
62
- - Did you just rename a story?
63
- - Did you remove it from your CSF file?
64
- - Are you sure a story with the id '${Ws.storyId}' exists?
65
- - Please check the values in the stories field of your main.js config and see if they would match your CSF File.
66
- - Also check the browser console and terminal for potential error messages.`}),this.data=Ws}};t$3(f$1,"MissingStoryAfterHmrError");var D$1=f$1,R$1=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:2,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function",message:r$1`
67
- We detected that you use an implicit action arg while ${Ws.phase} of your story.
68
- ${Ws.deprecated?`
69
- This is deprecated and won't work in Storybook 8 anymore.
70
- `:""}
71
- Please provide an explicit spy to your args like this:
72
- import { fn } from '@storybook/test';
73
- ...
74
- args: {
75
- ${Ws.name}: fn()
76
- }`}),this.data=Ws}};t$3(R$1,"ImplicitActionsDuringRendering");var b=class extends o$1{constructor(){super({category:"PREVIEW_API",code:3,message:r$1`
77
- Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first.
78
-
79
- You probably meant to call \`await preview.extract()\` which does the above for you.`})}};t$3(b,"CalledExtractOnStoreError");var L=b,I$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:4,message:r$1`
80
- Expected your framework's preset to export a \`renderToCanvas\` field.
81
-
82
- Perhaps it needs to be upgraded for Storybook 7.0?`,documentation:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"})}};t$3(I$1,"MissingRenderToCanvasError");var G$2=I$1,P$2=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:5,message:r$1`
83
- Called \`Preview.${Ws.methodName}()\` before initialization.
84
-
85
- The preview needs to load the story index before most methods can be called. If you want
86
- to call \`${Ws.methodName}\`, try \`await preview.initializationPromise;\` first.
87
-
88
- If you didn't call the above code, then likely it was called by an addon that needs to
89
- do the above.`}),this.data=Ws}};t$3(P$2,"CalledPreviewMethodBeforeInitializationError");var Y=P$2,x$1=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:6,message:r$1`
90
- Error fetching \`/index.json\`:
91
-
92
- ${Ws.text}
93
-
94
- If you are in development, this likely indicates a problem with your Storybook process,
95
- check the terminal for errors.
96
-
97
- If you are in a deployed Storybook, there may have been an issue deploying the full Storybook
98
- build.`}),this.data=Ws}};t$3(x$1,"StoryIndexFetchError");var M$1=x$1,T=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:7,message:r$1`
99
- Tried to render docs entry ${Ws.storyId} but it is a MDX file that has no CSF
100
- references, or autodocs for a CSF file that some doesn't refer to itself.
101
-
102
- This likely is an internal error in Storybook's indexing, or you've attached the
103
- \`attached-mdx\` tag to an MDX file that is not attached.`}),this.data=Ws}};t$3(T,"MdxFileWithNoCsfReferencesError");var H=T,w$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:8,message:r$1`
104
- Couldn't find any stories in your Storybook.
105
-
106
- - Please check your stories field of your main.js config: does it match correctly?
107
- - Also check the browser console and terminal for error messages.`})}};t$3(w$1,"EmptyIndexError");var F$2=w$1,k$2=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:9,message:r$1`
108
- Couldn't find story matching '${Ws.storySpecifier}'.
109
-
110
- - Are you sure a story with that id exists?
111
- - Please check your stories field of your main.js config.
112
- - Also check the browser console and terminal for error messages.`}),this.data=Ws}};t$3(k$2,"NoStoryMatchError");var K$1=k$2,S$1=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:10,message:r$1`
113
- Couldn't find story matching id '${Ws.storyId}' after importing a CSF file.
114
-
115
- The file was indexed as if the story was there, but then after importing the file in the browser
116
- we didn't find the story. Possible reasons:
117
- - You are using a custom story indexer that is misbehaving.
118
- - You have a custom file loader that is removing or renaming exports.
119
-
120
- Please check your browser console and terminal for errors that may explain the issue.`}),this.data=Ws}};t$3(S$1,"MissingStoryFromCsfFileError");var X$1=S$1,v$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:11,message:r$1`
121
- Cannot access the Story Store until the index is ready.
122
-
123
- It is not recommended to use methods directly on the Story Store anyway, in Storybook 9 we will
124
- remove access to the store entirely`})}};t$3(v$1,"StoryStoreAccessedBeforeInitializationError");var U=v$1,_$1=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:12,message:r$1`
125
- Incorrect use of mount in the play function.
126
-
127
- To use mount in the play function, you must satisfy the following two requirements:
128
-
129
- 1. You *must* destructure the mount property from the \`context\` (the argument passed to your play function).
130
- This makes sure that Storybook does not start rendering the story before the play function begins.
131
-
132
- 2. Your Storybook framework or builder must be configured to transpile to ES2017 or newer.
133
- This is because destructuring statements and async/await usages are otherwise transpiled away,
134
- which prevents Storybook from recognizing your usage of \`mount\`.
135
-
136
- Note that Angular is not supported. As async/await is transpiled to support the zone.js polyfill.
137
-
138
- More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered
139
-
140
- Received the following play function:
141
- ${Ws.playFunction}`}),this.data=Ws}};t$3(_$1,"MountMustBeDestructuredError");var J$1=_$1,V=class extends o$1{constructor(Ws){super({category:"PREVIEW_API",code:14,message:r$1`
142
- No render function available for storyId '${Ws.id}'
143
- `}),this.data=Ws}};t$3(V,"NoRenderFunctionError");var q$1=V,N$1=class extends o$1{constructor(){super({category:"PREVIEW_API",code:15,message:r$1`
144
- No component is mounted in your story.
145
-
146
- This usually occurs when you destructure mount in the play function, but forget to call it.
147
-
148
- For example:
149
-
150
- async play({ mount, canvasElement }) {
151
- // 👈 mount should be called: await mount();
152
- const canvas = within(canvasElement);
153
- const button = await canvas.findByRole('button');
154
- await userEvent.click(button);
155
- };
156
-
157
- Make sure to either remove it or call mount in your play function.
158
- `})}};t$3(N$1,"NoStoryMountedError");var z$1=N$1,A=class extends o$1{constructor(){super({category:"FRAMEWORK_NEXTJS",code:1,documentation:"https://storybook.js.org/docs/get-started/nextjs#faq",message:r$1`
159
- You are importing avif images, but you don't have sharp installed.
160
-
161
- You have to install sharp in order to use image optimization features in Next.js.
162
- `})}};t$3(A,"NextJsSharpError");var W$1=class extends o$1{constructor(Ws){super({category:"FRAMEWORK_NEXTJS",code:2,message:r$1`
163
- Tried to access router mocks from "${Ws.importType}" but they were not created yet. You might be running code in an unsupported environment.
164
- `}),this.data=Ws}};t$3(W$1,"NextjsRouterMocksNotAvailable");var $=class extends o$1{constructor(Ws){super({category:"DOCS-TOOLS",code:1,documentation:"https://github.com/storybookjs/storybook/issues/26606",message:r$1`
165
- There was a failure when generating detailed ArgTypes in ${Ws.language} for:
166
- ${JSON.stringify(Ws.type,null,2)}
167
-
168
- Storybook will fall back to use a generic type description instead.
169
-
170
- This type is either not supported or it is a bug in the docgen generation in Storybook.
171
- If you think this is a bug, please detail it as much as possible in the Github issue.
172
- `}),this.data=Ws}};t$3($,"UnknownArgTypesError");var O$1=class extends o$1{constructor(Ws){super({category:"ADDON_VITEST",code:1,message:r$1`
173
- Encountered an unsupported value "${Ws.value}" when setting the viewport ${Ws.dimension} dimension.
174
-
175
- The Storybook plugin only supports values in the following units:
176
- - px, vh, vw, em, rem and %.
177
-
178
- You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://storybook.js.org/docs/writing-stories/tags
179
- `}),this.data=Ws}};t$3(O$1,"UnsupportedViewportDimensionError");var C$2=Object.create,u=Object.defineProperty,B=Object.getOwnPropertyDescriptor,F$1=Object.getOwnPropertyNames,h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,E=(Ws,ws)=>()=>(ws||Ws((ws={exports:{}}).exports,ws),ws.exports),v=(Ws,ws,oi,si)=>{if(ws&&typeof ws=="object"||typeof ws=="function")for(let ii of F$1(ws))!w.call(Ws,ii)&&ii!==oi&&u(Ws,ii,{get:()=>ws[ii],enumerable:!(si=B(ws,ii))||si.enumerable});return Ws},I=(Ws,ws,oi)=>(oi=Ws!=null?C$2(h(Ws)):{},v(!Ws||!Ws.__esModule?u(oi,"default",{value:Ws,enumerable:!0}):oi,Ws)),x=E(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.isEqual=function(){var ws=Object.prototype.toString,oi=Object.getPrototypeOf,si=Object.getOwnPropertySymbols?function(ii){return Object.keys(ii).concat(Object.getOwnPropertySymbols(ii))}:Object.keys;return function(ii,ai){return function li(ci,ui,di){var hi,pi,ha,ga=ws.call(ci),va=ws.call(ui);if(ci===ui)return!0;if(ci==null||ui==null)return!1;if(di.indexOf(ci)>-1&&di.indexOf(ui)>-1)return!0;if(di.push(ci,ui),ga!=va||(hi=si(ci),pi=si(ui),hi.length!=pi.length||hi.some(function(ba){return!li(ci[ba],ui[ba],di)})))return!1;switch(ga.slice(8,-1)){case"Symbol":return ci.valueOf()==ui.valueOf();case"Date":case"Number":return+ci==+ui||+ci!=+ci&&+ui!=+ui;case"RegExp":case"Function":case"String":case"Boolean":return""+ci==""+ui;case"Set":case"Map":hi=ci.entries(),pi=ui.entries();do if(!li((ha=hi.next()).value,pi.next().value,di))return!1;while(!ha.done);return!0;case"ArrayBuffer":ci=new Uint8Array(ci),ui=new Uint8Array(ui);case"DataView":ci=new Uint8Array(ci.buffer),ui=new Uint8Array(ui.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(ci.length!=ui.length)return!1;for(ha=0;ha<ci.length;ha++)if((ha in ci||ha in ui)&&(ha in ci!=ha in ui||!li(ci[ha],ui[ha],di)))return!1;return!0;case"Object":return li(oi(ci),oi(ui),di);default:return!1}}(ii,ai,[])}}()});function R(Ws){return Ws.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(ws,oi,si,ii)=>`${oi} ${si}${ii}`).replace(/([a-z])([A-Z])/g,(ws,oi,si)=>`${oi} ${si}`).replace(/([a-z])([0-9])/gi,(ws,oi,si)=>`${oi} ${si}`).replace(/([0-9])([a-z])/gi,(ws,oi,si)=>`${oi} ${si}`).replace(/(\s|^)(\w)/g,(ws,oi,si)=>`${oi}${si.toUpperCase()}`).replace(/ +/g," ").trim()}var l=I(x()),S=Ws=>Ws.map(ws=>typeof ws<"u").filter(Boolean).length,k$1=(Ws,ws)=>{let{exists:oi,eq:si,neq:ii,truthy:ai}=Ws;if(S([oi,si,ii,ai])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:oi,eq:si,neq:ii})}`);if(typeof si<"u")return(0,l.isEqual)(ws,si);if(typeof ii<"u")return!(0,l.isEqual)(ws,ii);if(typeof oi<"u"){let li=typeof ws<"u";return oi?li:!li}return typeof ai>"u"||ai?!!ws:!ws},P$1=(Ws,ws,oi)=>{if(!Ws.if)return!0;let{arg:si,global:ii}=Ws.if;if(S([si,ii])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:si,global:ii})}`);let ai=si?ws[si]:oi[ii];return k$1(Ws.if,ai)},O=Ws=>Ws.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),f=(Ws,ws)=>{let oi=O(Ws);if(oi==="")throw new Error(`Invalid ${ws} '${Ws}', must include alphanumeric characters`);return oi},G$1=(Ws,ws)=>`${f(Ws,"kind")}${ws?`--${f(ws,"name")}`:""}`,N=Ws=>R(Ws);function m(Ws,ws){return Array.isArray(ws)?ws.includes(Ws):Ws.match(ws)}function M(Ws,{includeStories:ws,excludeStories:oi}){return Ws!=="__esModule"&&(!ws||m(Ws,ws))&&(!oi||!m(Ws,oi))}var z=(...Ws)=>{let ws=Ws.reduce((oi,si)=>(si.startsWith("!")?oi.delete(si.slice(1)):oi.add(si),oi),new Set);return Array.from(ws)},jn=Object.create,fr=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyNames,Ln=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty,s$1=(Ws,ws)=>fr(Ws,"name",{value:ws,configurable:!0}),Ee=(Ws=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Ws,{get:(ws,oi)=>(typeof require<"u"?require:ws)[oi]}):Ws)(function(Ws){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Ws+'" is not supported')}),D=(Ws,ws)=>()=>(ws||Ws((ws={exports:{}}).exports,ws),ws.exports),qn=(Ws,ws,oi,si)=>{if(ws&&typeof ws=="object"||typeof ws=="function")for(let ii of _n(ws))!Nn.call(Ws,ii)&&ii!==oi&&fr(Ws,ii,{get:()=>ws[ii],enumerable:!(si=Mn(ws,ii))||si.enumerable});return Ws},ue=(Ws,ws,oi)=>(oi=Ws!=null?jn(Ln(Ws)):{},qn(fr(oi,"default",{value:Ws,enumerable:!0}),Ws)),Or=D((Ws,ws)=>{(function(oi){if(typeof Ws=="object"&&typeof ws<"u")ws.exports=oi();else if(typeof define=="function"&&define.amd)define([],oi);else{var si;typeof window<"u"?si=window:typeof global<"u"?si=global:typeof self<"u"?si=self:si=this,si.memoizerific=oi()}})(function(){return s$1(function oi(si,ii,ai){function li(di,hi){if(!ii[di]){if(!si[di]){var pi=typeof Ee=="function"&&Ee;if(!hi&&pi)return pi(di,!0);if(ci)return ci(di,!0);var ha=new Error("Cannot find module '"+di+"'");throw ha.code="MODULE_NOT_FOUND",ha}var ga=ii[di]={exports:{}};si[di][0].call(ga.exports,function(va){var ba=si[di][1][va];return li(ba||va)},ga,ga.exports,oi,si,ii,ai)}return ii[di].exports}s$1(li,"s");for(var ci=typeof Ee=="function"&&Ee,ui=0;ui<ai.length;ui++)li(ai[ui]);return li},"e")({1:[function(oi,si,ii){si.exports=function(ai){if(typeof Map!="function"||ai){var li=oi("./similar");return new li}else return new Map}},{"./similar":2}],2:[function(oi,si,ii){function ai(){return this.list=[],this.lastItem=void 0,this.size=0,this}s$1(ai,"Similar"),ai.prototype.get=function(li){var ci;if(this.lastItem&&this.isEqual(this.lastItem.key,li))return this.lastItem.val;if(ci=this.indexOf(li),ci>=0)return this.lastItem=this.list[ci],this.list[ci].val},ai.prototype.set=function(li,ci){var ui;return this.lastItem&&this.isEqual(this.lastItem.key,li)?(this.lastItem.val=ci,this):(ui=this.indexOf(li),ui>=0?(this.lastItem=this.list[ui],this.list[ui].val=ci,this):(this.lastItem={key:li,val:ci},this.list.push(this.lastItem),this.size++,this))},ai.prototype.delete=function(li){var ci;if(this.lastItem&&this.isEqual(this.lastItem.key,li)&&(this.lastItem=void 0),ci=this.indexOf(li),ci>=0)return this.size--,this.list.splice(ci,1)[0]},ai.prototype.has=function(li){var ci;return this.lastItem&&this.isEqual(this.lastItem.key,li)?!0:(ci=this.indexOf(li),ci>=0?(this.lastItem=this.list[ci],!0):!1)},ai.prototype.forEach=function(li,ci){var ui;for(ui=0;ui<this.size;ui++)li.call(ci||this,this.list[ui].val,this.list[ui].key,this)},ai.prototype.indexOf=function(li){var ci;for(ci=0;ci<this.size;ci++)if(this.isEqual(this.list[ci].key,li))return ci;return-1},ai.prototype.isEqual=function(li,ci){return li===ci||li!==li&&ci!==ci},si.exports=ai},{}],3:[function(oi,si,ii){var ai=oi("map-or-similar");si.exports=function(di){var hi=new ai(!1),pi=[];return function(ha){var ga=s$1(function(){var va=hi,ba,wa,xa=arguments.length-1,Ca=Array(xa+1),el=!0,ku;if((ga.numArgs||ga.numArgs===0)&&ga.numArgs!==xa+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(ku=0;ku<xa;ku++){if(Ca[ku]={cacheItem:va,arg:arguments[ku]},va.has(arguments[ku])){va=va.get(arguments[ku]);continue}el=!1,ba=new ai(!1),va.set(arguments[ku],ba),va=ba}return el&&(va.has(arguments[xa])?wa=va.get(arguments[xa]):el=!1),el||(wa=ha.apply(null,arguments),va.set(arguments[xa],wa)),di>0&&(Ca[xa]={cacheItem:va,arg:arguments[xa]},el?li(pi,Ca):pi.push(Ca),pi.length>di&&ci(pi.shift())),ga.wasMemoized=el,ga.numArgs=xa+1,wa},"memoizerific");return ga.limit=di,ga.wasMemoized=!1,ga.cache=hi,ga.lru=pi,ga}};function li(di,hi){var pi=di.length,ha=hi.length,ga,va,ba;for(va=0;va<pi;va++){for(ga=!0,ba=0;ba<ha;ba++)if(!ui(di[va][ba].arg,hi[ba].arg)){ga=!1;break}if(ga)break}di.push(di.splice(va,1)[0])}s$1(li,"moveToMostRecentLru");function ci(di){var hi=di.length,pi=di[hi-1],ha,ga;for(pi.cacheItem.delete(pi.arg),ga=hi-2;ga>=0&&(pi=di[ga],ha=pi.cacheItem.get(pi.arg),!ha||!ha.size);ga--)pi.cacheItem.delete(pi.arg)}s$1(ci,"removeCachedResult");function ui(di,hi){return di===hi||di!==di&&hi!==hi}s$1(ui,"isEqual")},{"map-or-similar":1}]},{},[3])(3)})}),tt=D(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.encodeString=si;var ws=Array.from({length:256},(ii,ai)=>"%"+((ai<16?"0":"")+ai.toString(16)).toUpperCase()),oi=new Int8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0]);function si(ii){let ai=ii.length;if(ai===0)return"";let li="",ci=0,ui=0;e:for(;ui<ai;ui++){let di=ii.charCodeAt(ui);for(;di<128;){if(oi[di]!==1&&(ci<ui&&(li+=ii.slice(ci,ui)),ci=ui+1,li+=ws[di]),++ui===ai)break e;di=ii.charCodeAt(ui)}if(ci<ui&&(li+=ii.slice(ci,ui)),di<2048){ci=ui+1,li+=ws[192|di>>6]+ws[128|di&63];continue}if(di<55296||di>=57344){ci=ui+1,li+=ws[224|di>>12]+ws[128|di>>6&63]+ws[128|di&63];continue}if(++ui,ui>=ai)throw new Error("URI malformed");let hi=ii.charCodeAt(ui)&1023;ci=ui+1,di=65536+((di&1023)<<10|hi),li+=ws[240|di>>18]+ws[128|di>>12&63]+ws[128|di>>6&63]+ws[128|di&63]}return ci===0?ii:ci<ai?li+ii.slice(ci):li}s$1(si,"encodeString")}),Ze=D(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.defaultOptions=Ws.defaultShouldSerializeObject=Ws.defaultValueSerializer=void 0;var ws=tt(),oi=s$1(ai=>{switch(typeof ai){case"string":return(0,ws.encodeString)(ai);case"bigint":case"boolean":return""+ai;case"number":if(Number.isFinite(ai))return ai<1e21?""+ai:(0,ws.encodeString)(""+ai);break}return ai instanceof Date?(0,ws.encodeString)(ai.toISOString()):""},"defaultValueSerializer");Ws.defaultValueSerializer=oi;var si=s$1(ai=>ai instanceof Date,"defaultShouldSerializeObject");Ws.defaultShouldSerializeObject=si;var ii=s$1(ai=>ai,"identityFunc");Ws.defaultOptions={nesting:!0,nestingSyntax:"dot",arrayRepeat:!1,arrayRepeatSyntax:"repeat",delimiter:38,valueDeserializer:ii,valueSerializer:Ws.defaultValueSerializer,keyDeserializer:ii,shouldSerializeObject:Ws.defaultShouldSerializeObject}}),nt=D(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.getDeepObject=ii,Ws.stringifyObject=hi;var ws=Ze(),oi=tt();function si(pi){return pi==="__proto__"||pi==="constructor"||pi==="prototype"}s$1(si,"isPrototypeKey");function ii(pi,ha,ga,va,ba){if(si(ha))return pi;let wa=pi[ha];return typeof wa=="object"&&wa!==null?wa:!va&&(ba||typeof ga=="number"||typeof ga=="string"&&ga*0===0&&ga.indexOf(".")===-1)?pi[ha]=[]:pi[ha]={}}s$1(ii,"getDeepObject");var ai=20,li="[]",ci="[",ui="]",di=".";function hi(pi,ha,ga=0,va,ba){let{nestingSyntax:wa=ws.defaultOptions.nestingSyntax,arrayRepeat:xa=ws.defaultOptions.arrayRepeat,arrayRepeatSyntax:Ca=ws.defaultOptions.arrayRepeatSyntax,nesting:el=ws.defaultOptions.nesting,delimiter:ku=ws.defaultOptions.delimiter,valueSerializer:gd=ws.defaultOptions.valueSerializer,shouldSerializeObject:Ed=ws.defaultOptions.shouldSerializeObject}=ha,Od=typeof ku=="number"?String.fromCharCode(ku):ku,Nd=ba===!0&&xa,Pd=wa==="dot"||wa==="js"&&!ba;if(ga>ai)return"";let Ld="",rf=!0,kd=!1;for(let Md in pi){let Td=pi[Md],wd;va?(wd=va,Nd?Ca==="bracket"&&(wd+=li):Pd?(wd+=di,wd+=Md):(wd+=ci,wd+=Md,wd+=ui)):wd=Md,rf||(Ld+=Od),typeof Td=="object"&&Td!==null&&!Ed(Td)?(kd=Td.pop!==void 0,(el||xa&&kd)&&(Ld+=hi(Td,ha,ga+1,wd,kd))):(Ld+=(0,oi.encodeString)(wd),Ld+="=",Ld+=gd(Td,Md)),rf&&(rf=!1)}return Ld}s$1(hi,"stringifyObject")}),No=D((Ws,ws)=>{var oi=12,si=0,ii=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function ai(ui){var di=ui.indexOf("%");if(di===-1)return ui;for(var hi=ui.length,pi="",ha=0,ga=0,va=di,ba=oi;di>-1&&di<hi;){var wa=ci(ui[di+1],4),xa=ci(ui[di+2],0),Ca=wa|xa,el=ii[Ca];if(ba=ii[256+ba+el],ga=ga<<6|Ca&ii[364+el],ba===oi)pi+=ui.slice(ha,va),pi+=ga<=65535?String.fromCharCode(ga):String.fromCharCode(55232+(ga>>10),56320+(ga&1023)),ga=0,ha=di+3,di=va=ui.indexOf("%",ha);else{if(ba===si)return null;if(di+=3,di<hi&&ui.charCodeAt(di)===37)continue;return null}}return pi+ui.slice(ha)}s$1(ai,"decodeURIComponent");var li={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function ci(ui,di){var hi=li[ui];return hi===void 0?255:hi<<di}s$1(ci,"hexCodeToInt"),ws.exports=ai}),Go=D(Ws=>{var ws=Ws&&Ws.__importDefault||function(pi){return pi&&pi.__esModule?pi:{default:pi}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.numberValueDeserializer=Ws.numberKeyDeserializer=void 0,Ws.parse=hi;var oi=nt(),si=Ze(),ii=ws(No()),ai=s$1(pi=>{let ha=Number(pi);return Number.isNaN(ha)?pi:ha},"numberKeyDeserializer");Ws.numberKeyDeserializer=ai;var li=s$1(pi=>{let ha=Number(pi);return Number.isNaN(ha)?pi:ha},"numberValueDeserializer");Ws.numberValueDeserializer=li;var ci=/\+/g,ui=s$1(function(){},"Empty");ui.prototype=Object.create(null);function di(pi,ha,ga,va,ba){let wa=pi.substring(ha,ga);return va&&(wa=wa.replace(ci," ")),ba&&(wa=(0,ii.default)(wa)||wa),wa}s$1(di,"computeKeySlice");function hi(pi,ha){let{valueDeserializer:ga=si.defaultOptions.valueDeserializer,keyDeserializer:va=si.defaultOptions.keyDeserializer,arrayRepeatSyntax:ba=si.defaultOptions.arrayRepeatSyntax,nesting:wa=si.defaultOptions.nesting,arrayRepeat:xa=si.defaultOptions.arrayRepeat,nestingSyntax:Ca=si.defaultOptions.nestingSyntax,delimiter:el=si.defaultOptions.delimiter}=ha??{},ku=typeof el=="string"?el.charCodeAt(0):el,gd=Ca==="js",Ed=new ui;if(typeof pi!="string")return Ed;let Od=pi.length,Nd="",Pd=-1,Ld=-1,rf=-1,kd=Ed,Md,Td="",wd="",Cd=!1,sf=!1,of=!1,Wd=!1,df=!1,hf=!1,xd=!1,Fd=0,Vd=-1,af=-1,ff=-1;for(let uf=0;uf<Od+1;uf++){if(Fd=uf!==Od?pi.charCodeAt(uf):ku,Fd===ku){if(xd=Ld>Pd,xd||(Ld=uf),rf!==Ld-1&&(wd=di(pi,rf+1,Vd>-1?Vd:Ld,of,Cd),Td=va(wd),Md!==void 0&&(kd=(0,oi.getDeepObject)(kd,Md,Td,gd&&df,gd&&hf))),xd||Td!==""){xd&&(Nd=pi.slice(Ld+1,uf),Wd&&(Nd=Nd.replace(ci," ")),sf&&(Nd=(0,ii.default)(Nd)||Nd));let mf=ga(Nd,Td);if(xa){let yf=kd[Td];yf===void 0?Vd>-1?kd[Td]=[mf]:kd[Td]=mf:yf.pop?yf.push(mf):kd[Td]=[yf,mf]}else kd[Td]=mf}Nd="",Pd=uf,Ld=uf,Cd=!1,sf=!1,of=!1,Wd=!1,df=!1,hf=!1,Vd=-1,rf=uf,kd=Ed,Md=void 0,Td=""}else Fd===93?(xa&&ba==="bracket"&&ff===91&&(Vd=af),wa&&(Ca==="index"||gd)&&Ld<=Pd&&(rf!==af&&(wd=di(pi,rf+1,uf,of,Cd),Td=va(wd),Md!==void 0&&(kd=(0,oi.getDeepObject)(kd,Md,Td,void 0,gd)),Md=Td,of=!1,Cd=!1),rf=uf,hf=!0,df=!1)):Fd===46?wa&&(Ca==="dot"||gd)&&Ld<=Pd&&(rf!==af&&(wd=di(pi,rf+1,uf,of,Cd),Td=va(wd),Md!==void 0&&(kd=(0,oi.getDeepObject)(kd,Md,Td,gd)),Md=Td,of=!1,Cd=!1),df=!0,hf=!1,rf=uf):Fd===91?wa&&(Ca==="index"||gd)&&Ld<=Pd&&(rf!==af&&(wd=di(pi,rf+1,uf,of,Cd),Td=va(wd),gd&&Md!==void 0&&(kd=(0,oi.getDeepObject)(kd,Md,Td,gd)),Md=Td,of=!1,Cd=!1,df=!1,hf=!0),rf=uf):Fd===61?Ld<=Pd?Ld=uf:sf=!0:Fd===43?Ld>Pd?Wd=!0:of=!0:Fd===37&&(Ld>Pd?sf=!0:Cd=!0);af=uf,ff=Fd}return Ed}s$1(hi,"parse")}),Vo=D(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.stringify=oi;var ws=nt();function oi(si,ii){if(si===null||typeof si!="object")return"";let ai=ii??{};return(0,ws.stringifyObject)(si,ai)}s$1(oi,"stringify")}),or=D(Ws=>{var ws=Ws&&Ws.__createBinding||(Object.create?function(ai,li,ci,ui){ui===void 0&&(ui=ci);var di=Object.getOwnPropertyDescriptor(li,ci);(!di||("get"in di?!li.__esModule:di.writable||di.configurable))&&(di={enumerable:!0,get:s$1(function(){return li[ci]},"get")}),Object.defineProperty(ai,ui,di)}:function(ai,li,ci,ui){ui===void 0&&(ui=ci),ai[ui]=li[ci]}),oi=Ws&&Ws.__exportStar||function(ai,li){for(var ci in ai)ci!=="default"&&!Object.prototype.hasOwnProperty.call(li,ci)&&ws(li,ai,ci)};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.stringify=Ws.parse=void 0;var si=Go();Object.defineProperty(Ws,"parse",{enumerable:!0,get:s$1(function(){return si.parse},"get")});var ii=Vo();Object.defineProperty(Ws,"stringify",{enumerable:!0,get:s$1(function(){return ii.stringify},"get")}),oi(Ze(),Ws)}),dt=D((Ws,ws)=>{ws.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
180
- `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}}),Xo=D((Ws,ws)=>{ws.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}}),pt=D((Ws,ws)=>{ws.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}}),Jo=D((Ws,ws)=>{ws.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}}),Zo=D(Ws=>{var ws=Ws&&Ws.__importDefault||function(ai){return ai&&ai.__esModule?ai:{default:ai}};Object.defineProperty(Ws,"__esModule",{value:!0});var oi=ws(Jo()),si=String.fromCodePoint||function(ai){var li="";return ai>65535&&(ai-=65536,li+=String.fromCharCode(ai>>>10&1023|55296),ai=56320|ai&1023),li+=String.fromCharCode(ai),li};function ii(ai){return ai>=55296&&ai<=57343||ai>1114111?"�":(ai in oi.default&&(ai=oi.default[ai]),si(ai))}s$1(ii,"decodeCodePoint"),Ws.default=ii}),ft=D(Ws=>{var ws=Ws&&Ws.__importDefault||function(hi){return hi&&hi.__esModule?hi:{default:hi}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.decodeHTML=Ws.decodeHTMLStrict=Ws.decodeXML=void 0;var oi=ws(dt()),si=ws(Xo()),ii=ws(pt()),ai=ws(Zo()),li=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;Ws.decodeXML=ci(ii.default),Ws.decodeHTMLStrict=ci(oi.default);function ci(hi){var pi=di(hi);return function(ha){return String(ha).replace(li,pi)}}s$1(ci,"getStrictDecoder");var ui=s$1(function(hi,pi){return hi<pi?1:-1},"sorter");Ws.decodeHTML=function(){for(var hi=Object.keys(si.default).sort(ui),pi=Object.keys(oi.default).sort(ui),ha=0,ga=0;ha<pi.length;ha++)hi[ga]===pi[ha]?(pi[ha]+=";?",ga++):pi[ha]+=";";var va=new RegExp("&(?:"+pi.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),ba=di(oi.default);function wa(xa){return xa.substr(-1)!==";"&&(xa+=";"),ba(xa)}return s$1(wa,"replacer"),function(xa){return String(xa).replace(va,wa)}}();function di(hi){return s$1(function(pi){if(pi.charAt(1)==="#"){var ha=pi.charAt(2);return ha==="X"||ha==="x"?ai.default(parseInt(pi.substr(3),16)):ai.default(parseInt(pi.substr(2),10))}return hi[pi.slice(1,-1)]||pi},"replace")}s$1(di,"getReplacer")}),mt=D(Ws=>{var ws=Ws&&Ws.__importDefault||function(Ca){return Ca&&Ca.__esModule?Ca:{default:Ca}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.escapeUTF8=Ws.escape=Ws.encodeNonAsciiHTML=Ws.encodeHTML=Ws.encodeXML=void 0;var oi=ws(pt()),si=ui(oi.default),ii=di(si);Ws.encodeXML=xa(si);var ai=ws(dt()),li=ui(ai.default),ci=di(li);Ws.encodeHTML=ga(li,ci),Ws.encodeNonAsciiHTML=xa(li);function ui(Ca){return Object.keys(Ca).sort().reduce(function(el,ku){return el[Ca[ku]]="&"+ku+";",el},{})}s$1(ui,"getInverseObj");function di(Ca){for(var el=[],ku=[],gd=0,Ed=Object.keys(Ca);gd<Ed.length;gd++){var Od=Ed[gd];Od.length===1?el.push("\\"+Od):ku.push(Od)}el.sort();for(var Nd=0;Nd<el.length-1;Nd++){for(var Pd=Nd;Pd<el.length-1&&el[Pd].charCodeAt(1)+1===el[Pd+1].charCodeAt(1);)Pd+=1;var Ld=1+Pd-Nd;Ld<3||el.splice(Nd,Ld,el[Nd]+"-"+el[Pd])}return ku.unshift("["+el.join("")+"]"),new RegExp(ku.join("|"),"g")}s$1(di,"getInverseReplacer");var hi=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,pi=String.prototype.codePointAt!=null?function(Ca){return Ca.codePointAt(0)}:function(Ca){return(Ca.charCodeAt(0)-55296)*1024+Ca.charCodeAt(1)-56320+65536};function ha(Ca){return"&#x"+(Ca.length>1?pi(Ca):Ca.charCodeAt(0)).toString(16).toUpperCase()+";"}s$1(ha,"singleCharReplacer");function ga(Ca,el){return function(ku){return ku.replace(el,function(gd){return Ca[gd]}).replace(hi,ha)}}s$1(ga,"getInverse");var va=new RegExp(ii.source+"|"+hi.source,"g");function ba(Ca){return Ca.replace(va,ha)}s$1(ba,"escape"),Ws.escape=ba;function wa(Ca){return Ca.replace(ii,ha)}s$1(wa,"escapeUTF8"),Ws.escapeUTF8=wa;function xa(Ca){return function(el){return el.replace(va,function(ku){return Ca[ku]||ha(ku)})}}s$1(xa,"getASCIIEncoder")}),yn=D(Ws=>{Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.decodeXMLStrict=Ws.decodeHTML5Strict=Ws.decodeHTML4Strict=Ws.decodeHTML5=Ws.decodeHTML4=Ws.decodeHTMLStrict=Ws.decodeHTML=Ws.decodeXML=Ws.encodeHTML5=Ws.encodeHTML4=Ws.escapeUTF8=Ws.escape=Ws.encodeNonAsciiHTML=Ws.encodeHTML=Ws.encodeXML=Ws.encode=Ws.decodeStrict=Ws.decode=void 0;var ws=ft(),oi=mt();function si(ui,di){return(!di||di<=0?ws.decodeXML:ws.decodeHTML)(ui)}s$1(si,"decode"),Ws.decode=si;function ii(ui,di){return(!di||di<=0?ws.decodeXML:ws.decodeHTMLStrict)(ui)}s$1(ii,"decodeStrict"),Ws.decodeStrict=ii;function ai(ui,di){return(!di||di<=0?oi.encodeXML:oi.encodeHTML)(ui)}s$1(ai,"encode"),Ws.encode=ai;var li=mt();Object.defineProperty(Ws,"encodeXML",{enumerable:!0,get:s$1(function(){return li.encodeXML},"get")}),Object.defineProperty(Ws,"encodeHTML",{enumerable:!0,get:s$1(function(){return li.encodeHTML},"get")}),Object.defineProperty(Ws,"encodeNonAsciiHTML",{enumerable:!0,get:s$1(function(){return li.encodeNonAsciiHTML},"get")}),Object.defineProperty(Ws,"escape",{enumerable:!0,get:s$1(function(){return li.escape},"get")}),Object.defineProperty(Ws,"escapeUTF8",{enumerable:!0,get:s$1(function(){return li.escapeUTF8},"get")}),Object.defineProperty(Ws,"encodeHTML4",{enumerable:!0,get:s$1(function(){return li.encodeHTML},"get")}),Object.defineProperty(Ws,"encodeHTML5",{enumerable:!0,get:s$1(function(){return li.encodeHTML},"get")});var ci=ft();Object.defineProperty(Ws,"decodeXML",{enumerable:!0,get:s$1(function(){return ci.decodeXML},"get")}),Object.defineProperty(Ws,"decodeHTML",{enumerable:!0,get:s$1(function(){return ci.decodeHTML},"get")}),Object.defineProperty(Ws,"decodeHTMLStrict",{enumerable:!0,get:s$1(function(){return ci.decodeHTMLStrict},"get")}),Object.defineProperty(Ws,"decodeHTML4",{enumerable:!0,get:s$1(function(){return ci.decodeHTML},"get")}),Object.defineProperty(Ws,"decodeHTML5",{enumerable:!0,get:s$1(function(){return ci.decodeHTML},"get")}),Object.defineProperty(Ws,"decodeHTML4Strict",{enumerable:!0,get:s$1(function(){return ci.decodeHTMLStrict},"get")}),Object.defineProperty(Ws,"decodeHTML5Strict",{enumerable:!0,get:s$1(function(){return ci.decodeHTMLStrict},"get")}),Object.defineProperty(Ws,"decodeXMLStrict",{enumerable:!0,get:s$1(function(){return ci.decodeXML},"get")})}),An=D((Ws,ws)=>{function oi(Td,wd){if(!(Td instanceof wd))throw new TypeError("Cannot call a class as a function")}s$1(oi,"_classCallCheck");function si(Td,wd){for(var Cd=0;Cd<wd.length;Cd++){var sf=wd[Cd];sf.enumerable=sf.enumerable||!1,sf.configurable=!0,"value"in sf&&(sf.writable=!0),Object.defineProperty(Td,sf.key,sf)}}s$1(si,"_defineProperties");function ii(Td,wd,Cd){return wd&&si(Td.prototype,wd),Cd&&si(Td,Cd),Td}s$1(ii,"_createClass");function ai(Td,wd){var Cd=typeof Symbol<"u"&&Td[Symbol.iterator]||Td["@@iterator"];if(!Cd){if(Array.isArray(Td)||(Cd=li(Td))||wd&&Td&&typeof Td.length=="number"){Cd&&(Td=Cd);var sf=0,of=s$1(function(){},"F");return{s:of,n:s$1(function(){return sf>=Td.length?{done:!0}:{done:!1,value:Td[sf++]}},"n"),e:s$1(function(xd){throw xd},"e"),f:of}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
181
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Wd=!0,df=!1,hf;return{s:s$1(function(){Cd=Cd.call(Td)},"s"),n:s$1(function(){var xd=Cd.next();return Wd=xd.done,xd},"n"),e:s$1(function(xd){df=!0,hf=xd},"e"),f:s$1(function(){try{!Wd&&Cd.return!=null&&Cd.return()}finally{if(df)throw hf}},"f")}}s$1(ai,"_createForOfIteratorHelper");function li(Td,wd){if(Td){if(typeof Td=="string")return ci(Td,wd);var Cd=Object.prototype.toString.call(Td).slice(8,-1);if(Cd==="Object"&&Td.constructor&&(Cd=Td.constructor.name),Cd==="Map"||Cd==="Set")return Array.from(Td);if(Cd==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Cd))return ci(Td,wd)}}s$1(li,"_unsupportedIterableToArray");function ci(Td,wd){(wd==null||wd>Td.length)&&(wd=Td.length);for(var Cd=0,sf=new Array(wd);Cd<wd;Cd++)sf[Cd]=Td[Cd];return sf}s$1(ci,"_arrayLikeToArray");var ui=yn(),di={fg:"#FFF",bg:"#000",newline:!1,escapeXML:!1,stream:!1,colors:hi()};function hi(){var Td={0:"#000",1:"#A00",2:"#0A0",3:"#A50",4:"#00A",5:"#A0A",6:"#0AA",7:"#AAA",8:"#555",9:"#F55",10:"#5F5",11:"#FF5",12:"#55F",13:"#F5F",14:"#5FF",15:"#FFF"};return Ca(0,5).forEach(function(wd){Ca(0,5).forEach(function(Cd){Ca(0,5).forEach(function(sf){return pi(wd,Cd,sf,Td)})})}),Ca(0,23).forEach(function(wd){var Cd=wd+232,sf=ha(wd*10+8);Td[Cd]="#"+sf+sf+sf}),Td}s$1(hi,"getDefaultColors");function pi(Td,wd,Cd,sf){var of=16+Td*36+wd*6+Cd,Wd=Td>0?Td*40+55:0,df=wd>0?wd*40+55:0,hf=Cd>0?Cd*40+55:0;sf[of]=ga([Wd,df,hf])}s$1(pi,"setStyleColor");function ha(Td){for(var wd=Td.toString(16);wd.length<2;)wd="0"+wd;return wd}s$1(ha,"toHexString");function ga(Td){var wd=[],Cd=ai(Td),sf;try{for(Cd.s();!(sf=Cd.n()).done;){var of=sf.value;wd.push(ha(of))}}catch(Wd){Cd.e(Wd)}finally{Cd.f()}return"#"+wd.join("")}s$1(ga,"toColorHexString");function va(Td,wd,Cd,sf){var of;return wd==="text"?of=gd(Cd,sf):wd==="display"?of=wa(Td,Cd,sf):wd==="xterm256Foreground"?of=Nd(Td,sf.colors[Cd]):wd==="xterm256Background"?of=Pd(Td,sf.colors[Cd]):wd==="rgb"&&(of=ba(Td,Cd)),of}s$1(va,"generateOutput");function ba(Td,wd){wd=wd.substring(2).slice(0,-1);var Cd=+wd.substr(0,2),sf=wd.substring(5).split(";"),of=sf.map(function(Wd){return("0"+Number(Wd).toString(16)).substr(-2)}).join("");return Od(Td,(Cd===38?"color:#":"background-color:#")+of)}s$1(ba,"handleRgb");function wa(Td,wd,Cd){wd=parseInt(wd,10);var sf={"-1":s$1(function(){return"<br/>"},"_"),0:s$1(function(){return Td.length&&xa(Td)},"_"),1:s$1(function(){return Ed(Td,"b")},"_"),3:s$1(function(){return Ed(Td,"i")},"_"),4:s$1(function(){return Ed(Td,"u")},"_"),8:s$1(function(){return Od(Td,"display:none")},"_"),9:s$1(function(){return Ed(Td,"strike")},"_"),22:s$1(function(){return Od(Td,"font-weight:normal;text-decoration:none;font-style:normal")},"_"),23:s$1(function(){return Ld(Td,"i")},"_"),24:s$1(function(){return Ld(Td,"u")},"_"),39:s$1(function(){return Nd(Td,Cd.fg)},"_"),49:s$1(function(){return Pd(Td,Cd.bg)},"_"),53:s$1(function(){return Od(Td,"text-decoration:overline")},"_")},of;return sf[wd]?of=sf[wd]():4<wd&&wd<7?of=Ed(Td,"blink"):29<wd&&wd<38?of=Nd(Td,Cd.colors[wd-30]):39<wd&&wd<48?of=Pd(Td,Cd.colors[wd-40]):89<wd&&wd<98?of=Nd(Td,Cd.colors[8+(wd-90)]):99<wd&&wd<108&&(of=Pd(Td,Cd.colors[8+(wd-100)])),of}s$1(wa,"handleDisplay");function xa(Td){var wd=Td.slice(0);return Td.length=0,wd.reverse().map(function(Cd){return"</"+Cd+">"}).join("")}s$1(xa,"resetStyles");function Ca(Td,wd){for(var Cd=[],sf=Td;sf<=wd;sf++)Cd.push(sf);return Cd}s$1(Ca,"range");function el(Td){return function(wd){return(Td===null||wd.category!==Td)&&Td!=="all"}}s$1(el,"notCategory");function ku(Td){Td=parseInt(Td,10);var wd=null;return Td===0?wd="all":Td===1?wd="bold":2<Td&&Td<5?wd="underline":4<Td&&Td<7?wd="blink":Td===8?wd="hide":Td===9?wd="strike":29<Td&&Td<38||Td===39||89<Td&&Td<98?wd="foreground-color":(39<Td&&Td<48||Td===49||99<Td&&Td<108)&&(wd="background-color"),wd}s$1(ku,"categoryForCode");function gd(Td,wd){return wd.escapeXML?ui.encodeXML(Td):Td}s$1(gd,"pushText");function Ed(Td,wd,Cd){return Cd||(Cd=""),Td.push(wd),"<".concat(wd).concat(Cd?' style="'.concat(Cd,'"'):"",">")}s$1(Ed,"pushTag");function Od(Td,wd){return Ed(Td,"span",wd)}s$1(Od,"pushStyle");function Nd(Td,wd){return Ed(Td,"span","color:"+wd)}s$1(Nd,"pushForegroundColor");function Pd(Td,wd){return Ed(Td,"span","background-color:"+wd)}s$1(Pd,"pushBackgroundColor");function Ld(Td,wd){var Cd;if(Td.slice(-1)[0]===wd&&(Cd=Td.pop()),Cd)return"</"+wd+">"}s$1(Ld,"closeTag");function rf(Td,wd,Cd){var sf=!1,of=3;function Wd(){return""}s$1(Wd,"remove");function df(_d,Dd){return Cd("xterm256Foreground",Dd),""}s$1(df,"removeXterm256Foreground");function hf(_d,Dd){return Cd("xterm256Background",Dd),""}s$1(hf,"removeXterm256Background");function xd(_d){return wd.newline?Cd("display",-1):Cd("text",_d),""}s$1(xd,"newline");function Fd(_d,Dd){sf=!0,Dd.trim().length===0&&(Dd="0"),Dd=Dd.trimRight(";").split(";");var tf=ai(Dd),vd;try{for(tf.s();!(vd=tf.n()).done;){var Sd=vd.value;Cd("display",Sd)}}catch(Id){tf.e(Id)}finally{tf.f()}return""}s$1(Fd,"ansiMess");function Vd(_d){return Cd("text",_d),""}s$1(Vd,"realText");function af(_d){return Cd("rgb",_d),""}s$1(af,"rgb");var ff=[{pattern:/^\x08+/,sub:Wd},{pattern:/^\x1b\[[012]?K/,sub:Wd},{pattern:/^\x1b\[\(B/,sub:Wd},{pattern:/^\x1b\[[34]8;2;\d+;\d+;\d+m/,sub:af},{pattern:/^\x1b\[38;5;(\d+)m/,sub:df},{pattern:/^\x1b\[48;5;(\d+)m/,sub:hf},{pattern:/^\n/,sub:xd},{pattern:/^\r+\n/,sub:xd},{pattern:/^\r/,sub:xd},{pattern:/^\x1b\[((?:\d{1,3};?)+|)m/,sub:Fd},{pattern:/^\x1b\[\d?J/,sub:Wd},{pattern:/^\x1b\[\d{0,3};\d{0,3}f/,sub:Wd},{pattern:/^\x1b\[?[\d;]{0,3}/,sub:Wd},{pattern:/^(([^\x1b\x08\r\n])+)/,sub:Vd}];function uf(_d,Dd){Dd>of&&sf||(sf=!1,Td=Td.replace(_d.pattern,_d.sub))}s$1(uf,"process");var mf=[],yf=Td,Sf=yf.length;e:for(;Sf>0;){for(var Of=0,wf=0,Ef=ff.length;wf<Ef;Of=++wf){var xf=ff[Of];if(uf(xf,Of),Td.length!==Sf){Sf=Td.length;continue e}}if(Td.length===Sf)break;mf.push(0),Sf=Td.length}return mf}s$1(rf,"tokenize");function kd(Td,wd,Cd){return wd!=="text"&&(Td=Td.filter(el(ku(Cd))),Td.push({token:wd,data:Cd,category:ku(Cd)})),Td}s$1(kd,"updateStickyStack");var Md=function(){function Td(wd){oi(this,Td),wd=wd||{},wd.colors&&(wd.colors=Object.assign({},di.colors,wd.colors)),this.options=Object.assign({},di,wd),this.stack=[],this.stickyStack=[]}return s$1(Td,"Filter"),ii(Td,[{key:"toHtml",value:s$1(function(wd){var Cd=this;wd=typeof wd=="string"?[wd]:wd;var sf=this.stack,of=this.options,Wd=[];return this.stickyStack.forEach(function(df){var hf=va(sf,df.token,df.data,of);hf&&Wd.push(hf)}),rf(wd.join(""),of,function(df,hf){var xd=va(sf,df,hf,of);xd&&Wd.push(xd),of.stream&&(Cd.stickyStack=kd(Cd.stickyStack,df,hf))}),sf.length&&Wd.push(xa(sf)),Wd.join("")},"toHtml")}]),Td}();ws.exports=Md}),P=(()=>{let Ws;return typeof window<"u"?Ws=window:typeof globalThis<"u"?Ws=globalThis:typeof global<"u"?Ws=global:typeof self<"u"?Ws=self:Ws={},Ws})();function yr(){let Ws={setHandler:s$1(()=>{},"setHandler"),send:s$1(()=>{},"send")};return new z$2({transport:Ws})}s$1(yr,"mockChannel");var gr=class{constructor(){this.getChannel=s$1(()=>{if(!this.channel){let Ws=yr();return this.setChannel(Ws),Ws}return this.channel},"getChannel"),this.ready=s$1(()=>this.promise,"ready"),this.hasChannel=s$1(()=>!!this.channel,"hasChannel"),this.setChannel=s$1(Ws=>{this.channel=Ws,this.resolve()},"setChannel"),this.promise=new Promise(Ws=>{this.resolve=()=>Ws(this.getChannel())})}};s$1(gr,"AddonStore");var hr=gr,mr="__STORYBOOK_ADDONS_PREVIEW";function zn(){return P[mr]||(P[mr]=new hr),P[mr]}s$1(zn,"getAddonsStore");var G=zn(),Rr=class{constructor(){this.hookListsMap=void 0,this.mountedDecorators=void 0,this.prevMountedDecorators=void 0,this.currentHooks=void 0,this.nextHookIndex=void 0,this.currentPhase=void 0,this.currentEffects=void 0,this.prevEffects=void 0,this.currentDecoratorName=void 0,this.hasUpdates=void 0,this.currentContext=void 0,this.renderListener=s$1(Ws=>{var ws;Ws===((ws=this.currentContext)==null?void 0:ws.id)&&(this.triggerEffects(),this.currentContext=null,this.removeRenderListeners())},"renderListener"),this.init()}init(){this.hookListsMap=new WeakMap,this.mountedDecorators=new Set,this.prevMountedDecorators=new Set,this.currentHooks=[],this.nextHookIndex=0,this.currentPhase="NONE",this.currentEffects=[],this.prevEffects=[],this.currentDecoratorName=null,this.hasUpdates=!1,this.currentContext=null}clean(){this.prevEffects.forEach(Ws=>{Ws.destroy&&Ws.destroy()}),this.init(),this.removeRenderListeners()}getNextHook(){let Ws=this.currentHooks[this.nextHookIndex];return this.nextHookIndex+=1,Ws}triggerEffects(){this.prevEffects.forEach(Ws=>{!this.currentEffects.includes(Ws)&&Ws.destroy&&Ws.destroy()}),this.currentEffects.forEach(Ws=>{this.prevEffects.includes(Ws)||(Ws.destroy=Ws.create())}),this.prevEffects=this.currentEffects,this.currentEffects=[]}addRenderListeners(){this.removeRenderListeners(),G.getChannel().on(X$2,this.renderListener)}removeRenderListeners(){G.getChannel().removeListener(X$2,this.renderListener)}};s$1(Rr,"HooksContext");var te=Rr;function Rt(Ws){let ws=s$1((...oi)=>{let{hooks:si}=typeof oi[0]=="function"?oi[1]:oi[0],ii=si.currentPhase,ai=si.currentHooks,li=si.nextHookIndex,ci=si.currentDecoratorName;si.currentDecoratorName=Ws.name,si.prevMountedDecorators.has(Ws)?(si.currentPhase="UPDATE",si.currentHooks=si.hookListsMap.get(Ws)||[]):(si.currentPhase="MOUNT",si.currentHooks=[],si.hookListsMap.set(Ws,si.currentHooks),si.prevMountedDecorators.add(Ws)),si.nextHookIndex=0;let ui=P.STORYBOOK_HOOKS_CONTEXT;P.STORYBOOK_HOOKS_CONTEXT=si;let di=Ws(...oi);if(P.STORYBOOK_HOOKS_CONTEXT=ui,si.currentPhase==="UPDATE"&&si.getNextHook()!=null)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return si.currentPhase=ii,si.currentHooks=ai,si.nextHookIndex=li,si.currentDecoratorName=ci,di},"hookified");return ws.originalFn=Ws,ws}s$1(Rt,"hookify");var br=0,Wn=25,Sr=s$1(Ws=>(ws,oi)=>{let si=Ws(Rt(ws),oi.map(ii=>Rt(ii)));return ii=>{let{hooks:ai}=ii;ai.prevMountedDecorators??(ai.prevMountedDecorators=new Set),ai.mountedDecorators=new Set([ws,...oi]),ai.currentContext=ii,ai.hasUpdates=!1;let li=si(ii);for(br=1;ai.hasUpdates;)if(ai.hasUpdates=!1,ai.currentEffects=[],li=si(ii),br+=1,br>Wn)throw new Error("Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.");return ai.addRenderListeners(),li}},"applyHooks"),$n=s$1((Ws,ws)=>Ws.length===ws.length&&Ws.every((oi,si)=>oi===ws[si]),"areDepsEqual"),Tr=s$1(()=>new Error("Storybook preview hooks can only be called inside decorators and story functions."),"invalidHooksError");function wt(){return P.STORYBOOK_HOOKS_CONTEXT||null}s$1(wt,"getHooksContextOrNull");function xr(){let Ws=wt();if(Ws==null)throw Tr();return Ws}s$1(xr,"getHooksContextOrThrow");function Yn(Ws,ws,oi){let si=xr();if(si.currentPhase==="MOUNT"){oi!=null&&!Array.isArray(oi)&&s$3.warn(`${Ws} received a final argument that is not an array (instead, received ${oi}). When specified, the final argument must be an array.`);let ii={name:Ws,deps:oi};return si.currentHooks.push(ii),ws(ii),ii}if(si.currentPhase==="UPDATE"){let ii=si.getNextHook();if(ii==null)throw new Error("Rendered more hooks than during the previous render.");return ii.name!==Ws&&s$3.warn(`Storybook has detected a change in the order of Hooks${si.currentDecoratorName?` called by ${si.currentDecoratorName}`:""}. This will lead to bugs and errors if not fixed.`),oi!=null&&ii.deps==null&&s$3.warn(`${Ws} received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.`),oi!=null&&ii.deps!=null&&oi.length!==ii.deps.length&&s$3.warn(`The final argument passed to ${Ws} changed size between renders. The order and size of this array must remain constant.
182
- Previous: ${ii.deps}
183
- Incoming: ${oi}`),(oi==null||ii.deps==null||!$n(oi,ii.deps))&&(ws(ii),ii.deps=oi),ii}throw Tr()}s$1(Yn,"useHook");function Be(Ws,ws,oi){let{memoizedState:si}=Yn(Ws,ii=>{ii.memoizedState=ws()},oi);return si}s$1(Be,"useMemoLike");function Kn(Ws,ws){return Be("useMemo",Ws,ws)}s$1(Kn,"useMemo");function ve(Ws,ws){return Be("useCallback",()=>Ws,ws)}s$1(ve,"useCallback");function Et(Ws,ws){return Be(Ws,()=>({current:ws}),[])}s$1(Et,"useRefLike");function Xn(Ws){return Et("useRef",Ws)}s$1(Xn,"useRef");function Jn(){let Ws=wt();if(Ws!=null&&Ws.currentPhase!=="NONE")Ws.hasUpdates=!0;else try{G.getChannel().emit(L$1)}catch{s$3.warn("State updates of Storybook preview hooks work only in browser")}}s$1(Jn,"triggerUpdate");function At(Ws,ws){let oi=Et(Ws,typeof ws=="function"?ws():ws),si=s$1(ii=>{oi.current=typeof ii=="function"?ii(oi.current):ii,Jn()},"setState");return[oi.current,si]}s$1(At,"useStateLike");function Qn(Ws){return At("useState",Ws)}s$1(Qn,"useState");function Zn(Ws,ws,oi){let si=oi!=null?()=>oi(ws):ws,[ii,ai]=At("useReducer",si);return[ii,s$1(li=>ai(ci=>Ws(ci,li)),"dispatch")]}s$1(Zn,"useReducer");function vt(Ws,ws){let oi=xr(),si=Be("useEffect",()=>({create:Ws}),ws);oi.currentEffects.includes(si)||oi.currentEffects.push(si)}s$1(vt,"useEffect");function es(Ws,ws=[]){let oi=G.getChannel();return vt(()=>(Object.entries(Ws).forEach(([si,ii])=>oi.on(si,ii)),()=>{Object.entries(Ws).forEach(([si,ii])=>oi.removeListener(si,ii))}),[...Object.keys(Ws),...ws]),ve(oi.emit.bind(oi),[oi])}s$1(es,"useChannel");function ze(){let{currentContext:Ws}=xr();if(Ws==null)throw Tr();return Ws}s$1(ze,"useStoryContext");function rs(Ws,ws){let{parameters:oi}=ze();if(Ws)return oi[Ws]??ws}s$1(rs,"useParameter");function ts(){let Ws=G.getChannel(),{id:ws,args:oi}=ze(),si=ve(ai=>Ws.emit(z$3,{storyId:ws,updatedArgs:ai}),[Ws,ws]),ii=ve(ai=>Ws.emit(W$3,{storyId:ws,argNames:ai}),[Ws,ws]);return[oi,si,ii]}s$1(ts,"useArgs");function os(){let Ws=G.getChannel(),{globals:ws}=ze(),oi=ve(si=>Ws.emit(j$1,{globals:si}),[Ws]);return[ws,oi]}s$1(os,"useGlobals");function wr(Ws,ws){let oi={},si=Object.entries(Ws);for(let ii=0;ii<si.length;ii++){let[ai,li]=si[ii];ws(li,ai)||(oi[ai]=li)}return oi}s$1(wr,"omitBy");function Er(Ws,ws){let oi={};for(let si=0;si<ws.length;si++){let ii=ws[si];Object.prototype.hasOwnProperty.call(Ws,ii)&&(oi[ii]=Ws[ii])}return oi}s$1(Er,"pick");function Ar(Ws,ws){let oi={},si=Object.entries(Ws);for(let ii=0;ii<si.length;ii++){let[ai,li]=si[ii];ws(li,ai)&&(oi[ai]=li)}return oi}s$1(Ar,"pickBy");function j(Ws){if(typeof Ws!="object"||Ws==null)return!1;if(Object.getPrototypeOf(Ws)===null)return!0;if(Ws.toString()!=="[object Object]")return!1;let ws=Ws;for(;Object.getPrototypeOf(ws)!==null;)ws=Object.getPrototypeOf(ws);return Object.getPrototypeOf(Ws)===ws}s$1(j,"isPlainObject");function q(Ws,ws){let oi={},si=Object.keys(Ws);for(let ii=0;ii<si.length;ii++){let ai=si[ii],li=Ws[ai];oi[ai]=ws(li,ai,Ws)}return oi}s$1(q,"mapValues");var Ct="[object RegExp]",Pt="[object String]",Ft="[object Number]",It="[object Boolean]",vr="[object Arguments]",Ot="[object Symbol]",Dt="[object Date]",kt="[object Map]",jt="[object Set]",Mt="[object Array]",_t="[object Function]",Lt="[object ArrayBuffer]",Ge="[object Object]",Nt="[object Error]",qt="[object DataView]",Bt="[object Uint8Array]",zt="[object Uint8ClampedArray]",Gt="[object Uint16Array]",Vt="[object Uint32Array]",Ut="[object BigUint64Array]",Ht="[object Int8Array]",Wt="[object Int16Array]",$t="[object Int32Array]",Yt="[object BigInt64Array]",Kt="[object Float32Array]",Xt="[object Float64Array]";function Cr(Ws){return Object.getOwnPropertySymbols(Ws).filter(ws=>Object.prototype.propertyIsEnumerable.call(Ws,ws))}s$1(Cr,"getSymbols");function Pr(Ws){return Ws==null?Ws===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(Ws)}s$1(Pr,"getTag");function Fr(Ws,ws){if(typeof Ws==typeof ws)switch(typeof Ws){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return Ws===ws;case"number":return Ws===ws||Object.is(Ws,ws);case"function":return Ws===ws;case"object":return W(Ws,ws)}return W(Ws,ws)}s$1(Fr,"isEqual");function W(Ws,ws,oi){if(Object.is(Ws,ws))return!0;let si=Pr(Ws),ii=Pr(ws);if(si===vr&&(si=Ge),ii===vr&&(ii=Ge),si!==ii)return!1;switch(si){case Pt:return Ws.toString()===ws.toString();case Ft:{let ci=Ws.valueOf(),ui=ws.valueOf();return ci===ui||Number.isNaN(ci)&&Number.isNaN(ui)}case It:case Dt:case Ot:return Object.is(Ws.valueOf(),ws.valueOf());case Ct:return Ws.source===ws.source&&Ws.flags===ws.flags;case _t:return Ws===ws}oi=oi??new Map;let ai=oi.get(Ws),li=oi.get(ws);if(ai!=null&&li!=null)return ai===ws;oi.set(Ws,ws),oi.set(ws,Ws);try{switch(si){case kt:{if(Ws.size!==ws.size)return!1;for(let[ci,ui]of Ws.entries())if(!ws.has(ci)||!W(ui,ws.get(ci),oi))return!1;return!0}case jt:{if(Ws.size!==ws.size)return!1;let ci=Array.from(Ws.values()),ui=Array.from(ws.values());for(let di=0;di<ci.length;di++){let hi=ci[di],pi=ui.findIndex(ha=>W(hi,ha,oi));if(pi===-1)return!1;ui.splice(pi,1)}return!0}case Mt:case Bt:case zt:case Gt:case Vt:case Ut:case Ht:case Wt:case $t:case Yt:case Kt:case Xt:{if(typeof Buffer<"u"&&Buffer.isBuffer(Ws)!==Buffer.isBuffer(ws)||Ws.length!==ws.length)return!1;for(let ci=0;ci<Ws.length;ci++)if(!W(Ws[ci],ws[ci],oi))return!1;return!0}case Lt:return Ws.byteLength!==ws.byteLength?!1:W(new Uint8Array(Ws),new Uint8Array(ws),oi);case qt:return Ws.byteLength!==ws.byteLength||Ws.byteOffset!==ws.byteOffset?!1:W(Ws.buffer,ws.buffer,oi);case Nt:return Ws.name===ws.name&&Ws.message===ws.message;case Ge:{if(!(W(Ws.constructor,ws.constructor,oi)||j(Ws)&&j(ws)))return!1;let ci=[...Object.keys(Ws),...Cr(Ws)],ui=[...Object.keys(ws),...Cr(ws)];if(ci.length!==ui.length)return!1;for(let di=0;di<ci.length;di++){let hi=ci[di],pi=Ws[hi];if(!Object.prototype.hasOwnProperty.call(ws,hi))return!1;let ha=ws[hi];if(!W(pi,ha,oi))return!1}return!0}default:return!1}}finally{oi.delete(Ws),oi.delete(ws)}}s$1(W,"areObjectsEqual");var Xe=ue(Or());function F(Ws){for(var ws=[],oi=1;oi<arguments.length;oi++)ws[oi-1]=arguments[oi];var si=Array.from(typeof Ws=="string"?[Ws]:Ws);si[si.length-1]=si[si.length-1].replace(/\r?\n([\t ]*)$/,"");var ii=si.reduce(function(ci,ui){var di=ui.match(/\n([\t ]+|(?!\s).)/g);return di?ci.concat(di.map(function(hi){var pi,ha;return(ha=(pi=hi.match(/[\t ]/g))===null||pi===void 0?void 0:pi.length)!==null&&ha!==void 0?ha:0})):ci},[]);if(ii.length){var ai=new RegExp(`
184
- [ ]{`+Math.min.apply(Math,ii)+"}","g");si=si.map(function(ci){return ci.replace(ai,`
185
- `)})}si[0]=si[0].replace(/^\r?\n/,"");var li=si[0];return ws.forEach(function(ci,ui){var di=li.match(/(?:^|\n)( *)$/),hi=di?di[1]:"",pi=ci;typeof ci=="string"&&ci.includes(`
186
- `)&&(pi=String(ci).split(`
187
- `).map(function(ha,ga){return ga===0?ha:""+hi+ha}).join(`
188
- `)),li+=pi+si[ui+1]}),li}s$1(F,"dedent");var fe=Symbol("incompatible"),kr=s$1((Ws,ws)=>{let oi=ws.type;if(Ws==null||!oi||ws.mapping)return Ws;switch(oi.name){case"string":return String(Ws);case"enum":return Ws;case"number":return Number(Ws);case"boolean":return String(Ws)==="true";case"array":return!oi.value||!Array.isArray(Ws)?fe:Ws.reduce((si,ii,ai)=>{let li=kr(ii,{type:oi.value});return li!==fe&&(si[ai]=li),si},new Array(Ws.length));case"object":return typeof Ws=="string"||typeof Ws=="number"?Ws:!oi.value||typeof Ws!="object"?fe:Object.entries(Ws).reduce((si,[ii,ai])=>{let li=kr(ai,{type:oi.value[ii]});return li===fe?si:Object.assign(si,{[ii]:li})},{});default:return fe}},"map"),Qt=s$1((Ws,ws)=>Object.entries(Ws).reduce((oi,[si,ii])=>{if(!ws[si])return oi;let ai=kr(ii,ws[si]);return ai===fe?oi:Object.assign(oi,{[si]:ai})},{}),"mapArgsToTypes"),Ce=s$1((Ws,ws)=>Array.isArray(Ws)&&Array.isArray(ws)?ws.reduce((oi,si,ii)=>(oi[ii]=Ce(Ws[ii],ws[ii]),oi),[...Ws]).filter(oi=>oi!==void 0):!j(Ws)||!j(ws)?ws:Object.keys({...Ws,...ws}).reduce((oi,si)=>{if(si in ws){let ii=Ce(Ws[si],ws[si]);ii!==void 0&&(oi[si]=ii)}else oi[si]=Ws[si];return oi},{}),"combineArgs"),Zt=s$1((Ws,ws)=>Object.entries(ws).reduce((oi,[si,{options:ii}])=>{function ai(){return si in Ws&&(oi[si]=Ws[si]),oi}if(s$1(ai,"allowArg"),!ii)return ai();if(!Array.isArray(ii))return n$2.error(F`
189
- Invalid argType: '${si}.options' should be an array.
190
-
191
- More info: https://storybook.js.org/docs/api/arg-types
192
- `),ai();if(ii.some(pi=>pi&&["object","function"].includes(typeof pi)))return n$2.error(F`
193
- Invalid argType: '${si}.options' should only contain primitives. Use a 'mapping' for complex values.
194
-
195
- More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
196
- `),ai();let li=Array.isArray(Ws[si]),ci=li&&Ws[si].findIndex(pi=>!ii.includes(pi)),ui=li&&ci===-1;if(Ws[si]===void 0||ii.includes(Ws[si])||ui)return ai();let di=li?`${si}[${ci}]`:si,hi=ii.map(pi=>typeof pi=="string"?`'${pi}'`:String(pi)).join(", ");return n$2.warn(`Received illegal value for '${di}'. Supported options: ${hi}`),oi},{}),"validateOptions"),oe=Symbol("Deeply equal"),ye=s$1((Ws,ws)=>{if(typeof Ws!=typeof ws)return ws;if(Fr(Ws,ws))return oe;if(Array.isArray(Ws)&&Array.isArray(ws)){let oi=ws.reduce((si,ii,ai)=>{let li=ye(Ws[ai],ii);return li!==oe&&(si[ai]=li),si},new Array(ws.length));return ws.length>=Ws.length?oi:oi.concat(new Array(Ws.length-ws.length).fill(void 0))}return j(Ws)&&j(ws)?Object.keys({...Ws,...ws}).reduce((oi,si)=>{let ii=ye(Ws==null?void 0:Ws[si],ws==null?void 0:ws[si]);return ii===oe?oi:Object.assign(oi,{[si]:ii})},{}):ws},"deepDiff"),jr="UNTARGETED";function eo({args:Ws,argTypes:ws}){let oi={};return Object.entries(Ws).forEach(([si,ii])=>{let{target:ai=jr}=ws[si]||{};oi[ai]=oi[ai]||{},oi[ai][si]=ii}),oi}s$1(eo,"groupArgsByTarget");function ss(Ws){return Object.keys(Ws).forEach(ws=>Ws[ws]===void 0&&delete Ws[ws]),Ws}s$1(ss,"deleteUndefined");var Mr=class{constructor(){this.initialArgsByStoryId={},this.argsByStoryId={}}get(Ws){if(!(Ws in this.argsByStoryId))throw new Error(`No args known for ${Ws} -- has it been rendered yet?`);return this.argsByStoryId[Ws]}setInitial(Ws){if(!this.initialArgsByStoryId[Ws.id])this.initialArgsByStoryId[Ws.id]=Ws.initialArgs,this.argsByStoryId[Ws.id]=Ws.initialArgs;else if(this.initialArgsByStoryId[Ws.id]!==Ws.initialArgs){let ws=ye(this.initialArgsByStoryId[Ws.id],this.argsByStoryId[Ws.id]);this.initialArgsByStoryId[Ws.id]=Ws.initialArgs,this.argsByStoryId[Ws.id]=Ws.initialArgs,ws!==oe&&this.updateFromDelta(Ws,ws)}}updateFromDelta(Ws,ws){let oi=Zt(ws,Ws.argTypes);this.argsByStoryId[Ws.id]=Ce(this.argsByStoryId[Ws.id],oi)}updateFromPersisted(Ws,ws){let oi=Qt(ws,Ws.argTypes);return this.updateFromDelta(Ws,oi)}update(Ws,ws){if(!(Ws in this.argsByStoryId))throw new Error(`No args known for ${Ws} -- has it been rendered yet?`);this.argsByStoryId[Ws]=ss({...this.argsByStoryId[Ws],...ws})}};s$1(Mr,"ArgsStore");var Ve=Mr,Ue=s$1((Ws={})=>Object.entries(Ws).reduce((ws,[oi,{defaultValue:si}])=>(typeof si<"u"&&(ws[oi]=si),ws),{}),"getValuesFromArgTypes"),_r=class{constructor({globals:Ws={},globalTypes:ws={}}){this.set({globals:Ws,globalTypes:ws})}set({globals:Ws={},globalTypes:ws={}}){let oi=this.initialGlobals&&ye(this.initialGlobals,this.globals);this.allowedGlobalNames=new Set([...Object.keys(Ws),...Object.keys(ws)]);let si=Ue(ws);this.initialGlobals={...si,...Ws},this.globals=this.initialGlobals,oi&&oi!==oe&&this.updateFromPersisted(oi)}filterAllowedGlobals(Ws){return Object.entries(Ws).reduce((ws,[oi,si])=>(this.allowedGlobalNames.has(oi)?ws[oi]=si:s$3.warn(`Attempted to set a global (${oi}) that is not defined in initial globals or globalTypes`),ws),{})}updateFromPersisted(Ws){let ws=this.filterAllowedGlobals(Ws);this.globals={...this.globals,...ws}}get(){return this.globals}update(Ws){this.globals={...this.globals,...this.filterAllowedGlobals(Ws)}}};s$1(_r,"GlobalsStore");var He=_r,ro=ue(Or()),ls=(0,ro.default)(1)(Ws=>Object.values(Ws).reduce((ws,oi)=>(ws[oi.importPath]=ws[oi.importPath]||oi,ws),{})),Lr=class{constructor({entries:Ws}={v:5,entries:{}}){this.entries=Ws}entryFromSpecifier(Ws){let ws=Object.values(this.entries);if(Ws==="*")return ws[0];if(typeof Ws=="string")return this.entries[Ws]?this.entries[Ws]:ws.find(ii=>ii.id.startsWith(Ws));let{name:oi,title:si}=Ws;return ws.find(ii=>ii.name===oi&&ii.title===si)}storyIdToEntry(Ws){let ws=this.entries[Ws];if(!ws)throw new D$1({storyId:Ws});return ws}importPathToEntry(Ws){return ls(this.entries)[Ws]}};s$1(Lr,"StoryIndexStore");var We=Lr,cs=s$1(Ws=>typeof Ws=="string"?{name:Ws}:Ws,"normalizeType"),ds=s$1(Ws=>typeof Ws=="string"?{type:Ws}:Ws,"normalizeControl"),ps=s$1((Ws,ws)=>{let{type:oi,control:si,...ii}=Ws,ai={name:ws,...ii};return oi&&(ai.type=cs(oi)),si?ai.control=ds(si):si===!1&&(ai.control={disable:!0}),ai},"normalizeInputType"),ne=s$1(Ws=>q(Ws,ps),"normalizeInputTypes"),C$1=s$1(Ws=>Array.isArray(Ws)?Ws:Ws?[Ws]:[],"normalizeArrays"),hs=F`
197
- CSF .story annotations deprecated; annotate story functions directly:
198
- - StoryFn.story.name => StoryFn.storyName
199
- - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
200
- See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
201
- `;function Pe(Ws,ws,oi){let si=ws,ii=typeof ws=="function"?ws:null,{story:ai}=si;ai&&(s$3.debug("deprecated story",ai),m$2(hs));let li=N(Ws),ci=typeof si!="function"&&si.name||si.storyName||(ai==null?void 0:ai.name)||li,ui=[...C$1(si.decorators),...C$1(ai==null?void 0:ai.decorators)],di={...ai==null?void 0:ai.parameters,...si.parameters},hi={...ai==null?void 0:ai.args,...si.args},pi={...ai==null?void 0:ai.argTypes,...si.argTypes},ha=[...C$1(si.loaders),...C$1(ai==null?void 0:ai.loaders)],ga=[...C$1(si.beforeEach),...C$1(ai==null?void 0:ai.beforeEach)],va=[...C$1(si.experimental_afterEach),...C$1(ai==null?void 0:ai.experimental_afterEach)],{render:ba,play:wa,tags:xa=[],globals:Ca={}}=si,el=di.__id||G$1(oi.id,li);return{moduleExport:ws,id:el,name:ci,tags:xa,decorators:ui,parameters:di,args:hi,argTypes:ne(pi),loaders:ha,beforeEach:ga,experimental_afterEach:va,globals:Ca,...ba&&{render:ba},...ii&&{userStoryFn:ii},...wa&&{play:wa}}}s$1(Pe,"normalizeStory");function $e(Ws,ws=Ws.title,oi){let{id:si,argTypes:ii}=Ws;return{id:O(si||ws),...Ws,title:ws,...ii&&{argTypes:ne(ii)},parameters:{fileName:oi,...Ws.parameters}}}s$1($e,"normalizeComponentAnnotations");var Ss=s$1(Ws=>{let{globals:ws,globalTypes:oi}=Ws;(ws||oi)&&s$3.error("Global args/argTypes can only be set globally",JSON.stringify({globals:ws,globalTypes:oi}))},"checkGlobals"),Ts=s$1(Ws=>{let{options:ws}=Ws;ws!=null&&ws.storySort&&s$3.error("The storySort option parameter can only be set globally")},"checkStorySort"),to=s$1(Ws=>{Ws&&(Ss(Ws),Ts(Ws))},"checkDisallowedParameters");function no(Ws,ws,oi){let{default:si,__namedExportsOrder:ii,...ai}=Ws,li=$e(si,oi,ws);to(li.parameters);let ci={meta:li,stories:{},moduleExports:Ws};return Object.keys(ai).forEach(ui=>{if(M(ui,li)){let di=Pe(ui,ai[ui],li);to(di.parameters),ci.stories[di.id]=di}}),ci}s$1(no,"processCSFFile");function io(Ws){return Ws!=null&&xs(Ws).includes("mount")}s$1(io,"mountDestructured");function xs(Ws){let ws=Ws.toString().match(/[^(]*\(([^)]*)/);if(!ws)return[];let oi=so(ws[1]);if(!oi.length)return[];let si=oi[0];return si.startsWith("{")&&si.endsWith("}")?so(si.slice(1,-1).replace(/\s/g,"")).map(ii=>ii.replace(/:.*|=.*/g,"")):[]}s$1(xs,"getUsedProps");function so(Ws){let ws=[],oi=[],si=0;for(let ai=0;ai<Ws.length;ai++)if(Ws[ai]==="{"||Ws[ai]==="[")oi.push(Ws[ai]==="{"?"}":"]");else if(Ws[ai]===oi[oi.length-1])oi.pop();else if(!oi.length&&Ws[ai]===","){let li=Ws.substring(si,ai).trim();li&&ws.push(li),si=ai+1}let ii=Ws.substring(si).trim();return ii&&ws.push(ii),ws}s$1(so,"splitByComma");function ao(Ws,ws,oi){let si=oi(Ws);return ii=>ws(si,ii)}s$1(ao,"decorateStory");function lo({componentId:Ws,title:ws,kind:oi,id:si,name:ii,story:ai,parameters:li,initialArgs:ci,argTypes:ui,...di}={}){return di}s$1(lo,"sanitizeStoryContextUpdate");function Nr(Ws,ws){let oi={},si=s$1(ai=>li=>{if(!oi.value)throw new Error("Decorated function called without init");return oi.value={...oi.value,...lo(li)},ai(oi.value)},"bindWithContext"),ii=ws.reduce((ai,li)=>ao(ai,li,si),Ws);return ai=>(oi.value=ai,ii(ai))}s$1(Nr,"defaultDecorateStory");var _=s$1((...Ws)=>{let ws={},oi=Ws.filter(Boolean),si=oi.reduce((ii,ai)=>(Object.entries(ai).forEach(([li,ci])=>{let ui=ii[li];Array.isArray(ci)||typeof ui>"u"?ii[li]=ci:j(ci)&&j(ui)?ws[li]=!0:typeof ci<"u"&&(ii[li]=ci)}),ii),{});return Object.keys(ws).forEach(ii=>{let ai=oi.filter(Boolean).map(li=>li[ii]).filter(li=>typeof li<"u");ai.every(li=>j(li))?si[ii]=_(...ai):si[ii]=ai[ai.length-1]}),si},"combineParameters");function Fe(Ws,ws,oi){let{moduleExport:si,id:ii,name:ai}=Ws||{},li=co(Ws,ws,oi),ci=s$1(async Ed=>{let Od={};for(let Nd of[..."__STORYBOOK_TEST_LOADERS__"in P&&Array.isArray(P.__STORYBOOK_TEST_LOADERS__)?[P.__STORYBOOK_TEST_LOADERS__]:[],C$1(oi.loaders),C$1(ws.loaders),C$1(Ws.loaders)]){if(Ed.abortSignal.aborted)return Od;let Pd=await Promise.all(Nd.map(Ld=>Ld(Ed)));Object.assign(Od,...Pd)}return Od},"applyLoaders"),ui=s$1(async Ed=>{let Od=new Array;for(let Nd of[...C$1(oi.beforeEach),...C$1(ws.beforeEach),...C$1(Ws.beforeEach)]){if(Ed.abortSignal.aborted)return Od;let Pd=await Nd(Ed);Pd&&Od.push(Pd)}return Od},"applyBeforeEach"),di=s$1(async Ed=>{let Od=[...C$1(oi.experimental_afterEach),...C$1(ws.experimental_afterEach),...C$1(Ws.experimental_afterEach)].reverse();for(let Nd of Od){if(Ed.abortSignal.aborted)return;await Nd(Ed)}},"applyAfterEach"),hi=s$1(Ed=>Ed.originalStoryFn(Ed.args,Ed),"undecoratedStoryFn"),{applyDecorators:pi=Nr,runStep:ha}=oi,ga=[...C$1(Ws==null?void 0:Ws.decorators),...C$1(ws==null?void 0:ws.decorators),...C$1(oi==null?void 0:oi.decorators)],va=(Ws==null?void 0:Ws.userStoryFn)||(Ws==null?void 0:Ws.render)||ws.render||oi.render,ba=Sr(pi)(hi,ga),wa=s$1(Ed=>ba(Ed),"unboundStoryFn"),xa=(Ws==null?void 0:Ws.play)??(ws==null?void 0:ws.play),Ca=io(xa);if(!va&&!Ca)throw new q$1({id:ii});let el=s$1(Ed=>async()=>(await Ed.renderToCanvas(),Ed.canvas),"defaultMount"),ku=Ws.mount??ws.mount??oi.mount??el,gd=oi.testingLibraryRender;return{storyGlobals:{},...li,moduleExport:si,id:ii,name:ai,story:ai,originalStoryFn:va,undecoratedStoryFn:hi,unboundStoryFn:wa,applyLoaders:ci,applyBeforeEach:ui,applyAfterEach:di,playFunction:xa,runStep:ha,mount:ku,testingLibraryRender:gd,renderToCanvas:oi.renderToCanvas,usesMount:Ca}}s$1(Fe,"prepareStory");function qr(Ws,ws,oi){return{...co(void 0,Ws,ws),moduleExport:oi}}s$1(qr,"prepareMeta");function co(Ws,ws,oi){var si;let ii=["dev","test"],ai=((si=P.DOCS_OPTIONS)==null?void 0:si.autodocs)===!0?["autodocs"]:[],li=z(...ii,...ai,...oi.tags??[],...ws.tags??[],...(Ws==null?void 0:Ws.tags)??[]),ci=_(oi.parameters,ws.parameters,Ws==null?void 0:Ws.parameters),{argTypesEnhancers:ui=[],argsEnhancers:di=[]}=oi,hi=_(oi.argTypes,ws.argTypes,Ws==null?void 0:Ws.argTypes);if(Ws){let Ca=(Ws==null?void 0:Ws.userStoryFn)||(Ws==null?void 0:Ws.render)||ws.render||oi.render;ci.__isArgsStory=Ca&&Ca.length>0}let pi={...oi.args,...ws.args,...Ws==null?void 0:Ws.args},ha={...ws.globals,...Ws==null?void 0:Ws.globals},ga={componentId:ws.id,title:ws.title,kind:ws.title,id:(Ws==null?void 0:Ws.id)||ws.id,name:(Ws==null?void 0:Ws.name)||"__meta",story:(Ws==null?void 0:Ws.name)||"__meta",component:ws.component,subcomponents:ws.subcomponents,tags:li,parameters:ci,initialArgs:pi,argTypes:hi,storyGlobals:ha};ga.argTypes=ui.reduce((Ca,el)=>el({...ga,argTypes:Ca}),ga.argTypes);let va={...pi};ga.initialArgs=di.reduce((Ca,el)=>({...Ca,...el({...ga,initialArgs:Ca})}),va);let{name:ba,story:wa,...xa}=ga;return xa}s$1(co,"preparePartialAnnotations");function Ye(Ws){var ws;let{args:oi}=Ws,si={...Ws,allArgs:void 0,argsByTarget:void 0};if((ws=P.FEATURES)!=null&&ws.argTypeTargetsV7){let li=eo(Ws);si={...Ws,allArgs:Ws.args,argsByTarget:li,args:li[jr]||{}}}let ii=Object.entries(si.args).reduce((li,[ci,ui])=>{var di;if(!((di=si.argTypes[ci])!=null&&di.mapping))return li[ci]=ui,li;let hi=s$1(pi=>{let ha=si.argTypes[ci].mapping;return ha&&pi in ha?ha[pi]:pi},"mappingFn");return li[ci]=Array.isArray(ui)?ui.map(hi):hi(ui),li},{}),ai=Object.entries(ii).reduce((li,[ci,ui])=>{let di=si.argTypes[ci]||{};return P$1(di,ii,si.globals)&&(li[ci]=ui),li},{});return{...si,unmappedArgs:oi,args:ai}}s$1(Ye,"prepareContext");var Br=s$1((Ws,ws,oi)=>{let si=typeof Ws;switch(si){case"boolean":case"string":case"number":case"function":case"symbol":return{name:si}}return Ws?oi.has(Ws)?(s$3.warn(F`
202
- We've detected a cycle in arg '${ws}'. Args should be JSON-serializable.
203
-
204
- Consider using the mapping feature or fully custom args:
205
- - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
206
- - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
207
- `),{name:"other",value:"cyclic object"}):(oi.add(Ws),Array.isArray(Ws)?{name:"array",value:Ws.length>0?Br(Ws[0],ws,new Set(oi)):{name:"other",value:"unknown"}}:{name:"object",value:q(Ws,ii=>Br(ii,ws,new Set(oi)))}):{name:"object",value:{}}},"inferType"),zr=s$1(Ws=>{let{id:ws,argTypes:oi={},initialArgs:si={}}=Ws,ii=q(si,(li,ci)=>({name:ci,type:Br(li,`${ws}.${ci}`,new Set)})),ai=q(oi,(li,ci)=>({name:ci}));return _(ii,ai,oi)},"inferArgTypes");zr.secondPass=!0;var po=s$1((Ws,ws)=>Array.isArray(ws)?ws.includes(Ws):Ws.match(ws),"matches"),Ke=s$1((Ws,ws,oi)=>!ws&&!oi?Ws:Ws&&Ar(Ws,(si,ii)=>{let ai=si.name||ii.toString();return!!(!ws||po(ai,ws))&&(!oi||!po(ai,oi))}),"filterArgTypes"),Cs=s$1((Ws,ws,oi)=>{let{type:si,options:ii}=Ws;if(si){if(oi.color&&oi.color.test(ws)){let ai=si.name;if(ai==="string")return{control:{type:"color"}};ai!=="enum"&&s$3.warn(`Addon controls: Control of type color only supports string, received "${ai}" instead`)}if(oi.date&&oi.date.test(ws))return{control:{type:"date"}};switch(si.name){case"array":return{control:{type:"object"}};case"boolean":return{control:{type:"boolean"}};case"string":return{control:{type:"text"}};case"number":return{control:{type:"number"}};case"enum":{let{value:ai}=si;return{control:{type:(ai==null?void 0:ai.length)<=5?"radio":"select"},options:ai}}case"function":case"symbol":return null;default:return{control:{type:ii?"select":"object"}}}}},"inferControl"),Ie=s$1(Ws=>{let{argTypes:ws,parameters:{__isArgsStory:oi,controls:{include:si=null,exclude:ii=null,matchers:ai={}}={}}}=Ws;if(!oi)return ws;let li=Ke(ws,si,ii),ci=q(li,(ui,di)=>(ui==null?void 0:ui.type)&&Cs(ui,di.toString(),ai));return _(ci,li)},"inferControls");Ie.secondPass=!0;function Oe({argTypes:Ws,globalTypes:ws,argTypesEnhancers:oi,decorators:si,loaders:ii,beforeEach:ai,experimental_afterEach:li,globals:ci,initialGlobals:ui,...di}){return ci&&Object.keys(ci).length>0&&m$2(F`
208
- The preview.js 'globals' field is deprecated and will be removed in Storybook 9.0.
209
- Please use 'initialGlobals' instead. Learn more:
210
-
211
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#previewjs-globals-renamed-to-initialglobals
212
- `),{...Ws&&{argTypes:ne(Ws)},...ws&&{globalTypes:ne(ws)},decorators:C$1(si),loaders:C$1(ii),beforeEach:C$1(ai),experimental_afterEach:C$1(li),argTypesEnhancers:[...oi||[],zr,Ie],initialGlobals:_(ui,ci),...di}}s$1(Oe,"normalizeProjectAnnotations");var uo=s$1(Ws=>async()=>{let ws=[];for(let oi of Ws){let si=await oi();si&&ws.unshift(si)}return async()=>{for(let oi of ws)await oi()}},"composeBeforeAllHooks");function Gr(Ws){return async(ws,oi,si)=>{await Ws.reduceRight((ii,ai)=>async()=>ai(ws,ii,si),async()=>oi(si))()}}s$1(Gr,"composeStepRunners");function ke(Ws,ws){return Ws.map(oi=>{var si;return((si=oi.default)==null?void 0:si[ws])??oi[ws]}).filter(Boolean)}s$1(ke,"getField");function K(Ws,ws,oi={}){return ke(Ws,ws).reduce((si,ii)=>{let ai=C$1(ii);return oi.reverseFileOrder?[...ai,...si]:[...si,...ai]},[])}s$1(K,"getArrayField");function De(Ws,ws){return Object.assign({},...ke(Ws,ws))}s$1(De,"getObjectField");function me(Ws,ws){return ke(Ws,ws).pop()}s$1(me,"getSingletonField");function he(Ws){var ws;let oi=K(Ws,"argTypesEnhancers"),si=ke(Ws,"runStep"),ii=K(Ws,"beforeAll");return{parameters:_(...ke(Ws,"parameters")),decorators:K(Ws,"decorators",{reverseFileOrder:!(((ws=P.FEATURES)==null?void 0:ws.legacyDecoratorFileOrder)??!1)}),args:De(Ws,"args"),argsEnhancers:K(Ws,"argsEnhancers"),argTypes:De(Ws,"argTypes"),argTypesEnhancers:[...oi.filter(ai=>!ai.secondPass),...oi.filter(ai=>ai.secondPass)],globals:De(Ws,"globals"),initialGlobals:De(Ws,"initialGlobals"),globalTypes:De(Ws,"globalTypes"),loaders:K(Ws,"loaders"),beforeAll:uo(ii),beforeEach:K(Ws,"beforeEach"),experimental_afterEach:K(Ws,"experimental_afterEach"),render:me(Ws,"render"),renderToCanvas:me(Ws,"renderToCanvas"),renderToDOM:me(Ws,"renderToDOM"),applyDecorators:me(Ws,"applyDecorators"),runStep:Gr(si),tags:K(Ws,"tags"),mount:me(Ws,"mount"),testingLibraryRender:me(Ws,"testingLibraryRender")}}s$1(he,"composeConfigs");var Vr=class{constructor(){this.reports=[]}async addReport(Ws){this.reports.push(Ws)}};s$1(Vr,"ReporterAPI");var se=Vr;function Os(Ws){globalThis.defaultProjectAnnotations=Ws}s$1(Os,"setDefaultProjectAnnotations");var Ds="ComposedStory",ks="Unnamed Story";function js(Ws){return Ws?he([Ws]):{}}s$1(js,"extractAnnotation");function Ms(Ws){let ws=Array.isArray(Ws)?Ws:[Ws];return globalThis.globalProjectAnnotations=he(ws.map(js)),he([globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{}])}s$1(Ms,"setProjectAnnotations");var X=[];function fo(Ws,ws,oi,si,ii){var ai;if(Ws===void 0)throw new Error("Expected a story but received undefined.");ws.title=ws.title??Ds;let li=$e(ws),ci=ii||Ws.storyName||((ai=Ws.story)==null?void 0:ai.name)||Ws.name||ks,ui=Pe(ci,Ws,li),di=Oe(he([si&&Object.keys(si).length>0?si:globalThis.defaultProjectAnnotations??{},globalThis.globalProjectAnnotations??{},oi??{}])),hi=Fe(ui,li,di),pi={...Ue(di.globalTypes),...di.initialGlobals,...hi.storyGlobals},ha=new se,ga=s$1(()=>{let Ca=Ye({hooks:new te,globals:pi,args:{...hi.initialArgs},viewMode:"story",reporting:ha,loaded:{},abortSignal:new AbortController().signal,step:s$1((el,ku)=>hi.runStep(el,ku,Ca),"step"),canvasElement:null,canvas:{},globalTypes:di.globalTypes,...hi,context:null,mount:null});return Ca.context=Ca,hi.renderToCanvas&&(Ca.renderToCanvas=async()=>{var el;let ku=await((el=hi.renderToCanvas)==null?void 0:el.call(hi,{componentId:hi.componentId,title:hi.title,id:hi.id,name:hi.name,tags:hi.tags,showMain:s$1(()=>{},"showMain"),showError:s$1(gd=>{throw new Error(`${gd.title}
213
- ${gd.description}`)},"showError"),showException:s$1(gd=>{throw gd},"showException"),forceRemount:!0,storyContext:Ca,storyFn:s$1(()=>hi.unboundStoryFn(Ca),"storyFn"),unboundStoryFn:hi.unboundStoryFn},Ca.canvasElement));ku&&X.push(ku)}),Ca.mount=hi.mount(Ca),Ca},"initializeContext"),va,ba=s$1(async Ca=>{var el;let ku=ga();return ku.canvasElement??(ku.canvasElement=(el=globalThis==null?void 0:globalThis.document)==null?void 0:el.body),va&&(ku.loaded=va.loaded),Object.assign(ku,Ca),hi.playFunction(ku)},"play"),wa=s$1(Ca=>{let el=ga();return Object.assign(el,Ca),qs(hi,el)},"run"),xa=hi.playFunction?ba:void 0;return Object.assign(s$1(function(Ca){let el=ga();return va&&(el.loaded=va.loaded),el.args={...el.initialArgs,...Ca},hi.unboundStoryFn(el)},"storyFn"),{id:hi.id,storyName:ci,load:s$1(async()=>{for(let el of[...X].reverse())await el();X.length=0;let Ca=ga();Ca.loaded=await hi.applyLoaders(Ca),X.push(...(await hi.applyBeforeEach(Ca)).filter(Boolean)),va=Ca},"load"),globals:pi,args:hi.initialArgs,parameters:hi.parameters,argTypes:hi.argTypes,play:xa,run:wa,reporting:ha,tags:hi.tags})}s$1(fo,"composeStory");var _s=s$1((Ws,ws,oi,si)=>fo(Ws,ws,oi,{},si),"defaultComposeStory");function Ls(Ws,ws,oi=_s){let{default:si,__esModule:ii,__namedExportsOrder:ai,...li}=Ws;return Object.entries(li).reduce((ci,[ui,di])=>M(ui,si)?Object.assign(ci,{[ui]:oi(di,si,ws,ui)}):ci,{})}s$1(Ls,"composeStories");function Ns(Ws){return Ws.extend({mount:s$1(async({mount:ws,page:oi},si)=>{await si(async(ii,...ai)=>{if(!("__pw_type"in ii)||"__pw_type"in ii&&ii.__pw_type!=="jsx")throw new Error(F`
214
- Portable stories in Playwright CT only work when referencing JSX elements.
215
- Please use JSX format for your components such as:
216
-
217
- instead of:
218
- await mount(MyComponent, { props: { foo: 'bar' } })
219
-
220
- do:
221
- await mount(<MyComponent foo="bar"/>)
222
-
223
- More info: https://storybook.js.org/docs/api/portable-stories-playwright
224
- `);await oi.evaluate(async ci=>{var ui,di,hi;let pi=await((ui=globalThis.__pwUnwrapObject)==null?void 0:ui.call(globalThis,ci));return(hi=(di="__pw_type"in pi?pi.type:pi)==null?void 0:di.load)==null?void 0:hi.call(di)},ii);let li=await ws(ii,...ai);return await oi.evaluate(async ci=>{var ui,di;let hi=await((ui=globalThis.__pwUnwrapObject)==null?void 0:ui.call(globalThis,ci)),pi="__pw_type"in hi?hi.type:hi,ha=document.querySelector("#root");return(di=pi==null?void 0:pi.play)==null?void 0:di.call(pi,{canvasElement:ha})},ii),li})},"mount")})}s$1(Ns,"createPlaywrightTest");async function qs(Ws,ws){var oi,si;for(let li of[...X].reverse())await li();if(X.length=0,!ws.canvasElement){let li=document.createElement("div");(si=(oi=globalThis==null?void 0:globalThis.document)==null?void 0:oi.body)==null||si.appendChild(li),ws.canvasElement=li,X.push(()=>{var ci,ui,di,hi;(ui=(ci=globalThis==null?void 0:globalThis.document)==null?void 0:ci.body)!=null&&ui.contains(li)&&((hi=(di=globalThis==null?void 0:globalThis.document)==null?void 0:di.body)==null||hi.removeChild(li))})}if(ws.loaded=await Ws.applyLoaders(ws),ws.abortSignal.aborted)return;X.push(...(await Ws.applyBeforeEach(ws)).filter(Boolean));let ii=Ws.playFunction,ai=Ws.usesMount;ai||await ws.mount(),!ws.abortSignal.aborted&&(ii&&(ai||(ws.mount=async()=>{throw new J$1({playFunction:ii.toString()})}),await ii(ws)),await Ws.applyAfterEach(ws))}s$1(qs,"runStory");function mo(Ws,ws){return wr(Er(Ws,ws),oi=>oi===void 0)}s$1(mo,"picky");var ho=1e3,Gs=1e4,Ur=class{constructor(Ws,ws,oi){this.importFn=ws,this.getStoriesJsonData=s$1(()=>{let ai=this.getSetStoriesPayload(),li=["fileName","docsOnly","framework","__id","__isArgsStory"];return{v:3,stories:q(ai.stories,ci=>{let{importPath:ui}=this.storyIndex.entries[ci.id];return{...mo(ci,["id","name","title"]),importPath:ui,kind:ci.title,story:ci.name,parameters:{...mo(ci.parameters,li),fileName:ui}}})}},"getStoriesJsonData"),this.storyIndex=new We(Ws),this.projectAnnotations=Oe(oi);let{initialGlobals:si,globalTypes:ii}=this.projectAnnotations;this.args=new Ve,this.userGlobals=new He({globals:si,globalTypes:ii}),this.hooks={},this.cleanupCallbacks={},this.processCSFFileWithCache=(0,Xe.default)(ho)(no),this.prepareMetaWithCache=(0,Xe.default)(ho)(qr),this.prepareStoryWithCache=(0,Xe.default)(Gs)(Fe)}setProjectAnnotations(Ws){this.projectAnnotations=Oe(Ws);let{initialGlobals:ws,globalTypes:oi}=Ws;this.userGlobals.set({globals:ws,globalTypes:oi})}async onStoriesChanged({importFn:Ws,storyIndex:ws}){Ws&&(this.importFn=Ws),ws&&(this.storyIndex.entries=ws.entries),this.cachedCSFFiles&&await this.cacheAllCSFFiles()}async storyIdToEntry(Ws){return this.storyIndex.storyIdToEntry(Ws)}async loadCSFFileByStoryId(Ws){let{importPath:ws,title:oi}=this.storyIndex.storyIdToEntry(Ws),si=await this.importFn(ws);return this.processCSFFileWithCache(si,ws,oi)}async loadAllCSFFiles(){let Ws={};return Object.entries(this.storyIndex.entries).forEach(([ws,{importPath:oi}])=>{Ws[oi]=ws}),(await Promise.all(Object.entries(Ws).map(async([ws,oi])=>({importPath:ws,csfFile:await this.loadCSFFileByStoryId(oi)})))).reduce((ws,{importPath:oi,csfFile:si})=>(ws[oi]=si,ws),{})}async cacheAllCSFFiles(){this.cachedCSFFiles=await this.loadAllCSFFiles()}preparedMetaFromCSFFile({csfFile:Ws}){let ws=Ws.meta;return this.prepareMetaWithCache(ws,this.projectAnnotations,Ws.moduleExports.default)}async loadStory({storyId:Ws}){let ws=await this.loadCSFFileByStoryId(Ws);return this.storyFromCSFFile({storyId:Ws,csfFile:ws})}storyFromCSFFile({storyId:Ws,csfFile:ws}){let oi=ws.stories[Ws];if(!oi)throw new X$1({storyId:Ws});let si=ws.meta,ii=this.prepareStoryWithCache(oi,si,this.projectAnnotations);return this.args.setInitial(ii),this.hooks[ii.id]=this.hooks[ii.id]||new te,ii}componentStoriesFromCSFFile({csfFile:Ws}){return Object.keys(this.storyIndex.entries).filter(ws=>!!Ws.stories[ws]).map(ws=>this.storyFromCSFFile({storyId:ws,csfFile:Ws}))}async loadEntry(Ws){let ws=await this.storyIdToEntry(Ws),oi=ws.type==="docs"?ws.storiesImports:[],[si,...ii]=await Promise.all([this.importFn(ws.importPath),...oi.map(ai=>{let li=this.storyIndex.importPathToEntry(ai);return this.loadCSFFileByStoryId(li.id)})]);return{entryExports:si,csfFiles:ii}}getStoryContext(Ws,{forceInitialArgs:ws=!1}={}){let oi=this.userGlobals.get(),{initialGlobals:si}=this.userGlobals,ii=new se;return Ye({...Ws,args:ws?Ws.initialArgs:this.args.get(Ws.id),initialGlobals:si,globalTypes:this.projectAnnotations.globalTypes,userGlobals:oi,reporting:ii,globals:{...oi,...Ws.storyGlobals},hooks:this.hooks[Ws.id]})}addCleanupCallbacks(Ws,ws){this.cleanupCallbacks[Ws.id]=ws}async cleanupStory(Ws){this.hooks[Ws.id].clean();let ws=this.cleanupCallbacks[Ws.id];if(ws)for(let oi of[...ws].reverse())await oi();delete this.cleanupCallbacks[Ws.id]}extract(Ws={includeDocsOnly:!1}){let{cachedCSFFiles:ws}=this;if(!ws)throw new L;return Object.entries(this.storyIndex.entries).reduce((oi,[si,{type:ii,importPath:ai}])=>{if(ii==="docs")return oi;let li=ws[ai],ci=this.storyFromCSFFile({storyId:si,csfFile:li});return!Ws.includeDocsOnly&&ci.parameters.docsOnly||(oi[si]=Object.entries(ci).reduce((ui,[di,hi])=>di==="moduleExport"||typeof hi=="function"?ui:Array.isArray(hi)?Object.assign(ui,{[di]:hi.slice().sort()}):Object.assign(ui,{[di]:hi}),{args:ci.initialArgs})),oi},{})}getSetStoriesPayload(){let Ws=this.extract({includeDocsOnly:!0}),ws=Object.values(Ws).reduce((oi,{title:si})=>(oi[si]={},oi),{});return{v:2,globals:this.userGlobals.get(),globalParameters:{},kindParameters:ws,stories:Ws}}raw(){return m$2("StoryStore.raw() is deprecated and will be removed in 9.0, please use extract() instead"),Object.values(this.extract()).map(({id:Ws})=>this.fromId(Ws)).filter(Boolean)}fromId(Ws){if(m$2("StoryStore.fromId() is deprecated and will be removed in 9.0, please use loadStory() instead"),!this.cachedCSFFiles)throw new Error("Cannot call fromId/raw() unless you call cacheAllCSFFiles() first.");let ws;try{({importPath:ws}=this.storyIndex.storyIdToEntry(Ws))}catch{return null}let oi=this.cachedCSFFiles[ws],si=this.storyFromCSFFile({storyId:Ws,csfFile:oi});return{...si,storyFn:s$1(ii=>{let ai={...this.getStoryContext(si),abortSignal:new AbortController().signal,canvasElement:null,loaded:{},step:s$1((li,ci)=>si.runStep(li,ci,ai),"step"),context:null,mount:null,canvas:{},viewMode:"story"};return si.unboundStoryFn({...ai,...ii})},"storyFn")}}};s$1(Ur,"StoryStore");var ge=Ur;function Hr(Ws){return Ws.startsWith("\\\\?\\")?Ws:Ws.replace(/\\/g,"/")}s$1(Hr,"slash");function go(Ws){return Ws.flatMap(ws=>ws.split("/")).filter(Boolean).join("/")}s$1(go,"pathJoin");var J$4=new Error("prepareAborted"),{AbortController:wo}=globalThis;function Eo(Ws){try{let{name:ws="Error",message:oi=String(Ws),stack:si}=Ws;return{name:ws,message:oi,stack:si}}catch{return{name:"Error",message:String(Ws)}}}s$1(Eo,"serializeError");var Wr=class{constructor(Ws,ws,oi,si,ii,ai,li={autoplay:!0,forceInitialArgs:!1},ci){this.channel=Ws,this.store=ws,this.renderToScreen=oi,this.callbacks=si,this.id=ii,this.viewMode=ai,this.renderOptions=li,this.type="story",this.notYetRendered=!0,this.rerenderEnqueued=!1,this.disableKeyListeners=!1,this.teardownRender=s$1(()=>{},"teardownRender"),this.torndown=!1,this.abortController=new wo,ci&&(this.story=ci,this.phase="preparing")}async runPhase(Ws,ws,oi){this.phase=ws,this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),oi&&(await oi(),this.checkIfAborted(Ws))}checkIfAborted(Ws){return Ws.aborted?(this.phase="aborted",this.channel.emit(B$2,{newPhase:this.phase,storyId:this.id}),!0):!1}async prepare(){if(await this.runPhase(this.abortController.signal,"preparing",async()=>{this.story=await this.store.loadStory({storyId:this.id})}),this.abortController.signal.aborted)throw await this.store.cleanupStory(this.story),J$4}isEqual(Ws){return!!(this.id===Ws.id&&this.story&&this.story===Ws.story)}isPreparing(){return["preparing"].includes(this.phase)}isPending(){return["loading","beforeEach","rendering","playing","afterEach"].includes(this.phase)}async renderToElement(Ws){return this.canvasElement=Ws,this.render({initial:!0,forceRemount:!0})}storyContext(){if(!this.story)throw new Error("Cannot call storyContext before preparing");let{forceInitialArgs:Ws}=this.renderOptions;return this.store.getStoryContext(this.story,{forceInitialArgs:Ws})}async render({initial:Ws=!1,forceRemount:ws=!1}={}){var oi,si,ii,ai;let{canvasElement:li}=this;if(!this.story)throw new Error("cannot render when not prepared");let ci=this.story;if(!li)throw new Error("cannot render when canvasElement is unset");let{id:ui,componentId:di,title:hi,name:pi,tags:ha,applyLoaders:ga,applyBeforeEach:va,applyAfterEach:ba,unboundStoryFn:wa,playFunction:xa,runStep:Ca}=ci;ws&&!Ws&&(this.cancelRender(),this.abortController=new wo);let el=this.abortController.signal,ku=!1,gd=ci.usesMount;try{let Ed={...this.storyContext(),viewMode:this.viewMode,abortSignal:el,canvasElement:li,loaded:{},step:s$1((wd,Cd)=>Ca(wd,Cd,Ed),"step"),context:null,canvas:{},renderToCanvas:s$1(async()=>{let wd=await this.renderToScreen(Od,li);this.teardownRender=wd||(()=>{}),ku=!0},"renderToCanvas"),mount:s$1(async(...wd)=>{var Cd,sf;(sf=(Cd=this.callbacks).showStoryDuringRender)==null||sf.call(Cd);let of=null;return await this.runPhase(el,"rendering",async()=>{of=await ci.mount(Ed)(...wd)}),gd&&await this.runPhase(el,"playing"),of},"mount")};Ed.context=Ed;let Od={componentId:di,title:hi,kind:hi,id:ui,name:pi,story:pi,tags:ha,...this.callbacks,showError:s$1(wd=>(this.phase="errored",this.callbacks.showError(wd)),"showError"),showException:s$1(wd=>(this.phase="errored",this.callbacks.showException(wd)),"showException"),forceRemount:ws||this.notYetRendered,storyContext:Ed,storyFn:s$1(()=>wa(Ed),"storyFn"),unboundStoryFn:wa};if(await this.runPhase(el,"loading",async()=>{Ed.loaded=await ga(Ed)}),el.aborted)return;let Nd=await va(Ed);if(this.store.addCleanupCallbacks(ci,Nd),this.checkIfAborted(el)||(!ku&&!gd&&await Ed.mount(),this.notYetRendered=!1,el.aborted))return;let Pd=((si=(oi=this.story.parameters)==null?void 0:oi.test)==null?void 0:si.dangerouslyIgnoreUnhandledErrors)===!0,Ld=new Set,rf=s$1(wd=>Ld.add("error"in wd?wd.error:wd.reason),"onError");if(this.renderOptions.autoplay&&ws&&xa&&this.phase!=="errored"){window.addEventListener("error",rf),window.addEventListener("unhandledrejection",rf),this.disableKeyListeners=!0;try{if(gd?await xa(Ed):(Ed.mount=async()=>{throw new J$1({playFunction:xa.toString()})},await this.runPhase(el,"playing",async()=>xa(Ed))),!ku)throw new z$1;this.checkIfAborted(el),!Pd&&Ld.size>0?await this.runPhase(el,"errored"):await this.runPhase(el,"played")}catch(wd){if((ai=(ii=this.callbacks).showStoryDuringRender)==null||ai.call(ii),await this.runPhase(el,"errored",async()=>{this.channel.emit(a,Eo(wd))}),this.story.parameters.throwPlayFunctionExceptions!==!1)throw wd;console.error(wd)}if(!Pd&&Ld.size>0&&this.channel.emit(Y$1,Array.from(Ld).map(Eo)),this.disableKeyListeners=!1,window.removeEventListener("unhandledrejection",rf),window.removeEventListener("error",rf),el.aborted)return}await this.runPhase(el,"completed",async()=>this.channel.emit(X$2,ui)),this.phase!=="errored"&&await this.runPhase(el,"afterEach",async()=>{await ba(Ed)});let kd=!Pd&&Ld.size>0,Md=Ed.reporting.reports.some(wd=>wd.status==="failed"),Td=kd||Md;await this.runPhase(el,"finished",async()=>this.channel.emit(q$3,{storyId:ui,status:Td?"error":"success",reporters:Ed.reporting.reports}))}catch(Ed){this.phase="errored",this.callbacks.showException(Ed),await this.runPhase(el,"finished",async()=>this.channel.emit(q$3,{storyId:ui,status:"error",reporters:[]}))}this.rerenderEnqueued&&(this.rerenderEnqueued=!1,this.render())}async rerender(){if(this.isPending()&&this.phase!=="playing")this.rerenderEnqueued=!0;else return this.render()}async remount(){return await this.teardown(),this.render({forceRemount:!0})}cancelRender(){var Ws;(Ws=this.abortController)==null||Ws.abort()}async teardown(){this.torndown=!0,this.cancelRender(),this.story&&await this.store.cleanupStory(this.story);for(let Ws=0;Ws<3;Ws+=1){if(!this.isPending()){await this.teardownRender();return}await new Promise(ws=>setTimeout(ws,0))}window.location.reload(),await new Promise(()=>{})}};s$1(Wr,"StoryRender");var ie$2=Wr,{fetch:fi}=P,yi="./index.json",$r=class{constructor(Ws,ws,oi=G.getChannel(),si=!0){this.importFn=Ws,this.getProjectAnnotations=ws,this.channel=oi,this.storyRenders=[],this.storeInitializationPromise=new Promise((ii,ai)=>{this.resolveStoreInitializationPromise=ii,this.rejectStoreInitializationPromise=ai}),si&&this.initialize()}get storyStore(){return new Proxy({},{get:s$1((Ws,ws)=>{if(this.storyStoreValue)return m$2("Accessing the Story Store is deprecated and will be removed in 9.0"),this.storyStoreValue[ws];throw new U},"get")})}async initialize(){this.setupListeners();try{let Ws=await this.getProjectAnnotationsOrRenderError();await this.runBeforeAllHook(Ws),await this.initializeWithProjectAnnotations(Ws)}catch(Ws){this.rejectStoreInitializationPromise(Ws)}}ready(){return this.storeInitializationPromise}setupListeners(){this.channel.on(m$1,this.onStoryIndexChanged.bind(this)),this.channel.on(j$1,this.onUpdateGlobals.bind(this)),this.channel.on(z$3,this.onUpdateArgs.bind(this)),this.channel.on(SE,this.onRequestArgTypesInfo.bind(this)),this.channel.on(W$3,this.onResetArgs.bind(this)),this.channel.on(L$1,this.onForceReRender.bind(this)),this.channel.on(U$2,this.onForceRemount.bind(this))}async getProjectAnnotationsOrRenderError(){try{let Ws=await this.getProjectAnnotations();if(this.renderToCanvas=Ws.renderToCanvas,!this.renderToCanvas)throw new G$2;return Ws}catch(Ws){throw this.renderPreviewEntryError("Error reading preview.js:",Ws),Ws}}async initializeWithProjectAnnotations(Ws){this.projectAnnotationsBeforeInitialization=Ws;try{let ws=await this.getStoryIndexFromServer();return this.initializeWithStoryIndex(ws)}catch(ws){throw this.renderPreviewEntryError("Error loading story index:",ws),ws}}async runBeforeAllHook(Ws){var ws,oi;try{await((ws=this.beforeAllCleanup)==null?void 0:ws.call(this)),this.beforeAllCleanup=await((oi=Ws.beforeAll)==null?void 0:oi.call(Ws))}catch(si){throw this.renderPreviewEntryError("Error in beforeAll hook:",si),si}}async getStoryIndexFromServer(){let Ws=await fi(yi);if(Ws.status===200)return Ws.json();throw new M$1({text:await Ws.text()})}initializeWithStoryIndex(Ws){if(!this.projectAnnotationsBeforeInitialization)throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");this.storyStoreValue=new ge(Ws,this.importFn,this.projectAnnotationsBeforeInitialization),delete this.projectAnnotationsBeforeInitialization,this.setInitialGlobals(),this.resolveStoreInitializationPromise()}async setInitialGlobals(){this.emitGlobals()}emitGlobals(){if(!this.storyStoreValue)throw new Y({methodName:"emitGlobals"});let Ws={globals:this.storyStoreValue.userGlobals.get()||{},globalTypes:this.storyStoreValue.projectAnnotations.globalTypes||{}};this.channel.emit(u$1,Ws)}async onGetProjectAnnotationsChanged({getProjectAnnotations:Ws}){delete this.previewEntryError,this.getProjectAnnotations=Ws;let ws=await this.getProjectAnnotationsOrRenderError();if(await this.runBeforeAllHook(ws),!this.storyStoreValue){await this.initializeWithProjectAnnotations(ws);return}this.storyStoreValue.setProjectAnnotations(ws),this.emitGlobals()}async onStoryIndexChanged(){if(delete this.previewEntryError,!(!this.storyStoreValue&&!this.projectAnnotationsBeforeInitialization))try{let Ws=await this.getStoryIndexFromServer();if(this.projectAnnotationsBeforeInitialization){this.initializeWithStoryIndex(Ws);return}await this.onStoriesChanged({storyIndex:Ws})}catch(Ws){throw this.renderPreviewEntryError("Error loading story index:",Ws),Ws}}async onStoriesChanged({importFn:Ws,storyIndex:ws}){if(!this.storyStoreValue)throw new Y({methodName:"onStoriesChanged"});await this.storyStoreValue.onStoriesChanged({importFn:Ws,storyIndex:ws})}async onUpdateGlobals({globals:Ws,currentStory:ws}){if(this.storyStoreValue||await this.storeInitializationPromise,!this.storyStoreValue)throw new Y({methodName:"onUpdateGlobals"});if(this.storyStoreValue.userGlobals.update(Ws),ws){let{initialGlobals:oi,storyGlobals:si,userGlobals:ii,globals:ai}=this.storyStoreValue.getStoryContext(ws);this.channel.emit(P$3,{initialGlobals:oi,userGlobals:ii,storyGlobals:si,globals:ai})}else{let{initialGlobals:oi,globals:si}=this.storyStoreValue.userGlobals;this.channel.emit(P$3,{initialGlobals:oi,userGlobals:si,storyGlobals:{},globals:si})}await Promise.all(this.storyRenders.map(oi=>oi.rerender()))}async onUpdateArgs({storyId:Ws,updatedArgs:ws}){if(!this.storyStoreValue)throw new Y({methodName:"onUpdateArgs"});this.storyStoreValue.args.update(Ws,ws),await Promise.all(this.storyRenders.filter(oi=>oi.id===Ws&&!oi.renderOptions.forceInitialArgs).map(oi=>oi.story&&oi.story.usesMount?oi.remount():oi.rerender())),this.channel.emit(f$2,{storyId:Ws,args:this.storyStoreValue.args.get(Ws)})}async onRequestArgTypesInfo({id:Ws,payload:ws}){var oi;try{await this.storeInitializationPromise;let si=await((oi=this.storyStoreValue)==null?void 0:oi.loadStory(ws));this.channel.emit(TE,{id:Ws,success:!0,payload:{argTypes:(si==null?void 0:si.argTypes)||{}},error:null})}catch(si){this.channel.emit(TE,{id:Ws,success:!1,error:si==null?void 0:si.message})}}async onResetArgs({storyId:Ws,argNames:ws}){var oi;if(!this.storyStoreValue)throw new Y({methodName:"onResetArgs"});let si=((oi=this.storyRenders.find(ai=>ai.id===Ws))==null?void 0:oi.story)||await this.storyStoreValue.loadStory({storyId:Ws}),ii=(ws||[...new Set([...Object.keys(si.initialArgs),...Object.keys(this.storyStoreValue.args.get(Ws))])]).reduce((ai,li)=>(ai[li]=si.initialArgs[li],ai),{});await this.onUpdateArgs({storyId:Ws,updatedArgs:ii})}async onForceReRender(){await Promise.all(this.storyRenders.map(Ws=>Ws.rerender()))}async onForceRemount({storyId:Ws}){await Promise.all(this.storyRenders.filter(ws=>ws.id===Ws).map(ws=>ws.remount()))}renderStoryToElement(Ws,ws,oi,si){if(!this.renderToCanvas||!this.storyStoreValue)throw new Y({methodName:"renderStoryToElement"});let ii=new ie$2(this.channel,this.storyStoreValue,this.renderToCanvas,oi,Ws.id,"docs",si,Ws);return ii.renderToElement(ws),this.storyRenders.push(ii),async()=>{await this.teardownRender(ii)}}async teardownRender(Ws,{viewModeChanged:ws}={}){var oi;this.storyRenders=this.storyRenders.filter(si=>si!==Ws),await((oi=Ws==null?void 0:Ws.teardown)==null?void 0:oi.call(Ws,{viewModeChanged:ws}))}async loadStory({storyId:Ws}){if(!this.storyStoreValue)throw new Y({methodName:"loadStory"});return this.storyStoreValue.loadStory({storyId:Ws})}getStoryContext(Ws,{forceInitialArgs:ws=!1}={}){if(!this.storyStoreValue)throw new Y({methodName:"getStoryContext"});return this.storyStoreValue.getStoryContext(Ws,{forceInitialArgs:ws})}async extract(Ws){if(!this.storyStoreValue)throw new Y({methodName:"extract"});if(this.previewEntryError)throw this.previewEntryError;return await this.storyStoreValue.cacheAllCSFFiles(),this.storyStoreValue.extract(Ws)}renderPreviewEntryError(Ws,ws){this.previewEntryError=ws,s$3.error(Ws),s$3.error(ws),this.channel.emit(N$2,ws)}};s$1($r,"Preview");var be=$r,Yr="Invariant failed";function Je(Ws,ws){if(!Ws){var oi=typeof ws=="function"?ws():ws,si=oi?"".concat(Yr,": ").concat(oi):Yr;throw new Error(si)}}s$1(Je,"invariant");var Kr=class{constructor(Ws,ws,oi,si){this.channel=Ws,this.store=ws,this.renderStoryToElement=oi,this.storyIdByName=s$1(ii=>{let ai=this.nameToStoryId.get(ii);if(ai)return ai;throw new Error(`No story found with that name: ${ii}`)},"storyIdByName"),this.componentStories=s$1(()=>this.componentStoriesValue,"componentStories"),this.componentStoriesFromCSFFile=s$1(ii=>this.store.componentStoriesFromCSFFile({csfFile:ii}),"componentStoriesFromCSFFile"),this.storyById=s$1(ii=>{if(!ii){if(!this.primaryStory)throw new Error("No primary story defined for docs entry. Did you forget to use `<Meta>`?");return this.primaryStory}let ai=this.storyIdToCSFFile.get(ii);if(!ai)throw new Error(`Called \`storyById\` for story that was never loaded: ${ii}`);return this.store.storyFromCSFFile({storyId:ii,csfFile:ai})},"storyById"),this.getStoryContext=s$1(ii=>({...this.store.getStoryContext(ii),loaded:{},viewMode:"docs"}),"getStoryContext"),this.loadStory=s$1(ii=>this.store.loadStory({storyId:ii}),"loadStory"),this.componentStoriesValue=[],this.storyIdToCSFFile=new Map,this.exportToStory=new Map,this.exportsToCSFFile=new Map,this.nameToStoryId=new Map,this.attachedCSFFiles=new Set,si.forEach((ii,ai)=>{this.referenceCSFFile(ii)})}referenceCSFFile(Ws){this.exportsToCSFFile.set(Ws.moduleExports,Ws),this.exportsToCSFFile.set(Ws.moduleExports.default,Ws),this.store.componentStoriesFromCSFFile({csfFile:Ws}).forEach(ws=>{let oi=Ws.stories[ws.id];this.storyIdToCSFFile.set(oi.id,Ws),this.exportToStory.set(oi.moduleExport,ws)})}attachCSFFile(Ws){if(!this.exportsToCSFFile.has(Ws.moduleExports))throw new Error("Cannot attach a CSF file that has not been referenced");this.attachedCSFFiles.has(Ws)||(this.attachedCSFFiles.add(Ws),this.store.componentStoriesFromCSFFile({csfFile:Ws}).forEach(ws=>{this.nameToStoryId.set(ws.name,ws.id),this.componentStoriesValue.push(ws),this.primaryStory||(this.primaryStory=ws)}))}referenceMeta(Ws,ws){let oi=this.resolveModuleExport(Ws);if(oi.type!=="meta")throw new Error("<Meta of={} /> must reference a CSF file module export or meta export. Did you mistakenly reference your component instead of your CSF file?");ws&&this.attachCSFFile(oi.csfFile)}get projectAnnotations(){let{projectAnnotations:Ws}=this.store;if(!Ws)throw new Error("Can't get projectAnnotations from DocsContext before they are initialized");return Ws}resolveAttachedModuleExportType(Ws){if(Ws==="story"){if(!this.primaryStory)throw new Error("No primary story attached to this docs file, did you forget to use <Meta of={} />?");return{type:"story",story:this.primaryStory}}if(this.attachedCSFFiles.size===0)throw new Error("No CSF file attached to this docs file, did you forget to use <Meta of={} />?");let ws=Array.from(this.attachedCSFFiles)[0];if(Ws==="meta")return{type:"meta",csfFile:ws};let{component:oi}=ws.meta;if(!oi)throw new Error("Attached CSF file does not defined a component, did you forget to export one?");return{type:"component",component:oi}}resolveModuleExport(Ws){let ws=this.exportsToCSFFile.get(Ws);if(ws)return{type:"meta",csfFile:ws};let oi=this.exportToStory.get(Ws);return oi?{type:"story",story:oi}:{type:"component",component:Ws}}resolveOf(Ws,ws=[]){let oi;if(["component","meta","story"].includes(Ws)){let si=Ws;oi=this.resolveAttachedModuleExportType(si)}else oi=this.resolveModuleExport(Ws);if(ws.length&&!ws.includes(oi.type)){let si=oi.type==="component"?"component or unknown":oi.type;throw new Error(F`Invalid value passed to the 'of' prop. The value was resolved to a '${si}' type but the only types for this block are: ${ws.join(", ")}.
225
- - Did you pass a component to the 'of' prop when the block only supports a story or a meta?
226
- - ... or vice versa?
227
- - Did you pass a story, CSF file or meta to the 'of' prop that is not indexed, ie. is not targeted by the 'stories' globs in the main configuration?`)}switch(oi.type){case"component":return{...oi,projectAnnotations:this.projectAnnotations};case"meta":return{...oi,preparedMeta:this.store.preparedMetaFromCSFFile({csfFile:oi.csfFile})};case"story":default:return oi}}};s$1(Kr,"DocsContext");var Q=Kr,Xr=class{constructor(Ws,ws,oi,si){this.channel=Ws,this.store=ws,this.entry=oi,this.callbacks=si,this.type="docs",this.subtype="csf",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=oi.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:Ws,csfFiles:ws=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw J$4;let{importPath:oi,title:si}=this.entry,ii=this.store.processCSFFileWithCache(Ws,oi,si),ai=Object.keys(ii.stories)[0];this.story=this.store.storyFromCSFFile({storyId:ai,csfFile:ii}),this.csfFiles=[ii,...ws],this.preparing=!1}isEqual(Ws){return!!(this.id===Ws.id&&this.story&&this.story===Ws.story)}docsContext(Ws){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");let ws=new Q(this.channel,this.store,Ws,this.csfFiles);return this.csfFiles.forEach(oi=>ws.attachCSFFile(oi)),ws}async renderToElement(Ws,ws){if(!this.story||!this.csfFiles)throw new Error("Cannot render docs before preparing");let oi=this.docsContext(ws),{docs:si}=this.story.parameters||{};if(!si)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let ii=await si.renderer(),{render:ai}=ii,li=s$1(async()=>{try{await ai(oi,si,Ws),this.channel.emit(I$2,this.id)}catch(ci){this.callbacks.showException(ci)}},"renderDocs");return this.rerender=async()=>li(),this.teardownRender=async({viewModeChanged:ci})=>{!ci||!Ws||ii.unmount(Ws)},li()}async teardown({viewModeChanged:Ws}={}){var ws;(ws=this.teardownRender)==null||ws.call(this,{viewModeChanged:Ws}),this.torndown=!0}};s$1(Xr,"CsfDocsRender");var je=Xr,Jr=class{constructor(Ws,ws,oi,si){this.channel=Ws,this.store=ws,this.entry=oi,this.callbacks=si,this.type="docs",this.subtype="mdx",this.torndown=!1,this.disableKeyListeners=!1,this.preparing=!1,this.id=oi.id}isPreparing(){return this.preparing}async prepare(){this.preparing=!0;let{entryExports:Ws,csfFiles:ws=[]}=await this.store.loadEntry(this.id);if(this.torndown)throw J$4;this.csfFiles=ws,this.exports=Ws,this.preparing=!1}isEqual(Ws){return!!(this.id===Ws.id&&this.exports&&this.exports===Ws.exports)}docsContext(Ws){if(!this.csfFiles)throw new Error("Cannot render docs before preparing");return new Q(this.channel,this.store,Ws,this.csfFiles)}async renderToElement(Ws,ws){if(!this.exports||!this.csfFiles||!this.store.projectAnnotations)throw new Error("Cannot render docs before preparing");let oi=this.docsContext(ws),{docs:si}=this.store.projectAnnotations.parameters||{};if(!si)throw new Error("Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed");let ii={...si,page:this.exports.default},ai=await si.renderer(),{render:li}=ai,ci=s$1(async()=>{try{await li(oi,ii,Ws),this.channel.emit(I$2,this.id)}catch(ui){this.callbacks.showException(ui)}},"renderDocs");return this.rerender=async()=>ci(),this.teardownRender=async({viewModeChanged:ui}={})=>{!ui||!Ws||(ai.unmount(Ws),this.torndown=!0)},ci()}async teardown({viewModeChanged:Ws}={}){var ws;(ws=this.teardownRender)==null||ws.call(this,{viewModeChanged:Ws}),this.torndown=!0}};s$1(Jr,"MdxDocsRender");var Me=Jr,Di=globalThis;function ki(Ws){let ws=Ws.composedPath&&Ws.composedPath()[0]||Ws.target;return/input|textarea/i.test(ws.tagName)||ws.getAttribute("contenteditable")!==null}s$1(ki,"focusInInput");var Do="attached-mdx",ji="unattached-mdx";function Mi({tags:Ws}){return(Ws==null?void 0:Ws.includes(ji))||(Ws==null?void 0:Ws.includes(Do))}s$1(Mi,"isMdxEntry");function Zr(Ws){return Ws.type==="story"}s$1(Zr,"isStoryRender");function _i(Ws){return Ws.type==="docs"}s$1(_i,"isDocsRender");function Li(Ws){return _i(Ws)&&Ws.subtype==="csf"}s$1(Li,"isCsfDocsRender");var et=class extends be{constructor(Ws,ws,oi,si){super(Ws,ws,void 0,!1),this.importFn=Ws,this.getProjectAnnotations=ws,this.selectionStore=oi,this.view=si,this.initialize()}setupListeners(){super.setupListeners(),Di.onkeydown=this.onKeydown.bind(this),this.channel.on(M$3,this.onSetCurrentStory.bind(this)),this.channel.on(k$4,this.onUpdateQueryParams.bind(this)),this.channel.on(t$4,this.onPreloadStories.bind(this))}async setInitialGlobals(){if(!this.storyStoreValue)throw new Y({methodName:"setInitialGlobals"});let{globals:Ws}=this.selectionStore.selectionSpecifier||{};Ws&&this.storyStoreValue.userGlobals.updateFromPersisted(Ws),this.emitGlobals()}async initializeWithStoryIndex(Ws){return await super.initializeWithStoryIndex(Ws),this.selectSpecifiedStory()}async selectSpecifiedStory(){if(!this.storyStoreValue)throw new Y({methodName:"selectSpecifiedStory"});if(this.selectionStore.selection){await this.renderSelection();return}if(!this.selectionStore.selectionSpecifier){this.renderMissingStory();return}let{storySpecifier:Ws,args:ws}=this.selectionStore.selectionSpecifier,oi=this.storyStoreValue.storyIndex.entryFromSpecifier(Ws);if(!oi){Ws==="*"?this.renderStoryLoadingException(Ws,new F$2):this.renderStoryLoadingException(Ws,new K$1({storySpecifier:Ws.toString()}));return}let{id:si,type:ii}=oi;this.selectionStore.setSelection({storyId:si,viewMode:ii}),this.channel.emit(b$2,this.selectionStore.selection),this.channel.emit(r$2,this.selectionStore.selection),await this.renderSelection({persistedArgs:ws})}async onGetProjectAnnotationsChanged({getProjectAnnotations:Ws}){await super.onGetProjectAnnotationsChanged({getProjectAnnotations:Ws}),this.selectionStore.selection&&this.renderSelection()}async onStoriesChanged({importFn:Ws,storyIndex:ws}){await super.onStoriesChanged({importFn:Ws,storyIndex:ws}),this.selectionStore.selection?await this.renderSelection():await this.selectSpecifiedStory()}onKeydown(Ws){if(!this.storyRenders.find(ws=>ws.disableKeyListeners)&&!ki(Ws)){let{altKey:ws,ctrlKey:oi,metaKey:si,shiftKey:ii,key:ai,code:li,keyCode:ci}=Ws;this.channel.emit(H$2,{event:{altKey:ws,ctrlKey:oi,metaKey:si,shiftKey:ii,key:ai,code:li,keyCode:ci}})}}async onSetCurrentStory(Ws){this.selectionStore.setSelection({viewMode:"story",...Ws}),await this.storeInitializationPromise,this.channel.emit(r$2,this.selectionStore.selection),this.renderSelection()}onUpdateQueryParams(Ws){this.selectionStore.setQueryParams(Ws)}async onUpdateGlobals({globals:Ws}){var ws,oi;let si=this.currentRender instanceof ie$2&&this.currentRender.story||void 0;super.onUpdateGlobals({globals:Ws,currentStory:si}),(this.currentRender instanceof Me||this.currentRender instanceof je)&&await((oi=(ws=this.currentRender).rerender)==null?void 0:oi.call(ws))}async onUpdateArgs({storyId:Ws,updatedArgs:ws}){super.onUpdateArgs({storyId:Ws,updatedArgs:ws})}async onPreloadStories({ids:Ws}){await this.storeInitializationPromise,this.storyStoreValue&&await Promise.allSettled(Ws.map(ws=>{var oi;return(oi=this.storyStoreValue)==null?void 0:oi.loadEntry(ws)}))}async renderSelection({persistedArgs:Ws}={}){var ws,oi,si,ii;let{renderToCanvas:ai}=this;if(!this.storyStoreValue||!ai)throw new Y({methodName:"renderSelection"});let{selection:li}=this.selectionStore;if(!li)throw new Error("Cannot call renderSelection as no selection was made");let{storyId:ci}=li,ui;try{ui=await this.storyStoreValue.storyIdToEntry(ci)}catch(ba){this.currentRender&&await this.teardownRender(this.currentRender),this.renderStoryLoadingException(ci,ba);return}let di=((ws=this.currentSelection)==null?void 0:ws.storyId)!==ci,hi=((oi=this.currentRender)==null?void 0:oi.type)!==ui.type;ui.type==="story"?this.view.showPreparingStory({immediate:hi}):this.view.showPreparingDocs({immediate:hi}),(si=this.currentRender)!=null&&si.isPreparing()&&await this.teardownRender(this.currentRender);let pi;ui.type==="story"?pi=new ie$2(this.channel,this.storyStoreValue,ai,this.mainStoryCallbacks(ci),ci,"story"):Mi(ui)?pi=new Me(this.channel,this.storyStoreValue,ui,this.mainStoryCallbacks(ci)):pi=new je(this.channel,this.storyStoreValue,ui,this.mainStoryCallbacks(ci));let ha=this.currentSelection;this.currentSelection=li;let ga=this.currentRender;this.currentRender=pi;try{await pi.prepare()}catch(ba){ga&&await this.teardownRender(ga),ba!==J$4&&this.renderStoryLoadingException(ci,ba);return}let va=!di&&ga&&!pi.isEqual(ga);if(Ws&&Zr(pi)&&(Je(!!pi.story),this.storyStoreValue.args.updateFromPersisted(pi.story,Ws)),ga&&!ga.torndown&&!di&&!va&&!hi){this.currentRender=ga,this.channel.emit(n$1,ci),this.view.showMain();return}if(ga&&await this.teardownRender(ga,{viewModeChanged:hi}),ha&&(di||hi)&&this.channel.emit(Q$1,ci),Zr(pi)){Je(!!pi.story);let{parameters:ba,initialArgs:wa,argTypes:xa,unmappedArgs:Ca,initialGlobals:el,userGlobals:ku,storyGlobals:gd,globals:Ed}=this.storyStoreValue.getStoryContext(pi.story);this.channel.emit(w$2,{id:ci,parameters:ba,initialArgs:wa,argTypes:xa,args:Ca}),this.channel.emit(P$3,{userGlobals:ku,storyGlobals:gd,globals:Ed,initialGlobals:el})}else{let{parameters:ba}=this.storyStoreValue.projectAnnotations,{initialGlobals:wa,globals:xa}=this.storyStoreValue.userGlobals;if(this.channel.emit(P$3,{globals:xa,initialGlobals:wa,storyGlobals:{},userGlobals:xa}),Li(pi)||((ii=pi.entry.tags)==null?void 0:ii.includes(Do))){if(!pi.csfFiles)throw new H({storyId:ci});({parameters:ba}=this.storyStoreValue.preparedMetaFromCSFFile({csfFile:pi.csfFiles[0]}))}this.channel.emit(D$3,{id:ci,parameters:ba})}Zr(pi)?(Je(!!pi.story),this.storyRenders.push(pi),this.currentRender.renderToElement(this.view.prepareForStory(pi.story))):this.currentRender.renderToElement(this.view.prepareForDocs(),this.renderStoryToElement.bind(this))}async teardownRender(Ws,{viewModeChanged:ws=!1}={}){var oi;this.storyRenders=this.storyRenders.filter(si=>si!==Ws),await((oi=Ws==null?void 0:Ws.teardown)==null?void 0:oi.call(Ws,{viewModeChanged:ws}))}mainStoryCallbacks(Ws){return{showStoryDuringRender:s$1(()=>this.view.showStoryDuringRender(),"showStoryDuringRender"),showMain:s$1(()=>this.view.showMain(),"showMain"),showError:s$1(ws=>this.renderError(Ws,ws),"showError"),showException:s$1(ws=>this.renderException(Ws,ws),"showException")}}renderPreviewEntryError(Ws,ws){super.renderPreviewEntryError(Ws,ws),this.view.showErrorDisplay(ws)}renderMissingStory(){this.view.showNoPreview(),this.channel.emit(V$1)}renderStoryLoadingException(Ws,ws){s$3.error(ws),this.view.showErrorDisplay(ws),this.channel.emit(V$1,Ws)}renderException(Ws,ws){let{name:oi="Error",message:si=String(ws),stack:ii}=ws;this.channel.emit(K$2,{name:oi,message:si,stack:ii}),this.channel.emit(B$2,{newPhase:"errored",storyId:Ws}),this.view.showErrorDisplay(ws),s$3.error(`Error rendering story '${Ws}':`),s$3.error(ws)}renderError(Ws,{title:ws,description:oi}){s$3.error(`Error rendering story ${ws}: ${oi}`),this.channel.emit(x$3,{title:ws,description:oi}),this.channel.emit(B$2,{newPhase:"errored",storyId:Ws}),this.view.showErrorDisplay({message:ws,stack:oi})}};s$1(et,"PreviewWithSelection");var Se=et,Le=ue(or()),Ho=ue(or()),Uo=/^[a-zA-Z0-9 _-]*$/,Wo=/^-?[0-9]+(\.[0-9]+)?$/,da=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,$o=/^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,at=s$1((Ws="",ws)=>Ws===null||Ws===""||!Uo.test(Ws)?!1:ws==null||ws instanceof Date||typeof ws=="number"||typeof ws=="boolean"?!0:typeof ws=="string"?Uo.test(ws)||Wo.test(ws)||da.test(ws)||$o.test(ws):Array.isArray(ws)?ws.every(oi=>at(Ws,oi)):j(ws)?Object.entries(ws).every(([oi,si])=>at(oi,si)):!1,"validateArgs"),pa={delimiter:";",nesting:!0,arrayRepeat:!0,arrayRepeatSyntax:"bracket",nestingSyntax:"js",valueDeserializer(Ws){if(Ws.startsWith("!")){if(Ws==="!undefined")return;if(Ws==="!null")return null;if(Ws==="!true")return!0;if(Ws==="!false")return!1;if(Ws.startsWith("!date(")&&Ws.endsWith(")"))return new Date(Ws.replaceAll(" ","+").slice(6,-1));if(Ws.startsWith("!hex(")&&Ws.endsWith(")"))return`#${Ws.slice(5,-1)}`;let ws=Ws.slice(1).match($o);if(ws)return Ws.startsWith("!rgba")||Ws.startsWith("!RGBA")?`${ws[1]}(${ws[2]}, ${ws[3]}, ${ws[4]}, ${ws[5]})`:Ws.startsWith("!hsla")||Ws.startsWith("!HSLA")?`${ws[1]}(${ws[2]}, ${ws[3]}%, ${ws[4]}%, ${ws[5]})`:Ws.startsWith("!rgb")||Ws.startsWith("!RGB")?`${ws[1]}(${ws[2]}, ${ws[3]}, ${ws[4]})`:`${ws[1]}(${ws[2]}, ${ws[3]}%, ${ws[4]}%)`}return Wo.test(Ws)?Number(Ws):Ws}},lt=s$1(Ws=>{let ws=Ws.split(";").map(oi=>oi.replace("=","~").replace(":","="));return Object.entries((0,Ho.parse)(ws.join(";"),pa)).reduce((oi,[si,ii])=>at(si,ii)?Object.assign(oi,{[si]:ii}):(n$2.warn(F`
228
- Omitted potentially unsafe URL args.
229
-
230
- More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
231
- `),oi),{})},"parseArgsParam"),{history:Yo,document:Z}=P;function ua(Ws){let ws=(Ws||"").match(/^\/story\/(.+)/);if(!ws)throw new Error(`Invalid path '${Ws}', must start with '/story/'`);return ws[1]}s$1(ua,"pathToId");var Ko=s$1(({selection:Ws,extraParams:ws})=>{let oi=Z==null?void 0:Z.location.search.slice(1),{path:si,selectedKind:ii,selectedStory:ai,...li}=(0,Le.parse)(oi);return`?${(0,Le.stringify)({...li,...ws,...Ws&&{id:Ws.storyId,viewMode:Ws.viewMode}})}`},"getQueryString"),fa=s$1(Ws=>{if(!Ws)return;let ws=Ko({selection:Ws}),{hash:oi=""}=Z.location;Z.title=Ws.storyId,Yo.replaceState({},"",`${Z.location.pathname}${ws}${oi}`)},"setPath"),ya=s$1(Ws=>Ws!=null&&typeof Ws=="object"&&Array.isArray(Ws)===!1,"isObject"),_e=s$1(Ws=>{if(Ws!==void 0){if(typeof Ws=="string")return Ws;if(Array.isArray(Ws))return _e(Ws[0]);if(ya(Ws))return _e(Object.values(Ws).filter(Boolean))}},"getFirstString"),ma=s$1(()=>{if(typeof Z<"u"){let Ws=Z.location.search.slice(1),ws=(0,Le.parse)(Ws),oi=typeof ws.args=="string"?lt(ws.args):void 0,si=typeof ws.globals=="string"?lt(ws.globals):void 0,ii=_e(ws.viewMode);(typeof ii!="string"||!ii.match(/docs|story/))&&(ii="story");let ai=_e(ws.path),li=ai?ua(ai):_e(ws.id);if(li)return{storySpecifier:li,args:oi,globals:si,viewMode:ii}}return null},"getSelectionSpecifierFromPath"),ct=class{constructor(){this.selectionSpecifier=ma()}setSelection(Ws){this.selection=Ws,fa(this.selection)}setQueryParams(Ws){let ws=Ko({extraParams:Ws}),{hash:oi=""}=Z.location;Yo.replaceState({},"",`${Z.location.pathname}${ws}${oi}`)}};s$1(ct,"UrlStore");var Te=ct,Pn=ue(An()),Fn=ue(or()),{document:k$5}=P,vn=100,In=(Ws=>(Ws.MAIN="MAIN",Ws.NOPREVIEW="NOPREVIEW",Ws.PREPARING_STORY="PREPARING_STORY",Ws.PREPARING_DOCS="PREPARING_DOCS",Ws.ERROR="ERROR",Ws))(In||{}),ht={PREPARING_STORY:"sb-show-preparing-story",PREPARING_DOCS:"sb-show-preparing-docs",MAIN:"sb-show-main",NOPREVIEW:"sb-show-nopreview",ERROR:"sb-show-errordisplay"},gt={centered:"sb-main-centered",fullscreen:"sb-main-fullscreen",padded:"sb-main-padded"},Cn=new Pn.default({escapeXML:!0}),bt=class{constructor(){if(this.testing=!1,typeof k$5<"u"){let{__SPECIAL_TEST_PARAMETER__:Ws}=(0,Fn.parse)(k$5.location.search.slice(1));switch(Ws){case"preparing-story":{this.showPreparingStory(),this.testing=!0;break}case"preparing-docs":{this.showPreparingDocs(),this.testing=!0;break}}}}prepareForStory(Ws){return this.showStory(),this.applyLayout(Ws.parameters.layout),k$5.documentElement.scrollTop=0,k$5.documentElement.scrollLeft=0,this.storyRoot()}storyRoot(){return k$5.getElementById("storybook-root")}prepareForDocs(){return this.showMain(),this.showDocs(),this.applyLayout("fullscreen"),k$5.documentElement.scrollTop=0,k$5.documentElement.scrollLeft=0,this.docsRoot()}docsRoot(){return k$5.getElementById("storybook-docs")}applyLayout(Ws="padded"){if(Ws==="none"){k$5.body.classList.remove(this.currentLayoutClass),this.currentLayoutClass=null;return}this.checkIfLayoutExists(Ws);let ws=gt[Ws];k$5.body.classList.remove(this.currentLayoutClass),k$5.body.classList.add(ws),this.currentLayoutClass=ws}checkIfLayoutExists(Ws){gt[Ws]||s$3.warn(F`
232
- The desired layout: ${Ws} is not a valid option.
233
- The possible options are: ${Object.keys(gt).join(", ")}, none.
234
- `)}showMode(Ws){clearTimeout(this.preparingTimeout),Object.keys(In).forEach(ws=>{ws===Ws?k$5.body.classList.add(ht[ws]):k$5.body.classList.remove(ht[ws])})}showErrorDisplay({message:Ws="",stack:ws=""}){let oi=Ws,si=ws,ii=Ws.split(`
235
- `);ii.length>1&&([oi]=ii,si=ii.slice(1).join(`
236
- `).replace(/^\n/,"")),k$5.getElementById("error-message").innerHTML=Cn.toHtml(oi),k$5.getElementById("error-stack").innerHTML=Cn.toHtml(si),this.showMode("ERROR")}showNoPreview(){var Ws,ws;this.testing||(this.showMode("NOPREVIEW"),(Ws=this.storyRoot())==null||Ws.setAttribute("hidden","true"),(ws=this.docsRoot())==null||ws.setAttribute("hidden","true"))}showPreparingStory({immediate:Ws=!1}={}){clearTimeout(this.preparingTimeout),Ws?this.showMode("PREPARING_STORY"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_STORY"),vn)}showPreparingDocs({immediate:Ws=!1}={}){clearTimeout(this.preparingTimeout),Ws?this.showMode("PREPARING_DOCS"):this.preparingTimeout=setTimeout(()=>this.showMode("PREPARING_DOCS"),vn)}showMain(){this.showMode("MAIN")}showDocs(){this.storyRoot().setAttribute("hidden","true"),this.docsRoot().removeAttribute("hidden")}showStory(){this.docsRoot().setAttribute("hidden","true"),this.storyRoot().removeAttribute("hidden")}showStoryDuringRender(){k$5.body.classList.add(ht.MAIN)}};s$1(bt,"WebView");var xe=bt,St=class extends Se{constructor(Ws,ws){super(Ws,ws,new Te,new xe),this.importFn=Ws,this.getProjectAnnotations=ws,P.__STORYBOOK_PREVIEW__=this}};s$1(St,"PreviewWeb");var{document:de}=P,Ja=["application/javascript","application/ecmascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript","module"],Qa="script",On="scripts-root";function ur(){let Ws=de.createEvent("Event");Ws.initEvent("DOMContentLoaded",!0,!0),de.dispatchEvent(Ws)}s$1(ur,"simulateDOMContentLoaded");function Za(Ws,ws,oi){let si=de.createElement("script");si.type=Ws.type==="module"?"module":"text/javascript",Ws.src?(si.onload=ws,si.onerror=ws,si.src=Ws.src):si.textContent=Ws.innerText,oi?oi.appendChild(si):de.head.appendChild(si),Ws.parentNode.removeChild(Ws),Ws.src||ws()}s$1(Za,"insertScript");function Dn(Ws,ws,oi=0){Ws[oi](()=>{oi++,oi===Ws.length?ws():Dn(Ws,ws,oi)})}s$1(Dn,"insertScriptsSequentially");function kn(Ws){let ws=de.getElementById(On);ws?ws.innerHTML="":(ws=de.createElement("div"),ws.id=On,de.body.appendChild(ws));let oi=Array.from(Ws.querySelectorAll(Qa));if(oi.length){let si=[];oi.forEach(ii=>{let ai=ii.getAttribute("type");(!ai||Ja.includes(ai))&&si.push(li=>Za(ii,li,ws))}),si.length&&Dn(si,ur,void 0)}else ur()}s$1(kn,"simulatePageLoad");const FormFieldContext=React__default.createContext({}),FormItemContext=React__default.createContext({}),useFormField=()=>{const Ws=React__default.useContext(FormFieldContext),ws=React__default.useContext(FormItemContext),{getFieldState:oi,formState:si}=$n$2(),ii=oi(Ws.name,si);if(!Ws)throw new Error("useFormField should be used within <FormField>");const{id:ai}=ws;return{id:ai,name:Ws.name,formItemId:`${ai}-form-item`,formDescriptionId:`${ai}-form-item-description`,formMessageId:`${ai}-form-item-message`,...ii}},Form=$d,FormField=({...Ws})=>jsx(FormFieldContext.Provider,{value:{name:Ws.name},children:jsx(zd,{...Ws})}),FormItem=React.forwardRef(({className:Ws,...ws},oi)=>{const si=React.useId();return jsx(FormItemContext.Provider,{value:{id:si},children:jsx("div",{ref:oi,className:cn("",Ws),...ws})})});FormItem.displayName="FormItem";const FormLabel=React.forwardRef(({className:Ws,...ws},oi)=>{const{error:si,formItemId:ii}=useFormField();return jsx(Label,{ref:oi,className:cn(si&&"text-destructive",Ws),htmlFor:ii,...ws})});FormLabel.displayName="FormLabel";const FormControl=React.forwardRef(({...Ws},ws)=>{const{error:oi,formItemId:si,formDescriptionId:ii,formMessageId:ai}=useFormField();return jsx(St$2,{ref:ws,id:si,"aria-describedby":oi?`${ii} ${ai}`:ii,"aria-invalid":!!oi,...Ws})});FormControl.displayName="FormControl";const FormDescription=React.forwardRef(({className:Ws,...ws},oi)=>{const{formDescriptionId:si}=useFormField();return jsx("p",{ref:oi,id:si,className:cn("text-[0.8rem] text-gray-600",Ws),...ws})});FormDescription.displayName="FormDescription";const FormMessage=React.forwardRef(({className:Ws,children:ws,...oi},si)=>{const{error:ii,formMessageId:ai}=useFormField(),li=ii?String(ii.message):ws;return li?jsx("p",{ref:si,id:ai,className:cn("text-[0.8rem] font-medium text-red-800",Ws),...oi,children:li}):null});FormMessage.displayName="FormMessage";var NAME="Label",Label$1=React.forwardRef((Ws,ws)=>jsx(se$2.label,{...Ws,ref:ws,onMouseDown:oi=>{var si;oi.target.closest("button, input, select, textarea")||((si=Ws.onMouseDown)==null||si.call(Ws,oi),!oi.defaultPrevented&&oi.detail>1&&oi.preventDefault())}}));Label$1.displayName=NAME;var Root=Label$1;const cx=jd,cva=(Ws,ws)=>oi=>cx(Ws,oi==null?void 0:oi.class,oi==null?void 0:oi.className);function cn(...Ws){return Hd(jd(Ws))}const SPLIT_LOWER_UPPER_RE=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),SPLIT_UPPER_UPPER_RE=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),SPLIT_SEPARATE_NUMBER_RE=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),DEFAULT_STRIP_REGEXP=/[^\p{L}\d]+/giu,SPLIT_REPLACE_VALUE="$1\0$2",DEFAULT_PREFIX_SUFFIX_CHARACTERS="";function split(Ws){let ws=Ws.trim();ws=ws.replace(SPLIT_LOWER_UPPER_RE,SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE,SPLIT_REPLACE_VALUE),ws=ws.replace(DEFAULT_STRIP_REGEXP,"\0");let oi=0,si=ws.length;for(;ws.charAt(oi)==="\0";)oi++;if(oi===si)return[];for(;ws.charAt(si-1)==="\0";)si--;return ws.slice(oi,si).split(/\0/g)}function splitSeparateNumbers(Ws){const ws=split(Ws);for(let oi=0;oi<ws.length;oi++){const si=ws[oi],ii=SPLIT_SEPARATE_NUMBER_RE.exec(si);if(ii){const ai=ii.index+(ii[1]??ii[2]).length;ws.splice(oi,1,si.slice(0,ai),si.slice(ai))}}return ws}function noCase(Ws,ws){const[oi,si,ii]=splitPrefixSuffix(Ws,ws);return oi+si.map(lowerFactory(ws==null?void 0:ws.locale)).join((ws==null?void 0:ws.delimiter)??" ")+ii}function pascalCase(Ws,ws){const[oi,si,ii]=splitPrefixSuffix(Ws,ws),ai=lowerFactory(void 0),li=upperFactory(void 0),ci=pascalCaseTransformFactory(ai,li);return oi+si.map(ci).join("")+ii}function constantCase(Ws,ws){const[oi,si,ii]=splitPrefixSuffix(Ws,ws);return oi+si.map(upperFactory(void 0)).join("_")+ii}function sentenceCase(Ws,ws){const[oi,si,ii]=splitPrefixSuffix(Ws,ws),ai=lowerFactory(void 0),li=upperFactory(void 0),ci=capitalCaseTransformFactory(ai,li);return oi+si.map((ui,di)=>di===0?ci(ui):ai(ui)).join(" ")+ii}function snakeCase(Ws,ws){return noCase(Ws,{delimiter:"_",...ws})}function lowerFactory(Ws){return Ws===!1?ws=>ws.toLowerCase():ws=>ws.toLocaleLowerCase(Ws)}function upperFactory(Ws){return ws=>ws.toLocaleUpperCase(Ws)}function capitalCaseTransformFactory(Ws,ws){return oi=>`${ws(oi[0])}${Ws(oi.slice(1))}`}function pascalCaseTransformFactory(Ws,ws){return(oi,si)=>{const ii=oi[0];return(si>0&&ii>="0"&&ii<="9"?"_"+ii:ws(ii))+Ws(oi.slice(1))}}function splitPrefixSuffix(Ws,ws={}){const oi=ws.split??(ws.separateNumbers?splitSeparateNumbers:split),si=ws.prefixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS,ii=ws.suffixCharacters??DEFAULT_PREFIX_SUFFIX_CHARACTERS;let ai=0,li=Ws.length;for(;ai<Ws.length;){const ci=Ws.charAt(ai);if(!si.includes(ci))break;ai++}for(;li>ai;){const ci=li-1,ui=Ws.charAt(ci);if(!ii.includes(ui))break;li=ci}return[Ws.slice(0,ai),oi(Ws.slice(ai,li)),Ws.slice(li)]}const versionInfo=Object.freeze({major:16,minor:10,patch:0,preReleaseTag:null});function devAssert(Ws,ws){throw new Error(ws)}function isObjectLike(Ws){return typeof Ws=="object"&&Ws!==null}function invariant$1(Ws,ws){throw new Error(ws??"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation$1(Ws,ws){let oi=0,si=1;for(const ii of Ws.body.matchAll(LineRegExp)){if(typeof ii.index=="number"||invariant$1(),ii.index>=ws)break;oi=ii.index+ii[0].length,si+=1}return{line:si,column:ws+1-oi}}function printLocation(Ws){return printSourceLocation(Ws.source,getLocation$1(Ws.source,Ws.start))}function printSourceLocation(Ws,ws){const oi=Ws.locationOffset.column-1,si="".padStart(oi)+Ws.body,ii=ws.line-1,ai=Ws.locationOffset.line-1,li=ws.line+ai,ci=ws.line===1?oi:0,ui=ws.column+ci,di=`${Ws.name}:${li}:${ui}
237
- `,hi=si.split(/\r\n|[\n\r]/g),pi=hi[ii];if(pi.length>120){const ha=Math.floor(ui/80),ga=ui%80,va=[];for(let ba=0;ba<pi.length;ba+=80)va.push(pi.slice(ba,ba+80));return di+printPrefixedLines([[`${li} |`,va[0]],...va.slice(1,ha+1).map(ba=>["|",ba]),["|","^".padStart(ga)],["|",va[ha+1]]])}return di+printPrefixedLines([[`${li-1} |`,hi[ii-1]],[`${li} |`,pi],["|","^".padStart(ui)],[`${li+1} |`,hi[ii+1]]])}function printPrefixedLines(Ws){const ws=Ws.filter(([si,ii])=>ii!==void 0),oi=Math.max(...ws.map(([si])=>si.length));return ws.map(([si,ii])=>si.padStart(oi)+(ii?" "+ii:"")).join(`
238
- `)}function toNormalizedOptions(Ws){const ws=Ws[0];return ws==null||"kind"in ws||"length"in ws?{nodes:ws,source:Ws[1],positions:Ws[2],path:Ws[3],originalError:Ws[4],extensions:Ws[5]}:ws}class GraphQLError extends Error{constructor(ws,...oi){var si,ii,ai;const{nodes:li,source:ci,positions:ui,path:di,originalError:hi,extensions:pi}=toNormalizedOptions(oi);super(ws),this.name="GraphQLError",this.path=di??void 0,this.originalError=hi??void 0,this.nodes=undefinedIfEmpty(Array.isArray(li)?li:li?[li]:void 0);const ha=undefinedIfEmpty((si=this.nodes)===null||si===void 0?void 0:si.map(va=>va.loc).filter(va=>va!=null));this.source=ci??(ha==null||(ii=ha[0])===null||ii===void 0?void 0:ii.source),this.positions=ui??(ha==null?void 0:ha.map(va=>va.start)),this.locations=ui&&ci?ui.map(va=>getLocation$1(ci,va)):ha==null?void 0:ha.map(va=>getLocation$1(va.source,va.start));const ga=isObjectLike(hi==null?void 0:hi.extensions)?hi==null?void 0:hi.extensions:void 0;this.extensions=(ai=pi??ga)!==null&&ai!==void 0?ai:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),hi!=null&&hi.stack?Object.defineProperty(this,"stack",{value:hi.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let ws=this.message;if(this.nodes)for(const oi of this.nodes)oi.loc&&(ws+=`
239
-
240
- `+printLocation(oi.loc));else if(this.source&&this.locations)for(const oi of this.locations)ws+=`
241
-
242
- `+printSourceLocation(this.source,oi);return ws}toJSON(){const ws={message:this.message};return this.locations!=null&&(ws.locations=this.locations),this.path!=null&&(ws.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(ws.extensions=this.extensions),ws}}function undefinedIfEmpty(Ws){return Ws===void 0||Ws.length===0?void 0:Ws}function syntaxError(Ws,ws,oi){return new GraphQLError(`Syntax Error: ${oi}`,{source:Ws,positions:[ws]})}let Location$1=class{constructor(Ws,ws,oi){this.start=Ws.start,this.end=ws.end,this.startToken=Ws,this.endToken=ws,this.source=oi}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}};class Token{constructor(ws,oi,si,ii,ai,li){this.kind=ws,this.start=oi,this.end=si,this.line=ii,this.column=ai,this.value=li,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},kindValues=new Set(Object.keys(QueryDocumentKeys));function isNode(Ws){const ws=Ws==null?void 0:Ws.kind;return typeof ws=="string"&&kindValues.has(ws)}var OperationTypeNode;(function(Ws){Ws.QUERY="query",Ws.MUTATION="mutation",Ws.SUBSCRIPTION="subscription"})(OperationTypeNode||(OperationTypeNode={}));var DirectiveLocation;(function(Ws){Ws.QUERY="QUERY",Ws.MUTATION="MUTATION",Ws.SUBSCRIPTION="SUBSCRIPTION",Ws.FIELD="FIELD",Ws.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",Ws.FRAGMENT_SPREAD="FRAGMENT_SPREAD",Ws.INLINE_FRAGMENT="INLINE_FRAGMENT",Ws.VARIABLE_DEFINITION="VARIABLE_DEFINITION",Ws.SCHEMA="SCHEMA",Ws.SCALAR="SCALAR",Ws.OBJECT="OBJECT",Ws.FIELD_DEFINITION="FIELD_DEFINITION",Ws.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",Ws.INTERFACE="INTERFACE",Ws.UNION="UNION",Ws.ENUM="ENUM",Ws.ENUM_VALUE="ENUM_VALUE",Ws.INPUT_OBJECT="INPUT_OBJECT",Ws.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(DirectiveLocation||(DirectiveLocation={}));var Kind;(function(Ws){Ws.NAME="Name",Ws.DOCUMENT="Document",Ws.OPERATION_DEFINITION="OperationDefinition",Ws.VARIABLE_DEFINITION="VariableDefinition",Ws.SELECTION_SET="SelectionSet",Ws.FIELD="Field",Ws.ARGUMENT="Argument",Ws.FRAGMENT_SPREAD="FragmentSpread",Ws.INLINE_FRAGMENT="InlineFragment",Ws.FRAGMENT_DEFINITION="FragmentDefinition",Ws.VARIABLE="Variable",Ws.INT="IntValue",Ws.FLOAT="FloatValue",Ws.STRING="StringValue",Ws.BOOLEAN="BooleanValue",Ws.NULL="NullValue",Ws.ENUM="EnumValue",Ws.LIST="ListValue",Ws.OBJECT="ObjectValue",Ws.OBJECT_FIELD="ObjectField",Ws.DIRECTIVE="Directive",Ws.NAMED_TYPE="NamedType",Ws.LIST_TYPE="ListType",Ws.NON_NULL_TYPE="NonNullType",Ws.SCHEMA_DEFINITION="SchemaDefinition",Ws.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Ws.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Ws.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Ws.FIELD_DEFINITION="FieldDefinition",Ws.INPUT_VALUE_DEFINITION="InputValueDefinition",Ws.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Ws.UNION_TYPE_DEFINITION="UnionTypeDefinition",Ws.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Ws.ENUM_VALUE_DEFINITION="EnumValueDefinition",Ws.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Ws.DIRECTIVE_DEFINITION="DirectiveDefinition",Ws.SCHEMA_EXTENSION="SchemaExtension",Ws.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Ws.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Ws.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Ws.UNION_TYPE_EXTENSION="UnionTypeExtension",Ws.ENUM_TYPE_EXTENSION="EnumTypeExtension",Ws.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Kind||(Kind={}));function isWhiteSpace(Ws){return Ws===9||Ws===32}function isDigit$1(Ws){return Ws>=48&&Ws<=57}function isLetter(Ws){return Ws>=97&&Ws<=122||Ws>=65&&Ws<=90}function isNameStart(Ws){return isLetter(Ws)||Ws===95}function isNameContinue(Ws){return isLetter(Ws)||isDigit$1(Ws)||Ws===95}function dedentBlockStringLines(Ws){var ws;let oi=Number.MAX_SAFE_INTEGER,si=null,ii=-1;for(let li=0;li<Ws.length;++li){var ai;const ci=Ws[li],ui=leadingWhitespace(ci);ui!==ci.length&&(si=(ai=si)!==null&&ai!==void 0?ai:li,ii=li,li!==0&&ui<oi&&(oi=ui))}return Ws.map((li,ci)=>ci===0?li:li.slice(oi)).slice((ws=si)!==null&&ws!==void 0?ws:0,ii+1)}function leadingWhitespace(Ws){let ws=0;for(;ws<Ws.length&&isWhiteSpace(Ws.charCodeAt(ws));)++ws;return ws}function isPrintableAsBlockString(Ws){if(Ws==="")return!0;let ws=!0,oi=!1,si=!0,ii=!1;for(let ai=0;ai<Ws.length;++ai)switch(Ws.codePointAt(ai)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(ws&&!ii)return!1;ii=!0,ws=!0,oi=!1;break;case 9:case 32:oi||(oi=ws);break;default:si&&(si=oi),ws=!1}return!(ws||si&&ii)}function printBlockString(Ws,ws){const oi=Ws.replace(/"""/g,'\\"""'),si=oi.split(/\r\n|[\n\r]/g),ii=si.length===1,ai=si.length>1&&si.slice(1).every(ga=>ga.length===0||isWhiteSpace(ga.charCodeAt(0))),li=oi.endsWith('\\"""'),ci=Ws.endsWith('"')&&!li,ui=Ws.endsWith("\\"),di=ci||ui,hi=!ii||Ws.length>70||di||ai||li;let pi="";const ha=ii&&isWhiteSpace(Ws.charCodeAt(0));return(hi&&!ha||ai)&&(pi+=`
243
- `),pi+=oi,(hi||di)&&(pi+=`
244
- `),'"""'+pi+'"""'}var TokenKind;(function(Ws){Ws.SOF="<SOF>",Ws.EOF="<EOF>",Ws.BANG="!",Ws.DOLLAR="$",Ws.AMP="&",Ws.PAREN_L="(",Ws.PAREN_R=")",Ws.SPREAD="...",Ws.COLON=":",Ws.EQUALS="=",Ws.AT="@",Ws.BRACKET_L="[",Ws.BRACKET_R="]",Ws.BRACE_L="{",Ws.PIPE="|",Ws.BRACE_R="}",Ws.NAME="Name",Ws.INT="Int",Ws.FLOAT="Float",Ws.STRING="String",Ws.BLOCK_STRING="BlockString",Ws.COMMENT="Comment"})(TokenKind||(TokenKind={}));class Lexer{constructor(ws){const oi=new Token(TokenKind.SOF,0,0,0,0);this.source=ws,this.lastToken=oi,this.token=oi,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let ws=this.token;if(ws.kind!==TokenKind.EOF)do if(ws.next)ws=ws.next;else{const oi=readNextToken(this,ws.end);ws.next=oi,oi.prev=ws,ws=oi}while(ws.kind===TokenKind.COMMENT);return ws}}function isPunctuatorTokenKind(Ws){return Ws===TokenKind.BANG||Ws===TokenKind.DOLLAR||Ws===TokenKind.AMP||Ws===TokenKind.PAREN_L||Ws===TokenKind.PAREN_R||Ws===TokenKind.SPREAD||Ws===TokenKind.COLON||Ws===TokenKind.EQUALS||Ws===TokenKind.AT||Ws===TokenKind.BRACKET_L||Ws===TokenKind.BRACKET_R||Ws===TokenKind.BRACE_L||Ws===TokenKind.PIPE||Ws===TokenKind.BRACE_R}function isUnicodeScalarValue(Ws){return Ws>=0&&Ws<=55295||Ws>=57344&&Ws<=1114111}function isSupplementaryCodePoint(Ws,ws){return isLeadingSurrogate(Ws.charCodeAt(ws))&&isTrailingSurrogate(Ws.charCodeAt(ws+1))}function isLeadingSurrogate(Ws){return Ws>=55296&&Ws<=56319}function isTrailingSurrogate(Ws){return Ws>=56320&&Ws<=57343}function printCodePointAt(Ws,ws){const oi=Ws.source.body.codePointAt(ws);if(oi===void 0)return TokenKind.EOF;if(oi>=32&&oi<=126){const si=String.fromCodePoint(oi);return si==='"'?`'"'`:`"${si}"`}return"U+"+oi.toString(16).toUpperCase().padStart(4,"0")}function createToken(Ws,ws,oi,si,ii){const ai=Ws.line,li=1+oi-Ws.lineStart;return new Token(ws,oi,si,ai,li,ii)}function readNextToken(Ws,ws){const oi=Ws.source.body,si=oi.length;let ii=ws;for(;ii<si;){const ai=oi.charCodeAt(ii);switch(ai){case 65279:case 9:case 32:case 44:++ii;continue;case 10:++ii,++Ws.line,Ws.lineStart=ii;continue;case 13:oi.charCodeAt(ii+1)===10?ii+=2:++ii,++Ws.line,Ws.lineStart=ii;continue;case 35:return readComment(Ws,ii);case 33:return createToken(Ws,TokenKind.BANG,ii,ii+1);case 36:return createToken(Ws,TokenKind.DOLLAR,ii,ii+1);case 38:return createToken(Ws,TokenKind.AMP,ii,ii+1);case 40:return createToken(Ws,TokenKind.PAREN_L,ii,ii+1);case 41:return createToken(Ws,TokenKind.PAREN_R,ii,ii+1);case 46:if(oi.charCodeAt(ii+1)===46&&oi.charCodeAt(ii+2)===46)return createToken(Ws,TokenKind.SPREAD,ii,ii+3);break;case 58:return createToken(Ws,TokenKind.COLON,ii,ii+1);case 61:return createToken(Ws,TokenKind.EQUALS,ii,ii+1);case 64:return createToken(Ws,TokenKind.AT,ii,ii+1);case 91:return createToken(Ws,TokenKind.BRACKET_L,ii,ii+1);case 93:return createToken(Ws,TokenKind.BRACKET_R,ii,ii+1);case 123:return createToken(Ws,TokenKind.BRACE_L,ii,ii+1);case 124:return createToken(Ws,TokenKind.PIPE,ii,ii+1);case 125:return createToken(Ws,TokenKind.BRACE_R,ii,ii+1);case 34:return oi.charCodeAt(ii+1)===34&&oi.charCodeAt(ii+2)===34?readBlockString(Ws,ii):readString(Ws,ii)}if(isDigit$1(ai)||ai===45)return readNumber(Ws,ii,ai);if(isNameStart(ai))return readName(Ws,ii);throw syntaxError(Ws.source,ii,ai===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:isUnicodeScalarValue(ai)||isSupplementaryCodePoint(oi,ii)?`Unexpected character: ${printCodePointAt(Ws,ii)}.`:`Invalid character: ${printCodePointAt(Ws,ii)}.`)}return createToken(Ws,TokenKind.EOF,si,si)}function readComment(Ws,ws){const oi=Ws.source.body,si=oi.length;let ii=ws+1;for(;ii<si;){const ai=oi.charCodeAt(ii);if(ai===10||ai===13)break;if(isUnicodeScalarValue(ai))++ii;else if(isSupplementaryCodePoint(oi,ii))ii+=2;else break}return createToken(Ws,TokenKind.COMMENT,ws,ii,oi.slice(ws+1,ii))}function readNumber(Ws,ws,oi){const si=Ws.source.body;let ii=ws,ai=oi,li=!1;if(ai===45&&(ai=si.charCodeAt(++ii)),ai===48){if(ai=si.charCodeAt(++ii),isDigit$1(ai))throw syntaxError(Ws.source,ii,`Invalid number, unexpected digit after 0: ${printCodePointAt(Ws,ii)}.`)}else ii=readDigits(Ws,ii,ai),ai=si.charCodeAt(ii);if(ai===46&&(li=!0,ai=si.charCodeAt(++ii),ii=readDigits(Ws,ii,ai),ai=si.charCodeAt(ii)),(ai===69||ai===101)&&(li=!0,ai=si.charCodeAt(++ii),(ai===43||ai===45)&&(ai=si.charCodeAt(++ii)),ii=readDigits(Ws,ii,ai),ai=si.charCodeAt(ii)),ai===46||isNameStart(ai))throw syntaxError(Ws.source,ii,`Invalid number, expected digit but got: ${printCodePointAt(Ws,ii)}.`);return createToken(Ws,li?TokenKind.FLOAT:TokenKind.INT,ws,ii,si.slice(ws,ii))}function readDigits(Ws,ws,oi){if(!isDigit$1(oi))throw syntaxError(Ws.source,ws,`Invalid number, expected digit but got: ${printCodePointAt(Ws,ws)}.`);const si=Ws.source.body;let ii=ws+1;for(;isDigit$1(si.charCodeAt(ii));)++ii;return ii}function readString(Ws,ws){const oi=Ws.source.body,si=oi.length;let ii=ws+1,ai=ii,li="";for(;ii<si;){const ci=oi.charCodeAt(ii);if(ci===34)return li+=oi.slice(ai,ii),createToken(Ws,TokenKind.STRING,ws,ii+1,li);if(ci===92){li+=oi.slice(ai,ii);const ui=oi.charCodeAt(ii+1)===117?oi.charCodeAt(ii+2)===123?readEscapedUnicodeVariableWidth(Ws,ii):readEscapedUnicodeFixedWidth(Ws,ii):readEscapedCharacter(Ws,ii);li+=ui.value,ii+=ui.size,ai=ii;continue}if(ci===10||ci===13)break;if(isUnicodeScalarValue(ci))++ii;else if(isSupplementaryCodePoint(oi,ii))ii+=2;else throw syntaxError(Ws.source,ii,`Invalid character within String: ${printCodePointAt(Ws,ii)}.`)}throw syntaxError(Ws.source,ii,"Unterminated string.")}function readEscapedUnicodeVariableWidth(Ws,ws){const oi=Ws.source.body;let si=0,ii=3;for(;ii<12;){const ai=oi.charCodeAt(ws+ii++);if(ai===125){if(ii<5||!isUnicodeScalarValue(si))break;return{value:String.fromCodePoint(si),size:ii}}if(si=si<<4|readHexDigit(ai),si<0)break}throw syntaxError(Ws.source,ws,`Invalid Unicode escape sequence: "${oi.slice(ws,ws+ii)}".`)}function readEscapedUnicodeFixedWidth(Ws,ws){const oi=Ws.source.body,si=read16BitHexCode(oi,ws+2);if(isUnicodeScalarValue(si))return{value:String.fromCodePoint(si),size:6};if(isLeadingSurrogate(si)&&oi.charCodeAt(ws+6)===92&&oi.charCodeAt(ws+7)===117){const ii=read16BitHexCode(oi,ws+8);if(isTrailingSurrogate(ii))return{value:String.fromCodePoint(si,ii),size:12}}throw syntaxError(Ws.source,ws,`Invalid Unicode escape sequence: "${oi.slice(ws,ws+6)}".`)}function read16BitHexCode(Ws,ws){return readHexDigit(Ws.charCodeAt(ws))<<12|readHexDigit(Ws.charCodeAt(ws+1))<<8|readHexDigit(Ws.charCodeAt(ws+2))<<4|readHexDigit(Ws.charCodeAt(ws+3))}function readHexDigit(Ws){return Ws>=48&&Ws<=57?Ws-48:Ws>=65&&Ws<=70?Ws-55:Ws>=97&&Ws<=102?Ws-87:-1}function readEscapedCharacter(Ws,ws){const oi=Ws.source.body;switch(oi.charCodeAt(ws+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
245
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw syntaxError(Ws.source,ws,`Invalid character escape sequence: "${oi.slice(ws,ws+2)}".`)}function readBlockString(Ws,ws){const oi=Ws.source.body,si=oi.length;let ii=Ws.lineStart,ai=ws+3,li=ai,ci="";const ui=[];for(;ai<si;){const di=oi.charCodeAt(ai);if(di===34&&oi.charCodeAt(ai+1)===34&&oi.charCodeAt(ai+2)===34){ci+=oi.slice(li,ai),ui.push(ci);const hi=createToken(Ws,TokenKind.BLOCK_STRING,ws,ai+3,dedentBlockStringLines(ui).join(`
246
- `));return Ws.line+=ui.length-1,Ws.lineStart=ii,hi}if(di===92&&oi.charCodeAt(ai+1)===34&&oi.charCodeAt(ai+2)===34&&oi.charCodeAt(ai+3)===34){ci+=oi.slice(li,ai),li=ai+1,ai+=4;continue}if(di===10||di===13){ci+=oi.slice(li,ai),ui.push(ci),di===13&&oi.charCodeAt(ai+1)===10?ai+=2:++ai,ci="",li=ai,ii=ai;continue}if(isUnicodeScalarValue(di))++ai;else if(isSupplementaryCodePoint(oi,ai))ai+=2;else throw syntaxError(Ws.source,ai,`Invalid character within String: ${printCodePointAt(Ws,ai)}.`)}throw syntaxError(Ws.source,ai,"Unterminated string.")}function readName(Ws,ws){const oi=Ws.source.body,si=oi.length;let ii=ws+1;for(;ii<si;){const ai=oi.charCodeAt(ii);if(isNameContinue(ai))++ii;else break}return createToken(Ws,TokenKind.NAME,ws,ii,oi.slice(ws,ii))}const MAX_ARRAY_LENGTH=10,MAX_RECURSIVE_DEPTH=2;function inspect(Ws){return formatValue(Ws,[])}function formatValue(Ws,ws){switch(typeof Ws){case"string":return JSON.stringify(Ws);case"function":return Ws.name?`[function ${Ws.name}]`:"[function]";case"object":return formatObjectValue(Ws,ws);default:return String(Ws)}}function formatObjectValue(Ws,ws){if(Ws===null)return"null";if(ws.includes(Ws))return"[Circular]";const oi=[...ws,Ws];if(isJSONable(Ws)){const si=Ws.toJSON();if(si!==Ws)return typeof si=="string"?si:formatValue(si,oi)}else if(Array.isArray(Ws))return formatArray(Ws,oi);return formatObject(Ws,oi)}function isJSONable(Ws){return typeof Ws.toJSON=="function"}function formatObject(Ws,ws){const oi=Object.entries(Ws);return oi.length===0?"{}":ws.length>MAX_RECURSIVE_DEPTH?"["+getObjectTag(Ws)+"]":"{ "+oi.map(([si,ii])=>si+": "+formatValue(ii,ws)).join(", ")+" }"}function formatArray(Ws,ws){if(Ws.length===0)return"[]";if(ws.length>MAX_RECURSIVE_DEPTH)return"[Array]";const oi=Math.min(MAX_ARRAY_LENGTH,Ws.length),si=Ws.length-oi,ii=[];for(let ai=0;ai<oi;++ai)ii.push(formatValue(Ws[ai],ws));return si===1?ii.push("... 1 more item"):si>1&&ii.push(`... ${si} more items`),"["+ii.join(", ")+"]"}function getObjectTag(Ws){const ws=Object.prototype.toString.call(Ws).replace(/^\[object /,"").replace(/]$/,"");if(ws==="Object"&&typeof Ws.constructor=="function"){const oi=Ws.constructor.name;if(typeof oi=="string"&&oi!=="")return oi}return ws}const isProduction=globalThis.process&&!0,instanceOf=isProduction?function Ws(ws,oi){return ws instanceof oi}:function Ws(ws,oi){if(ws instanceof oi)return!0;if(typeof ws=="object"&&ws!==null){var si;const ii=oi.prototype[Symbol.toStringTag],ai=Symbol.toStringTag in ws?ws[Symbol.toStringTag]:(si=ws.constructor)===null||si===void 0?void 0:si.name;if(ii===ai){const li=inspect(ws);throw new Error(`Cannot use ${ii} "${li}" from another module or realm.
247
-
248
- Ensure that there is only one instance of "graphql" in the node_modules
249
- directory. If different versions of "graphql" are the dependencies of other
250
- relied on modules, use "resolutions" to ensure only one version is installed.
251
-
252
- https://yarnpkg.com/en/docs/selective-version-resolutions
253
-
254
- Duplicate "graphql" modules cannot be used at the same time since different
255
- versions may have different capabilities and behavior. The data from one
256
- version used in the function from another could produce confusing and
257
- spurious results.`)}}return!1};class Source{constructor(ws,oi="GraphQL request",si={line:1,column:1}){typeof ws=="string"||devAssert(!1,`Body must be a string. Received: ${inspect(ws)}.`),this.body=ws,this.name=oi,this.locationOffset=si,this.locationOffset.line>0||devAssert(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||devAssert(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function isSource(Ws){return instanceOf(Ws,Source)}function parse(Ws,ws){const oi=new Parser$1(Ws,ws),si=oi.parseDocument();return Object.defineProperty(si,"tokenCount",{enumerable:!1,value:oi.tokenCount}),si}let Parser$1=class{constructor(Ws,ws={}){const oi=isSource(Ws)?Ws:new Source(Ws);this._lexer=new Lexer(oi),this._options=ws,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const Ws=this.expectToken(TokenKind.NAME);return this.node(Ws,{kind:Kind.NAME,value:Ws.value})}parseDocument(){return this.node(this._lexer.token,{kind:Kind.DOCUMENT,definitions:this.many(TokenKind.SOF,this.parseDefinition,TokenKind.EOF)})}parseDefinition(){if(this.peek(TokenKind.BRACE_L))return this.parseOperationDefinition();const Ws=this.peekDescription(),ws=Ws?this._lexer.lookahead():this._lexer.token;if(ws.kind===TokenKind.NAME){switch(ws.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(Ws)throw syntaxError(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(ws.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(ws)}parseOperationDefinition(){const Ws=this._lexer.token;if(this.peek(TokenKind.BRACE_L))return this.node(Ws,{kind:Kind.OPERATION_DEFINITION,operation:OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const ws=this.parseOperationType();let oi;return this.peek(TokenKind.NAME)&&(oi=this.parseName()),this.node(Ws,{kind:Kind.OPERATION_DEFINITION,operation:ws,name:oi,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const Ws=this.expectToken(TokenKind.NAME);switch(Ws.value){case"query":return OperationTypeNode.QUERY;case"mutation":return OperationTypeNode.MUTATION;case"subscription":return OperationTypeNode.SUBSCRIPTION}throw this.unexpected(Ws)}parseVariableDefinitions(){return this.optionalMany(TokenKind.PAREN_L,this.parseVariableDefinition,TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const Ws=this._lexer.token;return this.expectToken(TokenKind.DOLLAR),this.node(Ws,{kind:Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Kind.SELECTION_SET,selections:this.many(TokenKind.BRACE_L,this.parseSelection,TokenKind.BRACE_R)})}parseSelection(){return this.peek(TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const Ws=this._lexer.token,ws=this.parseName();let oi,si;return this.expectOptionalToken(TokenKind.COLON)?(oi=ws,si=this.parseName()):si=ws,this.node(Ws,{kind:Kind.FIELD,alias:oi,name:si,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(Ws){const ws=Ws?this.parseConstArgument:this.parseArgument;return this.optionalMany(TokenKind.PAREN_L,ws,TokenKind.PAREN_R)}parseArgument(Ws=!1){const ws=this._lexer.token,oi=this.parseName();return this.expectToken(TokenKind.COLON),this.node(ws,{kind:Kind.ARGUMENT,name:oi,value:this.parseValueLiteral(Ws)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const Ws=this._lexer.token;this.expectToken(TokenKind.SPREAD);const ws=this.expectOptionalKeyword("on");return!ws&&this.peek(TokenKind.NAME)?this.node(Ws,{kind:Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(Ws,{kind:Kind.INLINE_FRAGMENT,typeCondition:ws?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const Ws=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(Ws,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(Ws,{kind:Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(Ws){const ws=this._lexer.token;switch(ws.kind){case TokenKind.BRACKET_L:return this.parseList(Ws);case TokenKind.BRACE_L:return this.parseObject(Ws);case TokenKind.INT:return this.advanceLexer(),this.node(ws,{kind:Kind.INT,value:ws.value});case TokenKind.FLOAT:return this.advanceLexer(),this.node(ws,{kind:Kind.FLOAT,value:ws.value});case TokenKind.STRING:case TokenKind.BLOCK_STRING:return this.parseStringLiteral();case TokenKind.NAME:switch(this.advanceLexer(),ws.value){case"true":return this.node(ws,{kind:Kind.BOOLEAN,value:!0});case"false":return this.node(ws,{kind:Kind.BOOLEAN,value:!1});case"null":return this.node(ws,{kind:Kind.NULL});default:return this.node(ws,{kind:Kind.ENUM,value:ws.value})}case TokenKind.DOLLAR:if(Ws)if(this.expectToken(TokenKind.DOLLAR),this._lexer.token.kind===TokenKind.NAME){const oi=this._lexer.token.value;throw syntaxError(this._lexer.source,ws.start,`Unexpected variable "$${oi}" in constant value.`)}else throw this.unexpected(ws);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const Ws=this._lexer.token;return this.advanceLexer(),this.node(Ws,{kind:Kind.STRING,value:Ws.value,block:Ws.kind===TokenKind.BLOCK_STRING})}parseList(Ws){const ws=()=>this.parseValueLiteral(Ws);return this.node(this._lexer.token,{kind:Kind.LIST,values:this.any(TokenKind.BRACKET_L,ws,TokenKind.BRACKET_R)})}parseObject(Ws){const ws=()=>this.parseObjectField(Ws);return this.node(this._lexer.token,{kind:Kind.OBJECT,fields:this.any(TokenKind.BRACE_L,ws,TokenKind.BRACE_R)})}parseObjectField(Ws){const ws=this._lexer.token,oi=this.parseName();return this.expectToken(TokenKind.COLON),this.node(ws,{kind:Kind.OBJECT_FIELD,name:oi,value:this.parseValueLiteral(Ws)})}parseDirectives(Ws){const ws=[];for(;this.peek(TokenKind.AT);)ws.push(this.parseDirective(Ws));return ws}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(Ws){const ws=this._lexer.token;return this.expectToken(TokenKind.AT),this.node(ws,{kind:Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(Ws)})}parseTypeReference(){const Ws=this._lexer.token;let ws;if(this.expectOptionalToken(TokenKind.BRACKET_L)){const oi=this.parseTypeReference();this.expectToken(TokenKind.BRACKET_R),ws=this.node(Ws,{kind:Kind.LIST_TYPE,type:oi})}else ws=this.parseNamedType();return this.expectOptionalToken(TokenKind.BANG)?this.node(Ws,{kind:Kind.NON_NULL_TYPE,type:ws}):ws}parseNamedType(){return this.node(this._lexer.token,{kind:Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(TokenKind.STRING)||this.peek(TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("schema");const oi=this.parseConstDirectives(),si=this.many(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);return this.node(Ws,{kind:Kind.SCHEMA_DEFINITION,description:ws,directives:oi,operationTypes:si})}parseOperationTypeDefinition(){const Ws=this._lexer.token,ws=this.parseOperationType();this.expectToken(TokenKind.COLON);const oi=this.parseNamedType();return this.node(Ws,{kind:Kind.OPERATION_TYPE_DEFINITION,operation:ws,type:oi})}parseScalarTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("scalar");const oi=this.parseName(),si=this.parseConstDirectives();return this.node(Ws,{kind:Kind.SCALAR_TYPE_DEFINITION,description:ws,name:oi,directives:si})}parseObjectTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("type");const oi=this.parseName(),si=this.parseImplementsInterfaces(),ii=this.parseConstDirectives(),ai=this.parseFieldsDefinition();return this.node(Ws,{kind:Kind.OBJECT_TYPE_DEFINITION,description:ws,name:oi,interfaces:si,directives:ii,fields:ai})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseFieldDefinition,TokenKind.BRACE_R)}parseFieldDefinition(){const Ws=this._lexer.token,ws=this.parseDescription(),oi=this.parseName(),si=this.parseArgumentDefs();this.expectToken(TokenKind.COLON);const ii=this.parseTypeReference(),ai=this.parseConstDirectives();return this.node(Ws,{kind:Kind.FIELD_DEFINITION,description:ws,name:oi,arguments:si,type:ii,directives:ai})}parseArgumentDefs(){return this.optionalMany(TokenKind.PAREN_L,this.parseInputValueDef,TokenKind.PAREN_R)}parseInputValueDef(){const Ws=this._lexer.token,ws=this.parseDescription(),oi=this.parseName();this.expectToken(TokenKind.COLON);const si=this.parseTypeReference();let ii;this.expectOptionalToken(TokenKind.EQUALS)&&(ii=this.parseConstValueLiteral());const ai=this.parseConstDirectives();return this.node(Ws,{kind:Kind.INPUT_VALUE_DEFINITION,description:ws,name:oi,type:si,defaultValue:ii,directives:ai})}parseInterfaceTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("interface");const oi=this.parseName(),si=this.parseImplementsInterfaces(),ii=this.parseConstDirectives(),ai=this.parseFieldsDefinition();return this.node(Ws,{kind:Kind.INTERFACE_TYPE_DEFINITION,description:ws,name:oi,interfaces:si,directives:ii,fields:ai})}parseUnionTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("union");const oi=this.parseName(),si=this.parseConstDirectives(),ii=this.parseUnionMemberTypes();return this.node(Ws,{kind:Kind.UNION_TYPE_DEFINITION,description:ws,name:oi,directives:si,types:ii})}parseUnionMemberTypes(){return this.expectOptionalToken(TokenKind.EQUALS)?this.delimitedMany(TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("enum");const oi=this.parseName(),si=this.parseConstDirectives(),ii=this.parseEnumValuesDefinition();return this.node(Ws,{kind:Kind.ENUM_TYPE_DEFINITION,description:ws,name:oi,directives:si,values:ii})}parseEnumValuesDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseEnumValueDefinition,TokenKind.BRACE_R)}parseEnumValueDefinition(){const Ws=this._lexer.token,ws=this.parseDescription(),oi=this.parseEnumValueName(),si=this.parseConstDirectives();return this.node(Ws,{kind:Kind.ENUM_VALUE_DEFINITION,description:ws,name:oi,directives:si})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw syntaxError(this._lexer.source,this._lexer.token.start,`${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("input");const oi=this.parseName(),si=this.parseConstDirectives(),ii=this.parseInputFieldsDefinition();return this.node(Ws,{kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,description:ws,name:oi,directives:si,fields:ii})}parseInputFieldsDefinition(){return this.optionalMany(TokenKind.BRACE_L,this.parseInputValueDef,TokenKind.BRACE_R)}parseTypeSystemExtension(){const Ws=this._lexer.lookahead();if(Ws.kind===TokenKind.NAME)switch(Ws.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(Ws)}parseSchemaExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const ws=this.parseConstDirectives(),oi=this.optionalMany(TokenKind.BRACE_L,this.parseOperationTypeDefinition,TokenKind.BRACE_R);if(ws.length===0&&oi.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.SCHEMA_EXTENSION,directives:ws,operationTypes:oi})}parseScalarTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const ws=this.parseName(),oi=this.parseConstDirectives();if(oi.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.SCALAR_TYPE_EXTENSION,name:ws,directives:oi})}parseObjectTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const ws=this.parseName(),oi=this.parseImplementsInterfaces(),si=this.parseConstDirectives(),ii=this.parseFieldsDefinition();if(oi.length===0&&si.length===0&&ii.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.OBJECT_TYPE_EXTENSION,name:ws,interfaces:oi,directives:si,fields:ii})}parseInterfaceTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const ws=this.parseName(),oi=this.parseImplementsInterfaces(),si=this.parseConstDirectives(),ii=this.parseFieldsDefinition();if(oi.length===0&&si.length===0&&ii.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.INTERFACE_TYPE_EXTENSION,name:ws,interfaces:oi,directives:si,fields:ii})}parseUnionTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const ws=this.parseName(),oi=this.parseConstDirectives(),si=this.parseUnionMemberTypes();if(oi.length===0&&si.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.UNION_TYPE_EXTENSION,name:ws,directives:oi,types:si})}parseEnumTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const ws=this.parseName(),oi=this.parseConstDirectives(),si=this.parseEnumValuesDefinition();if(oi.length===0&&si.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.ENUM_TYPE_EXTENSION,name:ws,directives:oi,values:si})}parseInputObjectTypeExtension(){const Ws=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const ws=this.parseName(),oi=this.parseConstDirectives(),si=this.parseInputFieldsDefinition();if(oi.length===0&&si.length===0)throw this.unexpected();return this.node(Ws,{kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,name:ws,directives:oi,fields:si})}parseDirectiveDefinition(){const Ws=this._lexer.token,ws=this.parseDescription();this.expectKeyword("directive"),this.expectToken(TokenKind.AT);const oi=this.parseName(),si=this.parseArgumentDefs(),ii=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const ai=this.parseDirectiveLocations();return this.node(Ws,{kind:Kind.DIRECTIVE_DEFINITION,description:ws,name:oi,arguments:si,repeatable:ii,locations:ai})}parseDirectiveLocations(){return this.delimitedMany(TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const Ws=this._lexer.token,ws=this.parseName();if(Object.prototype.hasOwnProperty.call(DirectiveLocation,ws.value))return ws;throw this.unexpected(Ws)}node(Ws,ws){return this._options.noLocation!==!0&&(ws.loc=new Location$1(Ws,this._lexer.lastToken,this._lexer.source)),ws}peek(Ws){return this._lexer.token.kind===Ws}expectToken(Ws){const ws=this._lexer.token;if(ws.kind===Ws)return this.advanceLexer(),ws;throw syntaxError(this._lexer.source,ws.start,`Expected ${getTokenKindDesc(Ws)}, found ${getTokenDesc(ws)}.`)}expectOptionalToken(Ws){return this._lexer.token.kind===Ws?(this.advanceLexer(),!0):!1}expectKeyword(Ws){const ws=this._lexer.token;if(ws.kind===TokenKind.NAME&&ws.value===Ws)this.advanceLexer();else throw syntaxError(this._lexer.source,ws.start,`Expected "${Ws}", found ${getTokenDesc(ws)}.`)}expectOptionalKeyword(Ws){const ws=this._lexer.token;return ws.kind===TokenKind.NAME&&ws.value===Ws?(this.advanceLexer(),!0):!1}unexpected(Ws){const ws=Ws??this._lexer.token;return syntaxError(this._lexer.source,ws.start,`Unexpected ${getTokenDesc(ws)}.`)}any(Ws,ws,oi){this.expectToken(Ws);const si=[];for(;!this.expectOptionalToken(oi);)si.push(ws.call(this));return si}optionalMany(Ws,ws,oi){if(this.expectOptionalToken(Ws)){const si=[];do si.push(ws.call(this));while(!this.expectOptionalToken(oi));return si}return[]}many(Ws,ws,oi){this.expectToken(Ws);const si=[];do si.push(ws.call(this));while(!this.expectOptionalToken(oi));return si}delimitedMany(Ws,ws){this.expectOptionalToken(Ws);const oi=[];do oi.push(ws.call(this));while(this.expectOptionalToken(Ws));return oi}advanceLexer(){const{maxTokens:Ws}=this._options,ws=this._lexer.advance();if(ws.kind!==TokenKind.EOF&&(++this._tokenCounter,Ws!==void 0&&this._tokenCounter>Ws))throw syntaxError(this._lexer.source,ws.start,`Document contains more that ${Ws} tokens. Parsing aborted.`)}};function getTokenDesc(Ws){const ws=Ws.value;return getTokenKindDesc(Ws.kind)+(ws!=null?` "${ws}"`:"")}function getTokenKindDesc(Ws){return isPunctuatorTokenKind(Ws)?`"${Ws}"`:Ws}const MAX_SUGGESTIONS=5;function didYouMean(Ws,ws){const[oi,si]=ws?[Ws,ws]:[void 0,Ws];let ii=" Did you mean ";oi&&(ii+=oi+" ");const ai=si.map(ui=>`"${ui}"`);switch(ai.length){case 0:return"";case 1:return ii+ai[0]+"?";case 2:return ii+ai[0]+" or "+ai[1]+"?"}const li=ai.slice(0,MAX_SUGGESTIONS),ci=li.pop();return ii+li.join(", ")+", or "+ci+"?"}function identityFunc(Ws){return Ws}function keyMap(Ws,ws){const oi=Object.create(null);for(const si of Ws)oi[ws(si)]=si;return oi}function keyValMap(Ws,ws,oi){const si=Object.create(null);for(const ii of Ws)si[ws(ii)]=oi(ii);return si}function mapValue(Ws,ws){const oi=Object.create(null);for(const si of Object.keys(Ws))oi[si]=ws(Ws[si],si);return oi}function naturalCompare(Ws,ws){let oi=0,si=0;for(;oi<Ws.length&&si<ws.length;){let ii=Ws.charCodeAt(oi),ai=ws.charCodeAt(si);if(isDigit(ii)&&isDigit(ai)){let li=0;do++oi,li=li*10+ii-DIGIT_0,ii=Ws.charCodeAt(oi);while(isDigit(ii)&&li>0);let ci=0;do++si,ci=ci*10+ai-DIGIT_0,ai=ws.charCodeAt(si);while(isDigit(ai)&&ci>0);if(li<ci)return-1;if(li>ci)return 1}else{if(ii<ai)return-1;if(ii>ai)return 1;++oi,++si}}return Ws.length-ws.length}const DIGIT_0=48,DIGIT_9=57;function isDigit(Ws){return!isNaN(Ws)&&DIGIT_0<=Ws&&Ws<=DIGIT_9}function suggestionList(Ws,ws){const oi=Object.create(null),si=new LexicalDistance(Ws),ii=Math.floor(Ws.length*.4)+1;for(const ai of ws){const li=si.measure(ai,ii);li!==void 0&&(oi[ai]=li)}return Object.keys(oi).sort((ai,li)=>{const ci=oi[ai]-oi[li];return ci!==0?ci:naturalCompare(ai,li)})}class LexicalDistance{constructor(ws){this._input=ws,this._inputLowerCase=ws.toLowerCase(),this._inputArray=stringToArray(this._inputLowerCase),this._rows=[new Array(ws.length+1).fill(0),new Array(ws.length+1).fill(0),new Array(ws.length+1).fill(0)]}measure(ws,oi){if(this._input===ws)return 0;const si=ws.toLowerCase();if(this._inputLowerCase===si)return 1;let ii=stringToArray(si),ai=this._inputArray;if(ii.length<ai.length){const hi=ii;ii=ai,ai=hi}const li=ii.length,ci=ai.length;if(li-ci>oi)return;const ui=this._rows;for(let hi=0;hi<=ci;hi++)ui[0][hi]=hi;for(let hi=1;hi<=li;hi++){const pi=ui[(hi-1)%3],ha=ui[hi%3];let ga=ha[0]=hi;for(let va=1;va<=ci;va++){const ba=ii[hi-1]===ai[va-1]?0:1;let wa=Math.min(pi[va]+1,ha[va-1]+1,pi[va-1]+ba);if(hi>1&&va>1&&ii[hi-1]===ai[va-2]&&ii[hi-2]===ai[va-1]){const xa=ui[(hi-2)%3][va-2];wa=Math.min(wa,xa+1)}wa<ga&&(ga=wa),ha[va]=wa}if(ga>oi)return}const di=ui[li%3][ci];return di<=oi?di:void 0}}function stringToArray(Ws){const ws=Ws.length,oi=new Array(ws);for(let si=0;si<ws;++si)oi[si]=Ws.charCodeAt(si);return oi}function toObjMap(Ws){if(Ws==null)return Object.create(null);if(Object.getPrototypeOf(Ws)===null)return Ws;const ws=Object.create(null);for(const[oi,si]of Object.entries(Ws))ws[oi]=si;return ws}function printString(Ws){return`"${Ws.replace(escapedRegExp,escapedReplacer)}"`}const escapedRegExp=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function escapedReplacer(Ws){return escapeSequences[Ws.charCodeAt(0)]}const escapeSequences=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],BREAK=Object.freeze({});function visit(Ws,ws,oi=QueryDocumentKeys){const si=new Map;for(const xa of Object.values(Kind))si.set(xa,getEnterLeaveForKind(ws,xa));let ii,ai=Array.isArray(Ws),li=[Ws],ci=-1,ui=[],di=Ws,hi,pi;const ha=[],ga=[];do{ci++;const xa=ci===li.length,Ca=xa&&ui.length!==0;if(xa){if(hi=ga.length===0?void 0:ha[ha.length-1],di=pi,pi=ga.pop(),Ca)if(ai){di=di.slice();let ku=0;for(const[gd,Ed]of ui){const Od=gd-ku;Ed===null?(di.splice(Od,1),ku++):di[Od]=Ed}}else{di=Object.defineProperties({},Object.getOwnPropertyDescriptors(di));for(const[ku,gd]of ui)di[ku]=gd}ci=ii.index,li=ii.keys,ui=ii.edits,ai=ii.inArray,ii=ii.prev}else if(pi){if(hi=ai?ci:li[ci],di=pi[hi],di==null)continue;ha.push(hi)}let el;if(!Array.isArray(di)){var va,ba;isNode(di)||devAssert(!1,`Invalid AST Node: ${inspect(di)}.`);const ku=xa?(va=si.get(di.kind))===null||va===void 0?void 0:va.leave:(ba=si.get(di.kind))===null||ba===void 0?void 0:ba.enter;if(el=ku==null?void 0:ku.call(ws,di,hi,pi,ha,ga),el===BREAK)break;if(el===!1){if(!xa){ha.pop();continue}}else if(el!==void 0&&(ui.push([hi,el]),!xa))if(isNode(el))di=el;else{ha.pop();continue}}if(el===void 0&&Ca&&ui.push([hi,di]),xa)ha.pop();else{var wa;ii={inArray:ai,index:ci,keys:li,edits:ui,prev:ii},ai=Array.isArray(di),li=ai?di:(wa=oi[di.kind])!==null&&wa!==void 0?wa:[],ci=-1,ui=[],pi&&ga.push(pi),pi=di}}while(ii!==void 0);return ui.length!==0?ui[ui.length-1][1]:Ws}function visitInParallel(Ws){const ws=new Array(Ws.length).fill(null),oi=Object.create(null);for(const si of Object.values(Kind)){let ii=!1;const ai=new Array(Ws.length).fill(void 0),li=new Array(Ws.length).fill(void 0);for(let ui=0;ui<Ws.length;++ui){const{enter:di,leave:hi}=getEnterLeaveForKind(Ws[ui],si);ii||(ii=di!=null||hi!=null),ai[ui]=di,li[ui]=hi}if(!ii)continue;const ci={enter(...ui){const di=ui[0];for(let pi=0;pi<Ws.length;pi++)if(ws[pi]===null){var hi;const ha=(hi=ai[pi])===null||hi===void 0?void 0:hi.apply(Ws[pi],ui);if(ha===!1)ws[pi]=di;else if(ha===BREAK)ws[pi]=BREAK;else if(ha!==void 0)return ha}},leave(...ui){const di=ui[0];for(let pi=0;pi<Ws.length;pi++)if(ws[pi]===null){var hi;const ha=(hi=li[pi])===null||hi===void 0?void 0:hi.apply(Ws[pi],ui);if(ha===BREAK)ws[pi]=BREAK;else if(ha!==void 0&&ha!==!1)return ha}else ws[pi]===di&&(ws[pi]=null)}};oi[si]=ci}return oi}function getEnterLeaveForKind(Ws,ws){const oi=Ws[ws];return typeof oi=="object"?oi:typeof oi=="function"?{enter:oi,leave:void 0}:{enter:Ws.enter,leave:Ws.leave}}function print(Ws){return visit(Ws,printDocASTReducer)}const MAX_LINE_LENGTH=80,printDocASTReducer={Name:{leave:Ws=>Ws.value},Variable:{leave:Ws=>"$"+Ws.name},Document:{leave:Ws=>join(Ws.definitions,`
258
-
259
- `)},OperationDefinition:{leave(Ws){const ws=wrap("(",join(Ws.variableDefinitions,", "),")"),oi=join([Ws.operation,join([Ws.name,ws]),join(Ws.directives," ")]," ");return(oi==="query"?"":oi+" ")+Ws.selectionSet}},VariableDefinition:{leave:({variable:Ws,type:ws,defaultValue:oi,directives:si})=>Ws+": "+ws+wrap(" = ",oi)+wrap(" ",join(si," "))},SelectionSet:{leave:({selections:Ws})=>block(Ws)},Field:{leave({alias:Ws,name:ws,arguments:oi,directives:si,selectionSet:ii}){const ai=wrap("",Ws,": ")+ws;let li=ai+wrap("(",join(oi,", "),")");return li.length>MAX_LINE_LENGTH&&(li=ai+wrap(`(
260
- `,indent(join(oi,`
261
- `)),`
262
- )`)),join([li,join(si," "),ii]," ")}},Argument:{leave:({name:Ws,value:ws})=>Ws+": "+ws},FragmentSpread:{leave:({name:Ws,directives:ws})=>"..."+Ws+wrap(" ",join(ws," "))},InlineFragment:{leave:({typeCondition:Ws,directives:ws,selectionSet:oi})=>join(["...",wrap("on ",Ws),join(ws," "),oi]," ")},FragmentDefinition:{leave:({name:Ws,typeCondition:ws,variableDefinitions:oi,directives:si,selectionSet:ii})=>`fragment ${Ws}${wrap("(",join(oi,", "),")")} on ${ws} ${wrap("",join(si," ")," ")}`+ii},IntValue:{leave:({value:Ws})=>Ws},FloatValue:{leave:({value:Ws})=>Ws},StringValue:{leave:({value:Ws,block:ws})=>ws?printBlockString(Ws):printString(Ws)},BooleanValue:{leave:({value:Ws})=>Ws?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:Ws})=>Ws},ListValue:{leave:({values:Ws})=>"["+join(Ws,", ")+"]"},ObjectValue:{leave:({fields:Ws})=>"{"+join(Ws,", ")+"}"},ObjectField:{leave:({name:Ws,value:ws})=>Ws+": "+ws},Directive:{leave:({name:Ws,arguments:ws})=>"@"+Ws+wrap("(",join(ws,", "),")")},NamedType:{leave:({name:Ws})=>Ws},ListType:{leave:({type:Ws})=>"["+Ws+"]"},NonNullType:{leave:({type:Ws})=>Ws+"!"},SchemaDefinition:{leave:({description:Ws,directives:ws,operationTypes:oi})=>wrap("",Ws,`
263
- `)+join(["schema",join(ws," "),block(oi)]," ")},OperationTypeDefinition:{leave:({operation:Ws,type:ws})=>Ws+": "+ws},ScalarTypeDefinition:{leave:({description:Ws,name:ws,directives:oi})=>wrap("",Ws,`
264
- `)+join(["scalar",ws,join(oi," ")]," ")},ObjectTypeDefinition:{leave:({description:Ws,name:ws,interfaces:oi,directives:si,fields:ii})=>wrap("",Ws,`
265
- `)+join(["type",ws,wrap("implements ",join(oi," & ")),join(si," "),block(ii)]," ")},FieldDefinition:{leave:({description:Ws,name:ws,arguments:oi,type:si,directives:ii})=>wrap("",Ws,`
266
- `)+ws+(hasMultilineItems(oi)?wrap(`(
267
- `,indent(join(oi,`
268
- `)),`
269
- )`):wrap("(",join(oi,", "),")"))+": "+si+wrap(" ",join(ii," "))},InputValueDefinition:{leave:({description:Ws,name:ws,type:oi,defaultValue:si,directives:ii})=>wrap("",Ws,`
270
- `)+join([ws+": "+oi,wrap("= ",si),join(ii," ")]," ")},InterfaceTypeDefinition:{leave:({description:Ws,name:ws,interfaces:oi,directives:si,fields:ii})=>wrap("",Ws,`
271
- `)+join(["interface",ws,wrap("implements ",join(oi," & ")),join(si," "),block(ii)]," ")},UnionTypeDefinition:{leave:({description:Ws,name:ws,directives:oi,types:si})=>wrap("",Ws,`
272
- `)+join(["union",ws,join(oi," "),wrap("= ",join(si," | "))]," ")},EnumTypeDefinition:{leave:({description:Ws,name:ws,directives:oi,values:si})=>wrap("",Ws,`
273
- `)+join(["enum",ws,join(oi," "),block(si)]," ")},EnumValueDefinition:{leave:({description:Ws,name:ws,directives:oi})=>wrap("",Ws,`
274
- `)+join([ws,join(oi," ")]," ")},InputObjectTypeDefinition:{leave:({description:Ws,name:ws,directives:oi,fields:si})=>wrap("",Ws,`
275
- `)+join(["input",ws,join(oi," "),block(si)]," ")},DirectiveDefinition:{leave:({description:Ws,name:ws,arguments:oi,repeatable:si,locations:ii})=>wrap("",Ws,`
276
- `)+"directive @"+ws+(hasMultilineItems(oi)?wrap(`(
277
- `,indent(join(oi,`
278
- `)),`
279
- )`):wrap("(",join(oi,", "),")"))+(si?" repeatable":"")+" on "+join(ii," | ")},SchemaExtension:{leave:({directives:Ws,operationTypes:ws})=>join(["extend schema",join(Ws," "),block(ws)]," ")},ScalarTypeExtension:{leave:({name:Ws,directives:ws})=>join(["extend scalar",Ws,join(ws," ")]," ")},ObjectTypeExtension:{leave:({name:Ws,interfaces:ws,directives:oi,fields:si})=>join(["extend type",Ws,wrap("implements ",join(ws," & ")),join(oi," "),block(si)]," ")},InterfaceTypeExtension:{leave:({name:Ws,interfaces:ws,directives:oi,fields:si})=>join(["extend interface",Ws,wrap("implements ",join(ws," & ")),join(oi," "),block(si)]," ")},UnionTypeExtension:{leave:({name:Ws,directives:ws,types:oi})=>join(["extend union",Ws,join(ws," "),wrap("= ",join(oi," | "))]," ")},EnumTypeExtension:{leave:({name:Ws,directives:ws,values:oi})=>join(["extend enum",Ws,join(ws," "),block(oi)]," ")},InputObjectTypeExtension:{leave:({name:Ws,directives:ws,fields:oi})=>join(["extend input",Ws,join(ws," "),block(oi)]," ")}};function join(Ws,ws=""){var oi;return(oi=Ws==null?void 0:Ws.filter(si=>si).join(ws))!==null&&oi!==void 0?oi:""}function block(Ws){return wrap(`{
280
- `,indent(join(Ws,`
281
- `)),`
282
- }`)}function wrap(Ws,ws,oi=""){return ws!=null&&ws!==""?Ws+ws+oi:""}function indent(Ws){return wrap(" ",Ws.replace(/\n/g,`
283
- `))}function hasMultilineItems(Ws){var ws;return(ws=Ws==null?void 0:Ws.some(oi=>oi.includes(`
284
- `)))!==null&&ws!==void 0?ws:!1}function valueFromASTUntyped(Ws,ws){switch(Ws.kind){case Kind.NULL:return null;case Kind.INT:return parseInt(Ws.value,10);case Kind.FLOAT:return parseFloat(Ws.value);case Kind.STRING:case Kind.ENUM:case Kind.BOOLEAN:return Ws.value;case Kind.LIST:return Ws.values.map(oi=>valueFromASTUntyped(oi,ws));case Kind.OBJECT:return keyValMap(Ws.fields,oi=>oi.name.value,oi=>valueFromASTUntyped(oi.value,ws));case Kind.VARIABLE:return ws==null?void 0:ws[Ws.name.value]}}function assertName(Ws){if(Ws!=null||devAssert(!1,"Must provide name."),typeof Ws=="string"||devAssert(!1,"Expected name to be a string."),Ws.length===0)throw new GraphQLError("Expected name to be a non-empty string.");for(let ws=1;ws<Ws.length;++ws)if(!isNameContinue(Ws.charCodeAt(ws)))throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${Ws}" does not.`);if(!isNameStart(Ws.charCodeAt(0)))throw new GraphQLError(`Names must start with [_a-zA-Z] but "${Ws}" does not.`);return Ws}function assertEnumValueName(Ws){if(Ws==="true"||Ws==="false"||Ws==="null")throw new GraphQLError(`Enum values cannot be named: ${Ws}`);return assertName(Ws)}function isType(Ws){return isScalarType(Ws)||isObjectType(Ws)||isInterfaceType(Ws)||isUnionType(Ws)||isEnumType(Ws)||isInputObjectType(Ws)||isListType(Ws)||isNonNullType(Ws)}function isScalarType(Ws){return instanceOf(Ws,GraphQLScalarType)}function isObjectType(Ws){return instanceOf(Ws,GraphQLObjectType)}function isInterfaceType(Ws){return instanceOf(Ws,GraphQLInterfaceType)}function isUnionType(Ws){return instanceOf(Ws,GraphQLUnionType)}function isEnumType(Ws){return instanceOf(Ws,GraphQLEnumType)}function isInputObjectType(Ws){return instanceOf(Ws,GraphQLInputObjectType)}function isListType(Ws){return instanceOf(Ws,GraphQLList)}function isNonNullType(Ws){return instanceOf(Ws,GraphQLNonNull)}function isInputType(Ws){return isScalarType(Ws)||isEnumType(Ws)||isInputObjectType(Ws)||isWrappingType(Ws)&&isInputType(Ws.ofType)}function isOutputType(Ws){return isScalarType(Ws)||isObjectType(Ws)||isInterfaceType(Ws)||isUnionType(Ws)||isEnumType(Ws)||isWrappingType(Ws)&&isOutputType(Ws.ofType)}function isLeafType(Ws){return isScalarType(Ws)||isEnumType(Ws)}function isCompositeType(Ws){return isObjectType(Ws)||isInterfaceType(Ws)||isUnionType(Ws)}function isAbstractType(Ws){return isInterfaceType(Ws)||isUnionType(Ws)}function assertAbstractType(Ws){if(!isAbstractType(Ws))throw new Error(`Expected ${inspect(Ws)} to be a GraphQL abstract type.`);return Ws}class GraphQLList{constructor(ws){isType(ws)||devAssert(!1,`Expected ${inspect(ws)} to be a GraphQL type.`),this.ofType=ws}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class GraphQLNonNull{constructor(ws){isNullableType(ws)||devAssert(!1,`Expected ${inspect(ws)} to be a GraphQL nullable type.`),this.ofType=ws}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function isWrappingType(Ws){return isListType(Ws)||isNonNullType(Ws)}function isNullableType(Ws){return isType(Ws)&&!isNonNullType(Ws)}function getNullableType(Ws){if(Ws)return isNonNullType(Ws)?Ws.ofType:Ws}function isNamedType(Ws){return isScalarType(Ws)||isObjectType(Ws)||isInterfaceType(Ws)||isUnionType(Ws)||isEnumType(Ws)||isInputObjectType(Ws)}function getNamedType(Ws){if(Ws){let ws=Ws;for(;isWrappingType(ws);)ws=ws.ofType;return ws}}function resolveReadonlyArrayThunk(Ws){return typeof Ws=="function"?Ws():Ws}function resolveObjMapThunk(Ws){return typeof Ws=="function"?Ws():Ws}class GraphQLScalarType{constructor(ws){var oi,si,ii,ai;const li=(oi=ws.parseValue)!==null&&oi!==void 0?oi:identityFunc;this.name=assertName(ws.name),this.description=ws.description,this.specifiedByURL=ws.specifiedByURL,this.serialize=(si=ws.serialize)!==null&&si!==void 0?si:identityFunc,this.parseValue=li,this.parseLiteral=(ii=ws.parseLiteral)!==null&&ii!==void 0?ii:(ci,ui)=>li(valueFromASTUntyped(ci,ui)),this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(ai=ws.extensionASTNodes)!==null&&ai!==void 0?ai:[],ws.specifiedByURL==null||typeof ws.specifiedByURL=="string"||devAssert(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(ws.specifiedByURL)}.`),ws.serialize==null||typeof ws.serialize=="function"||devAssert(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),ws.parseLiteral&&(typeof ws.parseValue=="function"&&typeof ws.parseLiteral=="function"||devAssert(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLObjectType{constructor(ws){var oi;this.name=assertName(ws.name),this.description=ws.description,this.isTypeOf=ws.isTypeOf,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this._fields=()=>defineFieldMap(ws),this._interfaces=()=>defineInterfaces(ws),ws.isTypeOf==null||typeof ws.isTypeOf=="function"||devAssert(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${inspect(ws.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineInterfaces(Ws){var ws;const oi=resolveReadonlyArrayThunk((ws=Ws.interfaces)!==null&&ws!==void 0?ws:[]);return Array.isArray(oi)||devAssert(!1,`${Ws.name} interfaces must be an Array or a function which returns an Array.`),oi}function defineFieldMap(Ws){const ws=resolveObjMapThunk(Ws.fields);return isPlainObj(ws)||devAssert(!1,`${Ws.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(ws,(oi,si)=>{var ii;isPlainObj(oi)||devAssert(!1,`${Ws.name}.${si} field config must be an object.`),oi.resolve==null||typeof oi.resolve=="function"||devAssert(!1,`${Ws.name}.${si} field resolver must be a function if provided, but got: ${inspect(oi.resolve)}.`);const ai=(ii=oi.args)!==null&&ii!==void 0?ii:{};return isPlainObj(ai)||devAssert(!1,`${Ws.name}.${si} args must be an object with argument names as keys.`),{name:assertName(si),description:oi.description,type:oi.type,args:defineArguments(ai),resolve:oi.resolve,subscribe:oi.subscribe,deprecationReason:oi.deprecationReason,extensions:toObjMap(oi.extensions),astNode:oi.astNode}})}function defineArguments(Ws){return Object.entries(Ws).map(([ws,oi])=>({name:assertName(ws),description:oi.description,type:oi.type,defaultValue:oi.defaultValue,deprecationReason:oi.deprecationReason,extensions:toObjMap(oi.extensions),astNode:oi.astNode}))}function isPlainObj(Ws){return isObjectLike(Ws)&&!Array.isArray(Ws)}function fieldsToFieldsConfig(Ws){return mapValue(Ws,ws=>({description:ws.description,type:ws.type,args:argsToArgsConfig(ws.args),resolve:ws.resolve,subscribe:ws.subscribe,deprecationReason:ws.deprecationReason,extensions:ws.extensions,astNode:ws.astNode}))}function argsToArgsConfig(Ws){return keyValMap(Ws,ws=>ws.name,ws=>({description:ws.description,type:ws.type,defaultValue:ws.defaultValue,deprecationReason:ws.deprecationReason,extensions:ws.extensions,astNode:ws.astNode}))}function isRequiredArgument(Ws){return isNonNullType(Ws.type)&&Ws.defaultValue===void 0}class GraphQLInterfaceType{constructor(ws){var oi;this.name=assertName(ws.name),this.description=ws.description,this.resolveType=ws.resolveType,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this._fields=defineFieldMap.bind(void 0,ws),this._interfaces=defineInterfaces.bind(void 0,ws),ws.resolveType==null||typeof ws.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(ws.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:fieldsToFieldsConfig(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class GraphQLUnionType{constructor(ws){var oi;this.name=assertName(ws.name),this.description=ws.description,this.resolveType=ws.resolveType,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this._types=defineTypes.bind(void 0,ws),ws.resolveType==null||typeof ws.resolveType=="function"||devAssert(!1,`${this.name} must provide "resolveType" as a function, but got: ${inspect(ws.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function defineTypes(Ws){const ws=resolveReadonlyArrayThunk(Ws.types);return Array.isArray(ws)||devAssert(!1,`Must provide Array of types or a function which returns such an array for Union ${Ws.name}.`),ws}class GraphQLEnumType{constructor(ws){var oi;this.name=assertName(ws.name),this.description=ws.description,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this._values=typeof ws.values=="function"?ws.values:defineEnumValues(this.name,ws.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=defineEnumValues(this.name,this._values())),this._values}getValue(ws){return this._nameLookup===null&&(this._nameLookup=keyMap(this.getValues(),oi=>oi.name)),this._nameLookup[ws]}serialize(ws){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(si=>[si.value,si])));const oi=this._valueLookup.get(ws);if(oi===void 0)throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(ws)}`);return oi.name}parseValue(ws){if(typeof ws!="string"){const si=inspect(ws);throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${si}.`+didYouMeanEnumValue(this,si))}const oi=this.getValue(ws);if(oi==null)throw new GraphQLError(`Value "${ws}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,ws));return oi.value}parseLiteral(ws,oi){if(ws.kind!==Kind.ENUM){const ii=print(ws);throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${ii}.`+didYouMeanEnumValue(this,ii),{nodes:ws})}const si=this.getValue(ws.value);if(si==null){const ii=print(ws);throw new GraphQLError(`Value "${ii}" does not exist in "${this.name}" enum.`+didYouMeanEnumValue(this,ii),{nodes:ws})}return si.value}toConfig(){const ws=keyValMap(this.getValues(),oi=>oi.name,oi=>({description:oi.description,value:oi.value,deprecationReason:oi.deprecationReason,extensions:oi.extensions,astNode:oi.astNode}));return{name:this.name,description:this.description,values:ws,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function didYouMeanEnumValue(Ws,ws){const oi=Ws.getValues().map(ii=>ii.name),si=suggestionList(ws,oi);return didYouMean("the enum value",si)}function defineEnumValues(Ws,ws){return isPlainObj(ws)||devAssert(!1,`${Ws} values must be an object with value names as keys.`),Object.entries(ws).map(([oi,si])=>(isPlainObj(si)||devAssert(!1,`${Ws}.${oi} must refer to an object with a "value" key representing an internal value but got: ${inspect(si)}.`),{name:assertEnumValueName(oi),description:si.description,value:si.value!==void 0?si.value:oi,deprecationReason:si.deprecationReason,extensions:toObjMap(si.extensions),astNode:si.astNode}))}class GraphQLInputObjectType{constructor(ws){var oi,si;this.name=assertName(ws.name),this.description=ws.description,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this.isOneOf=(si=ws.isOneOf)!==null&&si!==void 0?si:!1,this._fields=defineInputFieldMap.bind(void 0,ws)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const ws=mapValue(this.getFields(),oi=>({description:oi.description,type:oi.type,defaultValue:oi.defaultValue,deprecationReason:oi.deprecationReason,extensions:oi.extensions,astNode:oi.astNode}));return{name:this.name,description:this.description,fields:ws,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function defineInputFieldMap(Ws){const ws=resolveObjMapThunk(Ws.fields);return isPlainObj(ws)||devAssert(!1,`${Ws.name} fields must be an object with field names as keys or a function which returns such an object.`),mapValue(ws,(oi,si)=>(!("resolve"in oi)||devAssert(!1,`${Ws.name}.${si} field has a resolve property, but Input Types cannot define resolvers.`),{name:assertName(si),description:oi.description,type:oi.type,defaultValue:oi.defaultValue,deprecationReason:oi.deprecationReason,extensions:toObjMap(oi.extensions),astNode:oi.astNode}))}function isRequiredInputField(Ws){return isNonNullType(Ws.type)&&Ws.defaultValue===void 0}function isEqualType(Ws,ws){return Ws===ws?!0:isNonNullType(Ws)&&isNonNullType(ws)||isListType(Ws)&&isListType(ws)?isEqualType(Ws.ofType,ws.ofType):!1}function isTypeSubTypeOf(Ws,ws,oi){return ws===oi?!0:isNonNullType(oi)?isNonNullType(ws)?isTypeSubTypeOf(Ws,ws.ofType,oi.ofType):!1:isNonNullType(ws)?isTypeSubTypeOf(Ws,ws.ofType,oi):isListType(oi)?isListType(ws)?isTypeSubTypeOf(Ws,ws.ofType,oi.ofType):!1:isListType(ws)?!1:isAbstractType(oi)&&(isInterfaceType(ws)||isObjectType(ws))&&Ws.isSubType(oi,ws)}function doTypesOverlap(Ws,ws,oi){return ws===oi?!0:isAbstractType(ws)?isAbstractType(oi)?Ws.getPossibleTypes(ws).some(si=>Ws.isSubType(oi,si)):Ws.isSubType(ws,oi):isAbstractType(oi)?Ws.isSubType(oi,ws):!1}const GRAPHQL_MAX_INT=2147483647,GRAPHQL_MIN_INT=-2147483648,GraphQLInt=new GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(Ws){const ws=serializeObject(Ws);if(typeof ws=="boolean")return ws?1:0;let oi=ws;if(typeof ws=="string"&&ws!==""&&(oi=Number(ws)),typeof oi!="number"||!Number.isInteger(oi))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(ws)}`);if(oi>GRAPHQL_MAX_INT||oi<GRAPHQL_MIN_INT)throw new GraphQLError("Int cannot represent non 32-bit signed integer value: "+inspect(ws));return oi},parseValue(Ws){if(typeof Ws!="number"||!Number.isInteger(Ws))throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(Ws)}`);if(Ws>GRAPHQL_MAX_INT||Ws<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${Ws}`);return Ws},parseLiteral(Ws){if(Ws.kind!==Kind.INT)throw new GraphQLError(`Int cannot represent non-integer value: ${print(Ws)}`,{nodes:Ws});const ws=parseInt(Ws.value,10);if(ws>GRAPHQL_MAX_INT||ws<GRAPHQL_MIN_INT)throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${Ws.value}`,{nodes:Ws});return ws}}),GraphQLFloat=new GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(Ws){const ws=serializeObject(Ws);if(typeof ws=="boolean")return ws?1:0;let oi=ws;if(typeof ws=="string"&&ws!==""&&(oi=Number(ws)),typeof oi!="number"||!Number.isFinite(oi))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(ws)}`);return oi},parseValue(Ws){if(typeof Ws!="number"||!Number.isFinite(Ws))throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(Ws)}`);return Ws},parseLiteral(Ws){if(Ws.kind!==Kind.FLOAT&&Ws.kind!==Kind.INT)throw new GraphQLError(`Float cannot represent non numeric value: ${print(Ws)}`,Ws);return parseFloat(Ws.value)}}),GraphQLString=new GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(Ws){const ws=serializeObject(Ws);if(typeof ws=="string")return ws;if(typeof ws=="boolean")return ws?"true":"false";if(typeof ws=="number"&&Number.isFinite(ws))return ws.toString();throw new GraphQLError(`String cannot represent value: ${inspect(Ws)}`)},parseValue(Ws){if(typeof Ws!="string")throw new GraphQLError(`String cannot represent a non string value: ${inspect(Ws)}`);return Ws},parseLiteral(Ws){if(Ws.kind!==Kind.STRING)throw new GraphQLError(`String cannot represent a non string value: ${print(Ws)}`,{nodes:Ws});return Ws.value}}),GraphQLBoolean=new GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(Ws){const ws=serializeObject(Ws);if(typeof ws=="boolean")return ws;if(Number.isFinite(ws))return ws!==0;throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(ws)}`)},parseValue(Ws){if(typeof Ws!="boolean")throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(Ws)}`);return Ws},parseLiteral(Ws){if(Ws.kind!==Kind.BOOLEAN)throw new GraphQLError(`Boolean cannot represent a non boolean value: ${print(Ws)}`,{nodes:Ws});return Ws.value}}),GraphQLID=new GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(Ws){const ws=serializeObject(Ws);if(typeof ws=="string")return ws;if(Number.isInteger(ws))return String(ws);throw new GraphQLError(`ID cannot represent value: ${inspect(Ws)}`)},parseValue(Ws){if(typeof Ws=="string")return Ws;if(typeof Ws=="number"&&Number.isInteger(Ws))return Ws.toString();throw new GraphQLError(`ID cannot represent value: ${inspect(Ws)}`)},parseLiteral(Ws){if(Ws.kind!==Kind.STRING&&Ws.kind!==Kind.INT)throw new GraphQLError("ID cannot represent a non-string and non-integer value: "+print(Ws),{nodes:Ws});return Ws.value}}),specifiedScalarTypes=Object.freeze([GraphQLString,GraphQLInt,GraphQLFloat,GraphQLBoolean,GraphQLID]);function isSpecifiedScalarType(Ws){return specifiedScalarTypes.some(({name:ws})=>Ws.name===ws)}function serializeObject(Ws){if(isObjectLike(Ws)){if(typeof Ws.valueOf=="function"){const ws=Ws.valueOf();if(!isObjectLike(ws))return ws}if(typeof Ws.toJSON=="function")return Ws.toJSON()}return Ws}function isDirective(Ws){return instanceOf(Ws,GraphQLDirective)}class GraphQLDirective{constructor(ws){var oi,si;this.name=assertName(ws.name),this.description=ws.description,this.locations=ws.locations,this.isRepeatable=(oi=ws.isRepeatable)!==null&&oi!==void 0?oi:!1,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,Array.isArray(ws.locations)||devAssert(!1,`@${ws.name} locations must be an Array.`);const ii=(si=ws.args)!==null&&si!==void 0?si:{};isObjectLike(ii)&&!Array.isArray(ii)||devAssert(!1,`@${ws.name} args must be an object with argument names as keys.`),this.args=defineArguments(ii)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:argsToArgsConfig(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Included when true."}}}),GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[DirectiveLocation.FIELD,DirectiveLocation.FRAGMENT_SPREAD,DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new GraphQLNonNull(GraphQLBoolean),description:"Skipped when true."}}}),DEFAULT_DEPRECATION_REASON="No longer supported",GraphQLDeprecatedDirective=new GraphQLDirective({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[DirectiveLocation.FIELD_DEFINITION,DirectiveLocation.ARGUMENT_DEFINITION,DirectiveLocation.INPUT_FIELD_DEFINITION,DirectiveLocation.ENUM_VALUE],args:{reason:{type:GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:DEFAULT_DEPRECATION_REASON}}}),GraphQLSpecifiedByDirective=new GraphQLDirective({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[DirectiveLocation.SCALAR],args:{url:{type:new GraphQLNonNull(GraphQLString),description:"The URL that specifies the behavior of this scalar."}}}),GraphQLOneOfDirective=new GraphQLDirective({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[DirectiveLocation.INPUT_OBJECT],args:{}}),specifiedDirectives=Object.freeze([GraphQLIncludeDirective,GraphQLSkipDirective,GraphQLDeprecatedDirective,GraphQLSpecifiedByDirective,GraphQLOneOfDirective]);function isSpecifiedDirective(Ws){return specifiedDirectives.some(({name:ws})=>ws===Ws.name)}function isIterableObject(Ws){return typeof Ws=="object"&&typeof(Ws==null?void 0:Ws[Symbol.iterator])=="function"}function astFromValue(Ws,ws){if(isNonNullType(ws)){const oi=astFromValue(Ws,ws.ofType);return(oi==null?void 0:oi.kind)===Kind.NULL?null:oi}if(Ws===null)return{kind:Kind.NULL};if(Ws===void 0)return null;if(isListType(ws)){const oi=ws.ofType;if(isIterableObject(Ws)){const si=[];for(const ii of Ws){const ai=astFromValue(ii,oi);ai!=null&&si.push(ai)}return{kind:Kind.LIST,values:si}}return astFromValue(Ws,oi)}if(isInputObjectType(ws)){if(!isObjectLike(Ws))return null;const oi=[];for(const si of Object.values(ws.getFields())){const ii=astFromValue(Ws[si.name],si.type);ii&&oi.push({kind:Kind.OBJECT_FIELD,name:{kind:Kind.NAME,value:si.name},value:ii})}return{kind:Kind.OBJECT,fields:oi}}if(isLeafType(ws)){const oi=ws.serialize(Ws);if(oi==null)return null;if(typeof oi=="boolean")return{kind:Kind.BOOLEAN,value:oi};if(typeof oi=="number"&&Number.isFinite(oi)){const si=String(oi);return integerStringRegExp.test(si)?{kind:Kind.INT,value:si}:{kind:Kind.FLOAT,value:si}}if(typeof oi=="string")return isEnumType(ws)?{kind:Kind.ENUM,value:oi}:ws===GraphQLID&&integerStringRegExp.test(oi)?{kind:Kind.INT,value:oi}:{kind:Kind.STRING,value:oi};throw new TypeError(`Cannot convert value to AST: ${inspect(oi)}.`)}invariant$1(!1,"Unexpected input type: "+inspect(ws))}const integerStringRegExp=/^-?(?:0|[1-9][0-9]*)$/,__Schema=new GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:GraphQLString,resolve:Ws=>Ws.description},types:{description:"A list of all types supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),resolve(Ws){return Object.values(Ws.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new GraphQLNonNull(__Type),resolve:Ws=>Ws.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:Ws=>Ws.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:Ws=>Ws.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),resolve:Ws=>Ws.getDirectives()}})}),__Directive=new GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
285
-
286
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:Ws=>Ws.name},description:{type:GraphQLString,resolve:Ws=>Ws.description},isRepeatable:{type:new GraphQLNonNull(GraphQLBoolean),resolve:Ws=>Ws.isRepeatable},locations:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),resolve:Ws=>Ws.locations},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(Ws,{includeDeprecated:ws}){return ws?Ws.args:Ws.args.filter(oi=>oi.deprecationReason==null)}}})}),__DirectiveLocation=new GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),__Type=new GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new GraphQLNonNull(__TypeKind),resolve(Ws){if(isScalarType(Ws))return TypeKind.SCALAR;if(isObjectType(Ws))return TypeKind.OBJECT;if(isInterfaceType(Ws))return TypeKind.INTERFACE;if(isUnionType(Ws))return TypeKind.UNION;if(isEnumType(Ws))return TypeKind.ENUM;if(isInputObjectType(Ws))return TypeKind.INPUT_OBJECT;if(isListType(Ws))return TypeKind.LIST;if(isNonNullType(Ws))return TypeKind.NON_NULL;invariant$1(!1,`Unexpected type: "${inspect(Ws)}".`)}},name:{type:GraphQLString,resolve:Ws=>"name"in Ws?Ws.name:void 0},description:{type:GraphQLString,resolve:Ws=>"description"in Ws?Ws.description:void 0},specifiedByURL:{type:GraphQLString,resolve:Ws=>"specifiedByURL"in Ws?Ws.specifiedByURL:void 0},fields:{type:new GraphQLList(new GraphQLNonNull(__Field)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(Ws,{includeDeprecated:ws}){if(isObjectType(Ws)||isInterfaceType(Ws)){const oi=Object.values(Ws.getFields());return ws?oi:oi.filter(si=>si.deprecationReason==null)}}},interfaces:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(Ws){if(isObjectType(Ws)||isInterfaceType(Ws))return Ws.getInterfaces()}},possibleTypes:{type:new GraphQLList(new GraphQLNonNull(__Type)),resolve(Ws,ws,oi,{schema:si}){if(isAbstractType(Ws))return si.getPossibleTypes(Ws)}},enumValues:{type:new GraphQLList(new GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(Ws,{includeDeprecated:ws}){if(isEnumType(Ws)){const oi=Ws.getValues();return ws?oi:oi.filter(si=>si.deprecationReason==null)}}},inputFields:{type:new GraphQLList(new GraphQLNonNull(__InputValue)),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(Ws,{includeDeprecated:ws}){if(isInputObjectType(Ws)){const oi=Object.values(Ws.getFields());return ws?oi:oi.filter(si=>si.deprecationReason==null)}}},ofType:{type:__Type,resolve:Ws=>"ofType"in Ws?Ws.ofType:void 0},isOneOf:{type:GraphQLBoolean,resolve:Ws=>{if(isInputObjectType(Ws))return Ws.isOneOf}}})}),__Field=new GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:Ws=>Ws.name},description:{type:GraphQLString,resolve:Ws=>Ws.description},args:{type:new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),args:{includeDeprecated:{type:GraphQLBoolean,defaultValue:!1}},resolve(Ws,{includeDeprecated:ws}){return ws?Ws.args:Ws.args.filter(oi=>oi.deprecationReason==null)}},type:{type:new GraphQLNonNull(__Type),resolve:Ws=>Ws.type},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:Ws=>Ws.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:Ws=>Ws.deprecationReason}})}),__InputValue=new GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:Ws=>Ws.name},description:{type:GraphQLString,resolve:Ws=>Ws.description},type:{type:new GraphQLNonNull(__Type),resolve:Ws=>Ws.type},defaultValue:{type:GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(Ws){const{type:ws,defaultValue:oi}=Ws,si=astFromValue(oi,ws);return si?print(si):null}},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:Ws=>Ws.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:Ws=>Ws.deprecationReason}})}),__EnumValue=new GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new GraphQLNonNull(GraphQLString),resolve:Ws=>Ws.name},description:{type:GraphQLString,resolve:Ws=>Ws.description},isDeprecated:{type:new GraphQLNonNull(GraphQLBoolean),resolve:Ws=>Ws.deprecationReason!=null},deprecationReason:{type:GraphQLString,resolve:Ws=>Ws.deprecationReason}})});var TypeKind;(function(Ws){Ws.SCALAR="SCALAR",Ws.OBJECT="OBJECT",Ws.INTERFACE="INTERFACE",Ws.UNION="UNION",Ws.ENUM="ENUM",Ws.INPUT_OBJECT="INPUT_OBJECT",Ws.LIST="LIST",Ws.NON_NULL="NON_NULL"})(TypeKind||(TypeKind={}));const __TypeKind=new GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:(Ws,ws,oi,{schema:si})=>si,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new GraphQLNonNull(GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(Ws,{name:ws},oi,{schema:si})=>si.getType(ws),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},TypeNameMetaFieldDef={name:"__typename",type:new GraphQLNonNull(GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(Ws,ws,oi,{parentType:si})=>si.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},introspectionTypes=Object.freeze([__Schema,__Directive,__DirectiveLocation,__Type,__Field,__InputValue,__EnumValue,__TypeKind]);function isIntrospectionType(Ws){return introspectionTypes.some(({name:ws})=>Ws.name===ws)}function isSchema(Ws){return instanceOf(Ws,GraphQLSchema)}function assertSchema(Ws){if(!isSchema(Ws))throw new Error(`Expected ${inspect(Ws)} to be a GraphQL schema.`);return Ws}class GraphQLSchema{constructor(ws){var oi,si;this.__validationErrors=ws.assumeValid===!0?[]:void 0,isObjectLike(ws)||devAssert(!1,"Must provide configuration object."),!ws.types||Array.isArray(ws.types)||devAssert(!1,`"types" must be Array if provided but got: ${inspect(ws.types)}.`),!ws.directives||Array.isArray(ws.directives)||devAssert(!1,`"directives" must be Array if provided but got: ${inspect(ws.directives)}.`),this.description=ws.description,this.extensions=toObjMap(ws.extensions),this.astNode=ws.astNode,this.extensionASTNodes=(oi=ws.extensionASTNodes)!==null&&oi!==void 0?oi:[],this._queryType=ws.query,this._mutationType=ws.mutation,this._subscriptionType=ws.subscription,this._directives=(si=ws.directives)!==null&&si!==void 0?si:specifiedDirectives;const ii=new Set(ws.types);if(ws.types!=null)for(const ai of ws.types)ii.delete(ai),collectReferencedTypes(ai,ii);this._queryType!=null&&collectReferencedTypes(this._queryType,ii),this._mutationType!=null&&collectReferencedTypes(this._mutationType,ii),this._subscriptionType!=null&&collectReferencedTypes(this._subscriptionType,ii);for(const ai of this._directives)if(isDirective(ai))for(const li of ai.args)collectReferencedTypes(li.type,ii);collectReferencedTypes(__Schema,ii),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const ai of ii){if(ai==null)continue;const li=ai.name;if(li||devAssert(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[li]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${li}".`);if(this._typeMap[li]=ai,isInterfaceType(ai)){for(const ci of ai.getInterfaces())if(isInterfaceType(ci)){let ui=this._implementationsMap[ci.name];ui===void 0&&(ui=this._implementationsMap[ci.name]={objects:[],interfaces:[]}),ui.interfaces.push(ai)}}else if(isObjectType(ai)){for(const ci of ai.getInterfaces())if(isInterfaceType(ci)){let ui=this._implementationsMap[ci.name];ui===void 0&&(ui=this._implementationsMap[ci.name]={objects:[],interfaces:[]}),ui.objects.push(ai)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(ws){switch(ws){case OperationTypeNode.QUERY:return this.getQueryType();case OperationTypeNode.MUTATION:return this.getMutationType();case OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(ws){return this.getTypeMap()[ws]}getPossibleTypes(ws){return isUnionType(ws)?ws.getTypes():this.getImplementations(ws).objects}getImplementations(ws){return this._implementationsMap[ws.name]??{objects:[],interfaces:[]}}isSubType(ws,oi){let si=this._subTypeMap[ws.name];if(si===void 0){if(si=Object.create(null),isUnionType(ws))for(const ii of ws.getTypes())si[ii.name]=!0;else{const ii=this.getImplementations(ws);for(const ai of ii.objects)si[ai.name]=!0;for(const ai of ii.interfaces)si[ai.name]=!0}this._subTypeMap[ws.name]=si}return si[oi.name]!==void 0}getDirectives(){return this._directives}getDirective(ws){return this.getDirectives().find(oi=>oi.name===ws)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function collectReferencedTypes(Ws,ws){const oi=getNamedType(Ws);if(!ws.has(oi)){if(ws.add(oi),isUnionType(oi))for(const si of oi.getTypes())collectReferencedTypes(si,ws);else if(isObjectType(oi)||isInterfaceType(oi)){for(const si of oi.getInterfaces())collectReferencedTypes(si,ws);for(const si of Object.values(oi.getFields())){collectReferencedTypes(si.type,ws);for(const ii of si.args)collectReferencedTypes(ii.type,ws)}}else if(isInputObjectType(oi))for(const si of Object.values(oi.getFields()))collectReferencedTypes(si.type,ws)}return ws}function validateSchema(Ws){if(assertSchema(Ws),Ws.__validationErrors)return Ws.__validationErrors;const ws=new SchemaValidationContext(Ws);validateRootTypes(ws),validateDirectives(ws),validateTypes(ws);const oi=ws.getErrors();return Ws.__validationErrors=oi,oi}function assertValidSchema(Ws){const ws=validateSchema(Ws);if(ws.length!==0)throw new Error(ws.map(oi=>oi.message).join(`
287
-
288
- `))}class SchemaValidationContext{constructor(ws){this._errors=[],this.schema=ws}reportError(ws,oi){const si=Array.isArray(oi)?oi.filter(Boolean):oi;this._errors.push(new GraphQLError(ws,{nodes:si}))}getErrors(){return this._errors}}function validateRootTypes(Ws){const ws=Ws.schema,oi=ws.getQueryType();if(!oi)Ws.reportError("Query root type must be provided.",ws.astNode);else if(!isObjectType(oi)){var si;Ws.reportError(`Query root type must be Object type, it cannot be ${inspect(oi)}.`,(si=getOperationTypeNode(ws,OperationTypeNode.QUERY))!==null&&si!==void 0?si:oi.astNode)}const ii=ws.getMutationType();if(ii&&!isObjectType(ii)){var ai;Ws.reportError(`Mutation root type must be Object type if provided, it cannot be ${inspect(ii)}.`,(ai=getOperationTypeNode(ws,OperationTypeNode.MUTATION))!==null&&ai!==void 0?ai:ii.astNode)}const li=ws.getSubscriptionType();if(li&&!isObjectType(li)){var ci;Ws.reportError(`Subscription root type must be Object type if provided, it cannot be ${inspect(li)}.`,(ci=getOperationTypeNode(ws,OperationTypeNode.SUBSCRIPTION))!==null&&ci!==void 0?ci:li.astNode)}}function getOperationTypeNode(Ws,ws){var oi;return(oi=[Ws.astNode,...Ws.extensionASTNodes].flatMap(si=>{var ii;return(ii=si==null?void 0:si.operationTypes)!==null&&ii!==void 0?ii:[]}).find(si=>si.operation===ws))===null||oi===void 0?void 0:oi.type}function validateDirectives(Ws){for(const oi of Ws.schema.getDirectives()){if(!isDirective(oi)){Ws.reportError(`Expected directive but got: ${inspect(oi)}.`,oi==null?void 0:oi.astNode);continue}validateName(Ws,oi),oi.locations.length===0&&Ws.reportError(`Directive @${oi.name} must include 1 or more locations.`,oi.astNode);for(const si of oi.args)if(validateName(Ws,si),isInputType(si.type)||Ws.reportError(`The type of @${oi.name}(${si.name}:) must be Input Type but got: ${inspect(si.type)}.`,si.astNode),isRequiredArgument(si)&&si.deprecationReason!=null){var ws;Ws.reportError(`Required argument @${oi.name}(${si.name}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(si.astNode),(ws=si.astNode)===null||ws===void 0?void 0:ws.type])}}}function validateName(Ws,ws){ws.name.startsWith("__")&&Ws.reportError(`Name "${ws.name}" must not begin with "__", which is reserved by GraphQL introspection.`,ws.astNode)}function validateTypes(Ws){const ws=createInputObjectCircularRefsValidator(Ws),oi=Ws.schema.getTypeMap();for(const si of Object.values(oi)){if(!isNamedType(si)){Ws.reportError(`Expected GraphQL named type but got: ${inspect(si)}.`,si.astNode);continue}isIntrospectionType(si)||validateName(Ws,si),isObjectType(si)||isInterfaceType(si)?(validateFields(Ws,si),validateInterfaces(Ws,si)):isUnionType(si)?validateUnionMembers(Ws,si):isEnumType(si)?validateEnumValues(Ws,si):isInputObjectType(si)&&(validateInputFields(Ws,si),ws(si))}}function validateFields(Ws,ws){const oi=Object.values(ws.getFields());oi.length===0&&Ws.reportError(`Type ${ws.name} must define one or more fields.`,[ws.astNode,...ws.extensionASTNodes]);for(const li of oi){if(validateName(Ws,li),!isOutputType(li.type)){var si;Ws.reportError(`The type of ${ws.name}.${li.name} must be Output Type but got: ${inspect(li.type)}.`,(si=li.astNode)===null||si===void 0?void 0:si.type)}for(const ci of li.args){const ui=ci.name;if(validateName(Ws,ci),!isInputType(ci.type)){var ii;Ws.reportError(`The type of ${ws.name}.${li.name}(${ui}:) must be Input Type but got: ${inspect(ci.type)}.`,(ii=ci.astNode)===null||ii===void 0?void 0:ii.type)}if(isRequiredArgument(ci)&&ci.deprecationReason!=null){var ai;Ws.reportError(`Required argument ${ws.name}.${li.name}(${ui}:) cannot be deprecated.`,[getDeprecatedDirectiveNode(ci.astNode),(ai=ci.astNode)===null||ai===void 0?void 0:ai.type])}}}}function validateInterfaces(Ws,ws){const oi=Object.create(null);for(const si of ws.getInterfaces()){if(!isInterfaceType(si)){Ws.reportError(`Type ${inspect(ws)} must only implement Interface types, it cannot implement ${inspect(si)}.`,getAllImplementsInterfaceNodes(ws,si));continue}if(ws===si){Ws.reportError(`Type ${ws.name} cannot implement itself because it would create a circular reference.`,getAllImplementsInterfaceNodes(ws,si));continue}if(oi[si.name]){Ws.reportError(`Type ${ws.name} can only implement ${si.name} once.`,getAllImplementsInterfaceNodes(ws,si));continue}oi[si.name]=!0,validateTypeImplementsAncestors(Ws,ws,si),validateTypeImplementsInterface(Ws,ws,si)}}function validateTypeImplementsInterface(Ws,ws,oi){const si=ws.getFields();for(const ui of Object.values(oi.getFields())){const di=ui.name,hi=si[di];if(!hi){Ws.reportError(`Interface field ${oi.name}.${di} expected but ${ws.name} does not provide it.`,[ui.astNode,ws.astNode,...ws.extensionASTNodes]);continue}if(!isTypeSubTypeOf(Ws.schema,hi.type,ui.type)){var ii,ai;Ws.reportError(`Interface field ${oi.name}.${di} expects type ${inspect(ui.type)} but ${ws.name}.${di} is type ${inspect(hi.type)}.`,[(ii=ui.astNode)===null||ii===void 0?void 0:ii.type,(ai=hi.astNode)===null||ai===void 0?void 0:ai.type])}for(const pi of ui.args){const ha=pi.name,ga=hi.args.find(va=>va.name===ha);if(!ga){Ws.reportError(`Interface field argument ${oi.name}.${di}(${ha}:) expected but ${ws.name}.${di} does not provide it.`,[pi.astNode,hi.astNode]);continue}if(!isEqualType(pi.type,ga.type)){var li,ci;Ws.reportError(`Interface field argument ${oi.name}.${di}(${ha}:) expects type ${inspect(pi.type)} but ${ws.name}.${di}(${ha}:) is type ${inspect(ga.type)}.`,[(li=pi.astNode)===null||li===void 0?void 0:li.type,(ci=ga.astNode)===null||ci===void 0?void 0:ci.type])}}for(const pi of hi.args){const ha=pi.name;!ui.args.find(ga=>ga.name===ha)&&isRequiredArgument(pi)&&Ws.reportError(`Object field ${ws.name}.${di} includes required argument ${ha} that is missing from the Interface field ${oi.name}.${di}.`,[pi.astNode,ui.astNode])}}}function validateTypeImplementsAncestors(Ws,ws,oi){const si=ws.getInterfaces();for(const ii of oi.getInterfaces())si.includes(ii)||Ws.reportError(ii===ws?`Type ${ws.name} cannot implement ${oi.name} because it would create a circular reference.`:`Type ${ws.name} must implement ${ii.name} because it is implemented by ${oi.name}.`,[...getAllImplementsInterfaceNodes(oi,ii),...getAllImplementsInterfaceNodes(ws,oi)])}function validateUnionMembers(Ws,ws){const oi=ws.getTypes();oi.length===0&&Ws.reportError(`Union type ${ws.name} must define one or more member types.`,[ws.astNode,...ws.extensionASTNodes]);const si=Object.create(null);for(const ii of oi){if(si[ii.name]){Ws.reportError(`Union type ${ws.name} can only include type ${ii.name} once.`,getUnionMemberTypeNodes(ws,ii.name));continue}si[ii.name]=!0,isObjectType(ii)||Ws.reportError(`Union type ${ws.name} can only include Object types, it cannot include ${inspect(ii)}.`,getUnionMemberTypeNodes(ws,String(ii)))}}function validateEnumValues(Ws,ws){const oi=ws.getValues();oi.length===0&&Ws.reportError(`Enum type ${ws.name} must define one or more values.`,[ws.astNode,...ws.extensionASTNodes]);for(const si of oi)validateName(Ws,si)}function validateInputFields(Ws,ws){const oi=Object.values(ws.getFields());oi.length===0&&Ws.reportError(`Input Object type ${ws.name} must define one or more fields.`,[ws.astNode,...ws.extensionASTNodes]);for(const ai of oi){if(validateName(Ws,ai),!isInputType(ai.type)){var si;Ws.reportError(`The type of ${ws.name}.${ai.name} must be Input Type but got: ${inspect(ai.type)}.`,(si=ai.astNode)===null||si===void 0?void 0:si.type)}if(isRequiredInputField(ai)&&ai.deprecationReason!=null){var ii;Ws.reportError(`Required input field ${ws.name}.${ai.name} cannot be deprecated.`,[getDeprecatedDirectiveNode(ai.astNode),(ii=ai.astNode)===null||ii===void 0?void 0:ii.type])}ws.isOneOf&&validateOneOfInputObjectField(ws,ai,Ws)}}function validateOneOfInputObjectField(Ws,ws,oi){if(isNonNullType(ws.type)){var si;oi.reportError(`OneOf input field ${Ws.name}.${ws.name} must be nullable.`,(si=ws.astNode)===null||si===void 0?void 0:si.type)}ws.defaultValue!==void 0&&oi.reportError(`OneOf input field ${Ws.name}.${ws.name} cannot have a default value.`,ws.astNode)}function createInputObjectCircularRefsValidator(Ws){const ws=Object.create(null),oi=[],si=Object.create(null);return ii;function ii(ai){if(ws[ai.name])return;ws[ai.name]=!0,si[ai.name]=oi.length;const li=Object.values(ai.getFields());for(const ci of li)if(isNonNullType(ci.type)&&isInputObjectType(ci.type.ofType)){const ui=ci.type.ofType,di=si[ui.name];if(oi.push(ci),di===void 0)ii(ui);else{const hi=oi.slice(di),pi=hi.map(ha=>ha.name).join(".");Ws.reportError(`Cannot reference Input Object "${ui.name}" within itself through a series of non-null fields: "${pi}".`,hi.map(ha=>ha.astNode))}oi.pop()}si[ai.name]=void 0}}function getAllImplementsInterfaceNodes(Ws,ws){const{astNode:oi,extensionASTNodes:si}=Ws;return(oi!=null?[oi,...si]:si).flatMap(ii=>{var ai;return(ai=ii.interfaces)!==null&&ai!==void 0?ai:[]}).filter(ii=>ii.name.value===ws.name)}function getUnionMemberTypeNodes(Ws,ws){const{astNode:oi,extensionASTNodes:si}=Ws;return(oi!=null?[oi,...si]:si).flatMap(ii=>{var ai;return(ai=ii.types)!==null&&ai!==void 0?ai:[]}).filter(ii=>ii.name.value===ws)}function getDeprecatedDirectiveNode(Ws){var ws;return Ws==null||(ws=Ws.directives)===null||ws===void 0?void 0:ws.find(oi=>oi.name.value===GraphQLDeprecatedDirective.name)}function typeFromAST(Ws,ws){switch(ws.kind){case Kind.LIST_TYPE:{const oi=typeFromAST(Ws,ws.type);return oi&&new GraphQLList(oi)}case Kind.NON_NULL_TYPE:{const oi=typeFromAST(Ws,ws.type);return oi&&new GraphQLNonNull(oi)}case Kind.NAMED_TYPE:return Ws.getType(ws.name.value)}}class TypeInfo{constructor(ws,oi,si){this._schema=ws,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=si??getFieldDef$1,oi&&(isInputType(oi)&&this._inputTypeStack.push(oi),isCompositeType(oi)&&this._parentTypeStack.push(oi),isOutputType(oi)&&this._typeStack.push(oi))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(ws){const oi=this._schema;switch(ws.kind){case Kind.SELECTION_SET:{const ii=getNamedType(this.getType());this._parentTypeStack.push(isCompositeType(ii)?ii:void 0);break}case Kind.FIELD:{const ii=this.getParentType();let ai,li;ii&&(ai=this._getFieldDef(oi,ii,ws),ai&&(li=ai.type)),this._fieldDefStack.push(ai),this._typeStack.push(isOutputType(li)?li:void 0);break}case Kind.DIRECTIVE:this._directive=oi.getDirective(ws.name.value);break;case Kind.OPERATION_DEFINITION:{const ii=oi.getRootType(ws.operation);this._typeStack.push(isObjectType(ii)?ii:void 0);break}case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:{const ii=ws.typeCondition,ai=ii?typeFromAST(oi,ii):getNamedType(this.getType());this._typeStack.push(isOutputType(ai)?ai:void 0);break}case Kind.VARIABLE_DEFINITION:{const ii=typeFromAST(oi,ws.type);this._inputTypeStack.push(isInputType(ii)?ii:void 0);break}case Kind.ARGUMENT:{var si;let ii,ai;const li=(si=this.getDirective())!==null&&si!==void 0?si:this.getFieldDef();li&&(ii=li.args.find(ci=>ci.name===ws.name.value),ii&&(ai=ii.type)),this._argument=ii,this._defaultValueStack.push(ii?ii.defaultValue:void 0),this._inputTypeStack.push(isInputType(ai)?ai:void 0);break}case Kind.LIST:{const ii=getNullableType(this.getInputType()),ai=isListType(ii)?ii.ofType:ii;this._defaultValueStack.push(void 0),this._inputTypeStack.push(isInputType(ai)?ai:void 0);break}case Kind.OBJECT_FIELD:{const ii=getNamedType(this.getInputType());let ai,li;isInputObjectType(ii)&&(li=ii.getFields()[ws.name.value],li&&(ai=li.type)),this._defaultValueStack.push(li?li.defaultValue:void 0),this._inputTypeStack.push(isInputType(ai)?ai:void 0);break}case Kind.ENUM:{const ii=getNamedType(this.getInputType());let ai;isEnumType(ii)&&(ai=ii.getValue(ws.value)),this._enumValue=ai;break}}}leave(ws){switch(ws.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Kind.ENUM:this._enumValue=null;break}}}function getFieldDef$1(Ws,ws,oi){const si=oi.name.value;if(si===SchemaMetaFieldDef.name&&Ws.getQueryType()===ws)return SchemaMetaFieldDef;if(si===TypeMetaFieldDef.name&&Ws.getQueryType()===ws)return TypeMetaFieldDef;if(si===TypeNameMetaFieldDef.name&&isCompositeType(ws))return TypeNameMetaFieldDef;if(isObjectType(ws)||isInterfaceType(ws))return ws.getFields()[si]}function visitWithTypeInfo(Ws,ws){return{enter(...oi){const si=oi[0];Ws.enter(si);const ii=getEnterLeaveForKind(ws,si.kind).enter;if(ii){const ai=ii.apply(ws,oi);return ai!==void 0&&(Ws.leave(si),isNode(ai)&&Ws.enter(ai)),ai}},leave(...oi){const si=oi[0],ii=getEnterLeaveForKind(ws,si.kind).leave;let ai;return ii&&(ai=ii.apply(ws,oi)),Ws.leave(si),ai}}}function isExecutableDefinitionNode(Ws){return Ws.kind===Kind.OPERATION_DEFINITION||Ws.kind===Kind.FRAGMENT_DEFINITION}function isTypeSystemDefinitionNode(Ws){return Ws.kind===Kind.SCHEMA_DEFINITION||isTypeDefinitionNode(Ws)||Ws.kind===Kind.DIRECTIVE_DEFINITION}function isTypeDefinitionNode(Ws){return Ws.kind===Kind.SCALAR_TYPE_DEFINITION||Ws.kind===Kind.OBJECT_TYPE_DEFINITION||Ws.kind===Kind.INTERFACE_TYPE_DEFINITION||Ws.kind===Kind.UNION_TYPE_DEFINITION||Ws.kind===Kind.ENUM_TYPE_DEFINITION||Ws.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION}function isTypeSystemExtensionNode(Ws){return Ws.kind===Kind.SCHEMA_EXTENSION||isTypeExtensionNode(Ws)}function isTypeExtensionNode(Ws){return Ws.kind===Kind.SCALAR_TYPE_EXTENSION||Ws.kind===Kind.OBJECT_TYPE_EXTENSION||Ws.kind===Kind.INTERFACE_TYPE_EXTENSION||Ws.kind===Kind.UNION_TYPE_EXTENSION||Ws.kind===Kind.ENUM_TYPE_EXTENSION||Ws.kind===Kind.INPUT_OBJECT_TYPE_EXTENSION}function ExecutableDefinitionsRule(Ws){return{Document(ws){for(const oi of ws.definitions)if(!isExecutableDefinitionNode(oi)){const si=oi.kind===Kind.SCHEMA_DEFINITION||oi.kind===Kind.SCHEMA_EXTENSION?"schema":'"'+oi.name.value+'"';Ws.reportError(new GraphQLError(`The ${si} definition is not executable.`,{nodes:oi}))}return!1}}}function FieldsOnCorrectTypeRule(Ws){return{Field(ws){const oi=Ws.getParentType();if(oi&&!Ws.getFieldDef()){const si=Ws.getSchema(),ii=ws.name.value;let ai=didYouMean("to use an inline fragment on",getSuggestedTypeNames(si,oi,ii));ai===""&&(ai=didYouMean(getSuggestedFieldNames(oi,ii))),Ws.reportError(new GraphQLError(`Cannot query field "${ii}" on type "${oi.name}".`+ai,{nodes:ws}))}}}}function getSuggestedTypeNames(Ws,ws,oi){if(!isAbstractType(ws))return[];const si=new Set,ii=Object.create(null);for(const li of Ws.getPossibleTypes(ws))if(li.getFields()[oi]){si.add(li),ii[li.name]=1;for(const ci of li.getInterfaces()){var ai;ci.getFields()[oi]&&(si.add(ci),ii[ci.name]=((ai=ii[ci.name])!==null&&ai!==void 0?ai:0)+1)}}return[...si].sort((li,ci)=>{const ui=ii[ci.name]-ii[li.name];return ui!==0?ui:isInterfaceType(li)&&Ws.isSubType(li,ci)?-1:isInterfaceType(ci)&&Ws.isSubType(ci,li)?1:naturalCompare(li.name,ci.name)}).map(li=>li.name)}function getSuggestedFieldNames(Ws,ws){if(isObjectType(Ws)||isInterfaceType(Ws)){const oi=Object.keys(Ws.getFields());return suggestionList(ws,oi)}return[]}function FragmentsOnCompositeTypesRule(Ws){return{InlineFragment(ws){const oi=ws.typeCondition;if(oi){const si=typeFromAST(Ws.getSchema(),oi);if(si&&!isCompositeType(si)){const ii=print(oi);Ws.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${ii}".`,{nodes:oi}))}}},FragmentDefinition(ws){const oi=typeFromAST(Ws.getSchema(),ws.typeCondition);if(oi&&!isCompositeType(oi)){const si=print(ws.typeCondition);Ws.reportError(new GraphQLError(`Fragment "${ws.name.value}" cannot condition on non composite type "${si}".`,{nodes:ws.typeCondition}))}}}}function KnownArgumentNamesRule(Ws){return{...KnownArgumentNamesOnDirectivesRule(Ws),Argument(ws){const oi=Ws.getArgument(),si=Ws.getFieldDef(),ii=Ws.getParentType();if(!oi&&si&&ii){const ai=ws.name.value,li=si.args.map(ui=>ui.name),ci=suggestionList(ai,li);Ws.reportError(new GraphQLError(`Unknown argument "${ai}" on field "${ii.name}.${si.name}".`+didYouMean(ci),{nodes:ws}))}}}}function KnownArgumentNamesOnDirectivesRule(Ws){const ws=Object.create(null),oi=Ws.getSchema(),si=oi?oi.getDirectives():specifiedDirectives;for(const li of si)ws[li.name]=li.args.map(ci=>ci.name);const ii=Ws.getDocument().definitions;for(const li of ii)if(li.kind===Kind.DIRECTIVE_DEFINITION){var ai;const ci=(ai=li.arguments)!==null&&ai!==void 0?ai:[];ws[li.name.value]=ci.map(ui=>ui.name.value)}return{Directive(li){const ci=li.name.value,ui=ws[ci];if(li.arguments&&ui)for(const di of li.arguments){const hi=di.name.value;if(!ui.includes(hi)){const pi=suggestionList(hi,ui);Ws.reportError(new GraphQLError(`Unknown argument "${hi}" on directive "@${ci}".`+didYouMean(pi),{nodes:di}))}}return!1}}}function KnownDirectivesRule(Ws){const ws=Object.create(null),oi=Ws.getSchema(),si=oi?oi.getDirectives():specifiedDirectives;for(const ai of si)ws[ai.name]=ai.locations;const ii=Ws.getDocument().definitions;for(const ai of ii)ai.kind===Kind.DIRECTIVE_DEFINITION&&(ws[ai.name.value]=ai.locations.map(li=>li.value));return{Directive(ai,li,ci,ui,di){const hi=ai.name.value,pi=ws[hi];if(!pi){Ws.reportError(new GraphQLError(`Unknown directive "@${hi}".`,{nodes:ai}));return}const ha=getDirectiveLocationForASTPath(di);ha&&!pi.includes(ha)&&Ws.reportError(new GraphQLError(`Directive "@${hi}" may not be used on ${ha}.`,{nodes:ai}))}}}function getDirectiveLocationForASTPath(Ws){const ws=Ws[Ws.length-1];switch("kind"in ws||invariant$1(),ws.kind){case Kind.OPERATION_DEFINITION:return getDirectiveLocationForOperation(ws.operation);case Kind.FIELD:return DirectiveLocation.FIELD;case Kind.FRAGMENT_SPREAD:return DirectiveLocation.FRAGMENT_SPREAD;case Kind.INLINE_FRAGMENT:return DirectiveLocation.INLINE_FRAGMENT;case Kind.FRAGMENT_DEFINITION:return DirectiveLocation.FRAGMENT_DEFINITION;case Kind.VARIABLE_DEFINITION:return DirectiveLocation.VARIABLE_DEFINITION;case Kind.SCHEMA_DEFINITION:case Kind.SCHEMA_EXTENSION:return DirectiveLocation.SCHEMA;case Kind.SCALAR_TYPE_DEFINITION:case Kind.SCALAR_TYPE_EXTENSION:return DirectiveLocation.SCALAR;case Kind.OBJECT_TYPE_DEFINITION:case Kind.OBJECT_TYPE_EXTENSION:return DirectiveLocation.OBJECT;case Kind.FIELD_DEFINITION:return DirectiveLocation.FIELD_DEFINITION;case Kind.INTERFACE_TYPE_DEFINITION:case Kind.INTERFACE_TYPE_EXTENSION:return DirectiveLocation.INTERFACE;case Kind.UNION_TYPE_DEFINITION:case Kind.UNION_TYPE_EXTENSION:return DirectiveLocation.UNION;case Kind.ENUM_TYPE_DEFINITION:case Kind.ENUM_TYPE_EXTENSION:return DirectiveLocation.ENUM;case Kind.ENUM_VALUE_DEFINITION:return DirectiveLocation.ENUM_VALUE;case Kind.INPUT_OBJECT_TYPE_DEFINITION:case Kind.INPUT_OBJECT_TYPE_EXTENSION:return DirectiveLocation.INPUT_OBJECT;case Kind.INPUT_VALUE_DEFINITION:{const oi=Ws[Ws.length-3];return"kind"in oi||invariant$1(),oi.kind===Kind.INPUT_OBJECT_TYPE_DEFINITION?DirectiveLocation.INPUT_FIELD_DEFINITION:DirectiveLocation.ARGUMENT_DEFINITION}default:invariant$1(!1,"Unexpected kind: "+inspect(ws.kind))}}function getDirectiveLocationForOperation(Ws){switch(Ws){case OperationTypeNode.QUERY:return DirectiveLocation.QUERY;case OperationTypeNode.MUTATION:return DirectiveLocation.MUTATION;case OperationTypeNode.SUBSCRIPTION:return DirectiveLocation.SUBSCRIPTION}}function KnownFragmentNamesRule(Ws){return{FragmentSpread(ws){const oi=ws.name.value;Ws.getFragment(oi)||Ws.reportError(new GraphQLError(`Unknown fragment "${oi}".`,{nodes:ws.name}))}}}function KnownTypeNamesRule(Ws){const ws=Ws.getSchema(),oi=ws?ws.getTypeMap():Object.create(null),si=Object.create(null);for(const ai of Ws.getDocument().definitions)isTypeDefinitionNode(ai)&&(si[ai.name.value]=!0);const ii=[...Object.keys(oi),...Object.keys(si)];return{NamedType(ai,li,ci,ui,di){const hi=ai.name.value;if(!oi[hi]&&!si[hi]){var pi;const ha=(pi=di[2])!==null&&pi!==void 0?pi:ci,ga=ha!=null&&isSDLNode(ha);if(ga&&standardTypeNames.includes(hi))return;const va=suggestionList(hi,ga?standardTypeNames.concat(ii):ii);Ws.reportError(new GraphQLError(`Unknown type "${hi}".`+didYouMean(va),{nodes:ai}))}}}}const standardTypeNames=[...specifiedScalarTypes,...introspectionTypes].map(Ws=>Ws.name);function isSDLNode(Ws){return"kind"in Ws&&(isTypeSystemDefinitionNode(Ws)||isTypeSystemExtensionNode(Ws))}function LoneAnonymousOperationRule(Ws){let ws=0;return{Document(oi){ws=oi.definitions.filter(si=>si.kind===Kind.OPERATION_DEFINITION).length},OperationDefinition(oi){!oi.name&&ws>1&&Ws.reportError(new GraphQLError("This anonymous operation must be the only defined operation.",{nodes:oi}))}}}function LoneSchemaDefinitionRule(Ws){var ws,oi,si;const ii=Ws.getSchema(),ai=(ws=(oi=(si=ii==null?void 0:ii.astNode)!==null&&si!==void 0?si:ii==null?void 0:ii.getQueryType())!==null&&oi!==void 0?oi:ii==null?void 0:ii.getMutationType())!==null&&ws!==void 0?ws:ii==null?void 0:ii.getSubscriptionType();let li=0;return{SchemaDefinition(ci){if(ai){Ws.reportError(new GraphQLError("Cannot define a new schema within a schema extension.",{nodes:ci}));return}li>0&&Ws.reportError(new GraphQLError("Must provide only one schema definition.",{nodes:ci})),++li}}}const MAX_LISTS_DEPTH=3;function MaxIntrospectionDepthRule(Ws){function ws(oi,si=Object.create(null),ii=0){if(oi.kind===Kind.FRAGMENT_SPREAD){const ai=oi.name.value;if(si[ai]===!0)return!1;const li=Ws.getFragment(ai);if(!li)return!1;try{return si[ai]=!0,ws(li,si,ii)}finally{si[ai]=void 0}}if(oi.kind===Kind.FIELD&&(oi.name.value==="fields"||oi.name.value==="interfaces"||oi.name.value==="possibleTypes"||oi.name.value==="inputFields")&&(ii++,ii>=MAX_LISTS_DEPTH))return!0;if("selectionSet"in oi&&oi.selectionSet){for(const ai of oi.selectionSet.selections)if(ws(ai,si,ii))return!0}return!1}return{Field(oi){if((oi.name.value==="__schema"||oi.name.value==="__type")&&ws(oi))return Ws.reportError(new GraphQLError("Maximum introspection depth exceeded",{nodes:[oi]})),!1}}}function NoFragmentCyclesRule(Ws){const ws=Object.create(null),oi=[],si=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(ai){return ii(ai),!1}};function ii(ai){if(ws[ai.name.value])return;const li=ai.name.value;ws[li]=!0;const ci=Ws.getFragmentSpreads(ai.selectionSet);if(ci.length!==0){si[li]=oi.length;for(const ui of ci){const di=ui.name.value,hi=si[di];if(oi.push(ui),hi===void 0){const pi=Ws.getFragment(di);pi&&ii(pi)}else{const pi=oi.slice(hi),ha=pi.slice(0,-1).map(ga=>'"'+ga.name.value+'"').join(", ");Ws.reportError(new GraphQLError(`Cannot spread fragment "${di}" within itself`+(ha!==""?` via ${ha}.`:"."),{nodes:pi}))}oi.pop()}si[li]=void 0}}}function NoUndefinedVariablesRule(Ws){let ws=Object.create(null);return{OperationDefinition:{enter(){ws=Object.create(null)},leave(oi){const si=Ws.getRecursiveVariableUsages(oi);for(const{node:ii}of si){const ai=ii.name.value;ws[ai]!==!0&&Ws.reportError(new GraphQLError(oi.name?`Variable "$${ai}" is not defined by operation "${oi.name.value}".`:`Variable "$${ai}" is not defined.`,{nodes:[ii,oi]}))}}},VariableDefinition(oi){ws[oi.variable.name.value]=!0}}}function NoUnusedFragmentsRule(Ws){const ws=[],oi=[];return{OperationDefinition(si){return ws.push(si),!1},FragmentDefinition(si){return oi.push(si),!1},Document:{leave(){const si=Object.create(null);for(const ii of ws)for(const ai of Ws.getRecursivelyReferencedFragments(ii))si[ai.name.value]=!0;for(const ii of oi){const ai=ii.name.value;si[ai]!==!0&&Ws.reportError(new GraphQLError(`Fragment "${ai}" is never used.`,{nodes:ii}))}}}}}function NoUnusedVariablesRule(Ws){let ws=[];return{OperationDefinition:{enter(){ws=[]},leave(oi){const si=Object.create(null),ii=Ws.getRecursiveVariableUsages(oi);for(const{node:ai}of ii)si[ai.name.value]=!0;for(const ai of ws){const li=ai.variable.name.value;si[li]!==!0&&Ws.reportError(new GraphQLError(oi.name?`Variable "$${li}" is never used in operation "${oi.name.value}".`:`Variable "$${li}" is never used.`,{nodes:ai}))}}},VariableDefinition(oi){ws.push(oi)}}}function sortValueNode(Ws){switch(Ws.kind){case Kind.OBJECT:return{...Ws,fields:sortFields(Ws.fields)};case Kind.LIST:return{...Ws,values:Ws.values.map(sortValueNode)};case Kind.INT:case Kind.FLOAT:case Kind.STRING:case Kind.BOOLEAN:case Kind.NULL:case Kind.ENUM:case Kind.VARIABLE:return Ws}}function sortFields(Ws){return Ws.map(ws=>({...ws,value:sortValueNode(ws.value)})).sort((ws,oi)=>naturalCompare(ws.name.value,oi.name.value))}function reasonMessage(Ws){return Array.isArray(Ws)?Ws.map(([ws,oi])=>`subfields "${ws}" conflict because `+reasonMessage(oi)).join(" and "):Ws}function OverlappingFieldsCanBeMergedRule(Ws){const ws=new OrderedPairSet,oi=new PairSet,si=new Map;return{SelectionSet(ii){const ai=findConflictsWithinSelectionSet(Ws,si,ws,oi,Ws.getParentType(),ii);for(const[[li,ci],ui,di]of ai){const hi=reasonMessage(ci);Ws.reportError(new GraphQLError(`Fields "${li}" conflict because ${hi}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:ui.concat(di)}))}}}}function findConflictsWithinSelectionSet(Ws,ws,oi,si,ii,ai){const li=[],[ci,ui]=getFieldsAndFragmentNames(Ws,ws,ii,ai);if(collectConflictsWithin(Ws,li,ws,oi,si,ci),ui.length!==0)for(let di=0;di<ui.length;di++){collectConflictsBetweenFieldsAndFragment(Ws,li,ws,oi,si,!1,ci,ui[di]);for(let hi=di+1;hi<ui.length;hi++)collectConflictsBetweenFragments(Ws,li,ws,oi,si,!1,ui[di],ui[hi])}return li}function collectConflictsBetweenFieldsAndFragment(Ws,ws,oi,si,ii,ai,li,ci){if(si.has(li,ci,ai))return;si.add(li,ci,ai);const ui=Ws.getFragment(ci);if(!ui)return;const[di,hi]=getReferencedFieldsAndFragmentNames(Ws,oi,ui);if(li!==di){collectConflictsBetween(Ws,ws,oi,si,ii,ai,li,di);for(const pi of hi)collectConflictsBetweenFieldsAndFragment(Ws,ws,oi,si,ii,ai,li,pi)}}function collectConflictsBetweenFragments(Ws,ws,oi,si,ii,ai,li,ci){if(li===ci||ii.has(li,ci,ai))return;ii.add(li,ci,ai);const ui=Ws.getFragment(li),di=Ws.getFragment(ci);if(!ui||!di)return;const[hi,pi]=getReferencedFieldsAndFragmentNames(Ws,oi,ui),[ha,ga]=getReferencedFieldsAndFragmentNames(Ws,oi,di);collectConflictsBetween(Ws,ws,oi,si,ii,ai,hi,ha);for(const va of ga)collectConflictsBetweenFragments(Ws,ws,oi,si,ii,ai,li,va);for(const va of pi)collectConflictsBetweenFragments(Ws,ws,oi,si,ii,ai,va,ci)}function findConflictsBetweenSubSelectionSets(Ws,ws,oi,si,ii,ai,li,ci,ui){const di=[],[hi,pi]=getFieldsAndFragmentNames(Ws,ws,ai,li),[ha,ga]=getFieldsAndFragmentNames(Ws,ws,ci,ui);collectConflictsBetween(Ws,di,ws,oi,si,ii,hi,ha);for(const va of ga)collectConflictsBetweenFieldsAndFragment(Ws,di,ws,oi,si,ii,hi,va);for(const va of pi)collectConflictsBetweenFieldsAndFragment(Ws,di,ws,oi,si,ii,ha,va);for(const va of pi)for(const ba of ga)collectConflictsBetweenFragments(Ws,di,ws,oi,si,ii,va,ba);return di}function collectConflictsWithin(Ws,ws,oi,si,ii,ai){for(const[li,ci]of Object.entries(ai))if(ci.length>1)for(let ui=0;ui<ci.length;ui++)for(let di=ui+1;di<ci.length;di++){const hi=findConflict(Ws,oi,si,ii,!1,li,ci[ui],ci[di]);hi&&ws.push(hi)}}function collectConflictsBetween(Ws,ws,oi,si,ii,ai,li,ci){for(const[ui,di]of Object.entries(li)){const hi=ci[ui];if(hi)for(const pi of di)for(const ha of hi){const ga=findConflict(Ws,oi,si,ii,ai,ui,pi,ha);ga&&ws.push(ga)}}}function findConflict(Ws,ws,oi,si,ii,ai,li,ci){const[ui,di,hi]=li,[pi,ha,ga]=ci,va=ii||ui!==pi&&isObjectType(ui)&&isObjectType(pi);if(!va){const el=di.name.value,ku=ha.name.value;if(el!==ku)return[[ai,`"${el}" and "${ku}" are different fields`],[di],[ha]];if(!sameArguments(di,ha))return[[ai,"they have differing arguments"],[di],[ha]]}const ba=hi==null?void 0:hi.type,wa=ga==null?void 0:ga.type;if(ba&&wa&&doTypesConflict(ba,wa))return[[ai,`they return conflicting types "${inspect(ba)}" and "${inspect(wa)}"`],[di],[ha]];const xa=di.selectionSet,Ca=ha.selectionSet;if(xa&&Ca){const el=findConflictsBetweenSubSelectionSets(Ws,ws,oi,si,va,getNamedType(ba),xa,getNamedType(wa),Ca);return subfieldConflicts(el,ai,di,ha)}}function sameArguments(Ws,ws){const oi=Ws.arguments,si=ws.arguments;if(oi===void 0||oi.length===0)return si===void 0||si.length===0;if(si===void 0||si.length===0||oi.length!==si.length)return!1;const ii=new Map(si.map(({name:ai,value:li})=>[ai.value,li]));return oi.every(ai=>{const li=ai.value,ci=ii.get(ai.name.value);return ci===void 0?!1:stringifyValue(li)===stringifyValue(ci)})}function stringifyValue(Ws){return print(sortValueNode(Ws))}function doTypesConflict(Ws,ws){return isListType(Ws)?isListType(ws)?doTypesConflict(Ws.ofType,ws.ofType):!0:isListType(ws)?!0:isNonNullType(Ws)?isNonNullType(ws)?doTypesConflict(Ws.ofType,ws.ofType):!0:isNonNullType(ws)?!0:isLeafType(Ws)||isLeafType(ws)?Ws!==ws:!1}function getFieldsAndFragmentNames(Ws,ws,oi,si){const ii=ws.get(si);if(ii)return ii;const ai=Object.create(null),li=Object.create(null);_collectFieldsAndFragmentNames(Ws,oi,si,ai,li);const ci=[ai,Object.keys(li)];return ws.set(si,ci),ci}function getReferencedFieldsAndFragmentNames(Ws,ws,oi){const si=ws.get(oi.selectionSet);if(si)return si;const ii=typeFromAST(Ws.getSchema(),oi.typeCondition);return getFieldsAndFragmentNames(Ws,ws,ii,oi.selectionSet)}function _collectFieldsAndFragmentNames(Ws,ws,oi,si,ii){for(const ai of oi.selections)switch(ai.kind){case Kind.FIELD:{const li=ai.name.value;let ci;(isObjectType(ws)||isInterfaceType(ws))&&(ci=ws.getFields()[li]);const ui=ai.alias?ai.alias.value:li;si[ui]||(si[ui]=[]),si[ui].push([ws,ai,ci]);break}case Kind.FRAGMENT_SPREAD:ii[ai.name.value]=!0;break;case Kind.INLINE_FRAGMENT:{const li=ai.typeCondition,ci=li?typeFromAST(Ws.getSchema(),li):ws;_collectFieldsAndFragmentNames(Ws,ci,ai.selectionSet,si,ii);break}}}function subfieldConflicts(Ws,ws,oi,si){if(Ws.length>0)return[[ws,Ws.map(([ii])=>ii)],[oi,...Ws.map(([,ii])=>ii).flat()],[si,...Ws.map(([,,ii])=>ii).flat()]]}class OrderedPairSet{constructor(){this._data=new Map}has(ws,oi,si){var ii;const ai=(ii=this._data.get(ws))===null||ii===void 0?void 0:ii.get(oi);return ai===void 0?!1:si?!0:si===ai}add(ws,oi,si){const ii=this._data.get(ws);ii===void 0?this._data.set(ws,new Map([[oi,si]])):ii.set(oi,si)}}class PairSet{constructor(){this._orderedPairSet=new OrderedPairSet}has(ws,oi,si){return ws<oi?this._orderedPairSet.has(ws,oi,si):this._orderedPairSet.has(oi,ws,si)}add(ws,oi,si){ws<oi?this._orderedPairSet.add(ws,oi,si):this._orderedPairSet.add(oi,ws,si)}}function PossibleFragmentSpreadsRule(Ws){return{InlineFragment(ws){const oi=Ws.getType(),si=Ws.getParentType();if(isCompositeType(oi)&&isCompositeType(si)&&!doTypesOverlap(Ws.getSchema(),oi,si)){const ii=inspect(si),ai=inspect(oi);Ws.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${ii}" can never be of type "${ai}".`,{nodes:ws}))}},FragmentSpread(ws){const oi=ws.name.value,si=getFragmentType(Ws,oi),ii=Ws.getParentType();if(si&&ii&&!doTypesOverlap(Ws.getSchema(),si,ii)){const ai=inspect(ii),li=inspect(si);Ws.reportError(new GraphQLError(`Fragment "${oi}" cannot be spread here as objects of type "${ai}" can never be of type "${li}".`,{nodes:ws}))}}}}function getFragmentType(Ws,ws){const oi=Ws.getFragment(ws);if(oi){const si=typeFromAST(Ws.getSchema(),oi.typeCondition);if(isCompositeType(si))return si}}function PossibleTypeExtensionsRule(Ws){const ws=Ws.getSchema(),oi=Object.create(null);for(const ii of Ws.getDocument().definitions)isTypeDefinitionNode(ii)&&(oi[ii.name.value]=ii);return{ScalarTypeExtension:si,ObjectTypeExtension:si,InterfaceTypeExtension:si,UnionTypeExtension:si,EnumTypeExtension:si,InputObjectTypeExtension:si};function si(ii){const ai=ii.name.value,li=oi[ai],ci=ws==null?void 0:ws.getType(ai);let ui;if(li?ui=defKindToExtKind[li.kind]:ci&&(ui=typeToExtKind(ci)),ui){if(ui!==ii.kind){const di=extensionKindToTypeName(ii.kind);Ws.reportError(new GraphQLError(`Cannot extend non-${di} type "${ai}".`,{nodes:li?[li,ii]:ii}))}}else{const di=Object.keys({...oi,...ws==null?void 0:ws.getTypeMap()}),hi=suggestionList(ai,di);Ws.reportError(new GraphQLError(`Cannot extend type "${ai}" because it is not defined.`+didYouMean(hi),{nodes:ii.name}))}}}const defKindToExtKind={[Kind.SCALAR_TYPE_DEFINITION]:Kind.SCALAR_TYPE_EXTENSION,[Kind.OBJECT_TYPE_DEFINITION]:Kind.OBJECT_TYPE_EXTENSION,[Kind.INTERFACE_TYPE_DEFINITION]:Kind.INTERFACE_TYPE_EXTENSION,[Kind.UNION_TYPE_DEFINITION]:Kind.UNION_TYPE_EXTENSION,[Kind.ENUM_TYPE_DEFINITION]:Kind.ENUM_TYPE_EXTENSION,[Kind.INPUT_OBJECT_TYPE_DEFINITION]:Kind.INPUT_OBJECT_TYPE_EXTENSION};function typeToExtKind(Ws){if(isScalarType(Ws))return Kind.SCALAR_TYPE_EXTENSION;if(isObjectType(Ws))return Kind.OBJECT_TYPE_EXTENSION;if(isInterfaceType(Ws))return Kind.INTERFACE_TYPE_EXTENSION;if(isUnionType(Ws))return Kind.UNION_TYPE_EXTENSION;if(isEnumType(Ws))return Kind.ENUM_TYPE_EXTENSION;if(isInputObjectType(Ws))return Kind.INPUT_OBJECT_TYPE_EXTENSION;invariant$1(!1,"Unexpected type: "+inspect(Ws))}function extensionKindToTypeName(Ws){switch(Ws){case Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Kind.OBJECT_TYPE_EXTENSION:return"object";case Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Kind.UNION_TYPE_EXTENSION:return"union";case Kind.ENUM_TYPE_EXTENSION:return"enum";case Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:invariant$1(!1,"Unexpected kind: "+inspect(Ws))}}function ProvidedRequiredArgumentsRule(Ws){return{...ProvidedRequiredArgumentsOnDirectivesRule(Ws),Field:{leave(ws){var oi;const si=Ws.getFieldDef();if(!si)return!1;const ii=new Set((oi=ws.arguments)===null||oi===void 0?void 0:oi.map(ai=>ai.name.value));for(const ai of si.args)if(!ii.has(ai.name)&&isRequiredArgument(ai)){const li=inspect(ai.type);Ws.reportError(new GraphQLError(`Field "${si.name}" argument "${ai.name}" of type "${li}" is required, but it was not provided.`,{nodes:ws}))}}}}}function ProvidedRequiredArgumentsOnDirectivesRule(Ws){var ws;const oi=Object.create(null),si=Ws.getSchema(),ii=(ws=si==null?void 0:si.getDirectives())!==null&&ws!==void 0?ws:specifiedDirectives;for(const ci of ii)oi[ci.name]=keyMap(ci.args.filter(isRequiredArgument),ui=>ui.name);const ai=Ws.getDocument().definitions;for(const ci of ai)if(ci.kind===Kind.DIRECTIVE_DEFINITION){var li;const ui=(li=ci.arguments)!==null&&li!==void 0?li:[];oi[ci.name.value]=keyMap(ui.filter(isRequiredArgumentNode),di=>di.name.value)}return{Directive:{leave(ci){const ui=ci.name.value,di=oi[ui];if(di){var hi;const pi=(hi=ci.arguments)!==null&&hi!==void 0?hi:[],ha=new Set(pi.map(ga=>ga.name.value));for(const[ga,va]of Object.entries(di))if(!ha.has(ga)){const ba=isType(va.type)?inspect(va.type):print(va.type);Ws.reportError(new GraphQLError(`Directive "@${ui}" argument "${ga}" of type "${ba}" is required, but it was not provided.`,{nodes:ci}))}}}}}}function isRequiredArgumentNode(Ws){return Ws.type.kind===Kind.NON_NULL_TYPE&&Ws.defaultValue==null}function ScalarLeafsRule(Ws){return{Field(ws){const oi=Ws.getType(),si=ws.selectionSet;if(oi)if(isLeafType(getNamedType(oi))){if(si){const ii=ws.name.value,ai=inspect(oi);Ws.reportError(new GraphQLError(`Field "${ii}" must not have a selection since type "${ai}" has no subfields.`,{nodes:si}))}}else if(si){if(si.selections.length===0){const ii=ws.name.value,ai=inspect(oi);Ws.reportError(new GraphQLError(`Field "${ii}" of type "${ai}" must have at least one field selected.`,{nodes:ws}))}}else{const ii=ws.name.value,ai=inspect(oi);Ws.reportError(new GraphQLError(`Field "${ii}" of type "${ai}" must have a selection of subfields. Did you mean "${ii} { ... }"?`,{nodes:ws}))}}}}function valueFromAST(Ws,ws,oi){if(Ws){if(Ws.kind===Kind.VARIABLE){const si=Ws.name.value;if(oi==null||oi[si]===void 0)return;const ii=oi[si];return ii===null&&isNonNullType(ws)?void 0:ii}if(isNonNullType(ws))return Ws.kind===Kind.NULL?void 0:valueFromAST(Ws,ws.ofType,oi);if(Ws.kind===Kind.NULL)return null;if(isListType(ws)){const si=ws.ofType;if(Ws.kind===Kind.LIST){const ai=[];for(const li of Ws.values)if(isMissingVariable(li,oi)){if(isNonNullType(si))return;ai.push(null)}else{const ci=valueFromAST(li,si,oi);if(ci===void 0)return;ai.push(ci)}return ai}const ii=valueFromAST(Ws,si,oi);return ii===void 0?void 0:[ii]}if(isInputObjectType(ws)){if(Ws.kind!==Kind.OBJECT)return;const si=Object.create(null),ii=keyMap(Ws.fields,ai=>ai.name.value);for(const ai of Object.values(ws.getFields())){const li=ii[ai.name];if(!li||isMissingVariable(li.value,oi)){if(ai.defaultValue!==void 0)si[ai.name]=ai.defaultValue;else if(isNonNullType(ai.type))return;continue}const ci=valueFromAST(li.value,ai.type,oi);if(ci===void 0)return;si[ai.name]=ci}if(ws.isOneOf){const ai=Object.keys(si);if(ai.length!==1||si[ai[0]]===null)return}return si}if(isLeafType(ws)){let si;try{si=ws.parseLiteral(Ws,oi)}catch{return}return si===void 0?void 0:si}invariant$1(!1,"Unexpected input type: "+inspect(ws))}}function isMissingVariable(Ws,ws){return Ws.kind===Kind.VARIABLE&&(ws==null||ws[Ws.name.value]===void 0)}function getArgumentValues(Ws,ws,oi){var si;const ii={},ai=(si=ws.arguments)!==null&&si!==void 0?si:[],li=keyMap(ai,ci=>ci.name.value);for(const ci of Ws.args){const ui=ci.name,di=ci.type,hi=li[ui];if(!hi){if(ci.defaultValue!==void 0)ii[ui]=ci.defaultValue;else if(isNonNullType(di))throw new GraphQLError(`Argument "${ui}" of required type "${inspect(di)}" was not provided.`,{nodes:ws});continue}const pi=hi.value;let ha=pi.kind===Kind.NULL;if(pi.kind===Kind.VARIABLE){const va=pi.name.value;if(oi==null||!hasOwnProperty(oi,va)){if(ci.defaultValue!==void 0)ii[ui]=ci.defaultValue;else if(isNonNullType(di))throw new GraphQLError(`Argument "${ui}" of required type "${inspect(di)}" was provided the variable "$${va}" which was not provided a runtime value.`,{nodes:pi});continue}ha=oi[va]==null}if(ha&&isNonNullType(di))throw new GraphQLError(`Argument "${ui}" of non-null type "${inspect(di)}" must not be null.`,{nodes:pi});const ga=valueFromAST(pi,di,oi);if(ga===void 0)throw new GraphQLError(`Argument "${ui}" has invalid value ${print(pi)}.`,{nodes:pi});ii[ui]=ga}return ii}function getDirectiveValues(Ws,ws,oi){var si;const ii=(si=ws.directives)===null||si===void 0?void 0:si.find(ai=>ai.name.value===Ws.name);if(ii)return getArgumentValues(Ws,ii,oi)}function hasOwnProperty(Ws,ws){return Object.prototype.hasOwnProperty.call(Ws,ws)}function collectFields(Ws,ws,oi,si,ii){const ai=new Map;return collectFieldsImpl(Ws,ws,oi,si,ii,ai,new Set),ai}function collectFieldsImpl(Ws,ws,oi,si,ii,ai,li){for(const ci of ii.selections)switch(ci.kind){case Kind.FIELD:{if(!shouldIncludeNode(oi,ci))continue;const ui=getFieldEntryKey(ci),di=ai.get(ui);di!==void 0?di.push(ci):ai.set(ui,[ci]);break}case Kind.INLINE_FRAGMENT:{if(!shouldIncludeNode(oi,ci)||!doesFragmentConditionMatch(Ws,ci,si))continue;collectFieldsImpl(Ws,ws,oi,si,ci.selectionSet,ai,li);break}case Kind.FRAGMENT_SPREAD:{const ui=ci.name.value;if(li.has(ui)||!shouldIncludeNode(oi,ci))continue;li.add(ui);const di=ws[ui];if(!di||!doesFragmentConditionMatch(Ws,di,si))continue;collectFieldsImpl(Ws,ws,oi,si,di.selectionSet,ai,li);break}}}function shouldIncludeNode(Ws,ws){const oi=getDirectiveValues(GraphQLSkipDirective,ws,Ws);if((oi==null?void 0:oi.if)===!0)return!1;const si=getDirectiveValues(GraphQLIncludeDirective,ws,Ws);return(si==null?void 0:si.if)!==!1}function doesFragmentConditionMatch(Ws,ws,oi){const si=ws.typeCondition;if(!si)return!0;const ii=typeFromAST(Ws,si);return ii===oi?!0:isAbstractType(ii)?Ws.isSubType(ii,oi):!1}function getFieldEntryKey(Ws){return Ws.alias?Ws.alias.value:Ws.name.value}function SingleFieldSubscriptionsRule(Ws){return{OperationDefinition(ws){if(ws.operation==="subscription"){const oi=Ws.getSchema(),si=oi.getSubscriptionType();if(si){const ii=ws.name?ws.name.value:null,ai=Object.create(null),li=Ws.getDocument(),ci=Object.create(null);for(const di of li.definitions)di.kind===Kind.FRAGMENT_DEFINITION&&(ci[di.name.value]=di);const ui=collectFields(oi,ci,ai,si,ws.selectionSet);if(ui.size>1){const di=[...ui.values()].slice(1).flat();Ws.reportError(new GraphQLError(ii!=null?`Subscription "${ii}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:di}))}for(const di of ui.values())di[0].name.value.startsWith("__")&&Ws.reportError(new GraphQLError(ii!=null?`Subscription "${ii}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:di}))}}}}}function groupBy(Ws,ws){const oi=new Map;for(const si of Ws){const ii=ws(si),ai=oi.get(ii);ai===void 0?oi.set(ii,[si]):ai.push(si)}return oi}function UniqueArgumentDefinitionNamesRule(Ws){return{DirectiveDefinition(si){var ii;const ai=(ii=si.arguments)!==null&&ii!==void 0?ii:[];return oi(`@${si.name.value}`,ai)},InterfaceTypeDefinition:ws,InterfaceTypeExtension:ws,ObjectTypeDefinition:ws,ObjectTypeExtension:ws};function ws(si){var ii;const ai=si.name.value,li=(ii=si.fields)!==null&&ii!==void 0?ii:[];for(const ui of li){var ci;const di=ui.name.value,hi=(ci=ui.arguments)!==null&&ci!==void 0?ci:[];oi(`${ai}.${di}`,hi)}return!1}function oi(si,ii){const ai=groupBy(ii,li=>li.name.value);for(const[li,ci]of ai)ci.length>1&&Ws.reportError(new GraphQLError(`Argument "${si}(${li}:)" can only be defined once.`,{nodes:ci.map(ui=>ui.name)}));return!1}}function UniqueArgumentNamesRule(Ws){return{Field:ws,Directive:ws};function ws(oi){var si;const ii=(si=oi.arguments)!==null&&si!==void 0?si:[],ai=groupBy(ii,li=>li.name.value);for(const[li,ci]of ai)ci.length>1&&Ws.reportError(new GraphQLError(`There can be only one argument named "${li}".`,{nodes:ci.map(ui=>ui.name)}))}}function UniqueDirectiveNamesRule(Ws){const ws=Object.create(null),oi=Ws.getSchema();return{DirectiveDefinition(si){const ii=si.name.value;if(oi!=null&&oi.getDirective(ii)){Ws.reportError(new GraphQLError(`Directive "@${ii}" already exists in the schema. It cannot be redefined.`,{nodes:si.name}));return}return ws[ii]?Ws.reportError(new GraphQLError(`There can be only one directive named "@${ii}".`,{nodes:[ws[ii],si.name]})):ws[ii]=si.name,!1}}}function UniqueDirectivesPerLocationRule(Ws){const ws=Object.create(null),oi=Ws.getSchema(),si=oi?oi.getDirectives():specifiedDirectives;for(const ci of si)ws[ci.name]=!ci.isRepeatable;const ii=Ws.getDocument().definitions;for(const ci of ii)ci.kind===Kind.DIRECTIVE_DEFINITION&&(ws[ci.name.value]=!ci.repeatable);const ai=Object.create(null),li=Object.create(null);return{enter(ci){if(!("directives"in ci)||!ci.directives)return;let ui;if(ci.kind===Kind.SCHEMA_DEFINITION||ci.kind===Kind.SCHEMA_EXTENSION)ui=ai;else if(isTypeDefinitionNode(ci)||isTypeExtensionNode(ci)){const di=ci.name.value;ui=li[di],ui===void 0&&(li[di]=ui=Object.create(null))}else ui=Object.create(null);for(const di of ci.directives){const hi=di.name.value;ws[hi]&&(ui[hi]?Ws.reportError(new GraphQLError(`The directive "@${hi}" can only be used once at this location.`,{nodes:[ui[hi],di]})):ui[hi]=di)}}}}function UniqueEnumValueNamesRule(Ws){const ws=Ws.getSchema(),oi=ws?ws.getTypeMap():Object.create(null),si=Object.create(null);return{EnumTypeDefinition:ii,EnumTypeExtension:ii};function ii(ai){var li;const ci=ai.name.value;si[ci]||(si[ci]=Object.create(null));const ui=(li=ai.values)!==null&&li!==void 0?li:[],di=si[ci];for(const hi of ui){const pi=hi.name.value,ha=oi[ci];isEnumType(ha)&&ha.getValue(pi)?Ws.reportError(new GraphQLError(`Enum value "${ci}.${pi}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:hi.name})):di[pi]?Ws.reportError(new GraphQLError(`Enum value "${ci}.${pi}" can only be defined once.`,{nodes:[di[pi],hi.name]})):di[pi]=hi.name}return!1}}function UniqueFieldDefinitionNamesRule(Ws){const ws=Ws.getSchema(),oi=ws?ws.getTypeMap():Object.create(null),si=Object.create(null);return{InputObjectTypeDefinition:ii,InputObjectTypeExtension:ii,InterfaceTypeDefinition:ii,InterfaceTypeExtension:ii,ObjectTypeDefinition:ii,ObjectTypeExtension:ii};function ii(ai){var li;const ci=ai.name.value;si[ci]||(si[ci]=Object.create(null));const ui=(li=ai.fields)!==null&&li!==void 0?li:[],di=si[ci];for(const hi of ui){const pi=hi.name.value;hasField(oi[ci],pi)?Ws.reportError(new GraphQLError(`Field "${ci}.${pi}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:hi.name})):di[pi]?Ws.reportError(new GraphQLError(`Field "${ci}.${pi}" can only be defined once.`,{nodes:[di[pi],hi.name]})):di[pi]=hi.name}return!1}}function hasField(Ws,ws){return isObjectType(Ws)||isInterfaceType(Ws)||isInputObjectType(Ws)?Ws.getFields()[ws]!=null:!1}function UniqueFragmentNamesRule(Ws){const ws=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(oi){const si=oi.name.value;return ws[si]?Ws.reportError(new GraphQLError(`There can be only one fragment named "${si}".`,{nodes:[ws[si],oi.name]})):ws[si]=oi.name,!1}}}function UniqueInputFieldNamesRule(Ws){const ws=[];let oi=Object.create(null);return{ObjectValue:{enter(){ws.push(oi),oi=Object.create(null)},leave(){const si=ws.pop();si||invariant$1(),oi=si}},ObjectField(si){const ii=si.name.value;oi[ii]?Ws.reportError(new GraphQLError(`There can be only one input field named "${ii}".`,{nodes:[oi[ii],si.name]})):oi[ii]=si.name}}}function UniqueOperationNamesRule(Ws){const ws=Object.create(null);return{OperationDefinition(oi){const si=oi.name;return si&&(ws[si.value]?Ws.reportError(new GraphQLError(`There can be only one operation named "${si.value}".`,{nodes:[ws[si.value],si]})):ws[si.value]=si),!1},FragmentDefinition:()=>!1}}function UniqueOperationTypesRule(Ws){const ws=Ws.getSchema(),oi=Object.create(null),si=ws?{query:ws.getQueryType(),mutation:ws.getMutationType(),subscription:ws.getSubscriptionType()}:{};return{SchemaDefinition:ii,SchemaExtension:ii};function ii(ai){var li;const ci=(li=ai.operationTypes)!==null&&li!==void 0?li:[];for(const ui of ci){const di=ui.operation,hi=oi[di];si[di]?Ws.reportError(new GraphQLError(`Type for ${di} already defined in the schema. It cannot be redefined.`,{nodes:ui})):hi?Ws.reportError(new GraphQLError(`There can be only one ${di} type in schema.`,{nodes:[hi,ui]})):oi[di]=ui}return!1}}function UniqueTypeNamesRule(Ws){const ws=Object.create(null),oi=Ws.getSchema();return{ScalarTypeDefinition:si,ObjectTypeDefinition:si,InterfaceTypeDefinition:si,UnionTypeDefinition:si,EnumTypeDefinition:si,InputObjectTypeDefinition:si};function si(ii){const ai=ii.name.value;if(oi!=null&&oi.getType(ai)){Ws.reportError(new GraphQLError(`Type "${ai}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:ii.name}));return}return ws[ai]?Ws.reportError(new GraphQLError(`There can be only one type named "${ai}".`,{nodes:[ws[ai],ii.name]})):ws[ai]=ii.name,!1}}function UniqueVariableNamesRule(Ws){return{OperationDefinition(ws){var oi;const si=(oi=ws.variableDefinitions)!==null&&oi!==void 0?oi:[],ii=groupBy(si,ai=>ai.variable.name.value);for(const[ai,li]of ii)li.length>1&&Ws.reportError(new GraphQLError(`There can be only one variable named "$${ai}".`,{nodes:li.map(ci=>ci.variable.name)}))}}}function ValuesOfCorrectTypeRule(Ws){let ws={};return{OperationDefinition:{enter(){ws={}}},VariableDefinition(oi){ws[oi.variable.name.value]=oi},ListValue(oi){const si=getNullableType(Ws.getParentInputType());if(!isListType(si))return isValidValueNode(Ws,oi),!1},ObjectValue(oi){const si=getNamedType(Ws.getInputType());if(!isInputObjectType(si))return isValidValueNode(Ws,oi),!1;const ii=keyMap(oi.fields,ai=>ai.name.value);for(const ai of Object.values(si.getFields()))if(!ii[ai.name]&&isRequiredInputField(ai)){const li=inspect(ai.type);Ws.reportError(new GraphQLError(`Field "${si.name}.${ai.name}" of required type "${li}" was not provided.`,{nodes:oi}))}si.isOneOf&&validateOneOfInputObject(Ws,oi,si,ii,ws)},ObjectField(oi){const si=getNamedType(Ws.getParentInputType());if(!Ws.getInputType()&&isInputObjectType(si)){const ii=suggestionList(oi.name.value,Object.keys(si.getFields()));Ws.reportError(new GraphQLError(`Field "${oi.name.value}" is not defined by type "${si.name}".`+didYouMean(ii),{nodes:oi}))}},NullValue(oi){const si=Ws.getInputType();isNonNullType(si)&&Ws.reportError(new GraphQLError(`Expected value of type "${inspect(si)}", found ${print(oi)}.`,{nodes:oi}))},EnumValue:oi=>isValidValueNode(Ws,oi),IntValue:oi=>isValidValueNode(Ws,oi),FloatValue:oi=>isValidValueNode(Ws,oi),StringValue:oi=>isValidValueNode(Ws,oi),BooleanValue:oi=>isValidValueNode(Ws,oi)}}function isValidValueNode(Ws,ws){const oi=Ws.getInputType();if(!oi)return;const si=getNamedType(oi);if(!isLeafType(si)){const ii=inspect(oi);Ws.reportError(new GraphQLError(`Expected value of type "${ii}", found ${print(ws)}.`,{nodes:ws}));return}try{if(si.parseLiteral(ws,void 0)===void 0){const ii=inspect(oi);Ws.reportError(new GraphQLError(`Expected value of type "${ii}", found ${print(ws)}.`,{nodes:ws}))}}catch(ii){const ai=inspect(oi);ii instanceof GraphQLError?Ws.reportError(ii):Ws.reportError(new GraphQLError(`Expected value of type "${ai}", found ${print(ws)}; `+ii.message,{nodes:ws,originalError:ii}))}}function validateOneOfInputObject(Ws,ws,oi,si,ii){var ai;const li=Object.keys(si);if(li.length!==1){Ws.reportError(new GraphQLError(`OneOf Input Object "${oi.name}" must specify exactly one key.`,{nodes:[ws]}));return}const ci=(ai=si[li[0]])===null||ai===void 0?void 0:ai.value,ui=!ci||ci.kind===Kind.NULL,di=(ci==null?void 0:ci.kind)===Kind.VARIABLE;if(ui){Ws.reportError(new GraphQLError(`Field "${oi.name}.${li[0]}" must be non-null.`,{nodes:[ws]}));return}if(di){const hi=ci.name.value;ii[hi].type.kind!==Kind.NON_NULL_TYPE&&Ws.reportError(new GraphQLError(`Variable "${hi}" must be non-nullable to be used for OneOf Input Object "${oi.name}".`,{nodes:[ws]}))}}function VariablesAreInputTypesRule(Ws){return{VariableDefinition(ws){const oi=typeFromAST(Ws.getSchema(),ws.type);if(oi!==void 0&&!isInputType(oi)){const si=ws.variable.name.value,ii=print(ws.type);Ws.reportError(new GraphQLError(`Variable "$${si}" cannot be non-input type "${ii}".`,{nodes:ws.type}))}}}}function VariablesInAllowedPositionRule(Ws){let ws=Object.create(null);return{OperationDefinition:{enter(){ws=Object.create(null)},leave(oi){const si=Ws.getRecursiveVariableUsages(oi);for(const{node:ii,type:ai,defaultValue:li}of si){const ci=ii.name.value,ui=ws[ci];if(ui&&ai){const di=Ws.getSchema(),hi=typeFromAST(di,ui.type);if(hi&&!allowedVariableUsage(di,hi,ui.defaultValue,ai,li)){const pi=inspect(hi),ha=inspect(ai);Ws.reportError(new GraphQLError(`Variable "$${ci}" of type "${pi}" used in position expecting type "${ha}".`,{nodes:[ui,ii]}))}}}}},VariableDefinition(oi){ws[oi.variable.name.value]=oi}}}function allowedVariableUsage(Ws,ws,oi,si,ii){if(isNonNullType(si)&&!isNonNullType(ws)){if(!(oi!=null&&oi.kind!==Kind.NULL)&&ii===void 0)return!1;const ai=si.ofType;return isTypeSubTypeOf(Ws,ws,ai)}return isTypeSubTypeOf(Ws,ws,si)}const recommendedRules=Object.freeze([MaxIntrospectionDepthRule]),specifiedRules=Object.freeze([ExecutableDefinitionsRule,UniqueOperationNamesRule,LoneAnonymousOperationRule,SingleFieldSubscriptionsRule,KnownTypeNamesRule,FragmentsOnCompositeTypesRule,VariablesAreInputTypesRule,ScalarLeafsRule,FieldsOnCorrectTypeRule,UniqueFragmentNamesRule,KnownFragmentNamesRule,NoUnusedFragmentsRule,PossibleFragmentSpreadsRule,NoFragmentCyclesRule,UniqueVariableNamesRule,NoUndefinedVariablesRule,NoUnusedVariablesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,KnownArgumentNamesRule,UniqueArgumentNamesRule,ValuesOfCorrectTypeRule,ProvidedRequiredArgumentsRule,VariablesInAllowedPositionRule,OverlappingFieldsCanBeMergedRule,UniqueInputFieldNamesRule,...recommendedRules]),specifiedSDLRules=Object.freeze([LoneSchemaDefinitionRule,UniqueOperationTypesRule,UniqueTypeNamesRule,UniqueEnumValueNamesRule,UniqueFieldDefinitionNamesRule,UniqueArgumentDefinitionNamesRule,UniqueDirectiveNamesRule,KnownTypeNamesRule,KnownDirectivesRule,UniqueDirectivesPerLocationRule,PossibleTypeExtensionsRule,KnownArgumentNamesOnDirectivesRule,UniqueArgumentNamesRule,UniqueInputFieldNamesRule,ProvidedRequiredArgumentsOnDirectivesRule]);class ASTValidationContext{constructor(ws,oi){this._ast=ws,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=oi}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(ws){this._onError(ws)}getDocument(){return this._ast}getFragment(ws){let oi;if(this._fragments)oi=this._fragments;else{oi=Object.create(null);for(const si of this.getDocument().definitions)si.kind===Kind.FRAGMENT_DEFINITION&&(oi[si.name.value]=si);this._fragments=oi}return oi[ws]}getFragmentSpreads(ws){let oi=this._fragmentSpreads.get(ws);if(!oi){oi=[];const si=[ws];let ii;for(;ii=si.pop();)for(const ai of ii.selections)ai.kind===Kind.FRAGMENT_SPREAD?oi.push(ai):ai.selectionSet&&si.push(ai.selectionSet);this._fragmentSpreads.set(ws,oi)}return oi}getRecursivelyReferencedFragments(ws){let oi=this._recursivelyReferencedFragments.get(ws);if(!oi){oi=[];const si=Object.create(null),ii=[ws.selectionSet];let ai;for(;ai=ii.pop();)for(const li of this.getFragmentSpreads(ai)){const ci=li.name.value;if(si[ci]!==!0){si[ci]=!0;const ui=this.getFragment(ci);ui&&(oi.push(ui),ii.push(ui.selectionSet))}}this._recursivelyReferencedFragments.set(ws,oi)}return oi}}class SDLValidationContext extends ASTValidationContext{constructor(ws,oi,si){super(ws,si),this._schema=oi}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class ValidationContext extends ASTValidationContext{constructor(ws,oi,si,ii){super(oi,ii),this._schema=ws,this._typeInfo=si,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(ws){let oi=this._variableUsages.get(ws);if(!oi){const si=[],ii=new TypeInfo(this._schema);visit(ws,visitWithTypeInfo(ii,{VariableDefinition:()=>!1,Variable(ai){si.push({node:ai,type:ii.getInputType(),defaultValue:ii.getDefaultValue()})}})),oi=si,this._variableUsages.set(ws,oi)}return oi}getRecursiveVariableUsages(ws){let oi=this._recursiveVariableUsages.get(ws);if(!oi){oi=this.getVariableUsages(ws);for(const si of this.getRecursivelyReferencedFragments(ws))oi=oi.concat(this.getVariableUsages(si));this._recursiveVariableUsages.set(ws,oi)}return oi}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function validate(Ws,ws,oi=specifiedRules,si,ii=new TypeInfo(Ws)){var ai;const li=(ai=void 0)!==null&&ai!==void 0?ai:100;ws||devAssert(!1,"Must provide document."),assertValidSchema(Ws);const ci=Object.freeze({}),ui=[],di=new ValidationContext(Ws,ws,ii,pi=>{if(ui.length>=li)throw ui.push(new GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),ci;ui.push(pi)}),hi=visitInParallel(oi.map(pi=>pi(di)));try{visit(ws,visitWithTypeInfo(ii,hi))}catch(pi){if(pi!==ci)throw pi}return ui}function validateSDL(Ws,ws,oi=specifiedSDLRules){const si=[],ii=new SDLValidationContext(Ws,ws,li=>{si.push(li)}),ai=oi.map(li=>li(ii));return visit(Ws,visitInParallel(ai)),si}function assertValidSDL(Ws){const ws=validateSDL(Ws);if(ws.length!==0)throw new Error(ws.map(oi=>oi.message).join(`
289
-
290
- `))}function assertValidSDLExtension(Ws,ws){const oi=validateSDL(Ws,ws);if(oi.length!==0)throw new Error(oi.map(si=>si.message).join(`
291
-
292
- `))}function toError(Ws){return Ws instanceof Error?Ws:new NonErrorThrown(Ws)}class NonErrorThrown extends Error{constructor(ws){super("Unexpected error value: "+inspect(ws)),this.name="NonErrorThrown",this.thrownValue=ws}}function locatedError(Ws,ws,oi){var si;const ii=toError(Ws);return isLocatedGraphQLError(ii)?ii:new GraphQLError(ii.message,{nodes:(si=ii.nodes)!==null&&si!==void 0?si:ws,source:ii.source,positions:ii.positions,path:oi,originalError:ii})}function isLocatedGraphQLError(Ws){return Array.isArray(Ws.path)}function NoDeprecatedCustomRule(Ws){return{Field(ws){const oi=Ws.getFieldDef(),si=oi==null?void 0:oi.deprecationReason;if(oi&&si!=null){const ii=Ws.getParentType();ii!=null||invariant$1(),Ws.reportError(new GraphQLError(`The field ${ii.name}.${oi.name} is deprecated. ${si}`,{nodes:ws}))}},Argument(ws){const oi=Ws.getArgument(),si=oi==null?void 0:oi.deprecationReason;if(oi&&si!=null){const ii=Ws.getDirective();if(ii!=null)Ws.reportError(new GraphQLError(`Directive "@${ii.name}" argument "${oi.name}" is deprecated. ${si}`,{nodes:ws}));else{const ai=Ws.getParentType(),li=Ws.getFieldDef();ai!=null&&li!=null||invariant$1(),Ws.reportError(new GraphQLError(`Field "${ai.name}.${li.name}" argument "${oi.name}" is deprecated. ${si}`,{nodes:ws}))}}},ObjectField(ws){const oi=getNamedType(Ws.getParentInputType());if(isInputObjectType(oi)){const si=oi.getFields()[ws.name.value],ii=si==null?void 0:si.deprecationReason;ii!=null&&Ws.reportError(new GraphQLError(`The input field ${oi.name}.${si.name} is deprecated. ${ii}`,{nodes:ws}))}},EnumValue(ws){const oi=Ws.getEnumValue(),si=oi==null?void 0:oi.deprecationReason;if(oi&&si!=null){const ii=getNamedType(Ws.getInputType());ii!=null||invariant$1(),Ws.reportError(new GraphQLError(`The enum value "${ii.name}.${oi.name}" is deprecated. ${si}`,{nodes:ws}))}}}}function extendSchema(Ws,ws,oi){assertSchema(Ws),ws!=null&&ws.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),assertValidSDLExtension(ws,Ws);const si=Ws.toConfig(),ii=extendSchemaImpl(si,ws,oi);return si===ii?Ws:new GraphQLSchema(ii)}function extendSchemaImpl(Ws,ws,oi){var si,ii,ai,li;const ci=[],ui=Object.create(null),di=[];let hi;const pi=[];for(const xd of ws.definitions)if(xd.kind===Kind.SCHEMA_DEFINITION)hi=xd;else if(xd.kind===Kind.SCHEMA_EXTENSION)pi.push(xd);else if(isTypeDefinitionNode(xd))ci.push(xd);else if(isTypeExtensionNode(xd)){const Fd=xd.name.value,Vd=ui[Fd];ui[Fd]=Vd?Vd.concat([xd]):[xd]}else xd.kind===Kind.DIRECTIVE_DEFINITION&&di.push(xd);if(Object.keys(ui).length===0&&ci.length===0&&di.length===0&&pi.length===0&&hi==null)return Ws;const ha=Object.create(null);for(const xd of Ws.types)ha[xd.name]=Ca(xd);for(const xd of ci){var ga;const Fd=xd.name.value;ha[Fd]=(ga=stdTypeMap[Fd])!==null&&ga!==void 0?ga:hf(xd)}const va={query:Ws.query&&wa(Ws.query),mutation:Ws.mutation&&wa(Ws.mutation),subscription:Ws.subscription&&wa(Ws.subscription),...hi&&rf([hi]),...rf(pi)};return{description:(si=hi)===null||si===void 0||(ii=si.description)===null||ii===void 0?void 0:ii.value,...va,types:Object.values(ha),directives:[...Ws.directives.map(xa),...di.map(Td)],extensions:Object.create(null),astNode:(ai=hi)!==null&&ai!==void 0?ai:Ws.astNode,extensionASTNodes:Ws.extensionASTNodes.concat(pi),assumeValid:(li=oi==null?void 0:oi.assumeValid)!==null&&li!==void 0?li:!1};function ba(xd){return isListType(xd)?new GraphQLList(ba(xd.ofType)):isNonNullType(xd)?new GraphQLNonNull(ba(xd.ofType)):wa(xd)}function wa(xd){return ha[xd.name]}function xa(xd){const Fd=xd.toConfig();return new GraphQLDirective({...Fd,args:mapValue(Fd.args,Ld)})}function Ca(xd){if(isIntrospectionType(xd)||isSpecifiedScalarType(xd))return xd;if(isScalarType(xd))return gd(xd);if(isObjectType(xd))return Ed(xd);if(isInterfaceType(xd))return Od(xd);if(isUnionType(xd))return Nd(xd);if(isEnumType(xd))return ku(xd);if(isInputObjectType(xd))return el(xd);invariant$1(!1,"Unexpected type: "+inspect(xd))}function el(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[Vd.name])!==null&&Fd!==void 0?Fd:[];return new GraphQLInputObjectType({...Vd,fields:()=>({...mapValue(Vd.fields,ff=>({...ff,type:ba(ff.type)})),...sf(af)}),extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function ku(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[xd.name])!==null&&Fd!==void 0?Fd:[];return new GraphQLEnumType({...Vd,values:{...Vd.values,...of(af)},extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function gd(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[Vd.name])!==null&&Fd!==void 0?Fd:[];let ff=Vd.specifiedByURL;for(const mf of af){var uf;ff=(uf=getSpecifiedByURL(mf))!==null&&uf!==void 0?uf:ff}return new GraphQLScalarType({...Vd,specifiedByURL:ff,extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function Ed(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[Vd.name])!==null&&Fd!==void 0?Fd:[];return new GraphQLObjectType({...Vd,interfaces:()=>[...xd.getInterfaces().map(wa),...Wd(af)],fields:()=>({...mapValue(Vd.fields,Pd),...wd(af)}),extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function Od(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[Vd.name])!==null&&Fd!==void 0?Fd:[];return new GraphQLInterfaceType({...Vd,interfaces:()=>[...xd.getInterfaces().map(wa),...Wd(af)],fields:()=>({...mapValue(Vd.fields,Pd),...wd(af)}),extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function Nd(xd){var Fd;const Vd=xd.toConfig(),af=(Fd=ui[Vd.name])!==null&&Fd!==void 0?Fd:[];return new GraphQLUnionType({...Vd,types:()=>[...xd.getTypes().map(wa),...df(af)],extensionASTNodes:Vd.extensionASTNodes.concat(af)})}function Pd(xd){return{...xd,type:ba(xd.type),args:xd.args&&mapValue(xd.args,Ld)}}function Ld(xd){return{...xd,type:ba(xd.type)}}function rf(xd){const Fd={};for(const af of xd){var Vd;const ff=(Vd=af.operationTypes)!==null&&Vd!==void 0?Vd:[];for(const uf of ff)Fd[uf.operation]=kd(uf.type)}return Fd}function kd(xd){var Fd;const Vd=xd.name.value,af=(Fd=stdTypeMap[Vd])!==null&&Fd!==void 0?Fd:ha[Vd];if(af===void 0)throw new Error(`Unknown type: "${Vd}".`);return af}function Md(xd){return xd.kind===Kind.LIST_TYPE?new GraphQLList(Md(xd.type)):xd.kind===Kind.NON_NULL_TYPE?new GraphQLNonNull(Md(xd.type)):kd(xd)}function Td(xd){var Fd;return new GraphQLDirective({name:xd.name.value,description:(Fd=xd.description)===null||Fd===void 0?void 0:Fd.value,locations:xd.locations.map(({value:Vd})=>Vd),isRepeatable:xd.repeatable,args:Cd(xd.arguments),astNode:xd})}function wd(xd){const Fd=Object.create(null);for(const ff of xd){var Vd;const uf=(Vd=ff.fields)!==null&&Vd!==void 0?Vd:[];for(const mf of uf){var af;Fd[mf.name.value]={type:Md(mf.type),description:(af=mf.description)===null||af===void 0?void 0:af.value,args:Cd(mf.arguments),deprecationReason:getDeprecationReason(mf),astNode:mf}}}return Fd}function Cd(xd){const Fd=xd??[],Vd=Object.create(null);for(const ff of Fd){var af;const uf=Md(ff.type);Vd[ff.name.value]={type:uf,description:(af=ff.description)===null||af===void 0?void 0:af.value,defaultValue:valueFromAST(ff.defaultValue,uf),deprecationReason:getDeprecationReason(ff),astNode:ff}}return Vd}function sf(xd){const Fd=Object.create(null);for(const ff of xd){var Vd;const uf=(Vd=ff.fields)!==null&&Vd!==void 0?Vd:[];for(const mf of uf){var af;const yf=Md(mf.type);Fd[mf.name.value]={type:yf,description:(af=mf.description)===null||af===void 0?void 0:af.value,defaultValue:valueFromAST(mf.defaultValue,yf),deprecationReason:getDeprecationReason(mf),astNode:mf}}}return Fd}function of(xd){const Fd=Object.create(null);for(const ff of xd){var Vd;const uf=(Vd=ff.values)!==null&&Vd!==void 0?Vd:[];for(const mf of uf){var af;Fd[mf.name.value]={description:(af=mf.description)===null||af===void 0?void 0:af.value,deprecationReason:getDeprecationReason(mf),astNode:mf}}}return Fd}function Wd(xd){return xd.flatMap(Fd=>{var Vd,af;return(Vd=(af=Fd.interfaces)===null||af===void 0?void 0:af.map(kd))!==null&&Vd!==void 0?Vd:[]})}function df(xd){return xd.flatMap(Fd=>{var Vd,af;return(Vd=(af=Fd.types)===null||af===void 0?void 0:af.map(kd))!==null&&Vd!==void 0?Vd:[]})}function hf(xd){var Fd;const Vd=xd.name.value,af=(Fd=ui[Vd])!==null&&Fd!==void 0?Fd:[];switch(xd.kind){case Kind.OBJECT_TYPE_DEFINITION:{var ff;const wf=[xd,...af];return new GraphQLObjectType({name:Vd,description:(ff=xd.description)===null||ff===void 0?void 0:ff.value,interfaces:()=>Wd(wf),fields:()=>wd(wf),astNode:xd,extensionASTNodes:af})}case Kind.INTERFACE_TYPE_DEFINITION:{var uf;const wf=[xd,...af];return new GraphQLInterfaceType({name:Vd,description:(uf=xd.description)===null||uf===void 0?void 0:uf.value,interfaces:()=>Wd(wf),fields:()=>wd(wf),astNode:xd,extensionASTNodes:af})}case Kind.ENUM_TYPE_DEFINITION:{var mf;const wf=[xd,...af];return new GraphQLEnumType({name:Vd,description:(mf=xd.description)===null||mf===void 0?void 0:mf.value,values:of(wf),astNode:xd,extensionASTNodes:af})}case Kind.UNION_TYPE_DEFINITION:{var yf;const wf=[xd,...af];return new GraphQLUnionType({name:Vd,description:(yf=xd.description)===null||yf===void 0?void 0:yf.value,types:()=>df(wf),astNode:xd,extensionASTNodes:af})}case Kind.SCALAR_TYPE_DEFINITION:{var Sf;return new GraphQLScalarType({name:Vd,description:(Sf=xd.description)===null||Sf===void 0?void 0:Sf.value,specifiedByURL:getSpecifiedByURL(xd),astNode:xd,extensionASTNodes:af})}case Kind.INPUT_OBJECT_TYPE_DEFINITION:{var Of;const wf=[xd,...af];return new GraphQLInputObjectType({name:Vd,description:(Of=xd.description)===null||Of===void 0?void 0:Of.value,fields:()=>sf(wf),astNode:xd,extensionASTNodes:af,isOneOf:isOneOf(xd)})}}}}const stdTypeMap=keyMap([...specifiedScalarTypes,...introspectionTypes],Ws=>Ws.name);function getDeprecationReason(Ws){const ws=getDirectiveValues(GraphQLDeprecatedDirective,Ws);return ws==null?void 0:ws.reason}function getSpecifiedByURL(Ws){const ws=getDirectiveValues(GraphQLSpecifiedByDirective,Ws);return ws==null?void 0:ws.url}function isOneOf(Ws){return!!getDirectiveValues(GraphQLOneOfDirective,Ws)}function buildASTSchema(Ws,ws){Ws!=null&&Ws.kind===Kind.DOCUMENT||devAssert(!1,"Must provide valid Document AST."),(ws==null?void 0:ws.assumeValid)!==!0&&(ws==null?void 0:ws.assumeValidSDL)!==!0&&assertValidSDL(Ws);const oi=extendSchemaImpl({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},Ws,ws);if(oi.astNode==null)for(const ii of oi.types)switch(ii.name){case"Query":oi.query=ii;break;case"Mutation":oi.mutation=ii;break;case"Subscription":oi.subscription=ii;break}const si=[...oi.directives,...specifiedDirectives.filter(ii=>oi.directives.every(ai=>ai.name!==ii.name))];return new GraphQLSchema({...oi,directives:si})}function buildSchema(Ws,ws){const oi=parse(Ws,{noLocation:void 0,allowLegacyFragmentVariables:void 0});return buildASTSchema(oi,{assumeValidSDL:void 0,assumeValid:void 0})}function printSchema(Ws){return printFilteredSchema(Ws,ws=>!isSpecifiedDirective(ws),isDefinedType)}function isDefinedType(Ws){return!isSpecifiedScalarType(Ws)&&!isIntrospectionType(Ws)}function printFilteredSchema(Ws,ws,oi){const si=Ws.getDirectives().filter(ws),ii=Object.values(Ws.getTypeMap()).filter(oi);return[printSchemaDefinition(Ws),...si.map(ai=>printDirective(ai)),...ii.map(ai=>printType(ai))].filter(Boolean).join(`
293
-
294
- `)}function printSchemaDefinition(Ws){if(Ws.description==null&&isSchemaOfCommonNames(Ws))return;const ws=[],oi=Ws.getQueryType();oi&&ws.push(` query: ${oi.name}`);const si=Ws.getMutationType();si&&ws.push(` mutation: ${si.name}`);const ii=Ws.getSubscriptionType();return ii&&ws.push(` subscription: ${ii.name}`),printDescription(Ws)+`schema {
295
- ${ws.join(`
296
- `)}
297
- }`}function isSchemaOfCommonNames(Ws){const ws=Ws.getQueryType();if(ws&&ws.name!=="Query")return!1;const oi=Ws.getMutationType();if(oi&&oi.name!=="Mutation")return!1;const si=Ws.getSubscriptionType();return!(si&&si.name!=="Subscription")}function printType(Ws){if(isScalarType(Ws))return printScalar(Ws);if(isObjectType(Ws))return printObject(Ws);if(isInterfaceType(Ws))return printInterface(Ws);if(isUnionType(Ws))return printUnion(Ws);if(isEnumType(Ws))return printEnum(Ws);if(isInputObjectType(Ws))return printInputObject(Ws);invariant$1(!1,"Unexpected type: "+inspect(Ws))}function printScalar(Ws){return printDescription(Ws)+`scalar ${Ws.name}`+printSpecifiedByURL(Ws)}function printImplementedInterfaces(Ws){const ws=Ws.getInterfaces();return ws.length?" implements "+ws.map(oi=>oi.name).join(" & "):""}function printObject(Ws){return printDescription(Ws)+`type ${Ws.name}`+printImplementedInterfaces(Ws)+printFields(Ws)}function printInterface(Ws){return printDescription(Ws)+`interface ${Ws.name}`+printImplementedInterfaces(Ws)+printFields(Ws)}function printUnion(Ws){const ws=Ws.getTypes(),oi=ws.length?" = "+ws.join(" | "):"";return printDescription(Ws)+"union "+Ws.name+oi}function printEnum(Ws){const ws=Ws.getValues().map((oi,si)=>printDescription(oi," ",!si)+" "+oi.name+printDeprecated(oi.deprecationReason));return printDescription(Ws)+`enum ${Ws.name}`+printBlock(ws)}function printInputObject(Ws){const ws=Object.values(Ws.getFields()).map((oi,si)=>printDescription(oi," ",!si)+" "+printInputValue(oi));return printDescription(Ws)+`input ${Ws.name}`+(Ws.isOneOf?" @oneOf":"")+printBlock(ws)}function printFields(Ws){const ws=Object.values(Ws.getFields()).map((oi,si)=>printDescription(oi," ",!si)+" "+oi.name+printArgs(oi.args," ")+": "+String(oi.type)+printDeprecated(oi.deprecationReason));return printBlock(ws)}function printBlock(Ws){return Ws.length!==0?` {
298
- `+Ws.join(`
299
- `)+`
300
- }`:""}function printArgs(Ws,ws=""){return Ws.length===0?"":Ws.every(oi=>!oi.description)?"("+Ws.map(printInputValue).join(", ")+")":`(
301
- `+Ws.map((oi,si)=>printDescription(oi," "+ws,!si)+" "+ws+printInputValue(oi)).join(`
302
- `)+`
303
- `+ws+")"}function printInputValue(Ws){const ws=astFromValue(Ws.defaultValue,Ws.type);let oi=Ws.name+": "+String(Ws.type);return ws&&(oi+=` = ${print(ws)}`),oi+printDeprecated(Ws.deprecationReason)}function printDirective(Ws){return printDescription(Ws)+"directive @"+Ws.name+printArgs(Ws.args)+(Ws.isRepeatable?" repeatable":"")+" on "+Ws.locations.join(" | ")}function printDeprecated(Ws){return Ws==null?"":Ws!==DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${print({kind:Kind.STRING,value:Ws})})`:" @deprecated"}function printSpecifiedByURL(Ws){return Ws.specifiedByURL==null?"":` @specifiedBy(url: ${print({kind:Kind.STRING,value:Ws.specifiedByURL})})`}function printDescription(Ws,ws="",oi=!0){const{description:si}=Ws;if(si==null)return"";const ii=print({kind:Kind.STRING,value:si,block:isPrintableAsBlockString(si)});return(ws&&!oi?`
304
- `+ws:ws)+ii.replace(/\n/g,`
305
- `+ws)+`
306
- `}function makeStateObject(Ws,ws){const oi=makeStateObjectName(Ws,ws),si={kind:Kind.OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:oi},fields:[{description:{kind:Kind.STRING,value:`Add your ${ws} state fields here`,block:!1},kind:Kind.FIELD_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(si)}function makeEmptyInputObject(Ws){const ws={kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,name:{kind:Kind.NAME,value:Ws},fields:[{description:{kind:Kind.STRING,value:"Add your inputs here",block:!1},kind:Kind.INPUT_VALUE_DEFINITION,name:{kind:Kind.NAME,value:"_placeholder"},type:{kind:Kind.NAMED_TYPE,name:{kind:Kind.NAME,value:"String"}}}]};return print(ws)}function makeOperationInputName(Ws){return`${pascalCase(Ws)}Input`}function makeStateObjectName(Ws,ws){return`${pascalCase(Ws)}${ws==="local"?"Local":""}State`}function makeOperationInitialDoc(Ws){const ws=makeOperationInputName(Ws);return makeEmptyInputObject(ws)}function makeInitialSchemaDoc(Ws,ws){return makeStateObject(Ws,ws)}function isValidScalarValue(Ws,ws){if(Ws in customScalars){const oi=customScalars[Ws];if(oi instanceof GraphQLScalarType)return oi.parseValue(ws)!==void 0}switch(Ws){case"Int":return Number.isInteger(ws);case"Float":return typeof ws=="number";case"Boolean":return typeof ws=="boolean";case"DateTime":return typeof ws=="string"&&!isNaN(Date.parse(ws));case"ID":case"String":default:return typeof ws=="string"}}function getMinimalValue(Ws,ws,oi){const si=getNullableType(Ws);if(isScalarType(si)){const ii=si.name;if(oi!==void 0&&isValidScalarValue(ii,oi))return oi;switch(ii){case"Int":case"Float":return 0;case"Boolean":return!1;case"DateTime":return new Date().toISOString();case"ID":case"String":default:return""}}if(isEnumType(si)){const ii=si.getValues().map(ai=>ai.value);return oi!==void 0&&ii.includes(oi)?oi:ii[0]||null}if(isListType(si))return oi!==void 0&&Array.isArray(oi)?oi:[];if(isObjectType(si)){const ii={},ai=si.getFields(),li=oi;for(const ci in ai){const ui=ai[ci],di=li?li[ci]:void 0;ii[ci]=getMinimalValue(ui.type,ws,di)}return ii}return null}function makeMinimalObjectFromSDL(Ws,ws,oi){const si=buildASTSchema(parse(Ws)),ii=parse(ws),ai=[];if(ii.definitions.forEach(hi=>{(hi.kind===Kind.OBJECT_TYPE_DEFINITION||hi.kind===Kind.OBJECT_TYPE_EXTENSION)&&ai.push(hi.name.value)}),ai.length===0)throw new Error("No object type definition found in SDL.");const li=ai[0];let ci=si.getType(li),ui=si;if((!ci||!isObjectType(ci))&&(ui=extendSchema(si,ii),ci=ui.getType(li)),!ci||!isObjectType(ci))throw new Error(`Type "${li}" is not a valid ObjectType.`);const di=getMinimalValue(ci,ui,oi);return JSON.stringify(di,null,2)}function removeWhitespace(Ws){return Ws.replace(/\s+|\\n|\\t/g,"").toLowerCase()}function compareStringsWithoutWhitespace(Ws,ws){return removeWhitespace(Ws)===removeWhitespace(ws)}function renameSchemaType(Ws,ws,oi,si){const ii=si==="global"?"State":"LocalState",ai=`${pascalCase(ws)}${ii}`,li=`${pascalCase(oi)}${ii}`,ci=parse(Ws),ui=visit(ci,{ObjectTypeDefinition:di=>{if(di.name.value===ai)return{...di,name:{...di.name,value:li}}}});return print(ui)}function initializeModelSchema(Ws){const{modelName:ws,setStateSchema:oi}=Ws,si=makeInitialSchemaDoc(ws,"global");oi(si,"global")}function updateModelSchemaNames(Ws){const{oldName:ws,newName:oi,globalStateSchema:si,localStateSchema:ii,setStateSchema:ai}=Ws,li=renameSchemaType(si,ws,oi,"global");if(ai(li,"global"),ii){const ci=renameSchemaType(ii,ws,oi,"local");ai(ci,"local")}}function handleModelNameChange(Ws){const{oldName:ws,newName:oi,globalStateSchema:si,setStateSchema:ii}=Ws;if(!si){initializeModelSchema({modelName:oi,setStateSchema:ii});return}updateModelSchemaNames(Ws)}const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=React.forwardRef(({className:Ws,...ws},oi)=>jsx(Root,{ref:oi,className:cn(labelVariants(),Ws),...ws}));Label.displayName=Root.displayName;var validator$1={exports:{}},toDate={exports:{}},assertString={exports:{}},hasRequiredAssertString;function requireAssertString(){return hasRequiredAssertString||(hasRequiredAssertString=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=si;function oi(ii){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ai){return typeof ai}:function(ai){return ai&&typeof Symbol=="function"&&ai.constructor===Symbol&&ai!==Symbol.prototype?"symbol":typeof ai},oi(ii)}function si(ii){var ai=typeof ii=="string"||ii instanceof String;if(!ai){var li=oi(ii);throw ii===null?li="null":li==="object"&&(li=ii.constructor.name),new TypeError("Expected a string but received a ".concat(li))}}Ws.exports=ws.default,Ws.exports.default=ws.default}(assertString,assertString.exports)),assertString.exports}var hasRequiredToDate;function requireToDate(){return hasRequiredToDate||(hasRequiredToDate=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai),ai=Date.parse(ai),isNaN(ai)?null:new Date(ai)}Ws.exports=ws.default,Ws.exports.default=ws.default}(toDate,toDate.exports)),toDate.exports}var toFloat={exports:{}},isFloat={},alpha={},hasRequiredAlpha;function requireAlpha(){if(hasRequiredAlpha)return alpha;hasRequiredAlpha=1,Object.defineProperty(alpha,"__esModule",{value:!0}),alpha.farsiLocales=alpha.englishLocales=alpha.dotDecimal=alpha.decimal=alpha.commaDecimal=alpha.bengaliLocales=alpha.arabicLocales=alpha.alphanumeric=alpha.alpha=void 0;for(var Ws=alpha.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},ws=alpha.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},oi=alpha.decimal={"en-US":".",ar:"٫"},si=alpha.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],ii,ai=0;ai<si.length;ai++)ii="en-".concat(si[ai]),Ws[ii]=Ws["en-US"],ws[ii]=ws["en-US"],oi[ii]=oi["en-US"];for(var li=alpha.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],ci,ui=0;ui<li.length;ui++)ci="ar-".concat(li[ui]),Ws[ci]=Ws.ar,ws[ci]=ws.ar,oi[ci]=oi.ar;for(var di=alpha.farsiLocales=["IR","AF"],hi,pi=0;pi<di.length;pi++)hi="fa-".concat(di[pi]),ws[hi]=ws.fa,oi[hi]=oi.ar;for(var ha=alpha.bengaliLocales=["BD","IN"],ga,va=0;va<ha.length;va++)ga="bn-".concat(ha[va]),Ws[ga]=Ws.bn,ws[ga]=ws.bn,oi[ga]=oi["en-US"];for(var ba=alpha.dotDecimal=["ar-EG","ar-LB","ar-LY"],wa=alpha.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],xa=0;xa<ba.length;xa++)oi[ba[xa]]=oi["en-US"];for(var Ca=0;Ca<wa.length;Ca++)oi[wa[Ca]]=",";return Ws["fr-CA"]=Ws["fr-FR"],ws["fr-CA"]=ws["fr-FR"],Ws["pt-BR"]=Ws["pt-PT"],ws["pt-BR"]=ws["pt-PT"],oi["pt-BR"]=oi["pt-PT"],Ws["pl-Pl"]=Ws["pl-PL"],ws["pl-Pl"]=ws["pl-PL"],oi["pl-Pl"]=oi["pl-PL"],Ws["fa-AF"]=Ws.fa,alpha}var hasRequiredIsFloat;function requireIsFloat(){if(hasRequiredIsFloat)return isFloat;hasRequiredIsFloat=1,Object.defineProperty(isFloat,"__esModule",{value:!0}),isFloat.default=si,isFloat.locales=void 0;var Ws=oi(requireAssertString()),ws=requireAlpha();function oi(ii){return ii&&ii.__esModule?ii:{default:ii}}function si(ii,ai){(0,Ws.default)(ii),ai=ai||{};var li=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(ai.locale?ws.decimal[ai.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(ii===""||ii==="."||ii===","||ii==="-"||ii==="+")return!1;var ci=parseFloat(ii.replace(",","."));return li.test(ii)&&(!ai.hasOwnProperty("min")||ci>=ai.min)&&(!ai.hasOwnProperty("max")||ci<=ai.max)&&(!ai.hasOwnProperty("lt")||ci<ai.lt)&&(!ai.hasOwnProperty("gt")||ci>ai.gt)}return isFloat.locales=Object.keys(ws.decimal),isFloat}var hasRequiredToFloat;function requireToFloat(){return hasRequiredToFloat||(hasRequiredToFloat=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireIsFloat());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai)?parseFloat(ai):NaN}Ws.exports=ws.default,Ws.exports.default=ws.default}(toFloat,toFloat.exports)),toFloat.exports}var toInt={exports:{}},hasRequiredToInt;function requireToInt(){return hasRequiredToInt||(hasRequiredToInt=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){return(0,oi.default)(ai),parseInt(ai,li||10)}Ws.exports=ws.default,Ws.exports.default=ws.default}(toInt,toInt.exports)),toInt.exports}var toBoolean={exports:{}},hasRequiredToBoolean;function requireToBoolean(){return hasRequiredToBoolean||(hasRequiredToBoolean=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){return(0,oi.default)(ai),li?ai==="1"||/^true$/i.test(ai):ai!=="0"&&!/^false$/i.test(ai)&&ai!==""}Ws.exports=ws.default,Ws.exports.default=ws.default}(toBoolean,toBoolean.exports)),toBoolean.exports}var equals={exports:{}},hasRequiredEquals;function requireEquals(){return hasRequiredEquals||(hasRequiredEquals=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){return(0,oi.default)(ai),ai===li}Ws.exports=ws.default,Ws.exports.default=ws.default}(equals,equals.exports)),equals.exports}var contains$1={exports:{}},toString$1={exports:{}},hasRequiredToString;function requireToString(){return hasRequiredToString||(hasRequiredToString=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=si;function oi(ii){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ai){return typeof ai}:function(ai){return ai&&typeof Symbol=="function"&&ai.constructor===Symbol&&ai!==Symbol.prototype?"symbol":typeof ai},oi(ii)}function si(ii){return oi(ii)==="object"&&ii!==null?typeof ii.toString=="function"?ii=ii.toString():ii="[object Object]":(ii===null||typeof ii>"u"||isNaN(ii)&&!ii.length)&&(ii=""),String(ii)}Ws.exports=ws.default,Ws.exports.default=ws.default}(toString$1,toString$1.exports)),toString$1.exports}var merge={exports:{}},hasRequiredMerge;function requireMerge(){return hasRequiredMerge||(hasRequiredMerge=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=oi;function oi(){var si=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ii=arguments.length>1?arguments[1]:void 0;for(var ai in ii)typeof si[ai]>"u"&&(si[ai]=ii[ai]);return si}Ws.exports=ws.default,Ws.exports.default=ws.default}(merge,merge.exports)),merge.exports}var hasRequiredContains;function requireContains(){return hasRequiredContains||(hasRequiredContains=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=ai(requireAssertString()),si=ai(requireToString()),ii=ai(requireMerge());function ai(ui){return ui&&ui.__esModule?ui:{default:ui}}var li={ignoreCase:!1,minOccurrences:1};function ci(ui,di,hi){return(0,oi.default)(ui),hi=(0,ii.default)(hi,li),hi.ignoreCase?ui.toLowerCase().split((0,si.default)(di).toLowerCase()).length>hi.minOccurrences:ui.split((0,si.default)(di)).length>hi.minOccurrences}Ws.exports=ws.default,Ws.exports.default=ws.default}(contains$1,contains$1.exports)),contains$1.exports}var matches={exports:{}},hasRequiredMatches;function requireMatches(){return hasRequiredMatches||(hasRequiredMatches=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li,ci){return(0,oi.default)(ai),Object.prototype.toString.call(li)!=="[object RegExp]"&&(li=new RegExp(li,ci)),!!ai.match(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(matches,matches.exports)),matches.exports}var isEmail={exports:{}},isByteLength={exports:{}},hasRequiredIsByteLength;function requireIsByteLength(){return hasRequiredIsByteLength||(hasRequiredIsByteLength=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}function ii(li){"@babel/helpers - typeof";return ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ci){return typeof ci}:function(ci){return ci&&typeof Symbol=="function"&&ci.constructor===Symbol&&ci!==Symbol.prototype?"symbol":typeof ci},ii(li)}function ai(li,ci){(0,oi.default)(li);var ui,di;ii(ci)==="object"?(ui=ci.min||0,di=ci.max):(ui=arguments[1],di=arguments[2]);var hi=encodeURI(li).split(/%..|./).length-1;return hi>=ui&&(typeof di>"u"||hi<=di)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isByteLength,isByteLength.exports)),isByteLength.exports}var isFQDN={exports:{}},hasRequiredIsFQDN;function requireIsFQDN(){return hasRequiredIsFQDN||(hasRequiredIsFQDN=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function li(ci,ui){(0,oi.default)(ci),ui=(0,si.default)(ui,ai),ui.allow_trailing_dot&&ci[ci.length-1]==="."&&(ci=ci.substring(0,ci.length-1)),ui.allow_wildcard===!0&&ci.indexOf("*.")===0&&(ci=ci.substring(2));var di=ci.split("."),hi=di[di.length-1];return ui.require_tld&&(di.length<2||!ui.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(hi)||/\s/.test(hi))||!ui.allow_numeric_tld&&/^\d+$/.test(hi)?!1:di.every(function(pi){return!(pi.length>63&&!ui.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(pi)||/[\uff01-\uff5e]/.test(pi)||/^-|-$/.test(pi)||!ui.allow_underscores&&/_/.test(pi))})}Ws.exports=ws.default,Ws.exports.default=ws.default}(isFQDN,isFQDN.exports)),isFQDN.exports}var isIP={exports:{}},hasRequiredIsIP;function requireIsIP(){return hasRequiredIsIP||(hasRequiredIsIP=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=di;var oi=si(requireAssertString());function si(hi){return hi&&hi.__esModule?hi:{default:hi}}var ii="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",ai="(".concat(ii,"[.]){3}").concat(ii),li=new RegExp("^".concat(ai,"$")),ci="(?:[0-9a-fA-F]{1,4})",ui=new RegExp("^("+"(?:".concat(ci,":){7}(?:").concat(ci,"|:)|")+"(?:".concat(ci,":){6}(?:").concat(ai,"|:").concat(ci,"|:)|")+"(?:".concat(ci,":){5}(?::").concat(ai,"|(:").concat(ci,"){1,2}|:)|")+"(?:".concat(ci,":){4}(?:(:").concat(ci,"){0,1}:").concat(ai,"|(:").concat(ci,"){1,3}|:)|")+"(?:".concat(ci,":){3}(?:(:").concat(ci,"){0,2}:").concat(ai,"|(:").concat(ci,"){1,4}|:)|")+"(?:".concat(ci,":){2}(?:(:").concat(ci,"){0,3}:").concat(ai,"|(:").concat(ci,"){1,5}|:)|")+"(?:".concat(ci,":){1}(?:(:").concat(ci,"){0,4}:").concat(ai,"|(:").concat(ci,"){1,6}|:)|")+"(?::((?::".concat(ci,"){0,5}:").concat(ai,"|(?::").concat(ci,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function di(hi){var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,oi.default)(hi),pi=String(pi),pi?pi==="4"?li.test(hi):pi==="6"?ui.test(hi):!1:di(hi,4)||di(hi,6)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isIP,isIP.exports)),isIP.exports}var hasRequiredIsEmail;function requireIsEmail(){return hasRequiredIsEmail||(hasRequiredIsEmail=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=xa;var oi=ci(requireAssertString()),si=ci(requireIsByteLength()),ii=ci(requireIsFQDN()),ai=ci(requireIsIP()),li=ci(requireMerge());function ci(Ca){return Ca&&Ca.__esModule?Ca:{default:Ca}}var ui={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},di=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,hi=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,pi=/^[a-z\d]+$/,ha=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,ga=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,va=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,ba=254;function wa(Ca){var el=Ca.replace(/^"(.+)"$/,"$1");if(!el.trim())return!1;var ku=/[\.";<>]/.test(el);if(ku){if(el===Ca)return!1;var gd=el.split('"').length===el.split('\\"').length;if(!gd)return!1}return!0}function xa(Ca,el){if((0,oi.default)(Ca),el=(0,li.default)(el,ui),el.require_display_name||el.allow_display_name){var ku=Ca.match(di);if(ku){var gd=ku[1];if(Ca=Ca.replace(gd,"").replace(/(^<|>$)/g,""),gd.endsWith(" ")&&(gd=gd.slice(0,-1)),!wa(gd))return!1}else if(el.require_display_name)return!1}if(!el.ignore_max_length&&Ca.length>ba)return!1;var Ed=Ca.split("@"),Od=Ed.pop(),Nd=Od.toLowerCase();if(el.host_blacklist.includes(Nd)||el.host_whitelist.length>0&&!el.host_whitelist.includes(Nd))return!1;var Pd=Ed.join("@");if(el.domain_specific_validation&&(Nd==="gmail.com"||Nd==="googlemail.com")){Pd=Pd.toLowerCase();var Ld=Pd.split("+")[0];if(!(0,si.default)(Ld.replace(/\./g,""),{min:6,max:30}))return!1;for(var rf=Ld.split("."),kd=0;kd<rf.length;kd++)if(!pi.test(rf[kd]))return!1}if(el.ignore_max_length===!1&&(!(0,si.default)(Pd,{max:64})||!(0,si.default)(Od,{max:254})))return!1;if(!(0,ii.default)(Od,{require_tld:el.require_tld,ignore_max_length:el.ignore_max_length,allow_underscores:el.allow_underscores})){if(!el.allow_ip_domain)return!1;if(!(0,ai.default)(Od)){if(!Od.startsWith("[")||!Od.endsWith("]"))return!1;var Md=Od.slice(1,-1);if(Md.length===0||!(0,ai.default)(Md))return!1}}if(Pd[0]==='"')return Pd=Pd.slice(1,Pd.length-1),el.allow_utf8_local_part?va.test(Pd):ha.test(Pd);for(var Td=el.allow_utf8_local_part?ga:hi,wd=Pd.split("."),Cd=0;Cd<wd.length;Cd++)if(!Td.test(wd[Cd]))return!1;return!(el.blacklisted_chars&&Pd.search(new RegExp("[".concat(el.blacklisted_chars,"]+"),"g"))!==-1)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isEmail,isEmail.exports)),isEmail.exports}var isURL$1={exports:{}},hasRequiredIsURL;function requireIsURL(){return hasRequiredIsURL||(hasRequiredIsURL=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=xa;var oi=li(requireAssertString()),si=li(requireIsFQDN()),ii=li(requireIsIP()),ai=li(requireMerge());function li(Ca){return Ca&&Ca.__esModule?Ca:{default:Ca}}function ci(Ca,el){return ha(Ca)||pi(Ca,el)||di(Ca,el)||ui()}function ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
307
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function di(Ca,el){if(Ca){if(typeof Ca=="string")return hi(Ca,el);var ku=Object.prototype.toString.call(Ca).slice(8,-1);if(ku==="Object"&&Ca.constructor&&(ku=Ca.constructor.name),ku==="Map"||ku==="Set")return Array.from(Ca);if(ku==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ku))return hi(Ca,el)}}function hi(Ca,el){(el==null||el>Ca.length)&&(el=Ca.length);for(var ku=0,gd=new Array(el);ku<el;ku++)gd[ku]=Ca[ku];return gd}function pi(Ca,el){var ku=Ca==null?null:typeof Symbol<"u"&&Ca[Symbol.iterator]||Ca["@@iterator"];if(ku!=null){var gd,Ed,Od,Nd,Pd=[],Ld=!0,rf=!1;try{if(Od=(ku=ku.call(Ca)).next,el!==0)for(;!(Ld=(gd=Od.call(ku)).done)&&(Pd.push(gd.value),Pd.length!==el);Ld=!0);}catch(kd){rf=!0,Ed=kd}finally{try{if(!Ld&&ku.return!=null&&(Nd=ku.return(),Object(Nd)!==Nd))return}finally{if(rf)throw Ed}}return Pd}}function ha(Ca){if(Array.isArray(Ca))return Ca}var ga={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},va=/^\[([^\]]+)\](?::([0-9]+))?$/;function ba(Ca){return Object.prototype.toString.call(Ca)==="[object RegExp]"}function wa(Ca,el){for(var ku=0;ku<el.length;ku++){var gd=el[ku];if(Ca===gd||ba(gd)&&gd.test(Ca))return!0}return!1}function xa(Ca,el){if((0,oi.default)(Ca),!Ca||/[\s<>]/.test(Ca)||Ca.indexOf("mailto:")===0||(el=(0,ai.default)(el,ga),el.validate_length&&Ca.length>=2083)||!el.allow_fragments&&Ca.includes("#")||!el.allow_query_components&&(Ca.includes("?")||Ca.includes("&")))return!1;var ku,gd,Ed,Od,Nd,Pd,Ld,rf;if(Ld=Ca.split("#"),Ca=Ld.shift(),Ld=Ca.split("?"),Ca=Ld.shift(),Ld=Ca.split("://"),Ld.length>1){if(ku=Ld.shift().toLowerCase(),el.require_valid_protocol&&el.protocols.indexOf(ku)===-1)return!1}else{if(el.require_protocol)return!1;if(Ca.slice(0,2)==="//"){if(!el.allow_protocol_relative_urls)return!1;Ld[0]=Ca.slice(2)}}if(Ca=Ld.join("://"),Ca==="")return!1;if(Ld=Ca.split("/"),Ca=Ld.shift(),Ca===""&&!el.require_host)return!0;if(Ld=Ca.split("@"),Ld.length>1){if(el.disallow_auth||Ld[0]===""||(gd=Ld.shift(),gd.indexOf(":")>=0&&gd.split(":").length>2))return!1;var kd=gd.split(":"),Md=ci(kd,2),Td=Md[0],wd=Md[1];if(Td===""&&wd==="")return!1}Od=Ld.join("@"),Pd=null,rf=null;var Cd=Od.match(va);if(Cd?(Ed="",rf=Cd[1],Pd=Cd[2]||null):(Ld=Od.split(":"),Ed=Ld.shift(),Ld.length&&(Pd=Ld.join(":"))),Pd!==null&&Pd.length>0){if(Nd=parseInt(Pd,10),!/^[0-9]+$/.test(Pd)||Nd<=0||Nd>65535)return!1}else if(el.require_port)return!1;return el.host_whitelist?wa(Ed,el.host_whitelist):Ed===""&&!el.require_host?!0:!(!(0,ii.default)(Ed)&&!(0,si.default)(Ed,el)&&(!rf||!(0,ii.default)(rf,6))||(Ed=Ed||rf,el.host_blacklist&&wa(Ed,el.host_blacklist)))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isURL$1,isURL$1.exports)),isURL$1.exports}var isMACAddress={exports:{}},hasRequiredIsMACAddress;function requireIsMACAddress(){return hasRequiredIsMACAddress||(hasRequiredIsMACAddress=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=hi;var oi=si(requireAssertString());function si(pi){return pi&&pi.__esModule?pi:{default:pi}}var ii=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,ai=/^([0-9a-fA-F]){12}$/,li=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,ci=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,ui=/^([0-9a-fA-F]){16}$/,di=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function hi(pi,ha){return(0,oi.default)(pi),ha!=null&&ha.eui&&(ha.eui=String(ha.eui)),ha!=null&&ha.no_colons||ha!=null&&ha.no_separators?ha.eui==="48"?ai.test(pi):ha.eui==="64"?ui.test(pi):ai.test(pi)||ui.test(pi):(ha==null?void 0:ha.eui)==="48"?ii.test(pi)||li.test(pi):(ha==null?void 0:ha.eui)==="64"?ci.test(pi)||di.test(pi):hi(pi,{eui:"48"})||hi(pi,{eui:"64"})}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMACAddress,isMACAddress.exports)),isMACAddress.exports}var isIPRange={exports:{}},hasRequiredIsIPRange;function requireIsIPRange(){return hasRequiredIsIPRange||(hasRequiredIsIPRange=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ui;var oi=ii(requireAssertString()),si=ii(requireIsIP());function ii(di){return di&&di.__esModule?di:{default:di}}var ai=/^\d{1,3}$/,li=32,ci=128;function ui(di){var hi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,oi.default)(di);var pi=di.split("/");if(pi.length!==2||!ai.test(pi[1])||pi[1].length>1&&pi[1].startsWith("0"))return!1;var ha=(0,si.default)(pi[0],hi);if(!ha)return!1;var ga=null;switch(String(hi)){case"4":ga=li;break;case"6":ga=ci;break;default:ga=(0,si.default)(pi[0],"6")?ci:li}return pi[1]<=ga&&pi[1]>=0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isIPRange,isIPRange.exports)),isIPRange.exports}var isDate={exports:{}},hasRequiredIsDate;function requireIsDate(){return hasRequiredIsDate||(hasRequiredIsDate=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=va;var oi=si(requireMerge());function si(ba){return ba&&ba.__esModule?ba:{default:ba}}function ii(ba,wa){return ci(ba)||li(ba,wa)||di(ba,wa)||ai()}function ai(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
308
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function li(ba,wa){var xa=ba==null?null:typeof Symbol<"u"&&ba[Symbol.iterator]||ba["@@iterator"];if(xa!=null){var Ca,el,ku,gd,Ed=[],Od=!0,Nd=!1;try{if(ku=(xa=xa.call(ba)).next,wa!==0)for(;!(Od=(Ca=ku.call(xa)).done)&&(Ed.push(Ca.value),Ed.length!==wa);Od=!0);}catch(Pd){Nd=!0,el=Pd}finally{try{if(!Od&&xa.return!=null&&(gd=xa.return(),Object(gd)!==gd))return}finally{if(Nd)throw el}}return Ed}}function ci(ba){if(Array.isArray(ba))return ba}function ui(ba,wa){var xa=typeof Symbol<"u"&&ba[Symbol.iterator]||ba["@@iterator"];if(!xa){if(Array.isArray(ba)||(xa=di(ba))||wa){xa&&(ba=xa);var Ca=0,el=function(){};return{s:el,n:function(){return Ca>=ba.length?{done:!0}:{done:!1,value:ba[Ca++]}},e:function(Od){throw Od},f:el}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
309
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ku=!0,gd=!1,Ed;return{s:function(){xa=xa.call(ba)},n:function(){var Od=xa.next();return ku=Od.done,Od},e:function(Od){gd=!0,Ed=Od},f:function(){try{!ku&&xa.return!=null&&xa.return()}finally{if(gd)throw Ed}}}}function di(ba,wa){if(ba){if(typeof ba=="string")return hi(ba,wa);var xa=Object.prototype.toString.call(ba).slice(8,-1);if(xa==="Object"&&ba.constructor&&(xa=ba.constructor.name),xa==="Map"||xa==="Set")return Array.from(ba);if(xa==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xa))return hi(ba,wa)}}function hi(ba,wa){(wa==null||wa>ba.length)&&(wa=ba.length);for(var xa=0,Ca=new Array(wa);xa<wa;xa++)Ca[xa]=ba[xa];return Ca}var pi={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function ha(ba){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(ba)}function ga(ba,wa){for(var xa=[],Ca=Math.min(ba.length,wa.length),el=0;el<Ca;el++)xa.push([ba[el],wa[el]]);return xa}function va(ba,wa){if(typeof wa=="string"?wa=(0,oi.default)({format:wa},pi):wa=(0,oi.default)(wa,pi),typeof ba=="string"&&ha(wa.format)){var xa=wa.delimiters.find(function(wd){return wa.format.indexOf(wd)!==-1}),Ca=wa.strictMode?xa:wa.delimiters.find(function(wd){return ba.indexOf(wd)!==-1}),el=ga(ba.split(Ca),wa.format.toLowerCase().split(xa)),ku={},gd=ui(el),Ed;try{for(gd.s();!(Ed=gd.n()).done;){var Od=ii(Ed.value,2),Nd=Od[0],Pd=Od[1];if(Nd.length!==Pd.length)return!1;ku[Pd.charAt(0)]=Nd}}catch(wd){gd.e(wd)}finally{gd.f()}var Ld=ku.y;if(Ld.startsWith("-"))return!1;if(ku.y.length===2){var rf=parseInt(ku.y,10);if(isNaN(rf))return!1;var kd=new Date().getFullYear()%100;rf<kd?Ld="20".concat(ku.y):Ld="19".concat(ku.y)}var Md=ku.m;ku.m.length===1&&(Md="0".concat(ku.m));var Td=ku.d;return ku.d.length===1&&(Td="0".concat(ku.d)),new Date("".concat(Ld,"-").concat(Md,"-").concat(Td,"T00:00:00.000Z")).getUTCDate()===+ku.d}return wa.strictMode?!1:Object.prototype.toString.call(ba)==="[object Date]"&&isFinite(ba)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isDate,isDate.exports)),isDate.exports}var isTime={exports:{}},hasRequiredIsTime;function requireIsTime(){return hasRequiredIsTime||(hasRequiredIsTime=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=si(requireMerge());function si(ci){return ci&&ci.__esModule?ci:{default:ci}}var ii={hourFormat:"hour24",mode:"default"},ai={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function li(ci,ui){return ui=(0,oi.default)(ui,ii),typeof ci!="string"?!1:ai[ui.hourFormat][ui.mode].test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isTime,isTime.exports)),isTime.exports}var isBoolean={exports:{}},hasRequiredIsBoolean;function requireIsBoolean(){return hasRequiredIsBoolean||(hasRequiredIsBoolean=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=si(requireAssertString());function si(ui){return ui&&ui.__esModule?ui:{default:ui}}var ii={loose:!1},ai=["true","false","1","0"],li=[].concat(ai,["yes","no"]);function ci(ui){var di=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ii;return(0,oi.default)(ui),di.loose?li.includes(ui.toLowerCase()):ai.includes(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBoolean,isBoolean.exports)),isBoolean.exports}var isLocale={exports:{}},hasRequiredIsLocale;function requireIsLocale(){return hasRequiredIsLocale||(hasRequiredIsLocale=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=Ca;var oi=si(requireAssertString());function si(el){return el&&el.__esModule?el:{default:el}}var ii="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",ai="(([a-zA-Z]{2,3}(-".concat(ii,")?)|([a-zA-Z]{5,8}))"),li="([A-Za-z]{4})",ci="([A-Za-z]{2}|\\d{3})",ui="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",di="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",hi="(".concat(di,"(-[A-Za-z0-9]{2,8})+)"),pi="(x(-[A-Za-z0-9]{1,8})+)",ha="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",ga="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",va="(".concat(ha,"|").concat(ga,")"),ba="(-|_)",wa="".concat(ai,"(").concat(ba).concat(li,")?(").concat(ba).concat(ci,")?(").concat(ba).concat(ui,")*(").concat(ba).concat(hi,")*(").concat(ba).concat(pi,")?"),xa=new RegExp("(^".concat(pi,"$)|(^").concat(va,"$)|(^").concat(wa,"$)"));function Ca(el){return(0,oi.default)(el),xa.test(el)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLocale,isLocale.exports)),isLocale.exports}var isAbaRouting={exports:{}},hasRequiredIsAbaRouting;function requireIsAbaRouting(){return hasRequiredIsAbaRouting||(hasRequiredIsAbaRouting=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function ai(li){if((0,oi.default)(li),!ii.test(li))return!1;for(var ci=0,ui=0;ui<li.length;ui++)ui%3===0?ci+=li[ui]*3:ui%3===1?ci+=li[ui]*7:ci+=li[ui]*1;return ci%10===0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isAbaRouting,isAbaRouting.exports)),isAbaRouting.exports}var isAlpha={},hasRequiredIsAlpha;function requireIsAlpha(){if(hasRequiredIsAlpha)return isAlpha;hasRequiredIsAlpha=1,Object.defineProperty(isAlpha,"__esModule",{value:!0}),isAlpha.default=si,isAlpha.locales=void 0;var Ws=oi(requireAssertString()),ws=requireAlpha();function oi(ii){return ii&&ii.__esModule?ii:{default:ii}}function si(ii){var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",li=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,Ws.default)(ii);var ci=ii,ui=li.ignore;if(ui)if(ui instanceof RegExp)ci=ci.replace(ui,"");else if(typeof ui=="string")ci=ci.replace(new RegExp("[".concat(ui.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(ai in ws.alpha)return ws.alpha[ai].test(ci);throw new Error("Invalid locale '".concat(ai,"'"))}return isAlpha.locales=Object.keys(ws.alpha),isAlpha}var isAlphanumeric={},hasRequiredIsAlphanumeric;function requireIsAlphanumeric(){if(hasRequiredIsAlphanumeric)return isAlphanumeric;hasRequiredIsAlphanumeric=1,Object.defineProperty(isAlphanumeric,"__esModule",{value:!0}),isAlphanumeric.default=si,isAlphanumeric.locales=void 0;var Ws=oi(requireAssertString()),ws=requireAlpha();function oi(ii){return ii&&ii.__esModule?ii:{default:ii}}function si(ii){var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",li=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,Ws.default)(ii);var ci=ii,ui=li.ignore;if(ui)if(ui instanceof RegExp)ci=ci.replace(ui,"");else if(typeof ui=="string")ci=ci.replace(new RegExp("[".concat(ui.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(ai in ws.alphanumeric)return ws.alphanumeric[ai].test(ci);throw new Error("Invalid locale '".concat(ai,"'"))}return isAlphanumeric.locales=Object.keys(ws.alphanumeric),isAlphanumeric}var isNumeric={exports:{}},hasRequiredIsNumeric;function requireIsNumeric(){return hasRequiredIsNumeric||(hasRequiredIsNumeric=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=requireAlpha();function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai=/^[0-9]+$/;function li(ci,ui){return(0,oi.default)(ci),ui&&ui.no_symbols?ai.test(ci):new RegExp("^[+-]?([0-9]*[".concat((ui||{}).locale?si.decimal[ui.locale]:".","])?[0-9]+$")).test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isNumeric,isNumeric.exports)),isNumeric.exports}var isPassportNumber={exports:{}},hasRequiredIsPassportNumber;function requireIsPassportNumber(){return hasRequiredIsPassportNumber||(hasRequiredIsPassportNumber=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};function ai(li,ci){(0,oi.default)(li);var ui=li.replace(/\s/g,"").toUpperCase();return ci.toUpperCase()in ii&&ii[ci].test(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isPassportNumber,isPassportNumber.exports)),isPassportNumber.exports}var isPort={exports:{}},isInt={exports:{}},hasRequiredIsInt;function requireIsInt(){return hasRequiredIsInt||(hasRequiredIsInt=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=si(requireAssertString());function si(ci){return ci&&ci.__esModule?ci:{default:ci}}var ii=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,ai=/^[-+]?[0-9]+$/;function li(ci,ui){(0,oi.default)(ci),ui=ui||{};var di=ui.allow_leading_zeroes===!1?ii:ai,hi=!ui.hasOwnProperty("min")||ci>=ui.min,pi=!ui.hasOwnProperty("max")||ci<=ui.max,ha=!ui.hasOwnProperty("lt")||ci<ui.lt,ga=!ui.hasOwnProperty("gt")||ci>ui.gt;return di.test(ci)&&hi&&pi&&ha&&ga}Ws.exports=ws.default,Ws.exports.default=ws.default}(isInt,isInt.exports)),isInt.exports}var hasRequiredIsPort;function requireIsPort(){return hasRequiredIsPort||(hasRequiredIsPort=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireIsInt());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai,{allow_leading_zeroes:!1,min:0,max:65535})}Ws.exports=ws.default,Ws.exports.default=ws.default}(isPort,isPort.exports)),isPort.exports}var isLowercase={exports:{}},hasRequiredIsLowercase;function requireIsLowercase(){return hasRequiredIsLowercase||(hasRequiredIsLowercase=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai),ai===ai.toLowerCase()}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLowercase,isLowercase.exports)),isLowercase.exports}var isUppercase={exports:{}},hasRequiredIsUppercase;function requireIsUppercase(){return hasRequiredIsUppercase||(hasRequiredIsUppercase=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai),ai===ai.toUpperCase()}Ws.exports=ws.default,Ws.exports.default=ws.default}(isUppercase,isUppercase.exports)),isUppercase.exports}var isIMEI={exports:{}},hasRequiredIsIMEI;function requireIsIMEI(){return hasRequiredIsIMEI||(hasRequiredIsIMEI=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=si(requireAssertString());function si(ci){return ci&&ci.__esModule?ci:{default:ci}}var ii=/^[0-9]{15}$/,ai=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function li(ci,ui){(0,oi.default)(ci),ui=ui||{};var di=ii;if(ui.allow_hyphens&&(di=ai),!di.test(ci))return!1;ci=ci.replace(/-/g,"");for(var hi=0,pi=2,ha=14,ga=0;ga<ha;ga++){var va=ci.substring(ha-ga-1,ha-ga),ba=parseInt(va,10)*pi;ba>=10?hi+=ba%10+1:hi+=ba,pi===1?pi+=1:pi-=1}var wa=(10-hi%10)%10;return wa===parseInt(ci.substring(14,15),10)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isIMEI,isIMEI.exports)),isIMEI.exports}var isAscii={exports:{}},hasRequiredIsAscii;function requireIsAscii(){return hasRequiredIsAscii||(hasRequiredIsAscii=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[\x00-\x7F]+$/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isAscii,isAscii.exports)),isAscii.exports}var isFullWidth={},hasRequiredIsFullWidth;function requireIsFullWidth(){if(hasRequiredIsFullWidth)return isFullWidth;hasRequiredIsFullWidth=1,Object.defineProperty(isFullWidth,"__esModule",{value:!0}),isFullWidth.default=si,isFullWidth.fullWidth=void 0;var Ws=ws(requireAssertString());function ws(ii){return ii&&ii.__esModule?ii:{default:ii}}var oi=isFullWidth.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function si(ii){return(0,Ws.default)(ii),oi.test(ii)}return isFullWidth}var isHalfWidth={},hasRequiredIsHalfWidth;function requireIsHalfWidth(){if(hasRequiredIsHalfWidth)return isHalfWidth;hasRequiredIsHalfWidth=1,Object.defineProperty(isHalfWidth,"__esModule",{value:!0}),isHalfWidth.default=si,isHalfWidth.halfWidth=void 0;var Ws=ws(requireAssertString());function ws(ii){return ii&&ii.__esModule?ii:{default:ii}}var oi=isHalfWidth.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function si(ii){return(0,Ws.default)(ii),oi.test(ii)}return isHalfWidth}var isVariableWidth={exports:{}},hasRequiredIsVariableWidth;function requireIsVariableWidth(){return hasRequiredIsVariableWidth||(hasRequiredIsVariableWidth=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ai(requireAssertString()),si=requireIsFullWidth(),ii=requireIsHalfWidth();function ai(ci){return ci&&ci.__esModule?ci:{default:ci}}function li(ci){return(0,oi.default)(ci),si.fullWidth.test(ci)&&ii.halfWidth.test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isVariableWidth,isVariableWidth.exports)),isVariableWidth.exports}var isMultibyte={exports:{}},hasRequiredIsMultibyte;function requireIsMultibyte(){return hasRequiredIsMultibyte||(hasRequiredIsMultibyte=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/[^\x00-\x7F]/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMultibyte,isMultibyte.exports)),isMultibyte.exports}var isSemVer={exports:{}},multilineRegex={exports:{}},hasRequiredMultilineRegex;function requireMultilineRegex(){return hasRequiredMultilineRegex||(hasRequiredMultilineRegex=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=oi;function oi(si,ii){var ai=si.join("");return new RegExp(ai,ii)}Ws.exports=ws.default,Ws.exports.default=ws.default}(multilineRegex,multilineRegex.exports)),multilineRegex.exports}var hasRequiredIsSemVer;function requireIsSemVer(){return hasRequiredIsSemVer||(hasRequiredIsSemVer=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=ii(requireMultilineRegex());function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai=(0,si.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function li(ci){return(0,oi.default)(ci),ai.test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isSemVer,isSemVer.exports)),isSemVer.exports}var isSurrogatePair={exports:{}},hasRequiredIsSurrogatePair;function requireIsSurrogatePair(){return hasRequiredIsSurrogatePair||(hasRequiredIsSurrogatePair=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isSurrogatePair,isSurrogatePair.exports)),isSurrogatePair.exports}var isDecimal={exports:{}},includes={exports:{}},hasRequiredIncludes;function requireIncludes(){return hasRequiredIncludes||(hasRequiredIncludes=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=void 0;var oi=function(si,ii){return si.some(function(ai){return ii===ai})};ws.default=oi,Ws.exports=ws.default,Ws.exports.default=ws.default}(includes,includes.exports)),includes.exports}var hasRequiredIsDecimal;function requireIsDecimal(){return hasRequiredIsDecimal||(hasRequiredIsDecimal=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=hi;var oi=li(requireMerge()),si=li(requireAssertString()),ii=li(requireIncludes()),ai=requireAlpha();function li(pi){return pi&&pi.__esModule?pi:{default:pi}}function ci(pi){var ha=new RegExp("^[-+]?([0-9]+)?(\\".concat(ai.decimal[pi.locale],"[0-9]{").concat(pi.decimal_digits,"})").concat(pi.force_decimal?"":"?","$"));return ha}var ui={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},di=["","-","+"];function hi(pi,ha){if((0,si.default)(pi),ha=(0,oi.default)(ha,ui),ha.locale in ai.decimal)return!(0,ii.default)(di,pi.replace(/ /g,""))&&ci(ha).test(pi);throw new Error("Invalid locale '".concat(ha.locale,"'"))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isDecimal,isDecimal.exports)),isDecimal.exports}var isHexadecimal={exports:{}},hasRequiredIsHexadecimal;function requireIsHexadecimal(){return hasRequiredIsHexadecimal||(hasRequiredIsHexadecimal=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^(0x|0h)?[0-9A-F]+$/i;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isHexadecimal,isHexadecimal.exports)),isHexadecimal.exports}var isOctal={exports:{}},hasRequiredIsOctal;function requireIsOctal(){return hasRequiredIsOctal||(hasRequiredIsOctal=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^(0o)?[0-7]+$/i;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isOctal,isOctal.exports)),isOctal.exports}var isDivisibleBy={exports:{}},hasRequiredIsDivisibleBy;function requireIsDivisibleBy(){return hasRequiredIsDivisibleBy||(hasRequiredIsDivisibleBy=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireAssertString()),si=ii(requireToFloat());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li,ci){return(0,oi.default)(li),(0,si.default)(li)%parseInt(ci,10)===0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isDivisibleBy,isDivisibleBy.exports)),isDivisibleBy.exports}var isHexColor={exports:{}},hasRequiredIsHexColor;function requireIsHexColor(){return hasRequiredIsHexColor||(hasRequiredIsHexColor=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isHexColor,isHexColor.exports)),isHexColor.exports}var isRgbColor={exports:{}},hasRequiredIsRgbColor;function requireIsRgbColor(){return hasRequiredIsRgbColor||(hasRequiredIsRgbColor=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ui;var oi=si(requireAssertString());function si(di){return di&&di.__esModule?di:{default:di}}var ii=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,ai=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,li=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,ci=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;function ui(di){var hi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return(0,oi.default)(di),hi?ii.test(di)||ai.test(di)||li.test(di)||ci.test(di):ii.test(di)||ai.test(di)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isRgbColor,isRgbColor.exports)),isRgbColor.exports}var isHSL={exports:{}},hasRequiredIsHSL;function requireIsHSL(){return hasRequiredIsHSL||(hasRequiredIsHSL=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=si(requireAssertString());function si(ci){return ci&&ci.__esModule?ci:{default:ci}}var ii=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,ai=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function li(ci){(0,oi.default)(ci);var ui=ci.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return ui.indexOf(",")!==-1?ii.test(ui):ai.test(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isHSL,isHSL.exports)),isHSL.exports}var isISRC={exports:{}},hasRequiredIsISRC;function requireIsISRC(){return hasRequiredIsISRC||(hasRequiredIsISRC=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISRC,isISRC.exports)),isISRC.exports}var isIBAN={},hasRequiredIsIBAN;function requireIsIBAN(){if(hasRequiredIsIBAN)return isIBAN;hasRequiredIsIBAN=1,Object.defineProperty(isIBAN,"__esModule",{value:!0}),isIBAN.default=li,isIBAN.locales=void 0;var Ws=ws(requireAssertString());function ws(ci){return ci&&ci.__esModule?ci:{default:ci}}var oi={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function si(ci){var ui=ci.filter(function(di){return!(di in oi)});return!(ui.length>0)}function ii(ci,ui){var di=ci.replace(/[\s\-]+/gi,"").toUpperCase(),hi=di.slice(0,2).toUpperCase(),pi=hi in oi;if(ui.whitelist){if(!si(ui.whitelist))return!1;var ha=ui.whitelist.includes(hi);if(!ha)return!1}if(ui.blacklist){var ga=ui.blacklist.includes(hi);if(ga)return!1}return pi&&oi[hi].test(di)}function ai(ci){var ui=ci.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),di=ui.slice(4)+ui.slice(0,4),hi=di.replace(/[A-Z]/g,function(ha){return ha.charCodeAt(0)-55}),pi=hi.match(/\d{1,7}/g).reduce(function(ha,ga){return Number(ha+ga)%97},"");return pi===1}function li(ci){var ui=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,Ws.default)(ci),ii(ci,ui)&&ai(ci)}return isIBAN.locales=Object.keys(oi),isIBAN}var isBIC={exports:{}},isISO31661Alpha2={},hasRequiredIsISO31661Alpha2;function requireIsISO31661Alpha2(){if(hasRequiredIsISO31661Alpha2)return isISO31661Alpha2;hasRequiredIsISO31661Alpha2=1,Object.defineProperty(isISO31661Alpha2,"__esModule",{value:!0}),isISO31661Alpha2.CountryCodes=void 0,isISO31661Alpha2.default=si;var Ws=ws(requireAssertString());function ws(ii){return ii&&ii.__esModule?ii:{default:ii}}var oi=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function si(ii){return(0,Ws.default)(ii),oi.has(ii.toUpperCase())}return isISO31661Alpha2.CountryCodes=oi,isISO31661Alpha2}var hasRequiredIsBIC;function requireIsBIC(){return hasRequiredIsBIC||(hasRequiredIsBIC=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=requireIsISO31661Alpha2();function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function li(ci){(0,oi.default)(ci);var ui=ci.slice(4,6).toUpperCase();return!si.CountryCodes.has(ui)&&ui!=="XK"?!1:ai.test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBIC,isBIC.exports)),isBIC.exports}var isMD5={exports:{}},hasRequiredIsMD5;function requireIsMD5(){return hasRequiredIsMD5||(hasRequiredIsMD5=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[a-f0-9]{32}$/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMD5,isMD5.exports)),isMD5.exports}var isHash={exports:{}},hasRequiredIsHash;function requireIsHash(){return hasRequiredIsHash||(hasRequiredIsHash=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function ai(li,ci){(0,oi.default)(li);var ui=new RegExp("^[a-fA-F0-9]{".concat(ii[ci],"}$"));return ui.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isHash,isHash.exports)),isHash.exports}var isJWT={exports:{}},isBase64={exports:{}},hasRequiredIsBase64;function requireIsBase64(){return hasRequiredIsBase64||(hasRequiredIsBase64=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ui;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(di){return di&&di.__esModule?di:{default:di}}var ai=/[^A-Z0-9+\/=]/i,li=/^[A-Z0-9_\-]*$/i,ci={urlSafe:!1};function ui(di,hi){(0,oi.default)(di),hi=(0,si.default)(hi,ci);var pi=di.length;if(hi.urlSafe)return li.test(di);if(pi%4!==0||ai.test(di))return!1;var ha=di.indexOf("=");return ha===-1||ha===pi-1||ha===pi-2&&di[pi-1]==="="}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBase64,isBase64.exports)),isBase64.exports}var hasRequiredIsJWT;function requireIsJWT(){return hasRequiredIsJWT||(hasRequiredIsJWT=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireAssertString()),si=ii(requireIsBase64());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li){(0,oi.default)(li);var ci=li.split("."),ui=ci.length;return ui!==3?!1:ci.reduce(function(di,hi){return di&&(0,si.default)(hi,{urlSafe:!0})},!0)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isJWT,isJWT.exports)),isJWT.exports}var isJSON={exports:{}},hasRequiredIsJSON;function requireIsJSON(){return hasRequiredIsJSON||(hasRequiredIsJSON=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(ui){return ui&&ui.__esModule?ui:{default:ui}}function ai(ui){"@babel/helpers - typeof";return ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(di){return typeof di}:function(di){return di&&typeof Symbol=="function"&&di.constructor===Symbol&&di!==Symbol.prototype?"symbol":typeof di},ai(ui)}var li={allow_primitives:!1};function ci(ui,di){(0,oi.default)(ui);try{di=(0,si.default)(di,li);var hi=[];di.allow_primitives&&(hi=[null,!1,!0]);var pi=JSON.parse(ui);return hi.includes(pi)||!!pi&&ai(pi)==="object"}catch{}return!1}Ws.exports=ws.default,Ws.exports.default=ws.default}(isJSON,isJSON.exports)),isJSON.exports}var isEmpty={exports:{}},hasRequiredIsEmpty;function requireIsEmpty(){return hasRequiredIsEmpty||(hasRequiredIsEmpty=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai={ignore_whitespace:!1};function li(ci,ui){return(0,oi.default)(ci),ui=(0,si.default)(ui,ai),(ui.ignore_whitespace?ci.trim().length:ci.length)===0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isEmpty,isEmpty.exports)),isEmpty.exports}var isLength={exports:{}},hasRequiredIsLength;function requireIsLength(){return hasRequiredIsLength||(hasRequiredIsLength=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}function ii(li){"@babel/helpers - typeof";return ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ci){return typeof ci}:function(ci){return ci&&typeof Symbol=="function"&&ci.constructor===Symbol&&ci!==Symbol.prototype?"symbol":typeof ci},ii(li)}function ai(li,ci){(0,oi.default)(li);var ui,di;ii(ci)==="object"?(ui=ci.min||0,di=ci.max):(ui=arguments[1]||0,di=arguments[2]);var hi=li.match(/(\uFE0F|\uFE0E)/g)||[],pi=li.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],ha=li.length-hi.length-pi.length;return ha>=ui&&(typeof di>"u"||ha<=di)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLength,isLength.exports)),isLength.exports}var isUUID={exports:{}},hasRequiredIsUUID;function requireIsUUID(){return hasRequiredIsUUID||(hasRequiredIsUUID=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function ai(li,ci){(0,oi.default)(li);var ui=ii[[void 0,null].includes(ci)?"all":ci];return!!ui&&ui.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isUUID,isUUID.exports)),isUUID.exports}var isMongoId={exports:{}},hasRequiredIsMongoId;function requireIsMongoId(){return hasRequiredIsMongoId||(hasRequiredIsMongoId=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireAssertString()),si=ii(requireIsHexadecimal());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li){return(0,oi.default)(li),(0,si.default)(li)&&li.length===24}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMongoId,isMongoId.exports)),isMongoId.exports}var isAfter={exports:{}},hasRequiredIsAfter;function requireIsAfter(){return hasRequiredIsAfter||(hasRequiredIsAfter=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireToDate());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){var ci=(li==null?void 0:li.comparisonDate)||li||Date().toString(),ui=(0,oi.default)(ci),di=(0,oi.default)(ai);return!!(di&&ui&&di>ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isAfter,isAfter.exports)),isAfter.exports}var isBefore={exports:{}},hasRequiredIsBefore;function requireIsBefore(){return hasRequiredIsBefore||(hasRequiredIsBefore=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireAssertString()),si=ii(requireToDate());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li){var ci=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,oi.default)(li);var ui=(0,si.default)(ci),di=(0,si.default)(li);return!!(di&&ui&&di<ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBefore,isBefore.exports)),isBefore.exports}var isIn={exports:{}},hasRequiredIsIn;function requireIsIn(){return hasRequiredIsIn||(hasRequiredIsIn=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=ii(requireToString());function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}function ai(ci){"@babel/helpers - typeof";return ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ui){return typeof ui}:function(ui){return ui&&typeof Symbol=="function"&&ui.constructor===Symbol&&ui!==Symbol.prototype?"symbol":typeof ui},ai(ci)}function li(ci,ui){(0,oi.default)(ci);var di;if(Object.prototype.toString.call(ui)==="[object Array]"){var hi=[];for(di in ui)({}).hasOwnProperty.call(ui,di)&&(hi[di]=(0,si.default)(ui[di]));return hi.indexOf(ci)>=0}else{if(ai(ui)==="object")return ui.hasOwnProperty(ci);if(ui&&typeof ui.indexOf=="function")return ui.indexOf(ci)>=0}return!1}Ws.exports=ws.default,Ws.exports.default=ws.default}(isIn,isIn.exports)),isIn.exports}var isLuhnNumber={exports:{}},hasRequiredIsLuhnNumber;function requireIsLuhnNumber(){return hasRequiredIsLuhnNumber||(hasRequiredIsLuhnNumber=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){(0,oi.default)(ai);for(var li=ai.replace(/[- ]+/g,""),ci=0,ui,di,hi,pi=li.length-1;pi>=0;pi--)ui=li.substring(pi,pi+1),di=parseInt(ui,10),hi?(di*=2,di>=10?ci+=di%10+1:ci+=di):ci+=di,hi=!hi;return!!(ci%10===0&&li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLuhnNumber,isLuhnNumber.exports)),isLuhnNumber.exports}var isCreditCard={exports:{}},hasRequiredIsCreditCard;function requireIsCreditCard(){return hasRequiredIsCreditCard||(hasRequiredIsCreditCard=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=ii(requireAssertString()),si=ii(requireIsLuhnNumber());function ii(ui){return ui&&ui.__esModule?ui:{default:ui}}var ai={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},li=function(){var ui=[];for(var di in ai)ai.hasOwnProperty(di)&&ui.push(ai[di]);return ui}();function ci(ui){var di=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,oi.default)(ui);var hi=di.provider,pi=ui.replace(/[- ]+/g,"");if(hi&&hi.toLowerCase()in ai){if(!ai[hi.toLowerCase()].test(pi))return!1}else{if(hi&&!(hi.toLowerCase()in ai))throw new Error("".concat(hi," is not a valid credit card provider."));if(!li.some(function(ha){return ha.test(pi)}))return!1}return(0,si.default)(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isCreditCard,isCreditCard.exports)),isCreditCard.exports}var isIdentityCard={exports:{}},hasRequiredIsIdentityCard;function requireIsIdentityCard(){return hasRequiredIsIdentityCard||(hasRequiredIsIdentityCard=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=ii(requireAssertString()),si=ii(requireIsInt());function ii(ci){return ci&&ci.__esModule?ci:{default:ci}}var ai={PL:function(ci){(0,oi.default)(ci);var ui={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(ci!=null&&ci.length===11&&(0,si.default)(ci,{allow_leading_zeroes:!0})){var di=ci.split("").slice(0,-1),hi=di.reduce(function(ga,va,ba){return ga+Number(va)*ui[ba+1]},0),pi=hi%10,ha=Number(ci.charAt(ci.length-1));if(pi===0&&ha===0||ha===10-pi)return!0}return!1},ES:function(ci){(0,oi.default)(ci);var ui=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,di={X:0,Y:1,Z:2},hi=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],pi=ci.trim().toUpperCase();if(!ui.test(pi))return!1;var ha=pi.slice(0,-1).replace(/[X,Y,Z]/g,function(ga){return di[ga]});return pi.endsWith(hi[ha%23])},FI:function(ci){if((0,oi.default)(ci),ci.length!==11||!ci.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var ui="0123456789ABCDEFHJKLMNPRSTUVWXY",di=parseInt(ci.slice(0,6),10)*1e3+parseInt(ci.slice(7,10),10),hi=di%31,pi=ui[hi];return pi===ci.slice(10,11)},IN:function(ci){var ui=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,di=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],hi=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],pi=ci.trim();if(!ui.test(pi))return!1;var ha=0,ga=pi.replace(/\s/g,"").split("").map(Number).reverse();return ga.forEach(function(va,ba){ha=di[ha][hi[ba%8][va]]}),ha===0},IR:function(ci){if(!ci.match(/^\d{10}$/)||(ci="0000".concat(ci).slice(ci.length-6),parseInt(ci.slice(3,9),10)===0))return!1;for(var ui=parseInt(ci.slice(9,10),10),di=0,hi=0;hi<9;hi++)di+=parseInt(ci.slice(hi,hi+1),10)*(10-hi);return di%=11,di<2&&ui===di||di>=2&&ui===11-di},IT:function(ci){return ci.length!==9||ci==="CA00000AA"?!1:ci.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(ci){var ui=ci.trim();if(isNaN(Number(ui))||ui.length!==11||ui==="00000000000")return!1;var di=ui.split("").map(Number),hi=(11-(3*di[0]+7*di[1]+6*di[2]+1*di[3]+8*di[4]+9*di[5]+4*di[6]+5*di[7]+2*di[8])%11)%11,pi=(11-(5*di[0]+4*di[1]+3*di[2]+2*di[3]+7*di[4]+6*di[5]+5*di[6]+4*di[7]+3*di[8]+2*hi)%11)%11;return!(hi!==di[9]||pi!==di[10])},TH:function(ci){if(!ci.match(/^[1-8]\d{12}$/))return!1;for(var ui=0,di=0;di<12;di++)ui+=parseInt(ci[di],10)*(13-di);return ci[12]===((11-ui%11)%10).toString()},LK:function(ci){var ui=/^[1-9]\d{8}[vx]$/i,di=/^[1-9]\d{11}$/i;return ci.length===10&&ui.test(ci)?!0:!!(ci.length===12&&di.test(ci))},"he-IL":function(ci){var ui=/^\d{9}$/,di=ci.trim();if(!ui.test(di))return!1;for(var hi=di,pi=0,ha,ga=0;ga<hi.length;ga++)ha=Number(hi[ga])*(ga%2+1),pi+=ha>9?ha-9:ha;return pi%10===0},"ar-LY":function(ci){var ui=/^(1|2)\d{11}$/,di=ci.trim();return!!ui.test(di)},"ar-TN":function(ci){var ui=/^\d{8}$/,di=ci.trim();return!!ui.test(di)},"zh-CN":function(ci){var ui=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],di=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],hi=["1","0","X","9","8","7","6","5","4","3","2"],pi=function(Ca){return ui.includes(Ca)},ha=function(Ca){var el=parseInt(Ca.substring(0,4),10),ku=parseInt(Ca.substring(4,6),10),gd=parseInt(Ca.substring(6),10),Ed=new Date(el,ku-1,gd);return Ed>new Date?!1:Ed.getFullYear()===el&&Ed.getMonth()===ku-1&&Ed.getDate()===gd},ga=function(Ca){for(var el=Ca.substring(0,17),ku=0,gd=0;gd<17;gd++)ku+=parseInt(el.charAt(gd),10)*parseInt(di[gd],10);var Ed=ku%11;return hi[Ed]},va=function(Ca){return ga(Ca)===Ca.charAt(17).toUpperCase()},ba=function(Ca){var el=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(Ca);if(!el)return!1;var ku=Ca.substring(0,2);if(el=pi(ku),!el)return!1;var gd="19".concat(Ca.substring(6,12));return el=ha(gd),!!el},wa=function(Ca){var el=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(Ca);if(!el)return!1;var ku=Ca.substring(0,2);if(el=pi(ku),!el)return!1;var gd=Ca.substring(6,14);return el=ha(gd),el?va(Ca):!1},xa=function(Ca){var el=/^\d{15}|(\d{17}(\d|x|X))$/.test(Ca);return el?Ca.length===15?ba(Ca):wa(Ca):!1};return xa(ci)},"zh-HK":function(ci){ci=ci.trim();var ui=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,di=/^[0-9]$/;if(ci=ci.toUpperCase(),!ui.test(ci))return!1;ci=ci.replace(/\[|\]|\(|\)/g,""),ci.length===8&&(ci="3".concat(ci));for(var hi=0,pi=0;pi<=7;pi++){var ha=void 0;di.test(ci[pi])?ha=ci[pi]:ha=(ci[pi].charCodeAt(0)-55)%11,hi+=ha*(9-pi)}hi%=11;var ga;return hi===0?ga="0":hi===1?ga="A":ga=String(11-hi),ga===ci[ci.length-1]},"zh-TW":function(ci){var ui={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},di=ci.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(di)?Array.from(di).reduce(function(hi,pi,ha){if(ha===0){var ga=ui[pi];return ga%10*9+Math.floor(ga/10)}return ha===9?(10-hi%10-Number(pi))%10===0:hi+Number(pi)*(9-ha)},0):!1}};function li(ci,ui){if((0,oi.default)(ci),ui in ai)return ai[ui](ci);if(ui==="any"){for(var di in ai)if(ai.hasOwnProperty(di)){var hi=ai[di];if(hi(ci))return!0}return!1}throw new Error("Invalid locale '".concat(ui,"'"))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isIdentityCard,isIdentityCard.exports)),isIdentityCard.exports}var isEAN={exports:{}},hasRequiredIsEAN;function requireIsEAN(){return hasRequiredIsEAN||(hasRequiredIsEAN=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=di;var oi=si(requireAssertString());function si(hi){return hi&&hi.__esModule?hi:{default:hi}}var ii=8,ai=14,li=/^(\d{8}|\d{13}|\d{14})$/;function ci(hi,pi){return hi===ii||hi===ai?pi%2===0?3:1:pi%2===0?1:3}function ui(hi){var pi=hi.slice(0,-1).split("").map(function(ga,va){return Number(ga)*ci(hi.length,va)}).reduce(function(ga,va){return ga+va},0),ha=10-pi%10;return ha<10?ha:0}function di(hi){(0,oi.default)(hi);var pi=Number(hi.slice(-1));return li.test(hi)&&pi===ui(hi)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isEAN,isEAN.exports)),isEAN.exports}var isISIN={exports:{}},hasRequiredIsISIN;function requireIsISIN(){return hasRequiredIsISIN||(hasRequiredIsISIN=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function ai(li){if((0,oi.default)(li),!ii.test(li))return!1;for(var ci=!0,ui=0,di=li.length-2;di>=0;di--)if(li[di]>="A"&&li[di]<="Z")for(var hi=li[di].charCodeAt(0)-55,pi=hi%10,ha=Math.trunc(hi/10),ga=0,va=[pi,ha];ga<va.length;ga++){var ba=va[ga];ci?ba>=5?ui+=1+(ba-5)*2:ui+=ba*2:ui+=ba,ci=!ci}else{var wa=li[di].charCodeAt(0)-48;ci?wa>=5?ui+=1+(wa-5)*2:ui+=wa*2:ui+=wa,ci=!ci}var xa=Math.trunc((ui+9)/10)*10-ui;return+li[li.length-1]===xa}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISIN,isISIN.exports)),isISIN.exports}var isISBN={exports:{}},hasRequiredIsISBN;function requireIsISBN(){return hasRequiredIsISBN||(hasRequiredIsISBN=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=si(requireAssertString());function si(ui){return ui&&ui.__esModule?ui:{default:ui}}var ii=/^(?:[0-9]{9}X|[0-9]{10})$/,ai=/^(?:[0-9]{13})$/,li=[1,3];function ci(ui,di){(0,oi.default)(ui);var hi=String((di==null?void 0:di.version)||di);if(!(di!=null&&di.version||di))return ci(ui,{version:10})||ci(ui,{version:13});var pi=ui.replace(/[\s-]+/g,""),ha=0;if(hi==="10"){if(!ii.test(pi))return!1;for(var ga=0;ga<hi-1;ga++)ha+=(ga+1)*pi.charAt(ga);if(pi.charAt(9)==="X"?ha+=10*10:ha+=10*pi.charAt(9),ha%11===0)return!0}else if(hi==="13"){if(!ai.test(pi))return!1;for(var va=0;va<12;va++)ha+=li[va%2]*pi.charAt(va);if(pi.charAt(12)-(10-ha%10)%10===0)return!0}return!1}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISBN,isISBN.exports)),isISBN.exports}var isISSN={exports:{}},hasRequiredIsISSN;function requireIsISSN(){return hasRequiredIsISSN||(hasRequiredIsISSN=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii="^\\d{4}-?\\d{3}[\\dX]$";function ai(li){var ci=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,oi.default)(li);var ui=ii;if(ui=ci.require_hyphen?ui.replace("?",""):ui,ui=ci.case_sensitive?new RegExp(ui):new RegExp(ui,"i"),!ui.test(li))return!1;for(var di=li.replace("-","").toUpperCase(),hi=0,pi=0;pi<di.length;pi++){var ha=di[pi];hi+=(ha==="X"?10:+ha)*(8-pi)}return hi%11===0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISSN,isISSN.exports)),isISSN.exports}var isTaxID={exports:{}},algorithms={},hasRequiredAlgorithms;function requireAlgorithms(){if(hasRequiredAlgorithms)return algorithms;hasRequiredAlgorithms=1,Object.defineProperty(algorithms,"__esModule",{value:!0}),algorithms.iso7064Check=Ws,algorithms.luhnCheck=ws,algorithms.reverseMultiplyAndSum=oi,algorithms.verhoeffCheck=si;function Ws(ii){for(var ai=10,li=0;li<ii.length-1;li++)ai=(parseInt(ii[li],10)+ai)%10===0?10*2%11:(parseInt(ii[li],10)+ai)%10*2%11;return ai=ai===1?0:11-ai,ai===parseInt(ii[10],10)}function ws(ii){for(var ai=0,li=!1,ci=ii.length-1;ci>=0;ci--){if(li){var ui=parseInt(ii[ci],10)*2;ui>9?ai+=ui.toString().split("").map(function(di){return parseInt(di,10)}).reduce(function(di,hi){return di+hi},0):ai+=ui}else ai+=parseInt(ii[ci],10);li=!li}return ai%10===0}function oi(ii,ai){for(var li=0,ci=0;ci<ii.length;ci++)li+=ii[ci]*(ai-ci);return li}function si(ii){for(var ai=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],li=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],ci=ii.split("").reverse().join(""),ui=0,di=0;di<ci.length;di++)ui=ai[ui][li[di%8][parseInt(ci[di],10)]];return ui===0}return algorithms}var hasRequiredIsTaxID;function requireIsTaxID(){return hasRequiredIsTaxID||(hasRequiredIsTaxID=1,function(Ws,ws){function oi(vd){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Sd){return typeof Sd}:function(Sd){return Sd&&typeof Symbol=="function"&&Sd.constructor===Symbol&&Sd!==Symbol.prototype?"symbol":typeof Sd},oi(vd)}Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=tf;var si=ui(requireAssertString()),ii=ci(requireAlgorithms()),ai=ui(requireIsDate());function li(vd){if(typeof WeakMap!="function")return null;var Sd=new WeakMap,Id=new WeakMap;return(li=function(Bd){return Bd?Id:Sd})(vd)}function ci(vd,Sd){if(vd&&vd.__esModule)return vd;if(vd===null||oi(vd)!="object"&&typeof vd!="function")return{default:vd};var Id=li(Sd);if(Id&&Id.has(vd))return Id.get(vd);var Bd={__proto__:null},nf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var lf in vd)if(lf!=="default"&&{}.hasOwnProperty.call(vd,lf)){var pf=nf?Object.getOwnPropertyDescriptor(vd,lf):null;pf&&(pf.get||pf.set)?Object.defineProperty(Bd,lf,pf):Bd[lf]=vd[lf]}return Bd.default=vd,Id&&Id.set(vd,Bd),Bd}function ui(vd){return vd&&vd.__esModule?vd:{default:vd}}function di(vd){return ga(vd)||ha(vd)||pi(vd)||hi()}function hi(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
310
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pi(vd,Sd){if(vd){if(typeof vd=="string")return va(vd,Sd);var Id=Object.prototype.toString.call(vd).slice(8,-1);if(Id==="Object"&&vd.constructor&&(Id=vd.constructor.name),Id==="Map"||Id==="Set")return Array.from(vd);if(Id==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Id))return va(vd,Sd)}}function ha(vd){if(typeof Symbol<"u"&&vd[Symbol.iterator]!=null||vd["@@iterator"]!=null)return Array.from(vd)}function ga(vd){if(Array.isArray(vd))return va(vd)}function va(vd,Sd){(Sd==null||Sd>vd.length)&&(Sd=vd.length);for(var Id=0,Bd=new Array(Sd);Id<Sd;Id++)Bd[Id]=vd[Id];return Bd}function ba(vd){var Sd=vd.slice(0,2),Id=parseInt(vd.slice(2,4),10);Id>40?(Id-=40,Sd="20".concat(Sd)):Id>20?(Id-=20,Sd="18".concat(Sd)):Sd="19".concat(Sd),Id<10&&(Id="0".concat(Id));var Bd="".concat(Sd,"/").concat(Id,"/").concat(vd.slice(4,6));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1;for(var nf=vd.split("").map(function(vf){return parseInt(vf,10)}),lf=[2,4,8,5,10,9,7,3,6],pf=0,gf=0;gf<lf.length;gf++)pf+=nf[gf]*lf[gf];return pf=pf%11===10?0:pf%11,pf===nf[9]}function wa(vd){var Sd=vd.split(""),Id=Sd.filter(function(nf,lf){return lf%2}).map(function(nf){return Number(nf)*2}).join("").split(""),Bd=Sd.filter(function(nf,lf){return!(lf%2)}).concat(Id).map(function(nf){return Number(nf)}).reduce(function(nf,lf){return nf+lf});return Bd%10===0}function xa(vd){vd=vd.replace(/\W/,"");var Sd=parseInt(vd.slice(0,2),10);if(vd.length===10)Sd<54?Sd="20".concat(Sd):Sd="19".concat(Sd);else{if(vd.slice(6)==="000")return!1;if(Sd<54)Sd="19".concat(Sd);else return!1}Sd.length===3&&(Sd=[Sd.slice(0,2),"0",Sd.slice(2)].join(""));var Id=parseInt(vd.slice(2,4),10);if(Id>50&&(Id-=50),Id>20){if(parseInt(Sd,10)<2004)return!1;Id-=20}Id<10&&(Id="0".concat(Id));var Bd="".concat(Sd,"/").concat(Id,"/").concat(vd.slice(4,6));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1;if(vd.length===10&&parseInt(vd,10)%11!==0){var nf=parseInt(vd.slice(0,9),10)%11;if(parseInt(Sd,10)<1986&&nf===10){if(parseInt(vd.slice(9),10)!==0)return!1}else return!1}return!0}function Ca(vd){return ii.luhnCheck(vd)}function el(vd){for(var Sd=vd.split("").map(function(vf){return parseInt(vf,10)}),Id=[],Bd=0;Bd<Sd.length-1;Bd++){Id.push("");for(var nf=0;nf<Sd.length-1;nf++)Sd[Bd]===Sd[nf]&&(Id[Bd]+=nf)}if(Id=Id.filter(function(vf){return vf.length>1}),Id.length!==2&&Id.length!==3)return!1;if(Id[0].length===3){for(var lf=Id[0].split("").map(function(vf){return parseInt(vf,10)}),pf=0,gf=0;gf<lf.length-1;gf++)lf[gf]+1===lf[gf+1]&&(pf+=1);if(pf===2)return!1}return ii.iso7064Check(vd)}function ku(vd){vd=vd.replace(/\W/,"");var Sd=parseInt(vd.slice(4,6),10),Id=vd.slice(6,7);switch(Id){case"0":case"1":case"2":case"3":Sd="19".concat(Sd);break;case"4":case"9":Sd<37?Sd="20".concat(Sd):Sd="19".concat(Sd);break;default:if(Sd<37)Sd="20".concat(Sd);else if(Sd>58)Sd="18".concat(Sd);else return!1;break}Sd.length===3&&(Sd=[Sd.slice(0,2),"0",Sd.slice(2)].join(""));var Bd="".concat(Sd,"/").concat(vd.slice(2,4),"/").concat(vd.slice(0,2));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1;for(var nf=vd.split("").map(function(vf){return parseInt(vf,10)}),lf=0,pf=4,gf=0;gf<9;gf++)lf+=nf[gf]*pf,pf-=1,pf===1&&(pf=7);return lf%=11,lf===1?!1:lf===0?nf[9]===0:nf[9]===11-lf}function gd(vd){for(var Sd=vd.slice(0,8).split("").map(function(lf){return parseInt(lf,10)}),Id=0,Bd=1;Bd<Sd.length;Bd+=2)Id+=Sd[Bd];for(var nf=0;nf<Sd.length;nf+=2)Sd[nf]<2?Id+=1-Sd[nf]:(Id+=2*(Sd[nf]-2)+5,Sd[nf]>4&&(Id+=2));return String.fromCharCode(Id%26+65)===vd.charAt(8)}function Ed(vd){for(var Sd=vd.split("").map(function(nf){return parseInt(nf,10)}),Id=0,Bd=0;Bd<8;Bd++)Id+=Sd[Bd]*Math.pow(2,8-Bd);return Id%11%10===Sd[8]}function Od(vd){var Sd=ii.reverseMultiplyAndSum(vd.split("").slice(0,7).map(function(Id){return parseInt(Id,10)}),8);return vd.length===9&&vd[8]!=="W"&&(Sd+=(vd[8].charCodeAt(0)-64)*9),Sd%=23,Sd===0?vd[7].toUpperCase()==="W":vd[7].toUpperCase()===String.fromCharCode(64+Sd)}var Nd={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function Pd(){var vd=[];for(var Sd in Nd)Nd.hasOwnProperty(Sd)&&vd.push.apply(vd,di(Nd[Sd]));return vd}function Ld(vd){return Pd().indexOf(vd.slice(0,2))!==-1}function rf(vd){for(var Sd=0,Id=vd.split(""),Bd=parseInt(Id.pop(),10),nf=0;nf<Id.length;nf++)Sd+=Id[9-nf]*(2+nf%6);var lf=11-Sd%11;return lf===11?lf=0:lf===10&&(lf=9),Bd===lf}function kd(vd){var Sd=vd.toUpperCase().split("");if(isNaN(parseInt(Sd[0],10))&&Sd.length>1){var Id=0;switch(Sd[0]){case"Y":Id=1;break;case"Z":Id=2;break}Sd.splice(0,1,Id)}else for(;Sd.length<9;)Sd.unshift(0);var Bd=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];Sd=Sd.join("");var nf=parseInt(Sd.slice(0,8),10)%23;return Sd[8]===Bd[nf]}function Md(vd){var Sd=vd.slice(1,3),Id=vd.slice(0,1);switch(Id){case"1":case"2":Sd="18".concat(Sd);break;case"3":case"4":Sd="19".concat(Sd);break;default:Sd="20".concat(Sd);break}var Bd="".concat(Sd,"/").concat(vd.slice(3,5),"/").concat(vd.slice(5,7));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1;for(var nf=vd.split("").map(function(bf){return parseInt(bf,10)}),lf=0,pf=1,gf=0;gf<10;gf++)lf+=nf[gf]*pf,pf+=1,pf===10&&(pf=1);if(lf%11===10){lf=0,pf=3;for(var vf=0;vf<10;vf++)lf+=nf[vf]*pf,pf+=1,pf===10&&(pf=1);if(lf%11===10)return nf[10]===0}return lf%11===nf[10]}function Td(vd){var Sd=vd.slice(4,6),Id=vd.slice(6,7);switch(Id){case"+":Sd="18".concat(Sd);break;case"-":Sd="19".concat(Sd);break;default:Sd="20".concat(Sd);break}var Bd="".concat(Sd,"/").concat(vd.slice(2,4),"/").concat(vd.slice(0,2));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1;var nf=parseInt(vd.slice(0,6)+vd.slice(7,10),10)%31;if(nf<10)return nf===parseInt(vd.slice(10),10);nf-=10;var lf=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return lf[nf]===vd.slice(10)}function wd(vd){if(vd.slice(2,4)!=="00"||vd.slice(4,6)!=="00"){var Sd="".concat(vd.slice(0,2),"/").concat(vd.slice(2,4),"/").concat(vd.slice(4,6));if(!(0,ai.default)(Sd,"YY/MM/DD"))return!1}var Id=97-parseInt(vd.slice(0,9),10)%97,Bd=parseInt(vd.slice(9,11),10);return!(Id!==Bd&&(Id=97-parseInt("2".concat(vd.slice(0,9)),10)%97,Id!==Bd))}function Cd(vd){vd=vd.replace(/\s/g,"");var Sd=parseInt(vd.slice(0,10),10)%511,Id=parseInt(vd.slice(10,13),10);return Sd===Id}function sf(vd){var Sd="".concat(vd.slice(0,4),"/").concat(vd.slice(4,6),"/").concat(vd.slice(6,8));return!(0,ai.default)(Sd,"YYYY/MM/DD")||!ii.luhnCheck(vd.slice(0,12))?!1:ii.verhoeffCheck("".concat(vd.slice(0,11)).concat(vd[12]))}function of(vd){return ii.iso7064Check(vd)}function Wd(vd){for(var Sd=vd.split("").map(function(nf){return parseInt(nf,10)}),Id=8,Bd=1;Bd<9;Bd++)Id+=Sd[Bd]*(Bd+1);return Id%11===Sd[9]}function df(vd){for(var Sd=!1,Id=!1,Bd=0;Bd<3;Bd++)if(!Sd&&/[AEIOU]/.test(vd[Bd]))Sd=!0;else if(!Id&&Sd&&vd[Bd]==="X")Id=!0;else if(Bd>0&&(Sd&&!Id&&!/[AEIOU]/.test(vd[Bd])||Id&&!/X/.test(vd[Bd])))return!1;return!0}function hf(vd){var Sd=vd.toUpperCase().split("");if(!df(Sd.slice(0,3))||!df(Sd.slice(3,6)))return!1;for(var Id=[6,7,9,10,12,13,14],Bd={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},nf=0,lf=Id;nf<lf.length;nf++){var pf=lf[nf];Sd[pf]in Bd&&Sd.splice(pf,1,Bd[Sd[pf]])}var gf={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},vf=gf[Sd[8]],bf=parseInt(Sd[9]+Sd[10],10);bf>40&&(bf-=40),bf<10&&(bf="0".concat(bf));var If="".concat(Sd[6]).concat(Sd[7],"/").concat(vf,"/").concat(bf);if(!(0,ai.default)(If,"YY/MM/DD"))return!1;for(var Af=0,$f=1;$f<Sd.length-1;$f+=2){var Cf=parseInt(Sd[$f],10);isNaN(Cf)&&(Cf=Sd[$f].charCodeAt(0)-65),Af+=Cf}for(var kf={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},Rf=0;Rf<Sd.length-1;Rf+=2){var Pf=0;if(Sd[Rf]in kf)Pf=kf[Sd[Rf]];else{var Ff=parseInt(Sd[Rf],10);Pf=2*Ff+1,Ff>4&&(Pf+=2)}Af+=Pf}return String.fromCharCode(65+Af%26)===Sd[15]}function xd(vd){vd=vd.replace(/\W/,"");var Sd=vd.slice(0,2);if(Sd!=="32"){var Id=vd.slice(2,4);if(Id!=="00"){var Bd=vd.slice(4,6);switch(vd[6]){case"0":Bd="18".concat(Bd);break;case"1":Bd="19".concat(Bd);break;default:Bd="20".concat(Bd);break}var nf="".concat(Bd,"/").concat(vd.slice(2,4),"/").concat(Sd);if(!(0,ai.default)(nf,"YYYY/MM/DD"))return!1}for(var lf=1101,pf=[1,6,3,7,9,10,5,8,4,2],gf=0;gf<vd.length-1;gf++)lf-=parseInt(vd[gf],10)*pf[gf];return parseInt(vd[10],10)===lf%11}return!0}function Fd(vd){if(vd.length!==9){for(var Sd=vd.toUpperCase().split("");Sd.length<8;)Sd.unshift(0);switch(vd[7]){case"A":case"P":if(parseInt(Sd[6],10)===0)return!1;break;default:{var Id=parseInt(Sd.join("").slice(0,5),10);if(Id>32e3)return!1;var Bd=parseInt(Sd.join("").slice(5,7),10);if(Id===Bd)return!1}}}return!0}function Vd(vd){return ii.reverseMultiplyAndSum(vd.split("").slice(0,8).map(function(Sd){return parseInt(Sd,10)}),9)%11===parseInt(vd[8],10)}function af(vd){if(vd.length===10){for(var Sd=[6,5,7,2,3,4,5,6,7],Id=0,Bd=0;Bd<Sd.length;Bd++)Id+=parseInt(vd[Bd],10)*Sd[Bd];return Id%=11,Id===10?!1:Id===parseInt(vd[9],10)}var nf=vd.slice(0,2),lf=parseInt(vd.slice(2,4),10);lf>80?(nf="18".concat(nf),lf-=80):lf>60?(nf="22".concat(nf),lf-=60):lf>40?(nf="21".concat(nf),lf-=40):lf>20?(nf="20".concat(nf),lf-=20):nf="19".concat(nf),lf<10&&(lf="0".concat(lf));var pf="".concat(nf,"/").concat(lf,"/").concat(vd.slice(4,6));if(!(0,ai.default)(pf,"YYYY/MM/DD"))return!1;for(var gf=0,vf=1,bf=0;bf<vd.length-1;bf++)gf+=parseInt(vd[bf],10)*vf%10,vf+=2,vf>10?vf=1:vf===5&&(vf+=2);return gf=10-gf%10,gf===parseInt(vd[10],10)}function ff(vd){if(vd.length===11){var Sd,Id;if(Sd=0,vd==="11111111111"||vd==="22222222222"||vd==="33333333333"||vd==="44444444444"||vd==="55555555555"||vd==="66666666666"||vd==="77777777777"||vd==="88888888888"||vd==="99999999999"||vd==="00000000000")return!1;for(var Bd=1;Bd<=9;Bd++)Sd+=parseInt(vd.substring(Bd-1,Bd),10)*(11-Bd);if(Id=Sd*10%11,Id===10&&(Id=0),Id!==parseInt(vd.substring(9,10),10))return!1;Sd=0;for(var nf=1;nf<=10;nf++)Sd+=parseInt(vd.substring(nf-1,nf),10)*(12-nf);return Id=Sd*10%11,Id===10&&(Id=0),Id===parseInt(vd.substring(10,11),10)}if(vd==="00000000000000"||vd==="11111111111111"||vd==="22222222222222"||vd==="33333333333333"||vd==="44444444444444"||vd==="55555555555555"||vd==="66666666666666"||vd==="77777777777777"||vd==="88888888888888"||vd==="99999999999999")return!1;for(var lf=vd.length-2,pf=vd.substring(0,lf),gf=vd.substring(lf),vf=0,bf=lf-7,If=lf;If>=1;If--)vf+=pf.charAt(lf-If)*bf,bf-=1,bf<2&&(bf=9);var Af=vf%11<2?0:11-vf%11;if(Af!==parseInt(gf.charAt(0),10))return!1;lf+=1,pf=vd.substring(0,lf),vf=0,bf=lf-7;for(var $f=lf;$f>=1;$f--)vf+=pf.charAt(lf-$f)*bf,bf-=1,bf<2&&(bf=9);return Af=vf%11<2?0:11-vf%11,Af===parseInt(gf.charAt(1),10)}function uf(vd){var Sd=11-ii.reverseMultiplyAndSum(vd.split("").slice(0,8).map(function(Id){return parseInt(Id,10)}),9)%11;return Sd>9?parseInt(vd[8],10)===0:Sd===parseInt(vd[8],10)}function mf(vd){if(vd.slice(0,4)!=="9000"){var Sd=vd.slice(1,3);switch(vd[0]){case"1":case"2":Sd="19".concat(Sd);break;case"3":case"4":Sd="18".concat(Sd);break;case"5":case"6":Sd="20".concat(Sd);break}var Id="".concat(Sd,"/").concat(vd.slice(3,5),"/").concat(vd.slice(5,7));if(Id.length===8){if(!(0,ai.default)(Id,"YY/MM/DD"))return!1}else if(!(0,ai.default)(Id,"YYYY/MM/DD"))return!1;for(var Bd=vd.split("").map(function(gf){return parseInt(gf,10)}),nf=[2,7,9,1,4,6,3,5,8,2,7,9],lf=0,pf=0;pf<nf.length;pf++)lf+=Bd[pf]*nf[pf];return lf%11===10?Bd[12]===1:Bd[12]===lf%11}return!0}function yf(vd){if(vd.length===9){if(vd=vd.replace(/\W/,""),vd.slice(6)==="000")return!1;var Sd=parseInt(vd.slice(0,2),10);if(Sd>53)return!1;Sd<10?Sd="190".concat(Sd):Sd="19".concat(Sd);var Id=parseInt(vd.slice(2,4),10);Id>50&&(Id-=50),Id<10&&(Id="0".concat(Id));var Bd="".concat(Sd,"/").concat(Id,"/").concat(vd.slice(4,6));if(!(0,ai.default)(Bd,"YYYY/MM/DD"))return!1}return!0}function Sf(vd){var Sd=11-ii.reverseMultiplyAndSum(vd.split("").slice(0,7).map(function(Id){return parseInt(Id,10)}),8)%11;return Sd===10?parseInt(vd[7],10)===0:Sd===parseInt(vd[7],10)}function Of(vd){var Sd=vd.slice(0);vd.length>11&&(Sd=Sd.slice(2));var Id="",Bd=Sd.slice(2,4),nf=parseInt(Sd.slice(4,6),10);if(vd.length>11)Id=vd.slice(0,4);else if(Id=vd.slice(0,2),vd.length===11&&nf<60){var lf=new Date().getFullYear().toString(),pf=parseInt(lf.slice(0,2),10);if(lf=parseInt(lf,10),vd[6]==="-")parseInt("".concat(pf).concat(Id),10)>lf?Id="".concat(pf-1).concat(Id):Id="".concat(pf).concat(Id);else if(Id="".concat(pf-1).concat(Id),lf-parseInt(Id,10)<100)return!1}nf>60&&(nf-=60),nf<10&&(nf="0".concat(nf));var gf="".concat(Id,"/").concat(Bd,"/").concat(nf);if(gf.length===8){if(!(0,ai.default)(gf,"YY/MM/DD"))return!1}else if(!(0,ai.default)(gf,"YYYY/MM/DD"))return!1;return ii.luhnCheck(vd.replace(/\W/,""))}function wf(vd){for(var Sd=vd.split("").map(function(lf){return parseInt(lf,10)}),Id=[-1,5,7,9,4,6,10,5,7],Bd=0,nf=0;nf<Id.length;nf++)Bd+=Sd[nf]*Id[nf];return Bd%11===10?Sd[9]===0:Sd[9]===Bd%11}var Ef={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};Ef["lb-LU"]=Ef["fr-LU"],Ef["lt-LT"]=Ef["et-EE"],Ef["nl-BE"]=Ef["fr-BE"],Ef["fr-CA"]=Ef["en-CA"];var xf={"bg-BG":ba,"cs-CZ":xa,"de-AT":Ca,"de-DE":el,"dk-DK":ku,"el-CY":gd,"el-GR":Ed,"en-CA":wa,"en-IE":Od,"en-US":Ld,"es-AR":rf,"es-ES":kd,"et-EE":Md,"fi-FI":Td,"fr-BE":wd,"fr-FR":Cd,"fr-LU":sf,"hr-HR":of,"hu-HU":Wd,"it-IT":hf,"lv-LV":xd,"mt-MT":Fd,"nl-NL":Vd,"pl-PL":af,"pt-BR":ff,"pt-PT":uf,"ro-RO":mf,"sk-SK":yf,"sl-SI":Sf,"sv-SE":Of,"uk-UA":wf};xf["lb-LU"]=xf["fr-LU"],xf["lt-LT"]=xf["et-EE"],xf["nl-BE"]=xf["fr-BE"],xf["fr-CA"]=xf["en-CA"];var _d=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,Dd={"de-AT":_d,"de-DE":/[\/\\]/g,"fr-BE":_d};Dd["nl-BE"]=Dd["fr-BE"];function tf(vd){var Sd=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,si.default)(vd);var Id=vd.slice(0);if(Sd in Ef)return Sd in Dd&&(Id=Id.replace(Dd[Sd],"")),Ef[Sd].test(Id)?Sd in xf?xf[Sd](Id):!0:!1;throw new Error("Invalid locale '".concat(Sd,"'"))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isTaxID,isTaxID.exports)),isTaxID.exports}var isMobilePhone={},hasRequiredIsMobilePhone;function requireIsMobilePhone(){if(hasRequiredIsMobilePhone)return isMobilePhone;hasRequiredIsMobilePhone=1,Object.defineProperty(isMobilePhone,"__esModule",{value:!0}),isMobilePhone.default=si,isMobilePhone.locales=void 0;var Ws=ws(requireAssertString());function ws(ii){return ii&&ii.__esModule?ii:{default:ii}}var oi={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};oi["en-CA"]=oi["en-US"],oi["fr-CA"]=oi["en-CA"],oi["fr-BE"]=oi["nl-BE"],oi["zh-HK"]=oi["en-HK"],oi["zh-MO"]=oi["en-MO"],oi["ga-IE"]=oi["en-IE"],oi["fr-CH"]=oi["de-CH"],oi["it-CH"]=oi["fr-CH"];function si(ii,ai,li){if((0,Ws.default)(ii),li&&li.strictMode&&!ii.startsWith("+"))return!1;if(Array.isArray(ai))return ai.some(function(di){if(oi.hasOwnProperty(di)){var hi=oi[di];if(hi.test(ii))return!0}return!1});if(ai in oi)return oi[ai].test(ii);if(!ai||ai==="any"){for(var ci in oi)if(oi.hasOwnProperty(ci)){var ui=oi[ci];if(ui.test(ii))return!0}return!1}throw new Error("Invalid locale '".concat(ai,"'"))}return isMobilePhone.locales=Object.keys(oi),isMobilePhone}var isEthereumAddress={exports:{}},hasRequiredIsEthereumAddress;function requireIsEthereumAddress(){return hasRequiredIsEthereumAddress||(hasRequiredIsEthereumAddress=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^(0x)[0-9a-f]{40}$/i;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isEthereumAddress,isEthereumAddress.exports)),isEthereumAddress.exports}var isCurrency={exports:{}},hasRequiredIsCurrency;function requireIsCurrency(){return hasRequiredIsCurrency||(hasRequiredIsCurrency=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=ii(requireMerge()),si=ii(requireAssertString());function ii(ui){return ui&&ui.__esModule?ui:{default:ui}}function ai(ui){var di="\\d{".concat(ui.digits_after_decimal[0],"}");ui.digits_after_decimal.forEach(function(Ca,el){el!==0&&(di="".concat(di,"|\\d{").concat(Ca,"}"))});var hi="(".concat(ui.symbol.replace(/\W/,function(Ca){return"\\".concat(Ca)}),")").concat(ui.require_symbol?"":"?"),pi="-?",ha="[1-9]\\d*",ga="[1-9]\\d{0,2}(\\".concat(ui.thousands_separator,"\\d{3})*"),va=["0",ha,ga],ba="(".concat(va.join("|"),")?"),wa="(\\".concat(ui.decimal_separator,"(").concat(di,"))").concat(ui.require_decimal?"":"?"),xa=ba+(ui.allow_decimal||ui.require_decimal?wa:"");return ui.allow_negatives&&!ui.parens_for_negatives&&(ui.negative_sign_after_digits?xa+=pi:ui.negative_sign_before_digits&&(xa=pi+xa)),ui.allow_negative_sign_placeholder?xa="( (?!\\-))?".concat(xa):ui.allow_space_after_symbol?xa=" ?".concat(xa):ui.allow_space_after_digits&&(xa+="( (?!$))?"),ui.symbol_after_digits?xa+=hi:xa=hi+xa,ui.allow_negatives&&(ui.parens_for_negatives?xa="(\\(".concat(xa,"\\)|").concat(xa,")"):ui.negative_sign_before_digits||ui.negative_sign_after_digits||(xa=pi+xa)),new RegExp("^(?!-? )(?=.*\\d)".concat(xa,"$"))}var li={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function ci(ui,di){return(0,si.default)(ui),di=(0,oi.default)(di,li),ai(di).test(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isCurrency,isCurrency.exports)),isCurrency.exports}var isBtcAddress={exports:{}},hasRequiredIsBtcAddress;function requireIsBtcAddress(){return hasRequiredIsBtcAddress||(hasRequiredIsBtcAddress=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=li;var oi=si(requireAssertString());function si(ci){return ci&&ci.__esModule?ci:{default:ci}}var ii=/^(bc1)[a-z0-9]{25,39}$/,ai=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function li(ci){return(0,oi.default)(ci),ii.test(ci)||ai.test(ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBtcAddress,isBtcAddress.exports)),isBtcAddress.exports}var isISO6346={},hasRequiredIsISO6346;function requireIsISO6346(){if(hasRequiredIsISO6346)return isISO6346;hasRequiredIsISO6346=1,Object.defineProperty(isISO6346,"__esModule",{value:!0}),isISO6346.isFreightContainerID=void 0,isISO6346.isISO6346=ii;var Ws=ws(requireAssertString());function ws(ai){return ai&&ai.__esModule?ai:{default:ai}}var oi=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,si=/^[0-9]$/;function ii(ai){if((0,Ws.default)(ai),ai=ai.toUpperCase(),!oi.test(ai))return!1;if(ai.length===11){for(var li=0,ci=0;ci<ai.length-1;ci++)if(si.test(ai[ci]))li+=ai[ci]*Math.pow(2,ci);else{var ui=void 0,di=ai.charCodeAt(ci)-55;di<11?ui=di:di>=11&&di<=20?ui=12+di%11:di>=21&&di<=30?ui=23+di%21:ui=34+di%31,li+=ui*Math.pow(2,ci)}var hi=li%11;return Number(ai[ai.length-1])===hi}return!0}return isISO6346.isFreightContainerID=ii,isISO6346}var isISO6391={exports:{}},hasRequiredIsISO6391;function requireIsISO6391(){return hasRequiredIsISO6391||(hasRequiredIsISO6391=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function ai(li){return(0,oi.default)(li),ii.has(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISO6391,isISO6391.exports)),isISO6391.exports}var isISO8601={exports:{}},hasRequiredIsISO8601;function requireIsISO8601(){return hasRequiredIsISO8601||(hasRequiredIsISO8601=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=si(requireAssertString());function si(ui){return ui&&ui.__esModule?ui:{default:ui}}var ii=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,ai=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,li=function(ui){var di=ui.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(di){var hi=Number(di[1]),pi=Number(di[2]);return hi%4===0&&hi%100!==0||hi%400===0?pi<=366:pi<=365}var ha=ui.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),ga=ha[1],va=ha[2],ba=ha[3],wa=va&&"0".concat(va).slice(-2),xa=ba&&"0".concat(ba).slice(-2),Ca=new Date("".concat(ga,"-").concat(wa||"01","-").concat(xa||"01"));return va&&ba?Ca.getUTCFullYear()===ga&&Ca.getUTCMonth()+1===va&&Ca.getUTCDate()===ba:!0};function ci(ui){var di=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,oi.default)(ui);var hi=di.strictSeparator?ai.test(ui):ii.test(ui);return hi&&di.strict?li(ui):hi}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISO8601,isISO8601.exports)),isISO8601.exports}var isRFC3339={exports:{}},hasRequiredIsRFC3339;function requireIsRFC3339(){return hasRequiredIsRFC3339||(hasRequiredIsRFC3339=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=xa;var oi=si(requireAssertString());function si(Ca){return Ca&&Ca.__esModule?Ca:{default:Ca}}var ii=/[0-9]{4}/,ai=/(0[1-9]|1[0-2])/,li=/([12]\d|0[1-9]|3[01])/,ci=/([01][0-9]|2[0-3])/,ui=/[0-5][0-9]/,di=/([0-5][0-9]|60)/,hi=/(\.[0-9]+)?/,pi=new RegExp("[-+]".concat(ci.source,":").concat(ui.source)),ha=new RegExp("([zZ]|".concat(pi.source,")")),ga=new RegExp("".concat(ci.source,":").concat(ui.source,":").concat(di.source).concat(hi.source)),va=new RegExp("".concat(ii.source,"-").concat(ai.source,"-").concat(li.source)),ba=new RegExp("".concat(ga.source).concat(ha.source)),wa=new RegExp("^".concat(va.source,"[ tT]").concat(ba.source,"$"));function xa(Ca){return(0,oi.default)(Ca),wa.test(Ca)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isRFC3339,isRFC3339.exports)),isRFC3339.exports}var isISO31661Alpha3={exports:{}},hasRequiredIsISO31661Alpha3;function requireIsISO31661Alpha3(){return hasRequiredIsISO31661Alpha3||(hasRequiredIsISO31661Alpha3=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function ai(li){return(0,oi.default)(li),ii.has(li.toUpperCase())}Ws.exports=ws.default,Ws.exports.default=ws.default}(isISO31661Alpha3,isISO31661Alpha3.exports)),isISO31661Alpha3.exports}var isISO4217={},hasRequiredIsISO4217;function requireIsISO4217(){if(hasRequiredIsISO4217)return isISO4217;hasRequiredIsISO4217=1,Object.defineProperty(isISO4217,"__esModule",{value:!0}),isISO4217.CurrencyCodes=void 0,isISO4217.default=si;var Ws=ws(requireAssertString());function ws(ii){return ii&&ii.__esModule?ii:{default:ii}}var oi=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function si(ii){return(0,Ws.default)(ii),oi.has(ii.toUpperCase())}return isISO4217.CurrencyCodes=oi,isISO4217}var isBase32={exports:{}},hasRequiredIsBase32;function requireIsBase32(){return hasRequiredIsBase32||(hasRequiredIsBase32=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ui;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(di){return di&&di.__esModule?di:{default:di}}var ai=/^[A-Z2-7]+=*$/,li=/^[A-HJKMNP-TV-Z0-9]+$/,ci={crockford:!1};function ui(di,hi){if((0,oi.default)(di),hi=(0,si.default)(hi,ci),hi.crockford)return li.test(di);var pi=di.length;return!!(pi%8===0&&ai.test(di))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBase32,isBase32.exports)),isBase32.exports}var isBase58={exports:{}},hasRequiredIsBase58;function requireIsBase58(){return hasRequiredIsBase58||(hasRequiredIsBase58=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[A-HJ-NP-Za-km-z1-9]*$/;function ai(li){return(0,oi.default)(li),!!ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isBase58,isBase58.exports)),isBase58.exports}var isDataURI={exports:{}},hasRequiredIsDataURI;function requireIsDataURI(){return hasRequiredIsDataURI||(hasRequiredIsDataURI=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=si(requireAssertString());function si(ui){return ui&&ui.__esModule?ui:{default:ui}}var ii=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,ai=/^[a-z\-]+=[a-z0-9\-]+$/i,li=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function ci(ui){(0,oi.default)(ui);var di=ui.split(",");if(di.length<2)return!1;var hi=di.shift().trim().split(";"),pi=hi.shift();if(pi.slice(0,5)!=="data:")return!1;var ha=pi.slice(5);if(ha!==""&&!ii.test(ha))return!1;for(var ga=0;ga<hi.length;ga++)if(!(ga===hi.length-1&&hi[ga].toLowerCase()==="base64")&&!ai.test(hi[ga]))return!1;for(var va=0;va<di.length;va++)if(!li.test(di[va]))return!1;return!0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isDataURI,isDataURI.exports)),isDataURI.exports}var isMagnetURI={exports:{}},hasRequiredIsMagnetURI;function requireIsMagnetURI(){return hasRequiredIsMagnetURI||(hasRequiredIsMagnetURI=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function ai(li){return(0,oi.default)(li),li.indexOf("magnet:?")!==0?!1:ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMagnetURI,isMagnetURI.exports)),isMagnetURI.exports}var isMailtoURI={exports:{}},trim={exports:{}},rtrim={exports:{}},hasRequiredRtrim;function requireRtrim(){return hasRequiredRtrim||(hasRequiredRtrim=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){if((0,oi.default)(ai),li){var ci=new RegExp("[".concat(li.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return ai.replace(ci,"")}for(var ui=ai.length-1;/\s/.test(ai.charAt(ui));)ui-=1;return ai.slice(0,ui+1)}Ws.exports=ws.default,Ws.exports.default=ws.default}(rtrim,rtrim.exports)),rtrim.exports}var ltrim={exports:{}},hasRequiredLtrim;function requireLtrim(){return hasRequiredLtrim||(hasRequiredLtrim=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){(0,oi.default)(ai);var ci=li?new RegExp("^[".concat(li.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return ai.replace(ci,"")}Ws.exports=ws.default,Ws.exports.default=ws.default}(ltrim,ltrim.exports)),ltrim.exports}var hasRequiredTrim;function requireTrim(){return hasRequiredTrim||(hasRequiredTrim=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireRtrim()),si=ii(requireLtrim());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li,ci){return(0,oi.default)((0,si.default)(li,ci),ci)}Ws.exports=ws.default,Ws.exports.default=ws.default}(trim,trim.exports)),trim.exports}var hasRequiredIsMailtoURI;function requireIsMailtoURI(){return hasRequiredIsMailtoURI||(hasRequiredIsMailtoURI=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=va;var oi=ai(requireTrim()),si=ai(requireIsEmail()),ii=ai(requireAssertString());function ai(ba){return ba&&ba.__esModule?ba:{default:ba}}function li(ba,wa){return di(ba)||ui(ba,wa)||pi(ba,wa)||ci()}function ci(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
311
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ui(ba,wa){var xa=ba==null?null:typeof Symbol<"u"&&ba[Symbol.iterator]||ba["@@iterator"];if(xa!=null){var Ca,el,ku,gd,Ed=[],Od=!0,Nd=!1;try{if(ku=(xa=xa.call(ba)).next,wa!==0)for(;!(Od=(Ca=ku.call(xa)).done)&&(Ed.push(Ca.value),Ed.length!==wa);Od=!0);}catch(Pd){Nd=!0,el=Pd}finally{try{if(!Od&&xa.return!=null&&(gd=xa.return(),Object(gd)!==gd))return}finally{if(Nd)throw el}}return Ed}}function di(ba){if(Array.isArray(ba))return ba}function hi(ba,wa){var xa=typeof Symbol<"u"&&ba[Symbol.iterator]||ba["@@iterator"];if(!xa){if(Array.isArray(ba)||(xa=pi(ba))||wa){xa&&(ba=xa);var Ca=0,el=function(){};return{s:el,n:function(){return Ca>=ba.length?{done:!0}:{done:!1,value:ba[Ca++]}},e:function(Od){throw Od},f:el}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ku=!0,gd=!1,Ed;return{s:function(){xa=xa.call(ba)},n:function(){var Od=xa.next();return ku=Od.done,Od},e:function(Od){gd=!0,Ed=Od},f:function(){try{!ku&&xa.return!=null&&xa.return()}finally{if(gd)throw Ed}}}}function pi(ba,wa){if(ba){if(typeof ba=="string")return ha(ba,wa);var xa=Object.prototype.toString.call(ba).slice(8,-1);if(xa==="Object"&&ba.constructor&&(xa=ba.constructor.name),xa==="Map"||xa==="Set")return Array.from(ba);if(xa==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(xa))return ha(ba,wa)}}function ha(ba,wa){(wa==null||wa>ba.length)&&(wa=ba.length);for(var xa=0,Ca=new Array(wa);xa<wa;xa++)Ca[xa]=ba[xa];return Ca}function ga(ba){var wa=new Set(["subject","body","cc","bcc"]),xa={cc:"",bcc:""},Ca=!1,el=ba.split("&");if(el.length>4)return!1;var ku=hi(el),gd;try{for(ku.s();!(gd=ku.n()).done;){var Ed=gd.value,Od=Ed.split("="),Nd=li(Od,2),Pd=Nd[0],Ld=Nd[1];if(Pd&&!wa.has(Pd)){Ca=!0;break}Ld&&(Pd==="cc"||Pd==="bcc")&&(xa[Pd]=Ld),Pd&&wa.delete(Pd)}}catch(rf){ku.e(rf)}finally{ku.f()}return Ca?!1:xa}function va(ba,wa){if((0,ii.default)(ba),ba.indexOf("mailto:")!==0)return!1;var xa=ba.replace("mailto:","").split("?"),Ca=li(xa,2),el=Ca[0],ku=Ca[1],gd=ku===void 0?"":ku;if(!el&&!gd)return!0;var Ed=ga(gd);return Ed?"".concat(el,",").concat(Ed.cc,",").concat(Ed.bcc).split(",").every(function(Od){return Od=(0,oi.default)(Od," "),Od?(0,si.default)(Od,wa):!0}):!1}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMailtoURI,isMailtoURI.exports)),isMailtoURI.exports}var isMimeType={exports:{}},hasRequiredIsMimeType;function requireIsMimeType(){return hasRequiredIsMimeType||(hasRequiredIsMimeType=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ci;var oi=si(requireAssertString());function si(ui){return ui&&ui.__esModule?ui:{default:ui}}var ii=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,ai=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,li=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function ci(ui){return(0,oi.default)(ui),ii.test(ui)||ai.test(ui)||li.test(ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isMimeType,isMimeType.exports)),isMimeType.exports}var isLatLong={exports:{}},hasRequiredIsLatLong;function requireIsLatLong(){return hasRequiredIsLatLong||(hasRequiredIsLatLong=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=hi;var oi=ii(requireAssertString()),si=ii(requireMerge());function ii(pi){return pi&&pi.__esModule?pi:{default:pi}}var ai=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,li=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,ci=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,ui=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,di={checkDMS:!1};function hi(pi,ha){if((0,oi.default)(pi),ha=(0,si.default)(ha,di),!pi.includes(","))return!1;var ga=pi.split(",");return ga[0].startsWith("(")&&!ga[1].endsWith(")")||ga[1].endsWith(")")&&!ga[0].startsWith("(")?!1:ha.checkDMS?ci.test(ga[0])&&ui.test(ga[1]):ai.test(ga[0])&&li.test(ga[1])}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLatLong,isLatLong.exports)),isLatLong.exports}var isPostalCode={},hasRequiredIsPostalCode;function requireIsPostalCode(){if(hasRequiredIsPostalCode)return isPostalCode;hasRequiredIsPostalCode=1,Object.defineProperty(isPostalCode,"__esModule",{value:!0}),isPostalCode.default=ci,isPostalCode.locales=void 0;var Ws=ws(requireAssertString());function ws(ui){return ui&&ui.__esModule?ui:{default:ui}}var oi=/^\d{3}$/,si=/^\d{4}$/,ii=/^\d{5}$/,ai=/^\d{6}$/,li={AD:/^AD\d{3}$/,AT:si,AU:si,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:si,BG:si,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:si,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:ii,DK:si,DO:ii,DZ:ii,EE:ii,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:ii,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:si,ID:ii,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:oi,IT:ii,JP:/^\d{3}\-\d{4}$/,KE:ii,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:si,LV:/^LV\-\d{4}$/,LK:ii,MG:oi,MX:ii,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:ii,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:si,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:si,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:ai,RU:ai,SA:ii,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:ai,SI:si,SK:/^\d{3}\s?\d{2}$/,TH:ii,TN:si,TW:/^\d{3}(\d{2})?$/,UA:ii,US:/^\d{5}(-\d{4})?$/,ZA:si,ZM:ii};isPostalCode.locales=Object.keys(li);function ci(ui,di){if((0,Ws.default)(ui),di in li)return li[di].test(ui);if(di==="any"){for(var hi in li)if(li.hasOwnProperty(hi)){var pi=li[hi];if(pi.test(ui))return!0}return!1}throw new Error("Invalid locale '".concat(di,"'"))}return isPostalCode}var _escape={exports:{}},hasRequired_escape;function require_escape(){return hasRequired_escape||(hasRequired_escape=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai),ai.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")}Ws.exports=ws.default,Ws.exports.default=ws.default}(_escape,_escape.exports)),_escape.exports}var _unescape={exports:{}},hasRequired_unescape;function require_unescape(){return hasRequired_unescape||(hasRequired_unescape=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai){return(0,oi.default)(ai),ai.replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`").replace(/&amp;/g,"&")}Ws.exports=ws.default,Ws.exports.default=ws.default}(_unescape,_unescape.exports)),_unescape.exports}var stripLow={exports:{}},blacklist={exports:{}},hasRequiredBlacklist;function requireBlacklist(){return hasRequiredBlacklist||(hasRequiredBlacklist=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){return(0,oi.default)(ai),ai.replace(new RegExp("[".concat(li,"]+"),"g"),"")}Ws.exports=ws.default,Ws.exports.default=ws.default}(blacklist,blacklist.exports)),blacklist.exports}var hasRequiredStripLow;function requireStripLow(){return hasRequiredStripLow||(hasRequiredStripLow=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=ii(requireAssertString()),si=ii(requireBlacklist());function ii(li){return li&&li.__esModule?li:{default:li}}function ai(li,ci){(0,oi.default)(li);var ui=ci?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,si.default)(li,ui)}Ws.exports=ws.default,Ws.exports.default=ws.default}(stripLow,stripLow.exports)),stripLow.exports}var whitelist={exports:{}},hasRequiredWhitelist;function requireWhitelist(){return hasRequiredWhitelist||(hasRequiredWhitelist=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){return(0,oi.default)(ai),ai.replace(new RegExp("[^".concat(li,"]+"),"g"),"")}Ws.exports=ws.default,Ws.exports.default=ws.default}(whitelist,whitelist.exports)),whitelist.exports}var isWhitelisted={exports:{}},hasRequiredIsWhitelisted;function requireIsWhitelisted(){return hasRequiredIsWhitelisted||(hasRequiredIsWhitelisted=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ii;var oi=si(requireAssertString());function si(ai){return ai&&ai.__esModule?ai:{default:ai}}function ii(ai,li){(0,oi.default)(ai);for(var ci=ai.length-1;ci>=0;ci--)if(li.indexOf(ai[ci])===-1)return!1;return!0}Ws.exports=ws.default,Ws.exports.default=ws.default}(isWhitelisted,isWhitelisted.exports)),isWhitelisted.exports}var normalizeEmail={exports:{}},hasRequiredNormalizeEmail;function requireNormalizeEmail(){return hasRequiredNormalizeEmail||(hasRequiredNormalizeEmail=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=hi;var oi=si(requireMerge());function si(pi){return pi&&pi.__esModule?pi:{default:pi}}var ii={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},ai=["icloud.com","me.com"],li=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],ci=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],ui=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function di(pi){return pi.length>1?pi:""}function hi(pi,ha){ha=(0,oi.default)(ha,ii);var ga=pi.split("@"),va=ga.pop(),ba=ga.join("@"),wa=[ba,va];if(wa[1]=wa[1].toLowerCase(),wa[1]==="gmail.com"||wa[1]==="googlemail.com"){if(ha.gmail_remove_subaddress&&(wa[0]=wa[0].split("+")[0]),ha.gmail_remove_dots&&(wa[0]=wa[0].replace(/\.+/g,di)),!wa[0].length)return!1;(ha.all_lowercase||ha.gmail_lowercase)&&(wa[0]=wa[0].toLowerCase()),wa[1]=ha.gmail_convert_googlemaildotcom?"gmail.com":wa[1]}else if(ai.indexOf(wa[1])>=0){if(ha.icloud_remove_subaddress&&(wa[0]=wa[0].split("+")[0]),!wa[0].length)return!1;(ha.all_lowercase||ha.icloud_lowercase)&&(wa[0]=wa[0].toLowerCase())}else if(li.indexOf(wa[1])>=0){if(ha.outlookdotcom_remove_subaddress&&(wa[0]=wa[0].split("+")[0]),!wa[0].length)return!1;(ha.all_lowercase||ha.outlookdotcom_lowercase)&&(wa[0]=wa[0].toLowerCase())}else if(ci.indexOf(wa[1])>=0){if(ha.yahoo_remove_subaddress){var xa=wa[0].split("-");wa[0]=xa.length>1?xa.slice(0,-1).join("-"):xa[0]}if(!wa[0].length)return!1;(ha.all_lowercase||ha.yahoo_lowercase)&&(wa[0]=wa[0].toLowerCase())}else ui.indexOf(wa[1])>=0?((ha.all_lowercase||ha.yandex_lowercase)&&(wa[0]=wa[0].toLowerCase()),wa[1]="yandex.ru"):ha.all_lowercase&&(wa[0]=wa[0].toLowerCase());return wa.join("@")}Ws.exports=ws.default,Ws.exports.default=ws.default}(normalizeEmail,normalizeEmail.exports)),normalizeEmail.exports}var isSlug={exports:{}},hasRequiredIsSlug;function requireIsSlug(){return hasRequiredIsSlug||(hasRequiredIsSlug=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function ai(li){return(0,oi.default)(li),ii.test(li)}Ws.exports=ws.default,Ws.exports.default=ws.default}(isSlug,isSlug.exports)),isSlug.exports}var isLicensePlate={exports:{}},hasRequiredIsLicensePlate;function requireIsLicensePlate(){return hasRequiredIsLicensePlate||(hasRequiredIsLicensePlate=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ai;var oi=si(requireAssertString());function si(li){return li&&li.__esModule?li:{default:li}}var ii={"cs-CZ":function(li){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(li)},"de-DE":function(li){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(li)},"de-LI":function(li){return/^FL[- ]?\d{1,5}[UZ]?$/.test(li)},"en-IN":function(li){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(li)},"es-AR":function(li){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(li)},"fi-FI":function(li){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(li)},"hu-HU":function(li){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(li)},"pt-BR":function(li){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(li)},"pt-PT":function(li){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(li)},"sq-AL":function(li){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(li)},"sv-SE":function(li){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(li.trim())},"en-PK":function(li){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(li.trim())}};function ai(li,ci){if((0,oi.default)(li),ci in ii)return ii[ci](li);if(ci==="any"){for(var ui in ii){var di=ii[ui];if(di(li))return!0}return!1}throw new Error("Invalid locale '".concat(ci,"'"))}Ws.exports=ws.default,Ws.exports.default=ws.default}(isLicensePlate,isLicensePlate.exports)),isLicensePlate.exports}var isStrongPassword={exports:{}},hasRequiredIsStrongPassword;function requireIsStrongPassword(){return hasRequiredIsStrongPassword||(hasRequiredIsStrongPassword=1,function(Ws,ws){Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=ga;var oi=ii(requireMerge()),si=ii(requireAssertString());function ii(va){return va&&va.__esModule?va:{default:va}}var ai=/^[A-Z]$/,li=/^[a-z]$/,ci=/^[0-9]$/,ui=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,di={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function hi(va){var ba={};return Array.from(va).forEach(function(wa){var xa=ba[wa];xa?ba[wa]+=1:ba[wa]=1}),ba}function pi(va){var ba=hi(va),wa={length:va.length,uniqueChars:Object.keys(ba).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(ba).forEach(function(xa){ai.test(xa)?wa.uppercaseCount+=ba[xa]:li.test(xa)?wa.lowercaseCount+=ba[xa]:ci.test(xa)?wa.numberCount+=ba[xa]:ui.test(xa)&&(wa.symbolCount+=ba[xa])}),wa}function ha(va,ba){var wa=0;return wa+=va.uniqueChars*ba.pointsPerUnique,wa+=(va.length-va.uniqueChars)*ba.pointsPerRepeat,va.lowercaseCount>0&&(wa+=ba.pointsForContainingLower),va.uppercaseCount>0&&(wa+=ba.pointsForContainingUpper),va.numberCount>0&&(wa+=ba.pointsForContainingNumber),va.symbolCount>0&&(wa+=ba.pointsForContainingSymbol),wa}function ga(va){var ba=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,si.default)(va);var wa=pi(va);return ba=(0,oi.default)(ba||{},di),ba.returnScore?ha(wa,ba):wa.length>=ba.minLength&&wa.lowercaseCount>=ba.minLowercase&&wa.uppercaseCount>=ba.minUppercase&&wa.numberCount>=ba.minNumbers&&wa.symbolCount>=ba.minSymbols}Ws.exports=ws.default,Ws.exports.default=ws.default}(isStrongPassword,isStrongPassword.exports)),isStrongPassword.exports}var isVAT={},hasRequiredIsVAT;function requireIsVAT(){if(hasRequiredIsVAT)return isVAT;hasRequiredIsVAT=1;function Ws(pi){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ha){return typeof ha}:function(ha){return ha&&typeof Symbol=="function"&&ha.constructor===Symbol&&ha!==Symbol.prototype?"symbol":typeof ha},Ws(pi)}Object.defineProperty(isVAT,"__esModule",{value:!0}),isVAT.default=hi,isVAT.vatMatchers=void 0;var ws=ai(requireAssertString()),oi=ii(requireAlgorithms());function si(pi){if(typeof WeakMap!="function")return null;var ha=new WeakMap,ga=new WeakMap;return(si=function(va){return va?ga:ha})(pi)}function ii(pi,ha){if(pi&&pi.__esModule)return pi;if(pi===null||Ws(pi)!="object"&&typeof pi!="function")return{default:pi};var ga=si(ha);if(ga&&ga.has(pi))return ga.get(pi);var va={__proto__:null},ba=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var wa in pi)if(wa!=="default"&&{}.hasOwnProperty.call(pi,wa)){var xa=ba?Object.getOwnPropertyDescriptor(pi,wa):null;xa&&(xa.get||xa.set)?Object.defineProperty(va,wa,xa):va[wa]=pi[wa]}return va.default=pi,ga&&ga.set(pi,va),va}function ai(pi){return pi&&pi.__esModule?pi:{default:pi}}var li=function(pi){var ha=pi.match(/^(AU)?(\d{11})$/);if(!ha)return!1;var ga=[10,1,3,5,7,9,11,13,15,17,19];pi=pi.replace(/^AU/,"");for(var va=(parseInt(pi.slice(0,1),10)-1).toString()+pi.slice(1),ba=0,wa=0;wa<11;wa++)ba+=ga[wa]*va.charAt(wa);return ba!==0&&ba%89===0},ci=function(pi){var ha=function(ga){var va=ga.pop(),ba=[5,4,3,2,7,6,5,4],wa=(11-ga.reduce(function(xa,Ca,el){return xa+Ca*ba[el]},0)%11)%11;return va===wa};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(pi)&&ha(pi.match(/\d/g).map(function(ga){return+ga}))},ui=function(pi){var ha=pi.match(/^(PT)?(\d{9})$/);if(!ha)return!1;var ga=ha[2],va=11-oi.reverseMultiplyAndSum(ga.split("").slice(0,8).map(function(ba){return parseInt(ba,10)}),9)%11;return va>9?parseInt(ga[8],10)===0:va===parseInt(ga[8],10)},di=isVAT.vatMatchers={AT:function(pi){return/^(AT)?U\d{8}$/.test(pi)},BE:function(pi){return/^(BE)?\d{10}$/.test(pi)},BG:function(pi){return/^(BG)?\d{9,10}$/.test(pi)},HR:function(pi){return/^(HR)?\d{11}$/.test(pi)},CY:function(pi){return/^(CY)?\w{9}$/.test(pi)},CZ:function(pi){return/^(CZ)?\d{8,10}$/.test(pi)},DK:function(pi){return/^(DK)?\d{8}$/.test(pi)},EE:function(pi){return/^(EE)?\d{9}$/.test(pi)},FI:function(pi){return/^(FI)?\d{8}$/.test(pi)},FR:function(pi){return/^(FR)?\w{2}\d{9}$/.test(pi)},DE:function(pi){return/^(DE)?\d{9}$/.test(pi)},EL:function(pi){return/^(EL)?\d{9}$/.test(pi)},HU:function(pi){return/^(HU)?\d{8}$/.test(pi)},IE:function(pi){return/^(IE)?\d{7}\w{1}(W)?$/.test(pi)},IT:function(pi){return/^(IT)?\d{11}$/.test(pi)},LV:function(pi){return/^(LV)?\d{11}$/.test(pi)},LT:function(pi){return/^(LT)?\d{9,12}$/.test(pi)},LU:function(pi){return/^(LU)?\d{8}$/.test(pi)},MT:function(pi){return/^(MT)?\d{8}$/.test(pi)},NL:function(pi){return/^(NL)?\d{9}B\d{2}$/.test(pi)},PL:function(pi){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(pi)},PT:ui,RO:function(pi){return/^(RO)?\d{2,10}$/.test(pi)},SK:function(pi){return/^(SK)?\d{10}$/.test(pi)},SI:function(pi){return/^(SI)?\d{8}$/.test(pi)},ES:function(pi){return/^(ES)?\w\d{7}[A-Z]$/.test(pi)},SE:function(pi){return/^(SE)?\d{12}$/.test(pi)},AL:function(pi){return/^(AL)?\w{9}[A-Z]$/.test(pi)},MK:function(pi){return/^(MK)?\d{13}$/.test(pi)},AU:li,BY:function(pi){return/^(УНП )?\d{9}$/.test(pi)},CA:function(pi){return/^(CA)?\d{9}$/.test(pi)},IS:function(pi){return/^(IS)?\d{5,6}$/.test(pi)},IN:function(pi){return/^(IN)?\d{15}$/.test(pi)},ID:function(pi){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(pi)},IL:function(pi){return/^(IL)?\d{9}$/.test(pi)},KZ:function(pi){return/^(KZ)?\d{12}$/.test(pi)},NZ:function(pi){return/^(NZ)?\d{9}$/.test(pi)},NG:function(pi){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(pi)},NO:function(pi){return/^(NO)?\d{9}MVA$/.test(pi)},PH:function(pi){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(pi)},RU:function(pi){return/^(RU)?(\d{10}|\d{12})$/.test(pi)},SM:function(pi){return/^(SM)?\d{5}$/.test(pi)},SA:function(pi){return/^(SA)?\d{15}$/.test(pi)},RS:function(pi){return/^(RS)?\d{9}$/.test(pi)},CH:ci,TR:function(pi){return/^(TR)?\d{10}$/.test(pi)},UA:function(pi){return/^(UA)?\d{12}$/.test(pi)},GB:function(pi){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(pi)},UZ:function(pi){return/^(UZ)?\d{9}$/.test(pi)},AR:function(pi){return/^(AR)?\d{11}$/.test(pi)},BO:function(pi){return/^(BO)?\d{7}$/.test(pi)},BR:function(pi){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(pi)},CL:function(pi){return/^(CL)?\d{8}-\d{1}$/.test(pi)},CO:function(pi){return/^(CO)?\d{10}$/.test(pi)},CR:function(pi){return/^(CR)?\d{9,12}$/.test(pi)},EC:function(pi){return/^(EC)?\d{13}$/.test(pi)},SV:function(pi){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(pi)},GT:function(pi){return/^(GT)?\d{7}-\d{1}$/.test(pi)},HN:function(pi){return/^(HN)?$/.test(pi)},MX:function(pi){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(pi)},NI:function(pi){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(pi)},PA:function(pi){return/^(PA)?$/.test(pi)},PY:function(pi){return/^(PY)?\d{6,8}-\d{1}$/.test(pi)},PE:function(pi){return/^(PE)?\d{11}$/.test(pi)},DO:function(pi){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(pi)},UY:function(pi){return/^(UY)?\d{12}$/.test(pi)},VE:function(pi){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(pi)}};function hi(pi,ha){if((0,ws.default)(pi),(0,ws.default)(ha),ha in di)return di[ha](pi);throw new Error("Invalid country code: '".concat(ha,"'"))}return isVAT}var hasRequiredValidator;function requireValidator(){return hasRequiredValidator||(hasRequiredValidator=1,function(Ws,ws){function oi(Tf){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_f){return typeof _f}:function(_f){return _f&&typeof Symbol=="function"&&_f.constructor===Symbol&&_f!==Symbol.prototype?"symbol":typeof _f},oi(Tf)}Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=void 0;var si=cf(requireToDate()),ii=cf(requireToFloat()),ai=cf(requireToInt()),li=cf(requireToBoolean()),ci=cf(requireEquals()),ui=cf(requireContains()),di=cf(requireMatches()),hi=cf(requireIsEmail()),pi=cf(requireIsURL()),ha=cf(requireIsMACAddress()),ga=cf(requireIsIP()),va=cf(requireIsIPRange()),ba=cf(requireIsFQDN()),wa=cf(requireIsDate()),xa=cf(requireIsTime()),Ca=cf(requireIsBoolean()),el=cf(requireIsLocale()),ku=cf(requireIsAbaRouting()),gd=Lf(requireIsAlpha()),Ed=Lf(requireIsAlphanumeric()),Od=cf(requireIsNumeric()),Nd=cf(requireIsPassportNumber()),Pd=cf(requireIsPort()),Ld=cf(requireIsLowercase()),rf=cf(requireIsUppercase()),kd=cf(requireIsIMEI()),Md=cf(requireIsAscii()),Td=cf(requireIsFullWidth()),wd=cf(requireIsHalfWidth()),Cd=cf(requireIsVariableWidth()),sf=cf(requireIsMultibyte()),of=cf(requireIsSemVer()),Wd=cf(requireIsSurrogatePair()),df=cf(requireIsInt()),hf=Lf(requireIsFloat()),xd=cf(requireIsDecimal()),Fd=cf(requireIsHexadecimal()),Vd=cf(requireIsOctal()),af=cf(requireIsDivisibleBy()),ff=cf(requireIsHexColor()),uf=cf(requireIsRgbColor()),mf=cf(requireIsHSL()),yf=cf(requireIsISRC()),Sf=Lf(requireIsIBAN()),Of=cf(requireIsBIC()),wf=cf(requireIsMD5()),Ef=cf(requireIsHash()),xf=cf(requireIsJWT()),_d=cf(requireIsJSON()),Dd=cf(requireIsEmpty()),tf=cf(requireIsLength()),vd=cf(requireIsByteLength()),Sd=cf(requireIsUUID()),Id=cf(requireIsMongoId()),Bd=cf(requireIsAfter()),nf=cf(requireIsBefore()),lf=cf(requireIsIn()),pf=cf(requireIsLuhnNumber()),gf=cf(requireIsCreditCard()),vf=cf(requireIsIdentityCard()),bf=cf(requireIsEAN()),If=cf(requireIsISIN()),Af=cf(requireIsISBN()),$f=cf(requireIsISSN()),Cf=cf(requireIsTaxID()),kf=Lf(requireIsMobilePhone()),Rf=cf(requireIsEthereumAddress()),Pf=cf(requireIsCurrency()),Ff=cf(requireIsBtcAddress()),jf=requireIsISO6346(),Hf=cf(requireIsISO6391()),Wf=cf(requireIsISO8601()),zf=cf(requireIsRFC3339()),Yf=cf(requireIsISO31661Alpha2()),Xf=cf(requireIsISO31661Alpha3()),Jf=cf(requireIsISO4217()),eh=cf(requireIsBase32()),th=cf(requireIsBase58()),nh=cf(requireIsBase64()),rh=cf(requireIsDataURI()),oh=cf(requireIsMagnetURI()),sh=cf(requireIsMailtoURI()),ih=cf(requireIsMimeType()),ah=cf(requireIsLatLong()),Uf=Lf(requireIsPostalCode()),lh=cf(requireLtrim()),ch=cf(requireRtrim()),uh=cf(requireTrim()),dh=cf(require_escape()),fh=cf(require_unescape()),hh=cf(requireStripLow()),ph=cf(requireWhitelist()),mh=cf(requireBlacklist()),gh=cf(requireIsWhitelisted()),yh=cf(requireNormalizeEmail()),vh=cf(requireIsSlug()),bh=cf(requireIsLicensePlate()),Sh=cf(requireIsStrongPassword()),Th=cf(requireIsVAT());function Qf(Tf){if(typeof WeakMap!="function")return null;var _f=new WeakMap,Nf=new WeakMap;return(Qf=function(Df){return Df?Nf:_f})(Tf)}function Lf(Tf,_f){if(Tf&&Tf.__esModule)return Tf;if(Tf===null||oi(Tf)!="object"&&typeof Tf!="function")return{default:Tf};var Nf=Qf(_f);if(Nf&&Nf.has(Tf))return Nf.get(Tf);var Df={__proto__:null},xh=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Mf in Tf)if(Mf!=="default"&&{}.hasOwnProperty.call(Tf,Mf)){var Vf=xh?Object.getOwnPropertyDescriptor(Tf,Mf):null;Vf&&(Vf.get||Vf.set)?Object.defineProperty(Df,Mf,Vf):Df[Mf]=Tf[Mf]}return Df.default=Tf,Nf&&Nf.set(Tf,Df),Df}function cf(Tf){return Tf&&Tf.__esModule?Tf:{default:Tf}}var Eh="13.12.0",wh={version:Eh,toDate:si.default,toFloat:ii.default,toInt:ai.default,toBoolean:li.default,equals:ci.default,contains:ui.default,matches:di.default,isEmail:hi.default,isURL:pi.default,isMACAddress:ha.default,isIP:ga.default,isIPRange:va.default,isFQDN:ba.default,isBoolean:Ca.default,isIBAN:Sf.default,isBIC:Of.default,isAbaRouting:ku.default,isAlpha:gd.default,isAlphaLocales:gd.locales,isAlphanumeric:Ed.default,isAlphanumericLocales:Ed.locales,isNumeric:Od.default,isPassportNumber:Nd.default,isPort:Pd.default,isLowercase:Ld.default,isUppercase:rf.default,isAscii:Md.default,isFullWidth:Td.default,isHalfWidth:wd.default,isVariableWidth:Cd.default,isMultibyte:sf.default,isSemVer:of.default,isSurrogatePair:Wd.default,isInt:df.default,isIMEI:kd.default,isFloat:hf.default,isFloatLocales:hf.locales,isDecimal:xd.default,isHexadecimal:Fd.default,isOctal:Vd.default,isDivisibleBy:af.default,isHexColor:ff.default,isRgbColor:uf.default,isHSL:mf.default,isISRC:yf.default,isMD5:wf.default,isHash:Ef.default,isJWT:xf.default,isJSON:_d.default,isEmpty:Dd.default,isLength:tf.default,isLocale:el.default,isByteLength:vd.default,isUUID:Sd.default,isMongoId:Id.default,isAfter:Bd.default,isBefore:nf.default,isIn:lf.default,isLuhnNumber:pf.default,isCreditCard:gf.default,isIdentityCard:vf.default,isEAN:bf.default,isISIN:If.default,isISBN:Af.default,isISSN:$f.default,isMobilePhone:kf.default,isMobilePhoneLocales:kf.locales,isPostalCode:Uf.default,isPostalCodeLocales:Uf.locales,isEthereumAddress:Rf.default,isCurrency:Pf.default,isBtcAddress:Ff.default,isISO6346:jf.isISO6346,isFreightContainerID:jf.isFreightContainerID,isISO6391:Hf.default,isISO8601:Wf.default,isRFC3339:zf.default,isISO31661Alpha2:Yf.default,isISO31661Alpha3:Xf.default,isISO4217:Jf.default,isBase32:eh.default,isBase58:th.default,isBase64:nh.default,isDataURI:rh.default,isMagnetURI:oh.default,isMailtoURI:sh.default,isMimeType:ih.default,isLatLong:ah.default,ltrim:lh.default,rtrim:ch.default,trim:uh.default,escape:dh.default,unescape:fh.default,stripLow:hh.default,whitelist:ph.default,blacklist:mh.default,isWhitelisted:gh.default,normalizeEmail:yh.default,toString,isSlug:vh.default,isStrongPassword:Sh.default,isTaxID:Cf.default,isDate:wa.default,isTime:xa.default,isLicensePlate:bh.default,isVAT:Th.default,ibanLocales:Sf.locales};ws.default=wh,Ws.exports=ws.default,Ws.exports.default=ws.default}(validator$1,validator$1.exports)),validator$1.exports}var validatorExports=requireValidator();const validator=Ud(validatorExports);function createNameSchema(Ws={}){const{required:ws=!1,allowEmpty:oi=!1,unique:si=[]}=Ws,ii=oi?h$3.string():h$3.string().min(1),ai=ii.refine(li=>!li&&oi?!0:!si.map(ci=>ci.toLowerCase()).includes(li.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"});return ws?si.length>0?ai:ii:si.length>0?h$3.string().optional().refine(li=>li===void 0||!li&&oi?!0:!si.map(ci=>ci.toLowerCase()).includes(li.replace(/^\s+|\s+$/g,"_").toLowerCase()),{message:"Item with this name already exists"}):h$3.string().optional()}function createConstantCaseSchema(Ws={}){return createNameSchema(Ws).transform(ws=>ws&&ws.toUpperCase()).refine(ws=>!ws||validator.isUppercase(ws),{message:"Must be uppercase"})}function createLowercaseSnakeCaseSchema(Ws={}){return createNameSchema(Ws).transform(ws=>ws&&ws.toLowerCase()).refine(ws=>!ws||validator.isLowercase(ws),{message:"Must be lowercase"})}function toLowercaseSnakeCase(Ws,ws={}){return createLowercaseSnakeCaseSchema(ws).parse(snakeCase(Ws))}function toConstantCase(Ws,ws={}){return createConstantCaseSchema(ws).parse(constantCase(Ws))}h$3.object({name:createNameSchema({allowEmpty:!0}),website:h$3.union([h$3.string().url(),h$3.literal("")]).optional().default("")}).default({name:"",website:""});h$3.string().default("");const s=(Ws,ws,oi)=>{if(Ws&&"reportValidity"in Ws){const si=k$6(oi,ws);Ws.setCustomValidity(si&&si.message||""),Ws.reportValidity()}},o=(Ws,ws)=>{for(const oi in ws.fields){const si=ws.fields[oi];si&&si.ref&&"reportValidity"in si.ref?s(si.ref,oi,Ws):si.refs&&si.refs.forEach(ii=>s(ii,oi,Ws))}},r=(Ws,ws)=>{ws.shouldUseNativeValidation&&o(Ws,ws);const oi={};for(const si in Ws){const ii=k$6(ws.fields,si),ai=Object.assign(Ws[si]||{},{ref:ii&&ii.ref});if(i$1(ws.names||Object.keys(Ws),si)){const li=Object.assign({},k$6(oi,si));J$5(li,"root",ai),J$5(oi,si,li)}else J$5(oi,si,ai)}return oi},i$1=(Ws,ws)=>Ws.some(oi=>oi.startsWith(ws+"."));var n=function(Ws,ws){for(var oi={};Ws.length;){var si=Ws[0],ii=si.code,ai=si.message,li=si.path.join(".");if(!oi[li])if("unionErrors"in si){var ci=si.unionErrors[0].errors[0];oi[li]={message:ci.message,type:ci.code}}else oi[li]={message:ai,type:ii};if("unionErrors"in si&&si.unionErrors.forEach(function(hi){return hi.errors.forEach(function(pi){return Ws.push(pi)})}),ws){var ui=oi[li].types,di=ui&&ui[si.code];oi[li]=xi(li,ws,oi,ii,di?[].concat(di,si.message):si.message)}Ws.shift()}return oi},t$2=function(Ws,ws,oi){return oi===void 0&&(oi={}),function(si,ii,ai){try{return Promise.resolve(function(li,ci){try{var ui=Promise.resolve(Ws[oi.mode==="sync"?"parse":"parseAsync"](si,ws)).then(function(di){return ai.shouldUseNativeValidation&&o({},ai),{errors:{},values:oi.raw?si:di}})}catch(di){return ci(di)}return ui&&ui.then?ui.then(void 0,ci):ui}(0,function(li){if(function(ci){return Array.isArray(ci==null?void 0:ci.errors)}(li))return{values:{},errors:r(n(li.errors,!ai.shouldUseNativeValidation&&ai.criteriaMode==="all"),ai)};throw li}))}catch(li){return Promise.reject(li)}}};const Textarea=forwardRef(({className:Ws,...ws},oi)=>{const si=useRef(null),ii=useCallback(li=>{li.style.height="auto";const ci=Math.max(li.scrollHeight,li.offsetHeight);li.style.height=`${ci}px`},[]),ai=useCallback(li=>{ii(li.currentTarget)},[ii]);return React.useEffect(()=>{si.current&&ii(si.current)},[ii]),useImperativeHandle(oi,()=>({focus:()=>{var li;return(li=si.current)==null?void 0:li.focus()},element:si.current})),jsx("textarea",{...ws,className:cn("min-h-10 w-full resize-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-800 placeholder:text-gray-600 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Ws),ref:si,onInput:ai})});Textarea.displayName="Textarea";const TextField=forwardRef(({name:Ws,value:ws,onSubmit:oi,label:si,placeholder:ii,unique:ai,className:li="",rows:ci=1,focusOnMount:ui=!1,required:di=!1,allowEmpty:hi=!1,shouldReset:pi=!1,onChange:ha},ga)=>{const va=useRef(null);useEffect(()=>{ui&&va.current&&va.current.focus()},[ui]);const ba=h$3.object({[Ws]:createNameSchema({required:di,allowEmpty:hi,unique:ai})}),wa=Gd({resolver:t$2(ba),defaultValues:{[Ws]:ws??""}}),xa=useCallback(gd=>{const Ed=gd[Ws];Ed===void 0||ws===Ed||(oi(Ed),pi&&wa.reset({[Ws]:""}))},[Ws,ws,oi,wa,pi]),Ca=useCallback(async()=>{const gd=wa.getValues()[Ws]??"";if(!(ws==null&&(!gd||gd.trim()===""))&&!compareStringsWithoutWhitespace(gd,ws??""))try{await wa.trigger(),wa.formState.isValid&&await wa.handleSubmit(xa)()}catch{}},[wa,xa,Ws,ws]),el=useCallback(gd=>{gd.key==="Enter"&&(gd.preventDefault(),gd.target.blur())},[]),ku=useCallback(gd=>{const Ed=gd.target.value;ha==null||ha(Ed)},[ha]);return useImperativeHandle(ga,()=>({focus:()=>{var gd;return(gd=va.current)==null?void 0:gd.focus()}})),useEffect(()=>{wa.reset({[Ws]:ws??""})},[wa,Ws,ws]),jsx(Form,{...wa,children:jsx(FormField,{control:wa.control,name:Ws,render:({field:gd})=>jsxs(FormItem,{className:"grid h-full grid-rows-[auto,1fr] gap-2 overflow-visible",children:[!!si&&jsx(FormLabel,{htmlFor:Ws,className:"text-sm font-medium text-gray-700",children:si}),jsx(FormControl,{children:jsx(Textarea,{...gd,id:Ws,ref:Ed=>{Ed&&(gd.ref(Ed.element),va.current=Ed)},placeholder:ii,onBlur:Ca,onChange:Ed=>{gd.onChange(Ed),ku(Ed)},onKeyDown:el,rows:ci,className:li})}),jsx(FormMessage,{})]})})})});TextField.displayName="TextField";function ModuleForm({module:Ws,onAddModule:ws,updateModuleName:oi,modules:si=[]}){const ii=!!Ws,ai=si.map(ci=>ci.name),li=async ci=>{const ui=toLowercaseSnakeCase(ci);ui.length&&(ii?ui!==Ws.name&&oi(Ws.id,ui):await ws(ui))};return jsx(TextField,{name:"name",label:ii?"Module name":"Add module",value:Ws==null?void 0:Ws.name,onSubmit:li,placeholder:"Add module",unique:ai,shouldReset:!ii,required:!0},(Ws==null?void 0:Ws.id)??"new")}const Input=React.forwardRef(({className:Ws,type:ws,...oi},si)=>jsx("input",{type:ws,className:cn("flex h-9 w-full rounded-md border border-gray-400 bg-transparent px-3 py-1 text-sm transition-colors hover:bg-gray-100 focus-visible:bg-gray-200 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Ws),ref:si,...oi}));Input.displayName="Input";let rangeFrom=[],rangeTo=[];(()=>{let Ws="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(ws=>ws?parseInt(ws,36):1);for(let ws=0,oi=0;ws<Ws.length;ws++)(ws%2?rangeTo:rangeFrom).push(oi=oi+Ws[ws])})();function isExtendingChar(Ws){if(Ws<768)return!1;for(let ws=0,oi=rangeFrom.length;;){let si=ws+oi>>1;if(Ws<rangeFrom[si])oi=si;else if(Ws>=rangeTo[si])ws=si+1;else return!0;if(ws==oi)return!1}}function isRegionalIndicator(Ws){return Ws>=127462&&Ws<=127487}const ZWJ=8205;function findClusterBreak$1(Ws,ws,oi=!0,si=!0){return(oi?nextClusterBreak:prevClusterBreak)(Ws,ws,si)}function nextClusterBreak(Ws,ws,oi){if(ws==Ws.length)return ws;ws&&surrogateLow$1(Ws.charCodeAt(ws))&&surrogateHigh$1(Ws.charCodeAt(ws-1))&&ws--;let si=codePointAt$1(Ws,ws);for(ws+=codePointSize$1(si);ws<Ws.length;){let ii=codePointAt$1(Ws,ws);if(si==ZWJ||ii==ZWJ||oi&&isExtendingChar(ii))ws+=codePointSize$1(ii),si=ii;else if(isRegionalIndicator(ii)){let ai=0,li=ws-2;for(;li>=0&&isRegionalIndicator(codePointAt$1(Ws,li));)ai++,li-=2;if(ai%2==0)break;ws+=2}else break}return ws}function prevClusterBreak(Ws,ws,oi){for(;ws>0;){let si=nextClusterBreak(Ws,ws-2,oi);if(si<ws)return si;ws--}return 0}function codePointAt$1(Ws,ws){let oi=Ws.charCodeAt(ws);if(!surrogateHigh$1(oi)||ws+1==Ws.length)return oi;let si=Ws.charCodeAt(ws+1);return surrogateLow$1(si)?(oi-55296<<10)+(si-56320)+65536:oi}function surrogateLow$1(Ws){return Ws>=56320&&Ws<57344}function surrogateHigh$1(Ws){return Ws>=55296&&Ws<56320}function codePointSize$1(Ws){return Ws<65536?1:2}class Text{lineAt(ws){if(ws<0||ws>this.length)throw new RangeError(`Invalid position ${ws} in document of length ${this.length}`);return this.lineInner(ws,!1,1,0)}line(ws){if(ws<1||ws>this.lines)throw new RangeError(`Invalid line number ${ws} in ${this.lines}-line document`);return this.lineInner(ws,!0,1,0)}replace(ws,oi,si){[ws,oi]=clip(this,ws,oi);let ii=[];return this.decompose(0,ws,ii,2),si.length&&si.decompose(0,si.length,ii,3),this.decompose(oi,this.length,ii,1),TextNode.from(ii,this.length-(oi-ws)+si.length)}append(ws){return this.replace(this.length,this.length,ws)}slice(ws,oi=this.length){[ws,oi]=clip(this,ws,oi);let si=[];return this.decompose(ws,oi,si,0),TextNode.from(si,oi-ws)}eq(ws){if(ws==this)return!0;if(ws.length!=this.length||ws.lines!=this.lines)return!1;let oi=this.scanIdentical(ws,1),si=this.length-this.scanIdentical(ws,-1),ii=new RawTextCursor(this),ai=new RawTextCursor(ws);for(let li=oi,ci=oi;;){if(ii.next(li),ai.next(li),li=0,ii.lineBreak!=ai.lineBreak||ii.done!=ai.done||ii.value!=ai.value)return!1;if(ci+=ii.value.length,ii.done||ci>=si)return!0}}iter(ws=1){return new RawTextCursor(this,ws)}iterRange(ws,oi=this.length){return new PartialTextCursor(this,ws,oi)}iterLines(ws,oi){let si;if(ws==null)si=this.iter();else{oi==null&&(oi=this.lines+1);let ii=this.line(ws).from;si=this.iterRange(ii,Math.max(ii,oi==this.lines+1?this.length:oi<=1?0:this.line(oi-1).to))}return new LineCursor(si)}toString(){return this.sliceString(0)}toJSON(){let ws=[];return this.flatten(ws),ws}constructor(){}static of(ws){if(ws.length==0)throw new RangeError("A document must have at least one line");return ws.length==1&&!ws[0]?Text.empty:ws.length<=32?new TextLeaf(ws):TextNode.from(TextLeaf.split(ws,[]))}}class TextLeaf extends Text{constructor(ws,oi=textLength(ws)){super(),this.text=ws,this.length=oi}get lines(){return this.text.length}get children(){return null}lineInner(ws,oi,si,ii){for(let ai=0;;ai++){let li=this.text[ai],ci=ii+li.length;if((oi?si:ci)>=ws)return new Line(ii,ci,si,li);ii=ci+1,si++}}decompose(ws,oi,si,ii){let ai=ws<=0&&oi>=this.length?this:new TextLeaf(sliceText(this.text,ws,oi),Math.min(oi,this.length)-Math.max(0,ws));if(ii&1){let li=si.pop(),ci=appendText(ai.text,li.text.slice(),0,ai.length);if(ci.length<=32)si.push(new TextLeaf(ci,li.length+ai.length));else{let ui=ci.length>>1;si.push(new TextLeaf(ci.slice(0,ui)),new TextLeaf(ci.slice(ui)))}}else si.push(ai)}replace(ws,oi,si){if(!(si instanceof TextLeaf))return super.replace(ws,oi,si);[ws,oi]=clip(this,ws,oi);let ii=appendText(this.text,appendText(si.text,sliceText(this.text,0,ws)),oi),ai=this.length+si.length-(oi-ws);return ii.length<=32?new TextLeaf(ii,ai):TextNode.from(TextLeaf.split(ii,[]),ai)}sliceString(ws,oi=this.length,si=`
313
- `){[ws,oi]=clip(this,ws,oi);let ii="";for(let ai=0,li=0;ai<=oi&&li<this.text.length;li++){let ci=this.text[li],ui=ai+ci.length;ai>ws&&li&&(ii+=si),ws<ui&&oi>ai&&(ii+=ci.slice(Math.max(0,ws-ai),oi-ai)),ai=ui+1}return ii}flatten(ws){for(let oi of this.text)ws.push(oi)}scanIdentical(){return 0}static split(ws,oi){let si=[],ii=-1;for(let ai of ws)si.push(ai),ii+=ai.length+1,si.length==32&&(oi.push(new TextLeaf(si,ii)),si=[],ii=-1);return ii>-1&&oi.push(new TextLeaf(si,ii)),oi}}class TextNode extends Text{constructor(ws,oi){super(),this.children=ws,this.length=oi,this.lines=0;for(let si of ws)this.lines+=si.lines}lineInner(ws,oi,si,ii){for(let ai=0;;ai++){let li=this.children[ai],ci=ii+li.length,ui=si+li.lines-1;if((oi?ui:ci)>=ws)return li.lineInner(ws,oi,si,ii);ii=ci+1,si=ui+1}}decompose(ws,oi,si,ii){for(let ai=0,li=0;li<=oi&&ai<this.children.length;ai++){let ci=this.children[ai],ui=li+ci.length;if(ws<=ui&&oi>=li){let di=ii&((li<=ws?1:0)|(ui>=oi?2:0));li>=ws&&ui<=oi&&!di?si.push(ci):ci.decompose(ws-li,oi-li,si,di)}li=ui+1}}replace(ws,oi,si){if([ws,oi]=clip(this,ws,oi),si.lines<this.lines)for(let ii=0,ai=0;ii<this.children.length;ii++){let li=this.children[ii],ci=ai+li.length;if(ws>=ai&&oi<=ci){let ui=li.replace(ws-ai,oi-ai,si),di=this.lines-li.lines+ui.lines;if(ui.lines<di>>4&&ui.lines>di>>6){let hi=this.children.slice();return hi[ii]=ui,new TextNode(hi,this.length-(oi-ws)+si.length)}return super.replace(ai,ci,ui)}ai=ci+1}return super.replace(ws,oi,si)}sliceString(ws,oi=this.length,si=`
314
- `){[ws,oi]=clip(this,ws,oi);let ii="";for(let ai=0,li=0;ai<this.children.length&&li<=oi;ai++){let ci=this.children[ai],ui=li+ci.length;li>ws&&ai&&(ii+=si),ws<ui&&oi>li&&(ii+=ci.sliceString(ws-li,oi-li,si)),li=ui+1}return ii}flatten(ws){for(let oi of this.children)oi.flatten(ws)}scanIdentical(ws,oi){if(!(ws instanceof TextNode))return 0;let si=0,[ii,ai,li,ci]=oi>0?[0,0,this.children.length,ws.children.length]:[this.children.length-1,ws.children.length-1,-1,-1];for(;;ii+=oi,ai+=oi){if(ii==li||ai==ci)return si;let ui=this.children[ii],di=ws.children[ai];if(ui!=di)return si+ui.scanIdentical(di,oi);si+=ui.length+1}}static from(ws,oi=ws.reduce((si,ii)=>si+ii.length+1,-1)){let si=0;for(let ga of ws)si+=ga.lines;if(si<32){let ga=[];for(let va of ws)va.flatten(ga);return new TextLeaf(ga,oi)}let ii=Math.max(32,si>>5),ai=ii<<1,li=ii>>1,ci=[],ui=0,di=-1,hi=[];function pi(ga){let va;if(ga.lines>ai&&ga instanceof TextNode)for(let ba of ga.children)pi(ba);else ga.lines>li&&(ui>li||!ui)?(ha(),ci.push(ga)):ga instanceof TextLeaf&&ui&&(va=hi[hi.length-1])instanceof TextLeaf&&ga.lines+va.lines<=32?(ui+=ga.lines,di+=ga.length+1,hi[hi.length-1]=new TextLeaf(va.text.concat(ga.text),va.length+1+ga.length)):(ui+ga.lines>ii&&ha(),ui+=ga.lines,di+=ga.length+1,hi.push(ga))}function ha(){ui!=0&&(ci.push(hi.length==1?hi[0]:TextNode.from(hi,di)),di=-1,ui=hi.length=0)}for(let ga of ws)pi(ga);return ha(),ci.length==1?ci[0]:new TextNode(ci,oi)}}Text.empty=new TextLeaf([""],0);function textLength(Ws){let ws=-1;for(let oi of Ws)ws+=oi.length+1;return ws}function appendText(Ws,ws,oi=0,si=1e9){for(let ii=0,ai=0,li=!0;ai<Ws.length&&ii<=si;ai++){let ci=Ws[ai],ui=ii+ci.length;ui>=oi&&(ui>si&&(ci=ci.slice(0,si-ii)),ii<oi&&(ci=ci.slice(oi-ii)),li?(ws[ws.length-1]+=ci,li=!1):ws.push(ci)),ii=ui+1}return ws}function sliceText(Ws,ws,oi){return appendText(Ws,[""],ws,oi)}class RawTextCursor{constructor(ws,oi=1){this.dir=oi,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[ws],this.offsets=[oi>0?1:(ws instanceof TextLeaf?ws.text.length:ws.children.length)<<1]}nextInner(ws,oi){for(this.done=this.lineBreak=!1;;){let si=this.nodes.length-1,ii=this.nodes[si],ai=this.offsets[si],li=ai>>1,ci=ii instanceof TextLeaf?ii.text.length:ii.children.length;if(li==(oi>0?ci:0)){if(si==0)return this.done=!0,this.value="",this;oi>0&&this.offsets[si-1]++,this.nodes.pop(),this.offsets.pop()}else if((ai&1)==(oi>0?0:1)){if(this.offsets[si]+=oi,ws==0)return this.lineBreak=!0,this.value=`
315
- `,this;ws--}else if(ii instanceof TextLeaf){let ui=ii.text[li+(oi<0?-1:0)];if(this.offsets[si]+=oi,ui.length>Math.max(0,ws))return this.value=ws==0?ui:oi>0?ui.slice(ws):ui.slice(0,ui.length-ws),this;ws-=ui.length}else{let ui=ii.children[li+(oi<0?-1:0)];ws>ui.length?(ws-=ui.length,this.offsets[si]+=oi):(oi<0&&this.offsets[si]--,this.nodes.push(ui),this.offsets.push(oi>0?1:(ui instanceof TextLeaf?ui.text.length:ui.children.length)<<1))}}}next(ws=0){return ws<0&&(this.nextInner(-ws,-this.dir),ws=this.value.length),this.nextInner(ws,this.dir)}}class PartialTextCursor{constructor(ws,oi,si){this.value="",this.done=!1,this.cursor=new RawTextCursor(ws,oi>si?-1:1),this.pos=oi>si?ws.length:0,this.from=Math.min(oi,si),this.to=Math.max(oi,si)}nextInner(ws,oi){if(oi<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;ws+=Math.max(0,oi<0?this.pos-this.to:this.from-this.pos);let si=oi<0?this.pos-this.from:this.to-this.pos;ws>si&&(ws=si),si-=ws;let{value:ii}=this.cursor.next(ws);return this.pos+=(ii.length+ws)*oi,this.value=ii.length<=si?ii:oi<0?ii.slice(ii.length-si):ii.slice(0,si),this.done=!this.value,this}next(ws=0){return ws<0?ws=Math.max(ws,this.from-this.pos):ws>0&&(ws=Math.min(ws,this.to-this.pos)),this.nextInner(ws,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(ws){this.inner=ws,this.afterBreak=!0,this.value="",this.done=!1}next(ws=0){let{done:oi,lineBreak:si,value:ii}=this.inner.next(ws);return oi&&this.afterBreak?(this.value="",this.afterBreak=!1):oi?(this.done=!0,this.value=""):si?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=ii,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(ws,oi,si,ii){this.from=ws,this.to=oi,this.number=si,this.text=ii}get length(){return this.to-this.from}}function clip(Ws,ws,oi){return ws=Math.max(0,Math.min(Ws.length,ws)),[ws,Math.max(ws,Math.min(Ws.length,oi))]}function findClusterBreak(Ws,ws,oi=!0,si=!0){return findClusterBreak$1(Ws,ws,oi,si)}function surrogateLow(Ws){return Ws>=56320&&Ws<57344}function surrogateHigh(Ws){return Ws>=55296&&Ws<56320}function codePointAt(Ws,ws){let oi=Ws.charCodeAt(ws);if(!surrogateHigh(oi)||ws+1==Ws.length)return oi;let si=Ws.charCodeAt(ws+1);return surrogateLow(si)?(oi-55296<<10)+(si-56320)+65536:oi}function fromCodePoint(Ws){return Ws<=65535?String.fromCharCode(Ws):(Ws-=65536,String.fromCharCode((Ws>>10)+55296,(Ws&1023)+56320))}function codePointSize(Ws){return Ws<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(Ws){return Ws[Ws.Simple=0]="Simple",Ws[Ws.TrackDel=1]="TrackDel",Ws[Ws.TrackBefore=2]="TrackBefore",Ws[Ws.TrackAfter=3]="TrackAfter",Ws}(MapMode||(MapMode={}));class ChangeDesc{constructor(ws){this.sections=ws}get length(){let ws=0;for(let oi=0;oi<this.sections.length;oi+=2)ws+=this.sections[oi];return ws}get newLength(){let ws=0;for(let oi=0;oi<this.sections.length;oi+=2){let si=this.sections[oi+1];ws+=si<0?this.sections[oi]:si}return ws}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(ws){for(let oi=0,si=0,ii=0;oi<this.sections.length;){let ai=this.sections[oi++],li=this.sections[oi++];li<0?(ws(si,ii,ai),ii+=ai):ii+=li,si+=ai}}iterChangedRanges(ws,oi=!1){iterChanges(this,ws,oi)}get invertedDesc(){let ws=[];for(let oi=0;oi<this.sections.length;){let si=this.sections[oi++],ii=this.sections[oi++];ii<0?ws.push(si,ii):ws.push(ii,si)}return new ChangeDesc(ws)}composeDesc(ws){return this.empty?ws:ws.empty?this:composeSets(this,ws)}mapDesc(ws,oi=!1){return ws.empty?this:mapSet(this,ws,oi)}mapPos(ws,oi=-1,si=MapMode.Simple){let ii=0,ai=0;for(let li=0;li<this.sections.length;){let ci=this.sections[li++],ui=this.sections[li++],di=ii+ci;if(ui<0){if(di>ws)return ai+(ws-ii);ai+=ci}else{if(si!=MapMode.Simple&&di>=ws&&(si==MapMode.TrackDel&&ii<ws&&di>ws||si==MapMode.TrackBefore&&ii<ws||si==MapMode.TrackAfter&&di>ws))return null;if(di>ws||di==ws&&oi<0&&!ci)return ws==ii||oi<0?ai:ai+ui;ai+=ui}ii=di}if(ws>ii)throw new RangeError(`Position ${ws} is out of range for changeset of length ${ii}`);return ai}touchesRange(ws,oi=ws){for(let si=0,ii=0;si<this.sections.length&&ii<=oi;){let ai=this.sections[si++],li=this.sections[si++],ci=ii+ai;if(li>=0&&ii<=oi&&ci>=ws)return ii<ws&&ci>oi?"cover":!0;ii=ci}return!1}toString(){let ws="";for(let oi=0;oi<this.sections.length;){let si=this.sections[oi++],ii=this.sections[oi++];ws+=(ws?" ":"")+si+(ii>=0?":"+ii:"")}return ws}toJSON(){return this.sections}static fromJSON(ws){if(!Array.isArray(ws)||ws.length%2||ws.some(oi=>typeof oi!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(ws)}static create(ws){return new ChangeDesc(ws)}}class ChangeSet extends ChangeDesc{constructor(ws,oi){super(ws),this.inserted=oi}apply(ws){if(this.length!=ws.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(oi,si,ii,ai,li)=>ws=ws.replace(ii,ii+(si-oi),li),!1),ws}mapDesc(ws,oi=!1){return mapSet(this,ws,oi,!0)}invert(ws){let oi=this.sections.slice(),si=[];for(let ii=0,ai=0;ii<oi.length;ii+=2){let li=oi[ii],ci=oi[ii+1];if(ci>=0){oi[ii]=ci,oi[ii+1]=li;let ui=ii>>1;for(;si.length<ui;)si.push(Text.empty);si.push(li?ws.slice(ai,ai+li):Text.empty)}ai+=li}return new ChangeSet(oi,si)}compose(ws){return this.empty?ws:ws.empty?this:composeSets(this,ws,!0)}map(ws,oi=!1){return ws.empty?this:mapSet(this,ws,oi,!0)}iterChanges(ws,oi=!1){iterChanges(this,ws,oi)}get desc(){return ChangeDesc.create(this.sections)}filter(ws){let oi=[],si=[],ii=[],ai=new SectionIter(this);e:for(let li=0,ci=0;;){let ui=li==ws.length?1e9:ws[li++];for(;ci<ui||ci==ui&&ai.len==0;){if(ai.done)break e;let hi=Math.min(ai.len,ui-ci);addSection(ii,hi,-1);let pi=ai.ins==-1?-1:ai.off==0?ai.ins:0;addSection(oi,hi,pi),pi>0&&addInsert(si,oi,ai.text),ai.forward(hi),ci+=hi}let di=ws[li++];for(;ci<di;){if(ai.done)break e;let hi=Math.min(ai.len,di-ci);addSection(oi,hi,-1),addSection(ii,hi,ai.ins==-1?-1:ai.off==0?ai.ins:0),ai.forward(hi),ci+=hi}}return{changes:new ChangeSet(oi,si),filtered:ChangeDesc.create(ii)}}toJSON(){let ws=[];for(let oi=0;oi<this.sections.length;oi+=2){let si=this.sections[oi],ii=this.sections[oi+1];ii<0?ws.push(si):ii==0?ws.push([si]):ws.push([si].concat(this.inserted[oi>>1].toJSON()))}return ws}static of(ws,oi,si){let ii=[],ai=[],li=0,ci=null;function ui(hi=!1){if(!hi&&!ii.length)return;li<oi&&addSection(ii,oi-li,-1);let pi=new ChangeSet(ii,ai);ci=ci?ci.compose(pi.map(ci)):pi,ii=[],ai=[],li=0}function di(hi){if(Array.isArray(hi))for(let pi of hi)di(pi);else if(hi instanceof ChangeSet){if(hi.length!=oi)throw new RangeError(`Mismatched change set length (got ${hi.length}, expected ${oi})`);ui(),ci=ci?ci.compose(hi.map(ci)):hi}else{let{from:pi,to:ha=pi,insert:ga}=hi;if(pi>ha||pi<0||ha>oi)throw new RangeError(`Invalid change range ${pi} to ${ha} (in doc of length ${oi})`);let va=ga?typeof ga=="string"?Text.of(ga.split(si||DefaultSplit)):ga:Text.empty,ba=va.length;if(pi==ha&&ba==0)return;pi<li&&ui(),pi>li&&addSection(ii,pi-li,-1),addSection(ii,ha-pi,ba),addInsert(ai,ii,va),li=ha}}return di(ws),ui(!ci),ci}static empty(ws){return new ChangeSet(ws?[ws,-1]:[],[])}static fromJSON(ws){if(!Array.isArray(ws))throw new RangeError("Invalid JSON representation of ChangeSet");let oi=[],si=[];for(let ii=0;ii<ws.length;ii++){let ai=ws[ii];if(typeof ai=="number")oi.push(ai,-1);else{if(!Array.isArray(ai)||typeof ai[0]!="number"||ai.some((li,ci)=>ci&&typeof li!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(ai.length==1)oi.push(ai[0],0);else{for(;si.length<ii;)si.push(Text.empty);si[ii]=Text.of(ai.slice(1)),oi.push(ai[0],si[ii].length)}}}return new ChangeSet(oi,si)}static createSet(ws,oi){return new ChangeSet(ws,oi)}}function addSection(Ws,ws,oi,si=!1){if(ws==0&&oi<=0)return;let ii=Ws.length-2;ii>=0&&oi<=0&&oi==Ws[ii+1]?Ws[ii]+=ws:ii>=0&&ws==0&&Ws[ii]==0?Ws[ii+1]+=oi:si?(Ws[ii]+=ws,Ws[ii+1]+=oi):Ws.push(ws,oi)}function addInsert(Ws,ws,oi){if(oi.length==0)return;let si=ws.length-2>>1;if(si<Ws.length)Ws[Ws.length-1]=Ws[Ws.length-1].append(oi);else{for(;Ws.length<si;)Ws.push(Text.empty);Ws.push(oi)}}function iterChanges(Ws,ws,oi){let si=Ws.inserted;for(let ii=0,ai=0,li=0;li<Ws.sections.length;){let ci=Ws.sections[li++],ui=Ws.sections[li++];if(ui<0)ii+=ci,ai+=ci;else{let di=ii,hi=ai,pi=Text.empty;for(;di+=ci,hi+=ui,ui&&si&&(pi=pi.append(si[li-2>>1])),!(oi||li==Ws.sections.length||Ws.sections[li+1]<0);)ci=Ws.sections[li++],ui=Ws.sections[li++];ws(ii,di,ai,hi,pi),ii=di,ai=hi}}}function mapSet(Ws,ws,oi,si=!1){let ii=[],ai=si?[]:null,li=new SectionIter(Ws),ci=new SectionIter(ws);for(let ui=-1;;){if(li.done&&ci.len||ci.done&&li.len)throw new Error("Mismatched change set lengths");if(li.ins==-1&&ci.ins==-1){let di=Math.min(li.len,ci.len);addSection(ii,di,-1),li.forward(di),ci.forward(di)}else if(ci.ins>=0&&(li.ins<0||ui==li.i||li.off==0&&(ci.len<li.len||ci.len==li.len&&!oi))){let di=ci.len;for(addSection(ii,ci.ins,-1);di;){let hi=Math.min(li.len,di);li.ins>=0&&ui<li.i&&li.len<=hi&&(addSection(ii,0,li.ins),ai&&addInsert(ai,ii,li.text),ui=li.i),li.forward(hi),di-=hi}ci.next()}else if(li.ins>=0){let di=0,hi=li.len;for(;hi;)if(ci.ins==-1){let pi=Math.min(hi,ci.len);di+=pi,hi-=pi,ci.forward(pi)}else if(ci.ins==0&&ci.len<hi)hi-=ci.len,ci.next();else break;addSection(ii,di,ui<li.i?li.ins:0),ai&&ui<li.i&&addInsert(ai,ii,li.text),ui=li.i,li.forward(li.len-hi)}else{if(li.done&&ci.done)return ai?ChangeSet.createSet(ii,ai):ChangeDesc.create(ii);throw new Error("Mismatched change set lengths")}}}function composeSets(Ws,ws,oi=!1){let si=[],ii=oi?[]:null,ai=new SectionIter(Ws),li=new SectionIter(ws);for(let ci=!1;;){if(ai.done&&li.done)return ii?ChangeSet.createSet(si,ii):ChangeDesc.create(si);if(ai.ins==0)addSection(si,ai.len,0,ci),ai.next();else if(li.len==0&&!li.done)addSection(si,0,li.ins,ci),ii&&addInsert(ii,si,li.text),li.next();else{if(ai.done||li.done)throw new Error("Mismatched change set lengths");{let ui=Math.min(ai.len2,li.len),di=si.length;if(ai.ins==-1){let hi=li.ins==-1?-1:li.off?0:li.ins;addSection(si,ui,hi,ci),ii&&hi&&addInsert(ii,si,li.text)}else li.ins==-1?(addSection(si,ai.off?0:ai.len,ui,ci),ii&&addInsert(ii,si,ai.textBit(ui))):(addSection(si,ai.off?0:ai.len,li.off?0:li.ins,ci),ii&&!li.off&&addInsert(ii,si,li.text));ci=(ai.ins>ui||li.ins>=0&&li.len>ui)&&(ci||si.length>di),ai.forward2(ui),li.forward(ui)}}}}class SectionIter{constructor(ws){this.set=ws,this.i=0,this.next()}next(){let{sections:ws}=this.set;this.i<ws.length?(this.len=ws[this.i++],this.ins=ws[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:ws}=this.set,oi=this.i-2>>1;return oi>=ws.length?Text.empty:ws[oi]}textBit(ws){let{inserted:oi}=this.set,si=this.i-2>>1;return si>=oi.length&&!ws?Text.empty:oi[si].slice(this.off,ws==null?void 0:this.off+ws)}forward(ws){ws==this.len?this.next():(this.len-=ws,this.off+=ws)}forward2(ws){this.ins==-1?this.forward(ws):ws==this.ins?this.next():(this.ins-=ws,this.off+=ws)}}let SelectionRange$1=class Bf{constructor(ws,oi,si){this.from=ws,this.to=oi,this.flags=si}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let ws=this.flags&7;return ws==7?null:ws}get goalColumn(){let ws=this.flags>>6;return ws==16777215?void 0:ws}map(ws,oi=-1){let si,ii;return this.empty?si=ii=ws.mapPos(this.from,oi):(si=ws.mapPos(this.from,1),ii=ws.mapPos(this.to,-1)),si==this.from&&ii==this.to?this:new Bf(si,ii,this.flags)}extend(ws,oi=ws){if(ws<=this.anchor&&oi>=this.anchor)return EditorSelection.range(ws,oi);let si=Math.abs(ws-this.anchor)>Math.abs(oi-this.anchor)?ws:oi;return EditorSelection.range(this.anchor,si)}eq(ws,oi=!1){return this.anchor==ws.anchor&&this.head==ws.head&&(!oi||!this.empty||this.assoc==ws.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(ws){if(!ws||typeof ws.anchor!="number"||typeof ws.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(ws.anchor,ws.head)}static create(ws,oi,si){return new Bf(ws,oi,si)}};class EditorSelection{constructor(ws,oi){this.ranges=ws,this.mainIndex=oi}map(ws,oi=-1){return ws.empty?this:EditorSelection.create(this.ranges.map(si=>si.map(ws,oi)),this.mainIndex)}eq(ws,oi=!1){if(this.ranges.length!=ws.ranges.length||this.mainIndex!=ws.mainIndex)return!1;for(let si=0;si<this.ranges.length;si++)if(!this.ranges[si].eq(ws.ranges[si],oi))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main],0)}addRange(ws,oi=!0){return EditorSelection.create([ws].concat(this.ranges),oi?0:this.mainIndex+1)}replaceRange(ws,oi=this.mainIndex){let si=this.ranges.slice();return si[oi]=ws,EditorSelection.create(si,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(ws=>ws.toJSON()),main:this.mainIndex}}static fromJSON(ws){if(!ws||!Array.isArray(ws.ranges)||typeof ws.main!="number"||ws.main>=ws.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(ws.ranges.map(oi=>SelectionRange$1.fromJSON(oi)),ws.main)}static single(ws,oi=ws){return new EditorSelection([EditorSelection.range(ws,oi)],0)}static create(ws,oi=0){if(ws.length==0)throw new RangeError("A selection needs at least one range");for(let si=0,ii=0;ii<ws.length;ii++){let ai=ws[ii];if(ai.empty?ai.from<=si:ai.from<si)return EditorSelection.normalized(ws.slice(),oi);si=ai.to}return new EditorSelection(ws,oi)}static cursor(ws,oi=0,si,ii){return SelectionRange$1.create(ws,ws,(oi==0?0:oi<0?8:16)|(si==null?7:Math.min(6,si))|(ii??16777215)<<6)}static range(ws,oi,si,ii){let ai=(si??16777215)<<6|(ii==null?7:Math.min(6,ii));return oi<ws?SelectionRange$1.create(oi,ws,48|ai):SelectionRange$1.create(ws,oi,(oi>ws?8:0)|ai)}static normalized(ws,oi=0){let si=ws[oi];ws.sort((ii,ai)=>ii.from-ai.from),oi=ws.indexOf(si);for(let ii=1;ii<ws.length;ii++){let ai=ws[ii],li=ws[ii-1];if(ai.empty?ai.from<=li.to:ai.from<li.to){let ci=li.from,ui=Math.max(ai.to,li.to);ii<=oi&&oi--,ws.splice(--ii,2,ai.anchor>ai.head?EditorSelection.range(ui,ci):EditorSelection.range(ci,ui))}}return new EditorSelection(ws,oi)}}function checkSelection(Ws,ws){for(let oi of Ws.ranges)if(oi.to>ws)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(ws,oi,si,ii,ai){this.combine=ws,this.compareInput=oi,this.compare=si,this.isStatic=ii,this.id=nextID++,this.default=ws([]),this.extensions=typeof ai=="function"?ai(this):ai}get reader(){return this}static define(ws={}){return new Facet(ws.combine||(oi=>oi),ws.compareInput||((oi,si)=>oi===si),ws.compare||(ws.combine?(oi,si)=>oi===si:sameArray$1),!!ws.static,ws.enables)}of(ws){return new FacetProvider([],this,0,ws)}compute(ws,oi){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(ws,this,1,oi)}computeN(ws,oi){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(ws,this,2,oi)}from(ws,oi){return oi||(oi=si=>si),this.compute([ws],si=>oi(si.field(ws)))}}function sameArray$1(Ws,ws){return Ws==ws||Ws.length==ws.length&&Ws.every((oi,si)=>oi===ws[si])}class FacetProvider{constructor(ws,oi,si,ii){this.dependencies=ws,this.facet=oi,this.type=si,this.value=ii,this.id=nextID++}dynamicSlot(ws){var oi;let si=this.value,ii=this.facet.compareInput,ai=this.id,li=ws[ai]>>1,ci=this.type==2,ui=!1,di=!1,hi=[];for(let pi of this.dependencies)pi=="doc"?ui=!0:pi=="selection"?di=!0:((oi=ws[pi.id])!==null&&oi!==void 0?oi:1)&1||hi.push(ws[pi.id]);return{create(pi){return pi.values[li]=si(pi),1},update(pi,ha){if(ui&&ha.docChanged||di&&(ha.docChanged||ha.selection)||ensureAll(pi,hi)){let ga=si(pi);if(ci?!compareArray(ga,pi.values[li],ii):!ii(ga,pi.values[li]))return pi.values[li]=ga,1}return 0},reconfigure:(pi,ha)=>{let ga,va=ha.config.address[ai];if(va!=null){let ba=getAddr(ha,va);if(this.dependencies.every(wa=>wa instanceof Facet?ha.facet(wa)===pi.facet(wa):wa instanceof StateField?ha.field(wa,!1)==pi.field(wa,!1):!0)||(ci?compareArray(ga=si(pi),ba,ii):ii(ga=si(pi),ba)))return pi.values[li]=ba,0}else ga=si(pi);return pi.values[li]=ga,1}}}}function compareArray(Ws,ws,oi){if(Ws.length!=ws.length)return!1;for(let si=0;si<Ws.length;si++)if(!oi(Ws[si],ws[si]))return!1;return!0}function ensureAll(Ws,ws){let oi=!1;for(let si of ws)ensureAddr(Ws,si)&1&&(oi=!0);return oi}function dynamicFacetSlot(Ws,ws,oi){let si=oi.map(ui=>Ws[ui.id]),ii=oi.map(ui=>ui.type),ai=si.filter(ui=>!(ui&1)),li=Ws[ws.id]>>1;function ci(ui){let di=[];for(let hi=0;hi<si.length;hi++){let pi=getAddr(ui,si[hi]);if(ii[hi]==2)for(let ha of pi)di.push(ha);else di.push(pi)}return ws.combine(di)}return{create(ui){for(let di of si)ensureAddr(ui,di);return ui.values[li]=ci(ui),1},update(ui,di){if(!ensureAll(ui,ai))return 0;let hi=ci(ui);return ws.compare(hi,ui.values[li])?0:(ui.values[li]=hi,1)},reconfigure(ui,di){let hi=ensureAll(ui,si),pi=di.config.facets[ws.id],ha=di.facet(ws);if(pi&&!hi&&sameArray$1(oi,pi))return ui.values[li]=ha,0;let ga=ci(ui);return ws.compare(ga,ha)?(ui.values[li]=ha,0):(ui.values[li]=ga,1)}}}const initField=Facet.define({static:!0});class StateField{constructor(ws,oi,si,ii,ai){this.id=ws,this.createF=oi,this.updateF=si,this.compareF=ii,this.spec=ai,this.provides=void 0}static define(ws){let oi=new StateField(nextID++,ws.create,ws.update,ws.compare||((si,ii)=>si===ii),ws);return ws.provide&&(oi.provides=ws.provide(oi)),oi}create(ws){let oi=ws.facet(initField).find(si=>si.field==this);return((oi==null?void 0:oi.create)||this.createF)(ws)}slot(ws){let oi=ws[this.id]>>1;return{create:si=>(si.values[oi]=this.create(si),1),update:(si,ii)=>{let ai=si.values[oi],li=this.updateF(ai,ii);return this.compareF(ai,li)?0:(si.values[oi]=li,1)},reconfigure:(si,ii)=>ii.config.address[this.id]!=null?(si.values[oi]=ii.field(this),0):(si.values[oi]=this.create(si),1)}}init(ws){return[this,initField.of({field:this,create:ws})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(Ws){return ws=>new PrecExtension(ws,Ws)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(ws,oi){this.inner=ws,this.prec=oi}}class Compartment{of(ws){return new CompartmentInstance(this,ws)}reconfigure(ws){return Compartment.reconfigure.of({compartment:this,extension:ws})}get(ws){return ws.config.compartments.get(this)}}class CompartmentInstance{constructor(ws,oi){this.compartment=ws,this.inner=oi}}class Configuration{constructor(ws,oi,si,ii,ai,li){for(this.base=ws,this.compartments=oi,this.dynamicSlots=si,this.address=ii,this.staticValues=ai,this.facets=li,this.statusTemplate=[];this.statusTemplate.length<si.length;)this.statusTemplate.push(0)}staticFacet(ws){let oi=this.address[ws.id];return oi==null?ws.default:this.staticValues[oi>>1]}static resolve(ws,oi,si){let ii=[],ai=Object.create(null),li=new Map;for(let ha of flatten(ws,oi,li))ha instanceof StateField?ii.push(ha):(ai[ha.facet.id]||(ai[ha.facet.id]=[])).push(ha);let ci=Object.create(null),ui=[],di=[];for(let ha of ii)ci[ha.id]=di.length<<1,di.push(ga=>ha.slot(ga));let hi=si==null?void 0:si.config.facets;for(let ha in ai){let ga=ai[ha],va=ga[0].facet,ba=hi&&hi[ha]||[];if(ga.every(wa=>wa.type==0))if(ci[va.id]=ui.length<<1|1,sameArray$1(ba,ga))ui.push(si.facet(va));else{let wa=va.combine(ga.map(xa=>xa.value));ui.push(si&&va.compare(wa,si.facet(va))?si.facet(va):wa)}else{for(let wa of ga)wa.type==0?(ci[wa.id]=ui.length<<1|1,ui.push(wa.value)):(ci[wa.id]=di.length<<1,di.push(xa=>wa.dynamicSlot(xa)));ci[va.id]=di.length<<1,di.push(wa=>dynamicFacetSlot(wa,va,ga))}}let pi=di.map(ha=>ha(ci));return new Configuration(ws,li,pi,ci,ui,ai)}}function flatten(Ws,ws,oi){let si=[[],[],[],[],[]],ii=new Map;function ai(li,ci){let ui=ii.get(li);if(ui!=null){if(ui<=ci)return;let di=si[ui].indexOf(li);di>-1&&si[ui].splice(di,1),li instanceof CompartmentInstance&&oi.delete(li.compartment)}if(ii.set(li,ci),Array.isArray(li))for(let di of li)ai(di,ci);else if(li instanceof CompartmentInstance){if(oi.has(li.compartment))throw new RangeError("Duplicate use of compartment in extensions");let di=ws.get(li.compartment)||li.inner;oi.set(li.compartment,di),ai(di,ci)}else if(li instanceof PrecExtension)ai(li.inner,li.prec);else if(li instanceof StateField)si[ci].push(li),li.provides&&ai(li.provides,ci);else if(li instanceof FacetProvider)si[ci].push(li),li.facet.extensions&&ai(li.facet.extensions,Prec_.default);else{let di=li.extension;if(!di)throw new Error(`Unrecognized extension value in extension set (${li}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);ai(di,ci)}}return ai(Ws,Prec_.default),si.reduce((li,ci)=>li.concat(ci))}function ensureAddr(Ws,ws){if(ws&1)return 2;let oi=ws>>1,si=Ws.status[oi];if(si==4)throw new Error("Cyclic dependency between fields and/or facets");if(si&2)return si;Ws.status[oi]=4;let ii=Ws.computeSlot(Ws,Ws.config.dynamicSlots[oi]);return Ws.status[oi]=2|ii}function getAddr(Ws,ws){return ws&1?Ws.config.staticValues[ws>>1]:Ws.values[ws>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:Ws=>Ws.some(ws=>ws),static:!0}),lineSeparator=Facet.define({combine:Ws=>Ws.length?Ws[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:Ws=>Ws.length?Ws[0]:!1});class Annotation{constructor(ws,oi){this.type=ws,this.value=oi}static define(){return new AnnotationType}}class AnnotationType{of(ws){return new Annotation(this,ws)}}class StateEffectType{constructor(ws){this.map=ws}of(ws){return new StateEffect(this,ws)}}class StateEffect{constructor(ws,oi){this.type=ws,this.value=oi}map(ws){let oi=this.type.map(this.value,ws);return oi===void 0?void 0:oi==this.value?this:new StateEffect(this.type,oi)}is(ws){return this.type==ws}static define(ws={}){return new StateEffectType(ws.map||(oi=>oi))}static mapEffects(ws,oi){if(!ws.length)return ws;let si=[];for(let ii of ws){let ai=ii.map(oi);ai&&si.push(ai)}return si}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(ws,oi,si,ii,ai,li){this.startState=ws,this.changes=oi,this.selection=si,this.effects=ii,this.annotations=ai,this.scrollIntoView=li,this._doc=null,this._state=null,si&&checkSelection(si,oi.newLength),ai.some(ci=>ci.type==Transaction.time)||(this.annotations=ai.concat(Transaction.time.of(Date.now())))}static create(ws,oi,si,ii,ai,li){return new Transaction(ws,oi,si,ii,ai,li)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(ws){for(let oi of this.annotations)if(oi.type==ws)return oi.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(ws){let oi=this.annotation(Transaction.userEvent);return!!(oi&&(oi==ws||oi.length>ws.length&&oi.slice(0,ws.length)==ws&&oi[ws.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(Ws,ws){let oi=[];for(let si=0,ii=0;;){let ai,li;if(si<Ws.length&&(ii==ws.length||ws[ii]>=Ws[si]))ai=Ws[si++],li=Ws[si++];else if(ii<ws.length)ai=ws[ii++],li=ws[ii++];else return oi;!oi.length||oi[oi.length-1]<ai?oi.push(ai,li):oi[oi.length-1]<li&&(oi[oi.length-1]=li)}}function mergeTransaction(Ws,ws,oi){var si;let ii,ai,li;return oi?(ii=ws.changes,ai=ChangeSet.empty(ws.changes.length),li=Ws.changes.compose(ws.changes)):(ii=ws.changes.map(Ws.changes),ai=Ws.changes.mapDesc(ws.changes,!0),li=Ws.changes.compose(ii)),{changes:li,selection:ws.selection?ws.selection.map(ai):(si=Ws.selection)===null||si===void 0?void 0:si.map(ii),effects:StateEffect.mapEffects(Ws.effects,ii).concat(StateEffect.mapEffects(ws.effects,ai)),annotations:Ws.annotations.length?Ws.annotations.concat(ws.annotations):ws.annotations,scrollIntoView:Ws.scrollIntoView||ws.scrollIntoView}}function resolveTransactionInner(Ws,ws,oi){let si=ws.selection,ii=asArray$2(ws.annotations);return ws.userEvent&&(ii=ii.concat(Transaction.userEvent.of(ws.userEvent))),{changes:ws.changes instanceof ChangeSet?ws.changes:ChangeSet.of(ws.changes||[],oi,Ws.facet(lineSeparator)),selection:si&&(si instanceof EditorSelection?si:EditorSelection.single(si.anchor,si.head)),effects:asArray$2(ws.effects),annotations:ii,scrollIntoView:!!ws.scrollIntoView}}function resolveTransaction(Ws,ws,oi){let si=resolveTransactionInner(Ws,ws.length?ws[0]:{},Ws.doc.length);ws.length&&ws[0].filter===!1&&(oi=!1);for(let ai=1;ai<ws.length;ai++){ws[ai].filter===!1&&(oi=!1);let li=!!ws[ai].sequential;si=mergeTransaction(si,resolveTransactionInner(Ws,ws[ai],li?si.changes.newLength:Ws.doc.length),li)}let ii=Transaction.create(Ws,si.changes,si.selection,si.effects,si.annotations,si.scrollIntoView);return extendTransaction(oi?filterTransaction(ii):ii)}function filterTransaction(Ws){let ws=Ws.startState,oi=!0;for(let ii of ws.facet(changeFilter)){let ai=ii(Ws);if(ai===!1){oi=!1;break}Array.isArray(ai)&&(oi=oi===!0?ai:joinRanges(oi,ai))}if(oi!==!0){let ii,ai;if(oi===!1)ai=Ws.changes.invertedDesc,ii=ChangeSet.empty(ws.doc.length);else{let li=Ws.changes.filter(oi);ii=li.changes,ai=li.filtered.mapDesc(li.changes).invertedDesc}Ws=Transaction.create(ws,ii,Ws.selection&&Ws.selection.map(ai),StateEffect.mapEffects(Ws.effects,ai),Ws.annotations,Ws.scrollIntoView)}let si=ws.facet(transactionFilter);for(let ii=si.length-1;ii>=0;ii--){let ai=si[ii](Ws);ai instanceof Transaction?Ws=ai:Array.isArray(ai)&&ai.length==1&&ai[0]instanceof Transaction?Ws=ai[0]:Ws=resolveTransaction(ws,asArray$2(ai),!1)}return Ws}function extendTransaction(Ws){let ws=Ws.startState,oi=ws.facet(transactionExtender),si=Ws;for(let ii=oi.length-1;ii>=0;ii--){let ai=oi[ii](Ws);ai&&Object.keys(ai).length&&(si=mergeTransaction(si,resolveTransactionInner(ws,ai,Ws.changes.newLength),!0))}return si==Ws?Ws:Transaction.create(ws,Ws.changes,Ws.selection,si.effects,si.annotations,si.scrollIntoView)}const none$2=[];function asArray$2(Ws){return Ws==null?none$2:Array.isArray(Ws)?Ws:[Ws]}var CharCategory=function(Ws){return Ws[Ws.Word=0]="Word",Ws[Ws.Space=1]="Space",Ws[Ws.Other=2]="Other",Ws}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Ws){}function hasWordChar(Ws){if(wordChar)return wordChar.test(Ws);for(let ws=0;ws<Ws.length;ws++){let oi=Ws[ws];if(/\w/.test(oi)||oi>"€"&&(oi.toUpperCase()!=oi.toLowerCase()||nonASCIISingleCaseWordChar.test(oi)))return!0}return!1}function makeCategorizer(Ws){return ws=>{if(!/\S/.test(ws))return CharCategory.Space;if(hasWordChar(ws))return CharCategory.Word;for(let oi=0;oi<Ws.length;oi++)if(ws.indexOf(Ws[oi])>-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(ws,oi,si,ii,ai,li){this.config=ws,this.doc=oi,this.selection=si,this.values=ii,this.status=ws.statusTemplate.slice(),this.computeSlot=ai,li&&(li._state=this);for(let ci=0;ci<this.config.dynamicSlots.length;ci++)ensureAddr(this,ci<<1);this.computeSlot=null}field(ws,oi=!0){let si=this.config.address[ws.id];if(si==null){if(oi)throw new RangeError("Field is not present in this state");return}return ensureAddr(this,si),getAddr(this,si)}update(...ws){return resolveTransaction(this,ws,!0)}applyTransaction(ws){let oi=this.config,{base:si,compartments:ii}=oi;for(let ci of ws.effects)ci.is(Compartment.reconfigure)?(oi&&(ii=new Map,oi.compartments.forEach((ui,di)=>ii.set(di,ui)),oi=null),ii.set(ci.value.compartment,ci.value.extension)):ci.is(StateEffect.reconfigure)?(oi=null,si=ci.value):ci.is(StateEffect.appendConfig)&&(oi=null,si=asArray$2(si).concat(ci.value));let ai;oi?ai=ws.startState.values.slice():(oi=Configuration.resolve(si,ii,this),ai=new EditorState(oi,this.doc,this.selection,oi.dynamicSlots.map(()=>null),(ci,ui)=>ui.reconfigure(ci,this),null).values);let li=ws.startState.facet(allowMultipleSelections)?ws.newSelection:ws.newSelection.asSingle();new EditorState(oi,ws.newDoc,li,ai,(ci,ui)=>ui.update(ci,ws),ws)}replaceSelection(ws){return typeof ws=="string"&&(ws=this.toText(ws)),this.changeByRange(oi=>({changes:{from:oi.from,to:oi.to,insert:ws},range:EditorSelection.cursor(oi.from+ws.length)}))}changeByRange(ws){let oi=this.selection,si=ws(oi.ranges[0]),ii=this.changes(si.changes),ai=[si.range],li=asArray$2(si.effects);for(let ci=1;ci<oi.ranges.length;ci++){let ui=ws(oi.ranges[ci]),di=this.changes(ui.changes),hi=di.map(ii);for(let ha=0;ha<ci;ha++)ai[ha]=ai[ha].map(hi);let pi=ii.mapDesc(di,!0);ai.push(ui.range.map(pi)),ii=ii.compose(hi),li=StateEffect.mapEffects(li,hi).concat(StateEffect.mapEffects(asArray$2(ui.effects),pi))}return{changes:ii,selection:EditorSelection.create(ai,oi.mainIndex),effects:li}}changes(ws=[]){return ws instanceof ChangeSet?ws:ChangeSet.of(ws,this.doc.length,this.facet(EditorState.lineSeparator))}toText(ws){return Text.of(ws.split(this.facet(EditorState.lineSeparator)||DefaultSplit))}sliceDoc(ws=0,oi=this.doc.length){return this.doc.sliceString(ws,oi,this.lineBreak)}facet(ws){let oi=this.config.address[ws.id];return oi==null?ws.default:(ensureAddr(this,oi),getAddr(this,oi))}toJSON(ws){let oi={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(ws)for(let si in ws){let ii=ws[si];ii instanceof StateField&&this.config.address[ii.id]!=null&&(oi[si]=ii.spec.toJSON(this.field(ws[si]),this))}return oi}static fromJSON(ws,oi={},si){if(!ws||typeof ws.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let ii=[];if(si){for(let ai in si)if(Object.prototype.hasOwnProperty.call(ws,ai)){let li=si[ai],ci=ws[ai];ii.push(li.init(ui=>li.spec.fromJSON(ci,ui)))}}return EditorState.create({doc:ws.doc,selection:EditorSelection.fromJSON(ws.selection),extensions:oi.extensions?ii.concat([oi.extensions]):ii})}static create(ws={}){let oi=Configuration.resolve(ws.extensions||[],new Map),si=ws.doc instanceof Text?ws.doc:Text.of((ws.doc||"").split(oi.staticFacet(EditorState.lineSeparator)||DefaultSplit)),ii=ws.selection?ws.selection instanceof EditorSelection?ws.selection:EditorSelection.single(ws.selection.anchor,ws.selection.head):EditorSelection.single(0);return checkSelection(ii,si.length),oi.staticFacet(allowMultipleSelections)||(ii=ii.asSingle()),new EditorState(oi,si,ii,oi.dynamicSlots.map(()=>null),(ai,li)=>li.create(ai),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
316
- `}get readOnly(){return this.facet(readOnly)}phrase(ws,...oi){for(let si of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(si,ws)){ws=si[ws];break}return oi.length&&(ws=ws.replace(/\$(\$|\d*)/g,(si,ii)=>{if(ii=="$")return"$";let ai=+(ii||1);return!ai||ai>oi.length?si:oi[ai-1]})),ws}languageDataAt(ws,oi,si=-1){let ii=[];for(let ai of this.facet(languageData))for(let li of ai(this,oi,si))Object.prototype.hasOwnProperty.call(li,ws)&&ii.push(li[ws]);return ii}charCategorizer(ws){return makeCategorizer(this.languageDataAt("wordChars",ws).join(""))}wordAt(ws){let{text:oi,from:si,length:ii}=this.doc.lineAt(ws),ai=this.charCategorizer(ws),li=ws-si,ci=ws-si;for(;li>0;){let ui=findClusterBreak(oi,li,!1);if(ai(oi.slice(ui,li))!=CharCategory.Word)break;li=ui}for(;ci<ii;){let ui=findClusterBreak(oi,ci);if(ai(oi.slice(ci,ui))!=CharCategory.Word)break;ci=ui}return li==ci?null:EditorSelection.range(li+si,ci+si)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:Ws=>Ws.length?Ws[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(Ws,ws){let oi=Object.keys(Ws),si=Object.keys(ws);return oi.length==si.length&&oi.every(ii=>Ws[ii]==ws[ii])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(Ws,ws,oi={}){let si={};for(let ii of Ws)for(let ai of Object.keys(ii)){let li=ii[ai],ci=si[ai];if(ci===void 0)si[ai]=li;else if(!(ci===li||li===void 0))if(Object.hasOwnProperty.call(oi,ai))si[ai]=oi[ai](ci,li);else throw new Error("Config merge conflict for field "+ai)}for(let ii in ws)si[ii]===void 0&&(si[ii]=ws[ii]);return si}class RangeValue{eq(ws){return this==ws}range(ws,oi=ws){return Range$3.create(ws,oi,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;let Range$3=class Zf{constructor(ws,oi,si){this.from=ws,this.to=oi,this.value=si}static create(ws,oi,si){return new Zf(ws,oi,si)}};function cmpRange(Ws,ws){return Ws.from-ws.from||Ws.value.startSide-ws.value.startSide}class Chunk{constructor(ws,oi,si,ii){this.from=ws,this.to=oi,this.value=si,this.maxPoint=ii}get length(){return this.to[this.to.length-1]}findIndex(ws,oi,si,ii=0){let ai=si?this.to:this.from;for(let li=ii,ci=ai.length;;){if(li==ci)return li;let ui=li+ci>>1,di=ai[ui]-ws||(si?this.value[ui].endSide:this.value[ui].startSide)-oi;if(ui==li)return di>=0?li:ci;di>=0?ci=ui:li=ui+1}}between(ws,oi,si,ii){for(let ai=this.findIndex(oi,-1e9,!0),li=this.findIndex(si,1e9,!1,ai);ai<li;ai++)if(ii(this.from[ai]+ws,this.to[ai]+ws,this.value[ai])===!1)return!1}map(ws,oi){let si=[],ii=[],ai=[],li=-1,ci=-1;for(let ui=0;ui<this.value.length;ui++){let di=this.value[ui],hi=this.from[ui]+ws,pi=this.to[ui]+ws,ha,ga;if(hi==pi){let va=oi.mapPos(hi,di.startSide,di.mapMode);if(va==null||(ha=ga=va,di.startSide!=di.endSide&&(ga=oi.mapPos(hi,di.endSide),ga<ha)))continue}else if(ha=oi.mapPos(hi,di.startSide),ga=oi.mapPos(pi,di.endSide),ha>ga||ha==ga&&di.startSide>0&&di.endSide<=0)continue;(ga-ha||di.endSide-di.startSide)<0||(li<0&&(li=ha),di.point&&(ci=Math.max(ci,ga-ha)),si.push(di),ii.push(ha-li),ai.push(ga-li))}return{mapped:si.length?new Chunk(ii,ai,si,ci):null,pos:li}}}class RangeSet{constructor(ws,oi,si,ii){this.chunkPos=ws,this.chunk=oi,this.nextLayer=si,this.maxPoint=ii}static create(ws,oi,si,ii){return new RangeSet(ws,oi,si,ii)}get length(){let ws=this.chunk.length-1;return ws<0?0:Math.max(this.chunkEnd(ws),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let ws=this.nextLayer.size;for(let oi of this.chunk)ws+=oi.value.length;return ws}chunkEnd(ws){return this.chunkPos[ws]+this.chunk[ws].length}update(ws){let{add:oi=[],sort:si=!1,filterFrom:ii=0,filterTo:ai=this.length}=ws,li=ws.filter;if(oi.length==0&&!li)return this;if(si&&(oi=oi.slice().sort(cmpRange)),this.isEmpty)return oi.length?RangeSet.of(oi):this;let ci=new LayerCursor(this,null,-1).goto(0),ui=0,di=[],hi=new RangeSetBuilder;for(;ci.value||ui<oi.length;)if(ui<oi.length&&(ci.from-oi[ui].from||ci.startSide-oi[ui].value.startSide)>=0){let pi=oi[ui++];hi.addInner(pi.from,pi.to,pi.value)||di.push(pi)}else ci.rangeIndex==1&&ci.chunkIndex<this.chunk.length&&(ui==oi.length||this.chunkEnd(ci.chunkIndex)<oi[ui].from)&&(!li||ii>this.chunkEnd(ci.chunkIndex)||ai<this.chunkPos[ci.chunkIndex])&&hi.addChunk(this.chunkPos[ci.chunkIndex],this.chunk[ci.chunkIndex])?ci.nextChunk():((!li||ii>ci.to||ai<ci.from||li(ci.from,ci.to,ci.value))&&(hi.addInner(ci.from,ci.to,ci.value)||di.push(Range$3.create(ci.from,ci.to,ci.value))),ci.next());return hi.finishInner(this.nextLayer.isEmpty&&!di.length?RangeSet.empty:this.nextLayer.update({add:di,filter:li,filterFrom:ii,filterTo:ai}))}map(ws){if(ws.empty||this.isEmpty)return this;let oi=[],si=[],ii=-1;for(let li=0;li<this.chunk.length;li++){let ci=this.chunkPos[li],ui=this.chunk[li],di=ws.touchesRange(ci,ci+ui.length);if(di===!1)ii=Math.max(ii,ui.maxPoint),oi.push(ui),si.push(ws.mapPos(ci));else if(di===!0){let{mapped:hi,pos:pi}=ui.map(ci,ws);hi&&(ii=Math.max(ii,hi.maxPoint),oi.push(hi),si.push(pi))}}let ai=this.nextLayer.map(ws);return oi.length==0?ai:new RangeSet(si,oi,ai||RangeSet.empty,ii)}between(ws,oi,si){if(!this.isEmpty){for(let ii=0;ii<this.chunk.length;ii++){let ai=this.chunkPos[ii],li=this.chunk[ii];if(oi>=ai&&ws<=ai+li.length&&li.between(ai,ws-ai,oi-ai,si)===!1)return}this.nextLayer.between(ws,oi,si)}}iter(ws=0){return HeapCursor.from([this]).goto(ws)}get isEmpty(){return this.nextLayer==this}static iter(ws,oi=0){return HeapCursor.from(ws).goto(oi)}static compare(ws,oi,si,ii,ai=-1){let li=ws.filter(pi=>pi.maxPoint>0||!pi.isEmpty&&pi.maxPoint>=ai),ci=oi.filter(pi=>pi.maxPoint>0||!pi.isEmpty&&pi.maxPoint>=ai),ui=findSharedChunks(li,ci,si),di=new SpanCursor(li,ui,ai),hi=new SpanCursor(ci,ui,ai);si.iterGaps((pi,ha,ga)=>compare(di,pi,hi,ha,ga,ii)),si.empty&&si.length==0&&compare(di,0,hi,0,0,ii)}static eq(ws,oi,si=0,ii){ii==null&&(ii=999999999);let ai=ws.filter(hi=>!hi.isEmpty&&oi.indexOf(hi)<0),li=oi.filter(hi=>!hi.isEmpty&&ws.indexOf(hi)<0);if(ai.length!=li.length)return!1;if(!ai.length)return!0;let ci=findSharedChunks(ai,li),ui=new SpanCursor(ai,ci,0).goto(si),di=new SpanCursor(li,ci,0).goto(si);for(;;){if(ui.to!=di.to||!sameValues(ui.active,di.active)||ui.point&&(!di.point||!ui.point.eq(di.point)))return!1;if(ui.to>ii)return!0;ui.next(),di.next()}}static spans(ws,oi,si,ii,ai=-1){let li=new SpanCursor(ws,null,ai).goto(oi),ci=oi,ui=li.openStart;for(;;){let di=Math.min(li.to,si);if(li.point){let hi=li.activeForPoint(li.to),pi=li.pointFrom<oi?hi.length+1:li.point.startSide<0?hi.length:Math.min(hi.length,ui);ii.point(ci,di,li.point,hi,pi,li.pointRank),ui=Math.min(li.openEnd(di),hi.length)}else di>ci&&(ii.span(ci,di,li.active,ui),ui=li.openEnd(di));if(li.to>si)return ui+(li.point&&li.to>si?1:0);ci=li.to,li.next()}}static of(ws,oi=!1){let si=new RangeSetBuilder;for(let ii of ws instanceof Range$3?[ws]:oi?lazySort(ws):ws)si.add(ii.from,ii.to,ii.value);return si.finish()}static join(ws){if(!ws.length)return RangeSet.empty;let oi=ws[ws.length-1];for(let si=ws.length-2;si>=0;si--)for(let ii=ws[si];ii!=RangeSet.empty;ii=ii.nextLayer)oi=new RangeSet(ii.chunkPos,ii.chunk,oi,Math.max(ii.maxPoint,oi.maxPoint));return oi}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(Ws){if(Ws.length>1)for(let ws=Ws[0],oi=1;oi<Ws.length;oi++){let si=Ws[oi];if(cmpRange(ws,si)>0)return Ws.slice().sort(cmpRange);ws=si}return Ws}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{finishChunk(ws){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,ws&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(ws,oi,si){this.addInner(ws,oi,si)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(ws,oi,si)}addInner(ws,oi,si){let ii=ws-this.lastTo||si.startSide-this.last.endSide;if(ii<=0&&(ws-this.lastFrom||si.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return ii<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=ws),this.from.push(ws-this.chunkStart),this.to.push(oi-this.chunkStart),this.last=si,this.lastFrom=ws,this.lastTo=oi,this.value.push(si),si.point&&(this.maxPoint=Math.max(this.maxPoint,oi-ws)),!0)}addChunk(ws,oi){if((ws-this.lastTo||oi.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,oi.maxPoint),this.chunks.push(oi),this.chunkPos.push(ws);let si=oi.value.length-1;return this.last=oi.value[si],this.lastFrom=oi.from[si]+ws,this.lastTo=oi.to[si]+ws,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(ws){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return ws;let oi=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(ws):ws,this.setMaxPoint);return this.from=null,oi}}function findSharedChunks(Ws,ws,oi){let si=new Map;for(let ai of Ws)for(let li=0;li<ai.chunk.length;li++)ai.chunk[li].maxPoint<=0&&si.set(ai.chunk[li],ai.chunkPos[li]);let ii=new Set;for(let ai of ws)for(let li=0;li<ai.chunk.length;li++){let ci=si.get(ai.chunk[li]);ci!=null&&(oi?oi.mapPos(ci):ci)==ai.chunkPos[li]&&!(oi!=null&&oi.touchesRange(ci,ci+ai.chunk[li].length))&&ii.add(ai.chunk[li])}return ii}class LayerCursor{constructor(ws,oi,si,ii=0){this.layer=ws,this.skip=oi,this.minPoint=si,this.rank=ii}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(ws,oi=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(ws,oi,!1),this}gotoInner(ws,oi,si){for(;this.chunkIndex<this.layer.chunk.length;){let ii=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(ii)||this.layer.chunkEnd(this.chunkIndex)<ws||ii.maxPoint<this.minPoint))break;this.chunkIndex++,si=!1}if(this.chunkIndex<this.layer.chunk.length){let ii=this.layer.chunk[this.chunkIndex].findIndex(ws-this.layer.chunkPos[this.chunkIndex],oi,!0);(!si||this.rangeIndex<ii)&&this.setRangeIndex(ii)}this.next()}forward(ws,oi){(this.to-ws||this.endSide-oi)<0&&this.gotoInner(ws,oi,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let ws=this.layer.chunkPos[this.chunkIndex],oi=this.layer.chunk[this.chunkIndex],si=ws+oi.from[this.rangeIndex];if(this.from=si,this.to=ws+oi.to[this.rangeIndex],this.value=oi.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(ws){if(ws==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=ws}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(ws){return this.from-ws.from||this.startSide-ws.startSide||this.rank-ws.rank||this.to-ws.to||this.endSide-ws.endSide}}class HeapCursor{constructor(ws){this.heap=ws}static from(ws,oi=null,si=-1){let ii=[];for(let ai=0;ai<ws.length;ai++)for(let li=ws[ai];!li.isEmpty;li=li.nextLayer)li.maxPoint>=si&&ii.push(new LayerCursor(li,oi,si,ai));return ii.length==1?ii[0]:new HeapCursor(ii)}get startSide(){return this.value?this.value.startSide:0}goto(ws,oi=-1e9){for(let si of this.heap)si.goto(ws,oi);for(let si=this.heap.length>>1;si>=0;si--)heapBubble(this.heap,si);return this.next(),this}forward(ws,oi){for(let si of this.heap)si.forward(ws,oi);for(let si=this.heap.length>>1;si>=0;si--)heapBubble(this.heap,si);(this.to-ws||this.value.endSide-oi)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let ws=this.heap[0];this.from=ws.from,this.to=ws.to,this.value=ws.value,this.rank=ws.rank,ws.value&&ws.next(),heapBubble(this.heap,0)}}}function heapBubble(Ws,ws){for(let oi=Ws[ws];;){let si=(ws<<1)+1;if(si>=Ws.length)break;let ii=Ws[si];if(si+1<Ws.length&&ii.compare(Ws[si+1])>=0&&(ii=Ws[si+1],si++),oi.compare(ii)<0)break;Ws[si]=oi,Ws[ws]=ii,ws=si}}class SpanCursor{constructor(ws,oi,si){this.minPoint=si,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(ws,oi,si)}goto(ws,oi=-1e9){return this.cursor.goto(ws,oi),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=ws,this.endSide=oi,this.openStart=-1,this.next(),this}forward(ws,oi){for(;this.minActive>-1&&(this.activeTo[this.minActive]-ws||this.active[this.minActive].endSide-oi)<0;)this.removeActive(this.minActive);this.cursor.forward(ws,oi)}removeActive(ws){remove(this.active,ws),remove(this.activeTo,ws),remove(this.activeRank,ws),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(ws){let oi=0,{value:si,to:ii,rank:ai}=this.cursor;for(;oi<this.activeRank.length&&(ai-this.activeRank[oi]||ii-this.activeTo[oi])>0;)oi++;insert(this.active,oi,si),insert(this.activeTo,oi,ii),insert(this.activeRank,oi,ai),ws&&insert(ws,oi,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let ws=this.to,oi=this.point;this.point=null;let si=this.openStart<0?[]:null;for(;;){let ii=this.minActive;if(ii>-1&&(this.activeTo[ii]-this.cursor.from||this.active[ii].endSide-this.cursor.startSide)<0){if(this.activeTo[ii]>ws){this.to=this.activeTo[ii],this.endSide=this.active[ii].endSide;break}this.removeActive(ii),si&&remove(si,ii)}else if(this.cursor.value)if(this.cursor.from>ws){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let ai=this.cursor.value;if(!ai.point)this.addActive(si),this.cursor.next();else if(oi&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=ai,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=ai.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(si){this.openStart=0;for(let ii=si.length-1;ii>=0&&si[ii]<ws;ii--)this.openStart++}}activeForPoint(ws){if(!this.active.length)return this.active;let oi=[];for(let si=this.active.length-1;si>=0&&!(this.activeRank[si]<this.pointRank);si--)(this.activeTo[si]>ws||this.activeTo[si]==ws&&this.active[si].endSide>=this.point.endSide)&&oi.push(this.active[si]);return oi.reverse()}openEnd(ws){let oi=0;for(let si=this.activeTo.length-1;si>=0&&this.activeTo[si]>ws;si--)oi++;return oi}}function compare(Ws,ws,oi,si,ii,ai){Ws.goto(ws),oi.goto(si);let li=si+ii,ci=si,ui=si-ws;for(;;){let di=Ws.to+ui-oi.to,hi=di||Ws.endSide-oi.endSide,pi=hi<0?Ws.to+ui:oi.to,ha=Math.min(pi,li);if(Ws.point||oi.point?Ws.point&&oi.point&&(Ws.point==oi.point||Ws.point.eq(oi.point))&&sameValues(Ws.activeForPoint(Ws.to),oi.activeForPoint(oi.to))||ai.comparePoint(ci,ha,Ws.point,oi.point):ha>ci&&!sameValues(Ws.active,oi.active)&&ai.compareRange(ci,ha,Ws.active,oi.active),pi>li)break;(di||Ws.openEnd!=oi.openEnd)&&ai.boundChange&&ai.boundChange(pi),ci=pi,hi<=0&&Ws.next(),hi>=0&&oi.next()}}function sameValues(Ws,ws){if(Ws.length!=ws.length)return!1;for(let oi=0;oi<Ws.length;oi++)if(Ws[oi]!=ws[oi]&&!Ws[oi].eq(ws[oi]))return!1;return!0}function remove(Ws,ws){for(let oi=ws,si=Ws.length-1;oi<si;oi++)Ws[oi]=Ws[oi+1];Ws.pop()}function insert(Ws,ws,oi){for(let si=Ws.length-1;si>=ws;si--)Ws[si+1]=Ws[si];Ws[ws]=oi}function findMinIndex(Ws,ws){let oi=-1,si=1e9;for(let ii=0;ii<ws.length;ii++)(ws[ii]-si||Ws[ii].endSide-Ws[oi].endSide)<0&&(oi=ii,si=ws[ii]);return oi}function countColumn(Ws,ws,oi=Ws.length){let si=0;for(let ii=0;ii<oi&&ii<Ws.length;)Ws.charCodeAt(ii)==9?(si+=ws-si%ws,ii++):(si++,ii=findClusterBreak(Ws,ii));return si}function findColumn(Ws,ws,oi,si){for(let ii=0,ai=0;;){if(ai>=ws)return ii;if(ii==Ws.length)break;ai+=Ws.charCodeAt(ii)==9?oi-ai%oi:1,ii=findClusterBreak(Ws,ii)}return si===!0?-1:Ws.length}const C$5="ͼ",COUNT=typeof Symbol>"u"?"__"+C$5:Symbol.for(C$5),SET=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),top=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class StyleModule{constructor(ws,oi){this.rules=[];let{finish:si}=oi||{};function ii(li){return/^@/.test(li)?[li]:li.split(/,\s*/)}function ai(li,ci,ui,di){let hi=[],pi=/^@(\w+)\b/.exec(li[0]),ha=pi&&pi[1]=="keyframes";if(pi&&ci==null)return ui.push(li[0]+";");for(let ga in ci){let va=ci[ga];if(/&/.test(ga))ai(ga.split(/,\s*/).map(ba=>li.map(wa=>ba.replace(/&/,wa))).reduce((ba,wa)=>ba.concat(wa)),va,ui);else if(va&&typeof va=="object"){if(!pi)throw new RangeError("The value of a property ("+ga+") should be a primitive value.");ai(ii(ga),va,hi,ha)}else va!=null&&hi.push(ga.replace(/_.*/,"").replace(/[A-Z]/g,ba=>"-"+ba.toLowerCase())+": "+va+";")}(hi.length||ha)&&ui.push((si&&!pi&&!di?li.map(si):li).join(", ")+" {"+hi.join(" ")+"}")}for(let li in ws)ai(ii(li),ws[li],this.rules)}getRules(){return this.rules.join(`
317
- `)}static newName(){let ws=top[COUNT]||1;return top[COUNT]=ws+1,C$5+ws.toString(36)}static mount(ws,oi,si){let ii=ws[SET],ai=si&&si.nonce;ii?ai&&ii.setNonce(ai):ii=new StyleSet(ws,ai),ii.mount(Array.isArray(oi)?oi:[oi],ws)}}let adoptedSet=new Map;class StyleSet{constructor(ws,oi){let si=ws.ownerDocument||ws,ii=si.defaultView;if(!ws.head&&ws.adoptedStyleSheets&&ii.CSSStyleSheet){let ai=adoptedSet.get(si);if(ai)return ws[SET]=ai;this.sheet=new ii.CSSStyleSheet,adoptedSet.set(si,this)}else this.styleTag=si.createElement("style"),oi&&this.styleTag.setAttribute("nonce",oi);this.modules=[],ws[SET]=this}mount(ws,oi){let si=this.sheet,ii=0,ai=0;for(let li=0;li<ws.length;li++){let ci=ws[li],ui=this.modules.indexOf(ci);if(ui<ai&&ui>-1&&(this.modules.splice(ui,1),ai--,ui=-1),ui==-1){if(this.modules.splice(ai++,0,ci),si)for(let di=0;di<ci.rules.length;di++)si.insertRule(ci.rules[di],ii++)}else{for(;ai<ui;)ii+=this.modules[ai++].rules.length;ii+=ci.rules.length,ai++}}if(si)oi.adoptedStyleSheets.indexOf(this.sheet)<0&&(oi.adoptedStyleSheets=[this.sheet,...oi.adoptedStyleSheets]);else{let li="";for(let ui=0;ui<this.modules.length;ui++)li+=this.modules[ui].getRules()+`
318
- `;this.styleTag.textContent=li;let ci=oi.head||oi;this.styleTag.parentNode!=ci&&ci.insertBefore(this.styleTag,ci.firstChild)}}setNonce(ws){this.styleTag&&this.styleTag.getAttribute("nonce")!=ws&&this.styleTag.setAttribute("nonce",ws)}}var base={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie$1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i=0;i<10;i++)base[48+i]=base[96+i]=String(i);for(var i=1;i<=24;i++)base[i+111]="F"+i;for(var i=65;i<=90;i++)base[i]=String.fromCharCode(i+32),shift[i]=String.fromCharCode(i);for(var code in base)shift.hasOwnProperty(code)||(shift[code]=base[code]);function keyName(Ws){var ws=mac&&Ws.metaKey&&Ws.shiftKey&&!Ws.ctrlKey&&!Ws.altKey||ie$1&&Ws.shiftKey&&Ws.key&&Ws.key.length==1||Ws.key=="Unidentified",oi=!ws&&Ws.key||(Ws.shiftKey?shift:base)[Ws.keyCode]||Ws.key||"Unidentified";return oi=="Esc"&&(oi="Escape"),oi=="Del"&&(oi="Delete"),oi=="Left"&&(oi="ArrowLeft"),oi=="Up"&&(oi="ArrowUp"),oi=="Right"&&(oi="ArrowRight"),oi=="Down"&&(oi="ArrowDown"),oi}function getSelection(Ws){let ws;return Ws.nodeType==11?ws=Ws.getSelection?Ws:Ws.ownerDocument:ws=Ws,ws.getSelection()}function contains(Ws,ws){return ws?Ws==ws||Ws.contains(ws.nodeType!=1?ws.parentNode:ws):!1}function hasSelection(Ws,ws){if(!ws.anchorNode)return!1;try{return contains(Ws,ws.anchorNode)}catch{return!1}}function clientRectsFor(Ws){return Ws.nodeType==3?textRange(Ws,0,Ws.nodeValue.length).getClientRects():Ws.nodeType==1?Ws.getClientRects():[]}function isEquivalentPosition(Ws,ws,oi,si){return oi?scanFor(Ws,ws,oi,si,-1)||scanFor(Ws,ws,oi,si,1):!1}function domIndex(Ws){for(var ws=0;;ws++)if(Ws=Ws.previousSibling,!Ws)return ws}function isBlockElement(Ws){return Ws.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(Ws.nodeName)}function scanFor(Ws,ws,oi,si,ii){for(;;){if(Ws==oi&&ws==si)return!0;if(ws==(ii<0?0:maxOffset(Ws))){if(Ws.nodeName=="DIV")return!1;let ai=Ws.parentNode;if(!ai||ai.nodeType!=1)return!1;ws=domIndex(Ws)+(ii<0?0:1),Ws=ai}else if(Ws.nodeType==1){if(Ws=Ws.childNodes[ws+(ii<0?-1:0)],Ws.nodeType==1&&Ws.contentEditable=="false")return!1;ws=ii<0?maxOffset(Ws):0}else return!1}}function maxOffset(Ws){return Ws.nodeType==3?Ws.nodeValue.length:Ws.childNodes.length}function flattenRect(Ws,ws){let oi=ws?Ws.left:Ws.right;return{left:oi,right:oi,top:Ws.top,bottom:Ws.bottom}}function windowRect(Ws){let ws=Ws.visualViewport;return ws?{left:0,right:ws.width,top:0,bottom:ws.height}:{left:0,right:Ws.innerWidth,top:0,bottom:Ws.innerHeight}}function getScale(Ws,ws){let oi=ws.width/Ws.offsetWidth,si=ws.height/Ws.offsetHeight;return(oi>.995&&oi<1.005||!isFinite(oi)||Math.abs(ws.width-Ws.offsetWidth)<1)&&(oi=1),(si>.995&&si<1.005||!isFinite(si)||Math.abs(ws.height-Ws.offsetHeight)<1)&&(si=1),{scaleX:oi,scaleY:si}}function scrollRectIntoView(Ws,ws,oi,si,ii,ai,li,ci){let ui=Ws.ownerDocument,di=ui.defaultView||window;for(let hi=Ws,pi=!1;hi&&!pi;)if(hi.nodeType==1){let ha,ga=hi==ui.body,va=1,ba=1;if(ga)ha=windowRect(di);else{if(/^(fixed|sticky)$/.test(getComputedStyle(hi).position)&&(pi=!0),hi.scrollHeight<=hi.clientHeight&&hi.scrollWidth<=hi.clientWidth){hi=hi.assignedSlot||hi.parentNode;continue}let Ca=hi.getBoundingClientRect();({scaleX:va,scaleY:ba}=getScale(hi,Ca)),ha={left:Ca.left,right:Ca.left+hi.clientWidth*va,top:Ca.top,bottom:Ca.top+hi.clientHeight*ba}}let wa=0,xa=0;if(ii=="nearest")ws.top<ha.top?(xa=-(ha.top-ws.top+li),oi>0&&ws.bottom>ha.bottom+xa&&(xa=ws.bottom-ha.bottom+xa+li)):ws.bottom>ha.bottom&&(xa=ws.bottom-ha.bottom+li,oi<0&&ws.top-xa<ha.top&&(xa=-(ha.top+xa-ws.top+li)));else{let Ca=ws.bottom-ws.top,el=ha.bottom-ha.top;xa=(ii=="center"&&Ca<=el?ws.top+Ca/2-el/2:ii=="start"||ii=="center"&&oi<0?ws.top-li:ws.bottom-el+li)-ha.top}if(si=="nearest"?ws.left<ha.left?(wa=-(ha.left-ws.left+ai),oi>0&&ws.right>ha.right+wa&&(wa=ws.right-ha.right+wa+ai)):ws.right>ha.right&&(wa=ws.right-ha.right+ai,oi<0&&ws.left<ha.left+wa&&(wa=-(ha.left+wa-ws.left+ai))):wa=(si=="center"?ws.left+(ws.right-ws.left)/2-(ha.right-ha.left)/2:si=="start"==ci?ws.left-ai:ws.right-(ha.right-ha.left)+ai)-ha.left,wa||xa)if(ga)di.scrollBy(wa,xa);else{let Ca=0,el=0;if(xa){let ku=hi.scrollTop;hi.scrollTop+=xa/ba,el=(hi.scrollTop-ku)*ba}if(wa){let ku=hi.scrollLeft;hi.scrollLeft+=wa/va,Ca=(hi.scrollLeft-ku)*va}ws={left:ws.left-Ca,top:ws.top-el,right:ws.right-Ca,bottom:ws.bottom-el},Ca&&Math.abs(Ca-wa)<1&&(si="nearest"),el&&Math.abs(el-xa)<1&&(ii="nearest")}if(ga)break;hi=hi.assignedSlot||hi.parentNode}else if(hi.nodeType==11)hi=hi.host;else break}function scrollableParents(Ws){let ws=Ws.ownerDocument,oi,si;for(let ii=Ws.parentNode;ii&&!(ii==ws.body||oi&&si);)if(ii.nodeType==1)!si&&ii.scrollHeight>ii.clientHeight&&(si=ii),!oi&&ii.scrollWidth>ii.clientWidth&&(oi=ii),ii=ii.assignedSlot||ii.parentNode;else if(ii.nodeType==11)ii=ii.host;else break;return{x:oi,y:si}}class DOMSelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(ws){return this.anchorNode==ws.anchorNode&&this.anchorOffset==ws.anchorOffset&&this.focusNode==ws.focusNode&&this.focusOffset==ws.focusOffset}setRange(ws){let{anchorNode:oi,focusNode:si}=ws;this.set(oi,Math.min(ws.anchorOffset,oi?maxOffset(oi):0),si,Math.min(ws.focusOffset,si?maxOffset(si):0))}set(ws,oi,si,ii){this.anchorNode=ws,this.anchorOffset=oi,this.focusNode=si,this.focusOffset=ii}}let preventScrollSupported=null;function focusPreventScroll(Ws){if(Ws.setActive)return Ws.setActive();if(preventScrollSupported)return Ws.focus(preventScrollSupported);let ws=[];for(let oi=Ws;oi&&(ws.push(oi,oi.scrollTop,oi.scrollLeft),oi!=oi.ownerDocument);oi=oi.parentNode);if(Ws.focus(preventScrollSupported==null?{get preventScroll(){return preventScrollSupported={preventScroll:!0},!0}}:void 0),!preventScrollSupported){preventScrollSupported=!1;for(let oi=0;oi<ws.length;){let si=ws[oi++],ii=ws[oi++],ai=ws[oi++];si.scrollTop!=ii&&(si.scrollTop=ii),si.scrollLeft!=ai&&(si.scrollLeft=ai)}}}let scratchRange;function textRange(Ws,ws,oi=ws){let si=scratchRange||(scratchRange=document.createRange());return si.setEnd(Ws,oi),si.setStart(Ws,ws),si}function dispatchKey(Ws,ws,oi,si){let ii={key:ws,code:ws,keyCode:oi,which:oi,cancelable:!0};si&&({altKey:ii.altKey,ctrlKey:ii.ctrlKey,shiftKey:ii.shiftKey,metaKey:ii.metaKey}=si);let ai=new KeyboardEvent("keydown",ii);ai.synthetic=!0,Ws.dispatchEvent(ai);let li=new KeyboardEvent("keyup",ii);return li.synthetic=!0,Ws.dispatchEvent(li),ai.defaultPrevented||li.defaultPrevented}function getRoot(Ws){for(;Ws;){if(Ws&&(Ws.nodeType==9||Ws.nodeType==11&&Ws.host))return Ws;Ws=Ws.assignedSlot||Ws.parentNode}return null}function clearAttributes(Ws){for(;Ws.attributes.length;)Ws.removeAttributeNode(Ws.attributes[0])}function atElementStart(Ws,ws){let oi=ws.focusNode,si=ws.focusOffset;if(!oi||ws.anchorNode!=oi||ws.anchorOffset!=si)return!1;for(si=Math.min(si,maxOffset(oi));;)if(si){if(oi.nodeType!=1)return!1;let ii=oi.childNodes[si-1];ii.contentEditable=="false"?si--:(oi=ii,si=maxOffset(oi))}else{if(oi==Ws)return!0;si=domIndex(oi),oi=oi.parentNode}}function isScrolledToBottom(Ws){return Ws.scrollTop>Math.max(1,Ws.scrollHeight-Ws.clientHeight-4)}function textNodeBefore(Ws,ws){for(let oi=Ws,si=ws;;){if(oi.nodeType==3&&si>0)return{node:oi,offset:si};if(oi.nodeType==1&&si>0){if(oi.contentEditable=="false")return null;oi=oi.childNodes[si-1],si=maxOffset(oi)}else if(oi.parentNode&&!isBlockElement(oi))si=domIndex(oi),oi=oi.parentNode;else return null}}function textNodeAfter(Ws,ws){for(let oi=Ws,si=ws;;){if(oi.nodeType==3&&si<oi.nodeValue.length)return{node:oi,offset:si};if(oi.nodeType==1&&si<oi.childNodes.length){if(oi.contentEditable=="false")return null;oi=oi.childNodes[si],si=0}else if(oi.parentNode&&!isBlockElement(oi))si=domIndex(oi)+1,oi=oi.parentNode;else return null}}class DOMPos{constructor(ws,oi,si=!0){this.node=ws,this.offset=oi,this.precise=si}static before(ws,oi){return new DOMPos(ws.parentNode,domIndex(ws),oi)}static after(ws,oi){return new DOMPos(ws.parentNode,domIndex(ws)+1,oi)}}const noChildren=[];class ContentView{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(ws){let oi=this.posAtStart;for(let si of this.children){if(si==ws)return oi;oi+=si.length+si.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(ws){return this.posBefore(ws)+ws.length}sync(ws,oi){if(this.flags&2){let si=this.dom,ii=null,ai;for(let li of this.children){if(li.flags&7){if(!li.dom&&(ai=ii?ii.nextSibling:si.firstChild)){let ci=ContentView.get(ai);(!ci||!ci.parent&&ci.canReuseDOM(li))&&li.reuseDOM(ai)}li.sync(ws,oi),li.flags&=-8}if(ai=ii?ii.nextSibling:si.firstChild,oi&&!oi.written&&oi.node==si&&ai!=li.dom&&(oi.written=!0),li.dom.parentNode==si)for(;ai&&ai!=li.dom;)ai=rm$1(ai);else si.insertBefore(li.dom,ai);ii=li.dom}for(ai=ii?ii.nextSibling:si.firstChild,ai&&oi&&oi.node==si&&(oi.written=!0);ai;)ai=rm$1(ai)}else if(this.flags&1)for(let si of this.children)si.flags&7&&(si.sync(ws,oi),si.flags&=-8)}reuseDOM(ws){}localPosFromDOM(ws,oi){let si;if(ws==this.dom)si=this.dom.childNodes[oi];else{let ii=maxOffset(ws)==0?0:oi==0?-1:1;for(;;){let ai=ws.parentNode;if(ai==this.dom)break;ii==0&&ai.firstChild!=ai.lastChild&&(ws==ai.firstChild?ii=-1:ii=1),ws=ai}ii<0?si=ws:si=ws.nextSibling}if(si==this.dom.firstChild)return 0;for(;si&&!ContentView.get(si);)si=si.nextSibling;if(!si)return this.length;for(let ii=0,ai=0;;ii++){let li=this.children[ii];if(li.dom==si)return ai;ai+=li.length+li.breakAfter}}domBoundsAround(ws,oi,si=0){let ii=-1,ai=-1,li=-1,ci=-1;for(let ui=0,di=si,hi=si;ui<this.children.length;ui++){let pi=this.children[ui],ha=di+pi.length;if(di<ws&&ha>oi)return pi.domBoundsAround(ws,oi,di);if(ha>=ws&&ii==-1&&(ii=ui,ai=di),di>oi&&pi.dom.parentNode==this.dom){li=ui,ci=hi;break}hi=ha,di=ha+pi.breakAfter}return{from:ai,to:ci<0?si+this.length:ci,startDOM:(ii?this.children[ii-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:li<this.children.length&&li>=0?this.children[li].dom:null}}markDirty(ws=!1){this.flags|=2,this.markParentsDirty(ws)}markParentsDirty(ws){for(let oi=this.parent;oi;oi=oi.parent){if(ws&&(oi.flags|=2),oi.flags&1)return;oi.flags|=1,ws=!1}}setParent(ws){this.parent!=ws&&(this.parent=ws,this.flags&7&&this.markParentsDirty(!0))}setDOM(ws){this.dom!=ws&&(this.dom&&(this.dom.cmView=null),this.dom=ws,ws.cmView=this)}get rootView(){for(let ws=this;;){let oi=ws.parent;if(!oi)return ws;ws=oi}}replaceChildren(ws,oi,si=noChildren){this.markDirty();for(let ii=ws;ii<oi;ii++){let ai=this.children[ii];ai.parent==this&&si.indexOf(ai)<0&&ai.destroy()}si.length<250?this.children.splice(ws,oi-ws,...si):this.children=[].concat(this.children.slice(0,ws),si,this.children.slice(oi));for(let ii=0;ii<si.length;ii++)si[ii].setParent(this)}ignoreMutation(ws){return!1}ignoreEvent(ws){return!1}childCursor(ws=this.length){return new ChildCursor(this.children,ws,this.children.length)}childPos(ws,oi=1){return this.childCursor().findPos(ws,oi)}toString(){let ws=this.constructor.name.replace("View","");return ws+(this.children.length?"("+this.children.join()+")":this.length?"["+(ws=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(ws){return ws.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(ws,oi,si,ii,ai,li){return!1}become(ws){return!1}canReuseDOM(ws){return ws.constructor==this.constructor&&!((this.flags|ws.flags)&8)}getSide(){return 0}destroy(){for(let ws of this.children)ws.parent==this&&ws.destroy();this.parent=null}}ContentView.prototype.breakAfter=0;function rm$1(Ws){let ws=Ws.nextSibling;return Ws.parentNode.removeChild(Ws),ws}class ChildCursor{constructor(ws,oi,si){this.children=ws,this.pos=oi,this.i=si,this.off=0}findPos(ws,oi=1){for(;;){if(ws>this.pos||ws==this.pos&&(oi>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=ws-this.pos,this;let si=this.children[--this.i];this.pos-=si.length+si.breakAfter}}}function replaceRange(Ws,ws,oi,si,ii,ai,li,ci,ui){let{children:di}=Ws,hi=di.length?di[ws]:null,pi=ai.length?ai[ai.length-1]:null,ha=pi?pi.breakAfter:li;if(!(ws==si&&hi&&!li&&!ha&&ai.length<2&&hi.merge(oi,ii,ai.length?pi:null,oi==0,ci,ui))){if(si<di.length){let ga=di[si];ga&&(ii<ga.length||ga.breakAfter&&pi!=null&&pi.breakAfter)?(ws==si&&(ga=ga.split(ii),ii=0),!ha&&pi&&ga.merge(0,ii,pi,!0,0,ui)?ai[ai.length-1]=ga:((ii||ga.children.length&&!ga.children[0].length)&&ga.merge(0,ii,null,!1,0,ui),ai.push(ga))):ga!=null&&ga.breakAfter&&(pi?pi.breakAfter=1:li=1),si++}for(hi&&(hi.breakAfter=li,oi>0&&(!li&&ai.length&&hi.merge(oi,hi.length,ai[0],!1,ci,0)?hi.breakAfter=ai.shift().breakAfter:(oi<hi.length||hi.children.length&&hi.children[hi.children.length-1].length==0)&&hi.merge(oi,hi.length,null,!1,ci,0),ws++));ws<si&&ai.length;)if(di[si-1].become(ai[ai.length-1]))si--,ai.pop(),ui=ai.length?0:ci;else if(di[ws].become(ai[0]))ws++,ai.shift(),ci=ai.length?0:ui;else break;!ai.length&&ws&&si<di.length&&!di[ws-1].breakAfter&&di[si].merge(0,0,di[ws-1],!1,ci,ui)&&ws--,(ws<si||ai.length)&&Ws.replaceChildren(ws,si,ai)}}function mergeChildrenInto(Ws,ws,oi,si,ii,ai){let li=Ws.childCursor(),{i:ci,off:ui}=li.findPos(oi,1),{i:di,off:hi}=li.findPos(ws,-1),pi=ws-oi;for(let ha of si)pi+=ha.length;Ws.length+=pi,replaceRange(Ws,di,hi,ci,ui,si,0,ii,ai)}let nav=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},doc=typeof document<"u"?document:{documentElement:{style:{}}};const ie_edge=/Edge\/(\d+)/.exec(nav.userAgent),ie_upto10=/MSIE \d/.test(nav.userAgent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent),ie=!!(ie_upto10||ie_11up||ie_edge),gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent),chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent),webkit="webkitFontSmoothing"in doc.documentElement.style,safari=!ie&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios,android:/Android\b/.test(nav.userAgent),webkit,safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const MaxJoinLen=256;class TextView extends ContentView{constructor(ws){super(),this.text=ws}get length(){return this.text.length}createDOM(ws){this.setDOM(ws||document.createTextNode(this.text))}sync(ws,oi){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(oi&&oi.node==this.dom&&(oi.written=!0),this.dom.nodeValue=this.text)}reuseDOM(ws){ws.nodeType==3&&this.createDOM(ws)}merge(ws,oi,si){return this.flags&8||si&&(!(si instanceof TextView)||this.length-(oi-ws)+si.length>MaxJoinLen||si.flags&8)?!1:(this.text=this.text.slice(0,ws)+(si?si.text:"")+this.text.slice(oi),this.markDirty(),!0)}split(ws){let oi=new TextView(this.text.slice(ws));return this.text=this.text.slice(0,ws),this.markDirty(),oi.flags|=this.flags&8,oi}localPosFromDOM(ws,oi){return ws==this.dom?oi:oi?this.text.length:0}domAtPos(ws){return new DOMPos(this.dom,ws)}domBoundsAround(ws,oi,si){return{from:si,to:si+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(ws,oi){return textCoords(this.dom,ws,oi)}}class MarkView extends ContentView{constructor(ws,oi=[],si=0){super(),this.mark=ws,this.children=oi,this.length=si;for(let ii of oi)ii.setParent(this)}setAttrs(ws){if(clearAttributes(ws),this.mark.class&&(ws.className=this.mark.class),this.mark.attrs)for(let oi in this.mark.attrs)ws.setAttribute(oi,this.mark.attrs[oi]);return ws}canReuseDOM(ws){return super.canReuseDOM(ws)&&!((this.flags|ws.flags)&8)}reuseDOM(ws){ws.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(ws),this.flags|=6)}sync(ws,oi){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(ws,oi)}merge(ws,oi,si,ii,ai,li){return si&&(!(si instanceof MarkView&&si.mark.eq(this.mark))||ws&&ai<=0||oi<this.length&&li<=0)?!1:(mergeChildrenInto(this,ws,oi,si?si.children.slice():[],ai-1,li-1),this.markDirty(),!0)}split(ws){let oi=[],si=0,ii=-1,ai=0;for(let ci of this.children){let ui=si+ci.length;ui>ws&&oi.push(si<ws?ci.split(ws-si):ci),ii<0&&si>=ws&&(ii=ai),si=ui,ai++}let li=this.length-ws;return this.length=ws,ii>-1&&(this.children.length=ii,this.markDirty()),new MarkView(this.mark,oi,li)}domAtPos(ws){return inlineDOMAtPos(this,ws)}coordsAt(ws,oi){return coordsInChildren(this,ws,oi)}}function textCoords(Ws,ws,oi){let si=Ws.nodeValue.length;ws>si&&(ws=si);let ii=ws,ai=ws,li=0;ws==0&&oi<0||ws==si&&oi>=0?browser.chrome||browser.gecko||(ws?(ii--,li=1):ai<si&&(ai++,li=-1)):oi<0?ii--:ai<si&&ai++;let ci=textRange(Ws,ii,ai).getClientRects();if(!ci.length)return null;let ui=ci[(li?li<0:oi>=0)?0:ci.length-1];return browser.safari&&!li&&ui.width==0&&(ui=Array.prototype.find.call(ci,di=>di.width)||ui),li?flattenRect(ui,li<0):ui||null}class WidgetView extends ContentView{static create(ws,oi,si){return new WidgetView(ws,oi,si)}constructor(ws,oi,si){super(),this.widget=ws,this.length=oi,this.side=si,this.prevWidget=null}split(ws){let oi=WidgetView.create(this.widget,this.length-ws,this.side);return this.length-=ws,oi}sync(ws){(!this.dom||!this.widget.updateDOM(this.dom,ws))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(ws)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(ws,oi,si,ii,ai,li){return si&&(!(si instanceof WidgetView)||!this.widget.compare(si.widget)||ws>0&&ai<=0||oi<this.length&&li<=0)?!1:(this.length=ws+(si?si.length:0)+(this.length-oi),!0)}become(ws){return ws instanceof WidgetView&&ws.side==this.side&&this.widget.constructor==ws.widget.constructor?(this.widget.compare(ws.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=ws.widget,this.length=ws.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(ws){return this.widget.ignoreEvent(ws)}get overrideDOMText(){if(this.length==0)return Text.empty;let ws=this;for(;ws.parent;)ws=ws.parent;let{view:oi}=ws,si=oi&&oi.state.doc,ii=this.posAtStart;return si?si.slice(ii,ii+this.length):Text.empty}domAtPos(ws){return(this.length?ws==0:this.side>0)?DOMPos.before(this.dom):DOMPos.after(this.dom,ws==this.length)}domBoundsAround(){return null}coordsAt(ws,oi){let si=this.widget.coordsAt(this.dom,ws,oi);if(si)return si;let ii=this.dom.getClientRects(),ai=null;if(!ii.length)return null;let li=this.side?this.side<0:ws>0;for(let ci=li?ii.length-1:0;ai=ii[ci],!(ws>0?ci==0:ci==ii.length-1||ai.top<ai.bottom);ci+=li?-1:1);return flattenRect(ai,!li)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class WidgetBufferView extends ContentView{constructor(ws){super(),this.side=ws}get length(){return 0}merge(){return!1}become(ws){return ws instanceof WidgetBufferView&&ws.side==this.side}split(){return new WidgetBufferView(this.side)}sync(){if(!this.dom){let ws=document.createElement("img");ws.className="cm-widgetBuffer",ws.setAttribute("aria-hidden","true"),this.setDOM(ws)}}getSide(){return this.side}domAtPos(ws){return this.side>0?DOMPos.before(this.dom):DOMPos.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(ws){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Text.empty}get isHidden(){return!0}}TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(Ws,ws){let oi=Ws.dom,{children:si}=Ws,ii=0;for(let ai=0;ii<si.length;ii++){let li=si[ii],ci=ai+li.length;if(!(ci==ai&&li.getSide()<=0)){if(ws>ai&&ws<ci&&li.dom.parentNode==oi)return li.domAtPos(ws-ai);if(ws<=ai)break;ai=ci}}for(let ai=ii;ai>0;ai--){let li=si[ai-1];if(li.dom.parentNode==oi)return li.domAtPos(li.length)}for(let ai=ii;ai<si.length;ai++){let li=si[ai];if(li.dom.parentNode==oi)return li.domAtPos(0)}return new DOMPos(oi,0)}function joinInlineInto(Ws,ws,oi){let si,{children:ii}=Ws;oi>0&&ws instanceof MarkView&&ii.length&&(si=ii[ii.length-1])instanceof MarkView&&si.mark.eq(ws.mark)?joinInlineInto(si,ws.children[0],oi-1):(ii.push(ws),ws.setParent(Ws)),Ws.length+=ws.length}function coordsInChildren(Ws,ws,oi){let si=null,ii=-1,ai=null,li=-1;function ci(di,hi){for(let pi=0,ha=0;pi<di.children.length&&ha<=hi;pi++){let ga=di.children[pi],va=ha+ga.length;va>=hi&&(ga.children.length?ci(ga,hi-ha):(!ai||ai.isHidden&&oi>0)&&(va>hi||ha==va&&ga.getSide()>0)?(ai=ga,li=hi-ha):(ha<hi||ha==va&&ga.getSide()<0&&!ga.isHidden)&&(si=ga,ii=hi-ha)),ha=va}}ci(Ws,ws);let ui=(oi<0?si:ai)||si||ai;return ui?ui.coordsAt(Math.max(0,ui==si?ii:li),oi):fallbackRect(Ws)}function fallbackRect(Ws){let ws=Ws.dom.lastChild;if(!ws)return Ws.dom.getBoundingClientRect();let oi=clientRectsFor(ws);return oi[oi.length-1]||null}function combineAttrs(Ws,ws){for(let oi in Ws)oi=="class"&&ws.class?ws.class+=" "+Ws.class:oi=="style"&&ws.style?ws.style+=";"+Ws.style:ws[oi]=Ws[oi];return ws}const noAttrs$1=Object.create(null);function attrsEq(Ws,ws,oi){if(Ws==ws)return!0;Ws||(Ws=noAttrs$1),ws||(ws=noAttrs$1);let si=Object.keys(Ws),ii=Object.keys(ws);if(si.length-(oi&&si.indexOf(oi)>-1?1:0)!=ii.length-(oi&&ii.indexOf(oi)>-1?1:0))return!1;for(let ai of si)if(ai!=oi&&(ii.indexOf(ai)==-1||Ws[ai]!==ws[ai]))return!1;return!0}function updateAttrs(Ws,ws,oi){let si=!1;if(ws)for(let ii in ws)oi&&ii in oi||(si=!0,ii=="style"?Ws.style.cssText="":Ws.removeAttribute(ii));if(oi)for(let ii in oi)ws&&ws[ii]==oi[ii]||(si=!0,ii=="style"?Ws.style.cssText=oi[ii]:Ws.setAttribute(ii,oi[ii]));return si}function getAttrs(Ws){let ws=Object.create(null);for(let oi=0;oi<Ws.attributes.length;oi++){let si=Ws.attributes[oi];ws[si.name]=si.value}return ws}class WidgetType{eq(ws){return!1}updateDOM(ws,oi){return!1}compare(ws){return this==ws||this.constructor==ws.constructor&&this.eq(ws)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(ws){return!0}coordsAt(ws,oi,si){return null}get isHidden(){return!1}get editable(){return!1}destroy(ws){}}var BlockType=function(Ws){return Ws[Ws.Text=0]="Text",Ws[Ws.WidgetBefore=1]="WidgetBefore",Ws[Ws.WidgetAfter=2]="WidgetAfter",Ws[Ws.WidgetRange=3]="WidgetRange",Ws}(BlockType||(BlockType={}));class Decoration extends RangeValue{constructor(ws,oi,si,ii){super(),this.startSide=ws,this.endSide=oi,this.widget=si,this.spec=ii}get heightRelevant(){return!1}static mark(ws){return new MarkDecoration(ws)}static widget(ws){let oi=Math.max(-1e4,Math.min(1e4,ws.side||0)),si=!!ws.block;return oi+=si&&!ws.inlineOrder?oi>0?3e8:-4e8:oi>0?1e8:-1e8,new PointDecoration(ws,oi,oi,si,ws.widget||null,!1)}static replace(ws){let oi=!!ws.block,si,ii;if(ws.isBlockGap)si=-5e8,ii=4e8;else{let{start:ai,end:li}=getInclusive(ws,oi);si=(ai?oi?-3e8:-1:5e8)-1,ii=(li?oi?2e8:1:-6e8)+1}return new PointDecoration(ws,si,ii,oi,ws.widget||null,!0)}static line(ws){return new LineDecoration(ws)}static set(ws,oi=!1){return RangeSet.of(ws,oi)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Decoration.none=RangeSet.empty;class MarkDecoration extends Decoration{constructor(ws){let{start:oi,end:si}=getInclusive(ws);super(oi?-1:5e8,si?1:-6e8,null,ws),this.tagName=ws.tagName||"span",this.class=ws.class||"",this.attrs=ws.attributes||null}eq(ws){var oi,si;return this==ws||ws instanceof MarkDecoration&&this.tagName==ws.tagName&&(this.class||((oi=this.attrs)===null||oi===void 0?void 0:oi.class))==(ws.class||((si=ws.attrs)===null||si===void 0?void 0:si.class))&&attrsEq(this.attrs,ws.attrs,"class")}range(ws,oi=ws){if(ws>=oi)throw new RangeError("Mark decorations may not be empty");return super.range(ws,oi)}}MarkDecoration.prototype.point=!1;class LineDecoration extends Decoration{constructor(ws){super(-2e8,-2e8,null,ws)}eq(ws){return ws instanceof LineDecoration&&this.spec.class==ws.spec.class&&attrsEq(this.spec.attributes,ws.spec.attributes)}range(ws,oi=ws){if(oi!=ws)throw new RangeError("Line decoration ranges must be zero-length");return super.range(ws,oi)}}LineDecoration.prototype.mapMode=MapMode.TrackBefore;LineDecoration.prototype.point=!0;class PointDecoration extends Decoration{constructor(ws,oi,si,ii,ai,li){super(oi,si,ai,ws),this.block=ii,this.isReplace=li,this.mapMode=ii?oi<=0?MapMode.TrackBefore:MapMode.TrackAfter:MapMode.TrackDel}get type(){return this.startSide!=this.endSide?BlockType.WidgetRange:this.startSide<=0?BlockType.WidgetBefore:BlockType.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(ws){return ws instanceof PointDecoration&&widgetsEq(this.widget,ws.widget)&&this.block==ws.block&&this.startSide==ws.startSide&&this.endSide==ws.endSide}range(ws,oi=ws){if(this.isReplace&&(ws>oi||ws==oi&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&oi!=ws)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(ws,oi)}}PointDecoration.prototype.point=!0;function getInclusive(Ws,ws=!1){let{inclusiveStart:oi,inclusiveEnd:si}=Ws;return oi==null&&(oi=Ws.inclusive),si==null&&(si=Ws.inclusive),{start:oi??ws,end:si??ws}}function widgetsEq(Ws,ws){return Ws==ws||!!(Ws&&ws&&Ws.compare(ws))}function addRange(Ws,ws,oi,si=0){let ii=oi.length-1;ii>=0&&oi[ii]+si>=Ws?oi[ii]=Math.max(oi[ii],ws):oi.push(Ws,ws)}class LineView extends ContentView{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(ws,oi,si,ii,ai,li){if(si){if(!(si instanceof LineView))return!1;this.dom||si.transferDOM(this)}return ii&&this.setDeco(si?si.attrs:null),mergeChildrenInto(this,ws,oi,si?si.children.slice():[],ai,li),!0}split(ws){let oi=new LineView;if(oi.breakAfter=this.breakAfter,this.length==0)return oi;let{i:si,off:ii}=this.childPos(ws);ii&&(oi.append(this.children[si].split(ii),0),this.children[si].merge(ii,this.children[si].length,null,!1,0,0),si++);for(let ai=si;ai<this.children.length;ai++)oi.append(this.children[ai],0);for(;si>0&&this.children[si-1].length==0;)this.children[--si].destroy();return this.children.length=si,this.markDirty(),this.length=ws,oi}transferDOM(ws){this.dom&&(this.markDirty(),ws.setDOM(this.dom),ws.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(ws){attrsEq(this.attrs,ws)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=ws)}append(ws,oi){joinInlineInto(this,ws,oi)}addLineDeco(ws){let oi=ws.spec.attributes,si=ws.spec.class;oi&&(this.attrs=combineAttrs(oi,this.attrs||{})),si&&(this.attrs=combineAttrs({class:si},this.attrs||{}))}domAtPos(ws){return inlineDOMAtPos(this,ws)}reuseDOM(ws){ws.nodeName=="DIV"&&(this.setDOM(ws),this.flags|=6)}sync(ws,oi){var si;this.dom?this.flags&4&&(clearAttributes(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(updateAttrs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(ws,oi);let ii=this.dom.lastChild;for(;ii&&ContentView.get(ii)instanceof MarkView;)ii=ii.lastChild;if(!ii||!this.length||ii.nodeName!="BR"&&((si=ContentView.get(ii))===null||si===void 0?void 0:si.isEditable)==!1&&(!browser.ios||!this.children.some(ai=>ai instanceof TextView))){let ai=document.createElement("BR");ai.cmIgnore=!0,this.dom.appendChild(ai)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let ws=0,oi;for(let si of this.children){if(!(si instanceof TextView)||/[^ -~]/.test(si.text))return null;let ii=clientRectsFor(si.dom);if(ii.length!=1)return null;ws+=ii[0].width,oi=ii[0].height}return ws?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:ws/this.length,textHeight:oi}:null}coordsAt(ws,oi){let si=coordsInChildren(this,ws,oi);if(!this.children.length&&si&&this.parent){let{heightOracle:ii}=this.parent.view.viewState,ai=si.bottom-si.top;if(Math.abs(ai-ii.lineHeight)<2&&ii.textHeight<ai){let li=(ai-ii.textHeight)/2;return{top:si.top+li,bottom:si.bottom-li,left:si.left,right:si.left}}}return si}become(ws){return ws instanceof LineView&&this.children.length==0&&ws.children.length==0&&attrsEq(this.attrs,ws.attrs)&&this.breakAfter==ws.breakAfter}covers(){return!0}static find(ws,oi){for(let si=0,ii=0;si<ws.children.length;si++){let ai=ws.children[si],li=ii+ai.length;if(li>=oi){if(ai instanceof LineView)return ai;if(li>oi)break}ii=li+ai.breakAfter}return null}}class BlockWidgetView extends ContentView{constructor(ws,oi,si){super(),this.widget=ws,this.length=oi,this.deco=si,this.breakAfter=0,this.prevWidget=null}merge(ws,oi,si,ii,ai,li){return si&&(!(si instanceof BlockWidgetView)||!this.widget.compare(si.widget)||ws>0&&ai<=0||oi<this.length&&li<=0)?!1:(this.length=ws+(si?si.length:0)+(this.length-oi),!0)}domAtPos(ws){return ws==0?DOMPos.before(this.dom):DOMPos.after(this.dom,ws==this.length)}split(ws){let oi=this.length-ws;this.length=ws;let si=new BlockWidgetView(this.widget,oi,this.deco);return si.breakAfter=this.breakAfter,si}get children(){return noChildren}sync(ws){(!this.dom||!this.widget.updateDOM(this.dom,ws))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(ws)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Text.empty}domBoundsAround(){return null}become(ws){return ws instanceof BlockWidgetView&&ws.widget.constructor==this.widget.constructor?(ws.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=ws.widget,this.length=ws.length,this.deco=ws.deco,this.breakAfter=ws.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(ws){return this.widget.ignoreEvent(ws)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(ws,oi){return this.widget.coordsAt(this.dom,ws,oi)||(this.widget instanceof BlockGapWidget?null:flattenRect(this.dom.getBoundingClientRect(),this.length?ws==0:oi<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(ws){let{startSide:oi,endSide:si}=this.deco;return oi==si?!1:ws<0?oi<0:si>0}}class BlockGapWidget extends WidgetType{constructor(ws){super(),this.height=ws}toDOM(){let ws=document.createElement("div");return ws.className="cm-gap",this.updateDOM(ws),ws}eq(ws){return ws.height==this.height}updateDOM(ws){return ws.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ContentBuilder{constructor(ws,oi,si,ii){this.doc=ws,this.pos=oi,this.end=si,this.disallowBlockEffectsFor=ii,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=ws.iter(),this.skip=oi}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let ws=this.content[this.content.length-1];return!(ws.breakAfter||ws instanceof BlockWidgetView&&ws.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new LineView),this.atCursorPos=!0),this.curLine}flushBuffer(ws=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(wrapMarks(new WidgetBufferView(-1),ws),ws.length),this.pendingBuffer=0)}addBlockWidget(ws){this.flushBuffer(),this.curLine=null,this.content.push(ws)}finish(ws){this.pendingBuffer&&ws<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(ws&&this.content.length&&this.content[this.content.length-1]instanceof BlockWidgetView)&&this.getLine()}buildText(ws,oi,si){for(;ws>0;){if(this.textOff==this.text.length){let{value:ai,lineBreak:li,done:ci}=this.cursor.next(this.skip);if(this.skip=0,ci)throw new Error("Ran out of text content when drawing inline views");if(li){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,ws--;continue}else this.text=ai,this.textOff=0}let ii=Math.min(this.text.length-this.textOff,ws,512);this.flushBuffer(oi.slice(oi.length-si)),this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+ii)),oi),si),this.atCursorPos=!0,this.textOff+=ii,ws-=ii,si=0}}span(ws,oi,si,ii){this.buildText(oi-ws,si,ii),this.pos=oi,this.openStart<0&&(this.openStart=ii)}point(ws,oi,si,ii,ai,li){if(this.disallowBlockEffectsFor[li]&&si instanceof PointDecoration){if(si.block)throw new RangeError("Block decorations may not be specified via plugins");if(oi>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let ci=oi-ws;if(si instanceof PointDecoration)if(si.block)si.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new BlockWidgetView(si.widget||NullWidget.block,ci,si));else{let ui=WidgetView.create(si.widget||NullWidget.inline,ci,ci?0:si.startSide),di=this.atCursorPos&&!ui.isEditable&&ai<=ii.length&&(ws<oi||si.startSide>0),hi=!ui.isEditable&&(ws<oi||ai>ii.length||si.startSide<=0),pi=this.getLine();this.pendingBuffer==2&&!di&&!ui.isEditable&&(this.pendingBuffer=0),this.flushBuffer(ii),di&&(pi.append(wrapMarks(new WidgetBufferView(1),ii),ai),ai=ii.length+Math.max(0,ai-ii.length)),pi.append(wrapMarks(ui,ii),ai),this.atCursorPos=hi,this.pendingBuffer=hi?ws<oi||ai>ii.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=ii.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(si);ci&&(this.textOff+ci<=this.text.length?this.textOff+=ci:(this.skip+=ci-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=oi),this.openStart<0&&(this.openStart=ai)}static build(ws,oi,si,ii,ai){let li=new ContentBuilder(ws,oi,si,ai);return li.openEnd=RangeSet.spans(ii,oi,si,li),li.openStart<0&&(li.openStart=li.openEnd),li.finish(li.openEnd),li}}function wrapMarks(Ws,ws){for(let oi of ws)Ws=new MarkView(oi,[Ws],Ws.length);return Ws}class NullWidget extends WidgetType{constructor(ws){super(),this.tag=ws}eq(ws){return ws.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(ws){return ws.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}NullWidget.inline=new NullWidget("span");NullWidget.block=new NullWidget("div");var Direction=function(Ws){return Ws[Ws.LTR=0]="LTR",Ws[Ws.RTL=1]="RTL",Ws}(Direction||(Direction={}));const LTR=Direction.LTR,RTL=Direction.RTL;function dec(Ws){let ws=[];for(let oi=0;oi<Ws.length;oi++)ws.push(1<<+Ws[oi]);return ws}const LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Brackets=Object.create(null),BracketStack=[];for(let Ws of["()","[]","{}"]){let ws=Ws.charCodeAt(0),oi=Ws.charCodeAt(1);Brackets[ws]=oi,Brackets[oi]=-ws}function charType(Ws){return Ws<=247?LowTypes[Ws]:1424<=Ws&&Ws<=1524?2:1536<=Ws&&Ws<=1785?ArabicTypes[Ws-1536]:1774<=Ws&&Ws<=2220?4:8192<=Ws&&Ws<=8204?256:64336<=Ws&&Ws<=65023?4:1}const BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class BidiSpan{get dir(){return this.level%2?RTL:LTR}constructor(ws,oi,si){this.from=ws,this.to=oi,this.level=si}side(ws,oi){return this.dir==oi==ws?this.to:this.from}forward(ws,oi){return ws==(this.dir==oi)}static find(ws,oi,si,ii){let ai=-1;for(let li=0;li<ws.length;li++){let ci=ws[li];if(ci.from<=oi&&ci.to>=oi){if(ci.level==si)return li;(ai<0||(ii!=0?ii<0?ci.from<oi:ci.to>oi:ws[ai].level>ci.level))&&(ai=li)}}if(ai<0)throw new RangeError("Index out of range");return ai}}function isolatesEq(Ws,ws){if(Ws.length!=ws.length)return!1;for(let oi=0;oi<Ws.length;oi++){let si=Ws[oi],ii=ws[oi];if(si.from!=ii.from||si.to!=ii.to||si.direction!=ii.direction||!isolatesEq(si.inner,ii.inner))return!1}return!0}const types=[];function computeCharTypes(Ws,ws,oi,si,ii){for(let ai=0;ai<=si.length;ai++){let li=ai?si[ai-1].to:ws,ci=ai<si.length?si[ai].from:oi,ui=ai?256:ii;for(let di=li,hi=ui,pi=ui;di<ci;di++){let ha=charType(Ws.charCodeAt(di));ha==512?ha=hi:ha==8&&pi==4&&(ha=16),types[di]=ha==4?2:ha,ha&7&&(pi=ha),hi=ha}for(let di=li,hi=ui,pi=ui;di<ci;di++){let ha=types[di];if(ha==128)di<ci-1&&hi==types[di+1]&&hi&24?ha=types[di]=hi:types[di]=256;else if(ha==64){let ga=di+1;for(;ga<ci&&types[ga]==64;)ga++;let va=di&&hi==8||ga<oi&&types[ga]==8?pi==1?1:8:256;for(let ba=di;ba<ga;ba++)types[ba]=va;di=ga-1}else ha==8&&pi==1&&(types[di]=1);hi=ha,ha&7&&(pi=ha)}}}function processBracketPairs(Ws,ws,oi,si,ii){let ai=ii==1?2:1;for(let li=0,ci=0,ui=0;li<=si.length;li++){let di=li?si[li-1].to:ws,hi=li<si.length?si[li].from:oi;for(let pi=di,ha,ga,va;pi<hi;pi++)if(ga=Brackets[ha=Ws.charCodeAt(pi)])if(ga<0){for(let ba=ci-3;ba>=0;ba-=3)if(BracketStack[ba+1]==-ga){let wa=BracketStack[ba+2],xa=wa&2?ii:wa&4?wa&1?ai:ii:0;xa&&(types[pi]=types[BracketStack[ba]]=xa),ci=ba;break}}else{if(BracketStack.length==189)break;BracketStack[ci++]=pi,BracketStack[ci++]=ha,BracketStack[ci++]=ui}else if((va=types[pi])==2||va==1){let ba=va==ii;ui=ba?0:1;for(let wa=ci-3;wa>=0;wa-=3){let xa=BracketStack[wa+2];if(xa&2)break;if(ba)BracketStack[wa+2]|=2;else{if(xa&4)break;BracketStack[wa+2]|=4}}}}}function processNeutrals(Ws,ws,oi,si){for(let ii=0,ai=si;ii<=oi.length;ii++){let li=ii?oi[ii-1].to:Ws,ci=ii<oi.length?oi[ii].from:ws;for(let ui=li;ui<ci;){let di=types[ui];if(di==256){let hi=ui+1;for(;;)if(hi==ci){if(ii==oi.length)break;hi=oi[ii++].to,ci=ii<oi.length?oi[ii].from:ws}else if(types[hi]==256)hi++;else break;let pi=ai==1,ha=(hi<ws?types[hi]:si)==1,ga=pi==ha?pi?1:2:si;for(let va=hi,ba=ii,wa=ba?oi[ba-1].to:Ws;va>ui;)va==wa&&(va=oi[--ba].from,wa=ba?oi[ba-1].to:Ws),types[--va]=ga;ui=hi}else ai=di,ui++}}}function emitSpans(Ws,ws,oi,si,ii,ai,li){let ci=si%2?2:1;if(si%2==ii%2)for(let ui=ws,di=0;ui<oi;){let hi=!0,pi=!1;if(di==ai.length||ui<ai[di].from){let ba=types[ui];ba!=ci&&(hi=!1,pi=ba==16)}let ha=!hi&&ci==1?[]:null,ga=hi?si:si+1,va=ui;e:for(;;)if(di<ai.length&&va==ai[di].from){if(pi)break e;let ba=ai[di];if(!hi)for(let wa=ba.to,xa=di+1;;){if(wa==oi)break e;if(xa<ai.length&&ai[xa].from==wa)wa=ai[xa++].to;else{if(types[wa]==ci)break e;break}}if(di++,ha)ha.push(ba);else{ba.from>ui&&li.push(new BidiSpan(ui,ba.from,ga));let wa=ba.direction==LTR!=!(ga%2);computeSectionOrder(Ws,wa?si+1:si,ii,ba.inner,ba.from,ba.to,li),ui=ba.to}va=ba.to}else{if(va==oi||(hi?types[va]!=ci:types[va]==ci))break;va++}ha?emitSpans(Ws,ui,va,si+1,ii,ha,li):ui<va&&li.push(new BidiSpan(ui,va,ga)),ui=va}else for(let ui=oi,di=ai.length;ui>ws;){let hi=!0,pi=!1;if(!di||ui>ai[di-1].to){let ba=types[ui-1];ba!=ci&&(hi=!1,pi=ba==16)}let ha=!hi&&ci==1?[]:null,ga=hi?si:si+1,va=ui;e:for(;;)if(di&&va==ai[di-1].to){if(pi)break e;let ba=ai[--di];if(!hi)for(let wa=ba.from,xa=di;;){if(wa==ws)break e;if(xa&&ai[xa-1].to==wa)wa=ai[--xa].from;else{if(types[wa-1]==ci)break e;break}}if(ha)ha.push(ba);else{ba.to<ui&&li.push(new BidiSpan(ba.to,ui,ga));let wa=ba.direction==LTR!=!(ga%2);computeSectionOrder(Ws,wa?si+1:si,ii,ba.inner,ba.from,ba.to,li),ui=ba.from}va=ba.from}else{if(va==ws||(hi?types[va-1]!=ci:types[va-1]==ci))break;va--}ha?emitSpans(Ws,va,ui,si+1,ii,ha,li):va<ui&&li.push(new BidiSpan(va,ui,ga)),ui=va}}function computeSectionOrder(Ws,ws,oi,si,ii,ai,li){let ci=ws%2?2:1;computeCharTypes(Ws,ii,ai,si,ci),processBracketPairs(Ws,ii,ai,si,ci),processNeutrals(ii,ai,si,ci),emitSpans(Ws,ii,ai,ws,oi,si,li)}function computeOrder(Ws,ws,oi){if(!Ws)return[new BidiSpan(0,0,ws==RTL?1:0)];if(ws==LTR&&!oi.length&&!BidiRE.test(Ws))return trivialOrder(Ws.length);if(oi.length)for(;Ws.length>types.length;)types[types.length]=256;let si=[],ii=ws==LTR?0:1;return computeSectionOrder(Ws,ii,ii,oi,0,Ws.length,si),si}function trivialOrder(Ws){return[new BidiSpan(0,Ws,0)]}let movedOver="";function moveVisually(Ws,ws,oi,si,ii){var ai;let li=si.head-Ws.from,ci=BidiSpan.find(ws,li,(ai=si.bidiLevel)!==null&&ai!==void 0?ai:-1,si.assoc),ui=ws[ci],di=ui.side(ii,oi);if(li==di){let ha=ci+=ii?1:-1;if(ha<0||ha>=ws.length)return null;ui=ws[ci=ha],li=ui.side(!ii,oi),di=ui.side(ii,oi)}let hi=findClusterBreak(Ws.text,li,ui.forward(ii,oi));(hi<ui.from||hi>ui.to)&&(hi=di),movedOver=Ws.text.slice(Math.min(li,hi),Math.max(li,hi));let pi=ci==(ii?ws.length-1:0)?null:ws[ci+(ii?1:-1)];return pi&&hi==di&&pi.level+(ii?0:1)<ui.level?EditorSelection.cursor(pi.side(!ii,oi)+Ws.from,pi.forward(ii,oi)?1:-1,pi.level):EditorSelection.cursor(hi+Ws.from,ui.forward(ii,oi)?-1:1,ui.level)}function autoDirection(Ws,ws,oi){for(let si=ws;si<oi;si++){let ii=charType(Ws.charCodeAt(si));if(ii==1)return LTR;if(ii==2||ii==4)return RTL}return LTR}const clickAddsSelectionRange=Facet.define(),dragMovesSelection$1=Facet.define(),mouseSelectionStyle=Facet.define(),exceptionSink=Facet.define(),updateListener=Facet.define(),inputHandler$1=Facet.define(),focusChangeEffect=Facet.define(),clipboardInputFilter=Facet.define(),clipboardOutputFilter=Facet.define(),perLineTextDirection=Facet.define({combine:Ws=>Ws.some(ws=>ws)}),nativeSelectionHidden=Facet.define({combine:Ws=>Ws.some(ws=>ws)}),scrollHandler=Facet.define();class ScrollTarget{constructor(ws,oi="nearest",si="nearest",ii=5,ai=5,li=!1){this.range=ws,this.y=oi,this.x=si,this.yMargin=ii,this.xMargin=ai,this.isSnapshot=li}map(ws){return ws.empty?this:new ScrollTarget(this.range.map(ws),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(ws){return this.range.to<=ws.doc.length?this:new ScrollTarget(EditorSelection.cursor(ws.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const scrollIntoView$1=StateEffect.define({map:(Ws,ws)=>Ws.map(ws)}),setEditContextFormatting=StateEffect.define();function logException(Ws,ws,oi){let si=Ws.facet(exceptionSink);si.length?si[0](ws):window.onerror?window.onerror(String(ws),oi,void 0,void 0,ws):oi?console.error(oi+":",ws):console.error(ws)}const editable=Facet.define({combine:Ws=>Ws.length?Ws[0]:!0});let nextPluginID=0;const viewPlugin=Facet.define();class ViewPlugin{constructor(ws,oi,si,ii,ai){this.id=ws,this.create=oi,this.domEventHandlers=si,this.domEventObservers=ii,this.extension=ai(this)}static define(ws,oi){const{eventHandlers:si,eventObservers:ii,provide:ai,decorations:li}=oi||{};return new ViewPlugin(nextPluginID++,ws,si,ii,ci=>{let ui=[viewPlugin.of(ci)];return li&&ui.push(decorations.of(di=>{let hi=di.plugin(ci);return hi?li(hi):Decoration.none})),ai&&ui.push(ai(ci)),ui})}static fromClass(ws,oi){return ViewPlugin.define(si=>new ws(si),oi)}}class PluginInstance{constructor(ws){this.spec=ws,this.mustUpdate=null,this.value=null}update(ws){if(this.value){if(this.mustUpdate){let oi=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(oi)}catch(si){if(logException(oi.state,si,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(ws)}catch(oi){logException(ws.state,oi,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(ws){var oi;if(!((oi=this.value)===null||oi===void 0)&&oi.destroy)try{this.value.destroy()}catch(si){logException(ws.state,si,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const editorAttributes=Facet.define(),contentAttributes=Facet.define(),decorations=Facet.define(),outerDecorations=Facet.define(),atomicRanges=Facet.define(),bidiIsolatedRanges=Facet.define();function getIsolatedRanges(Ws,ws){let oi=Ws.state.facet(bidiIsolatedRanges);if(!oi.length)return oi;let si=oi.map(ai=>ai instanceof Function?ai(Ws):ai),ii=[];return RangeSet.spans(si,ws.from,ws.to,{point(){},span(ai,li,ci,ui){let di=ai-ws.from,hi=li-ws.from,pi=ii;for(let ha=ci.length-1;ha>=0;ha--,ui--){let ga=ci[ha].spec.bidiIsolate,va;if(ga==null&&(ga=autoDirection(ws.text,di,hi)),ui>0&&pi.length&&(va=pi[pi.length-1]).to==di&&va.direction==ga)va.to=hi,pi=va.inner;else{let ba={from:di,to:hi,direction:ga,inner:[]};pi.push(ba),pi=ba.inner}}}}),ii}const scrollMargins=Facet.define();function getScrollMargins(Ws){let ws=0,oi=0,si=0,ii=0;for(let ai of Ws.state.facet(scrollMargins)){let li=ai(Ws);li&&(li.left!=null&&(ws=Math.max(ws,li.left)),li.right!=null&&(oi=Math.max(oi,li.right)),li.top!=null&&(si=Math.max(si,li.top)),li.bottom!=null&&(ii=Math.max(ii,li.bottom)))}return{left:ws,right:oi,top:si,bottom:ii}}const styleModule=Facet.define();class ChangedRange{constructor(ws,oi,si,ii){this.fromA=ws,this.toA=oi,this.fromB=si,this.toB=ii}join(ws){return new ChangedRange(Math.min(this.fromA,ws.fromA),Math.max(this.toA,ws.toA),Math.min(this.fromB,ws.fromB),Math.max(this.toB,ws.toB))}addToSet(ws){let oi=ws.length,si=this;for(;oi>0;oi--){let ii=ws[oi-1];if(!(ii.fromA>si.toA)){if(ii.toA<si.fromA)break;si=si.join(ii),ws.splice(oi-1,1)}}return ws.splice(oi,0,si),ws}static extendWithRanges(ws,oi){if(oi.length==0)return ws;let si=[];for(let ii=0,ai=0,li=0,ci=0;;ii++){let ui=ii==ws.length?null:ws[ii],di=li-ci,hi=ui?ui.fromB:1e9;for(;ai<oi.length&&oi[ai]<hi;){let pi=oi[ai],ha=oi[ai+1],ga=Math.max(ci,pi),va=Math.min(hi,ha);if(ga<=va&&new ChangedRange(ga+di,va+di,ga,va).addToSet(si),ha>hi)break;ai+=2}if(!ui)return si;new ChangedRange(ui.fromA,ui.toA,ui.fromB,ui.toB).addToSet(si),li=ui.toA,ci=ui.toB}}}class ViewUpdate{constructor(ws,oi,si){this.view=ws,this.state=oi,this.transactions=si,this.flags=0,this.startState=ws.state,this.changes=ChangeSet.empty(this.startState.doc.length);for(let ai of si)this.changes=this.changes.compose(ai.changes);let ii=[];this.changes.iterChangedRanges((ai,li,ci,ui)=>ii.push(new ChangedRange(ai,li,ci,ui))),this.changedRanges=ii}static create(ws,oi,si){return new ViewUpdate(ws,oi,si)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(ws=>ws.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class DocView extends ContentView{get length(){return this.view.state.doc.length}constructor(ws){super(),this.view=ws,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Decoration.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(ws.contentDOM),this.children=[new LineView],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ChangedRange(0,0,0,ws.state.doc.length)],0,null)}update(ws){var oi;let si=ws.changedRanges;this.minWidth>0&&si.length&&(si.every(({fromA:di,toA:hi})=>hi<this.minWidthFrom||di>this.minWidthTo)?(this.minWidthFrom=ws.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=ws.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(ws);let ii=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((oi=this.domChanged)===null||oi===void 0)&&oi.newSel?ii=this.domChanged.newSel.head:!touchesComposition(ws.changes,this.hasComposition)&&!ws.selectionSet&&(ii=ws.state.selection.main.head));let ai=ii>-1?findCompositionRange(this.view,ws.changes,ii):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:di,to:hi}=this.hasComposition;si=new ChangedRange(di,hi,ws.changes.mapPos(di,-1),ws.changes.mapPos(hi,1)).addToSet(si.slice())}this.hasComposition=ai?{from:ai.range.fromB,to:ai.range.toB}:null,(browser.ie||browser.chrome)&&!ai&&ws&&ws.state.doc.lines!=ws.startState.doc.lines&&(this.forceSelection=!0);let li=this.decorations,ci=this.updateDeco(),ui=findChangedDeco(li,ci,ws.changes);return si=ChangedRange.extendWithRanges(si,ui),!(this.flags&7)&&si.length==0?!1:(this.updateInner(si,ws.startState.doc.length,ai),ws.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(ws,oi,si){this.view.viewState.mustMeasureContent=!0,this.updateChildren(ws,oi,si);let{observer:ii}=this.view;ii.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let li=browser.chrome||browser.ios?{node:ii.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,li),this.flags&=-8,li&&(li.written||ii.selectionRange.focusNode!=li.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(li=>li.flags&=-9);let ai=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let li of this.children)li instanceof BlockWidgetView&&li.widget instanceof BlockGapWidget&&ai.push(li.dom);ii.updateGaps(ai)}updateChildren(ws,oi,si){let ii=si?si.range.addToSet(ws.slice()):ws,ai=this.childCursor(oi);for(let li=ii.length-1;;li--){let ci=li>=0?ii[li]:null;if(!ci)break;let{fromA:ui,toA:di,fromB:hi,toB:pi}=ci,ha,ga,va,ba;if(si&&si.range.fromB<pi&&si.range.toB>hi){let ku=ContentBuilder.build(this.view.state.doc,hi,si.range.fromB,this.decorations,this.dynamicDecorationMap),gd=ContentBuilder.build(this.view.state.doc,si.range.toB,pi,this.decorations,this.dynamicDecorationMap);ga=ku.breakAtStart,va=ku.openStart,ba=gd.openEnd;let Ed=this.compositionView(si);gd.breakAtStart?Ed.breakAfter=1:gd.content.length&&Ed.merge(Ed.length,Ed.length,gd.content[0],!1,gd.openStart,0)&&(Ed.breakAfter=gd.content[0].breakAfter,gd.content.shift()),ku.content.length&&Ed.merge(0,0,ku.content[ku.content.length-1],!0,0,ku.openEnd)&&ku.content.pop(),ha=ku.content.concat(Ed).concat(gd.content)}else({content:ha,breakAtStart:ga,openStart:va,openEnd:ba}=ContentBuilder.build(this.view.state.doc,hi,pi,this.decorations,this.dynamicDecorationMap));let{i:wa,off:xa}=ai.findPos(di,1),{i:Ca,off:el}=ai.findPos(ui,-1);replaceRange(this,Ca,el,wa,xa,ha,ga,va,ba)}si&&this.fixCompositionDOM(si)}updateEditContextFormatting(ws){this.editContextFormatting=this.editContextFormatting.map(ws.changes);for(let oi of ws.transactions)for(let si of oi.effects)si.is(setEditContextFormatting)&&(this.editContextFormatting=si.value)}compositionView(ws){let oi=new TextView(ws.text.nodeValue);oi.flags|=8;for(let{deco:ii}of ws.marks)oi=new MarkView(ii,[oi],oi.length);let si=new LineView;return si.append(oi,0),si}fixCompositionDOM(ws){let oi=(ai,li)=>{li.flags|=8|(li.children.some(ui=>ui.flags&7)?1:0),this.markedForComposition.add(li);let ci=ContentView.get(ai);ci&&ci!=li&&(ci.dom=null),li.setDOM(ai)},si=this.childPos(ws.range.fromB,1),ii=this.children[si.i];oi(ws.line,ii);for(let ai=ws.marks.length-1;ai>=-1;ai--)si=ii.childPos(si.off,1),ii=ii.children[si.i],oi(ai>=0?ws.marks[ai].node:ws.text,ii)}updateSelection(ws=!1,oi=!1){(ws||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let si=this.view.root.activeElement,ii=si==this.dom,ai=!ii&&!(this.view.state.facet(editable)||this.dom.tabIndex>-1)&&hasSelection(this.dom,this.view.observer.selectionRange)&&!(si&&this.dom.contains(si));if(!(ii||oi||ai))return;let li=this.forceSelection;this.forceSelection=!1;let ci=this.view.state.selection.main,ui=this.moveToLine(this.domAtPos(ci.anchor)),di=ci.empty?ui:this.moveToLine(this.domAtPos(ci.head));if(browser.gecko&&ci.empty&&!this.hasComposition&&betweenUneditable(ui)){let pi=document.createTextNode("");this.view.observer.ignore(()=>ui.node.insertBefore(pi,ui.node.childNodes[ui.offset]||null)),ui=di=new DOMPos(pi,0),li=!0}let hi=this.view.observer.selectionRange;(li||!hi.focusNode||(!isEquivalentPosition(ui.node,ui.offset,hi.anchorNode,hi.anchorOffset)||!isEquivalentPosition(di.node,di.offset,hi.focusNode,hi.focusOffset))&&!this.suppressWidgetCursorChange(hi,ci))&&(this.view.observer.ignore(()=>{browser.android&&browser.chrome&&this.dom.contains(hi.focusNode)&&inUneditable(hi.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let pi=getSelection(this.view.root);if(pi)if(ci.empty){if(browser.gecko){let ha=nextToUneditable(ui.node,ui.offset);if(ha&&ha!=3){let ga=(ha==1?textNodeBefore:textNodeAfter)(ui.node,ui.offset);ga&&(ui=new DOMPos(ga.node,ga.offset))}}pi.collapse(ui.node,ui.offset),ci.bidiLevel!=null&&pi.caretBidiLevel!==void 0&&(pi.caretBidiLevel=ci.bidiLevel)}else if(pi.extend){pi.collapse(ui.node,ui.offset);try{pi.extend(di.node,di.offset)}catch{}}else{let ha=document.createRange();ci.anchor>ci.head&&([ui,di]=[di,ui]),ha.setEnd(di.node,di.offset),ha.setStart(ui.node,ui.offset),pi.removeAllRanges(),pi.addRange(ha)}ai&&this.view.root.activeElement==this.dom&&(this.dom.blur(),si&&si.focus())}),this.view.observer.setSelectionRange(ui,di)),this.impreciseAnchor=ui.precise?null:new DOMPos(hi.anchorNode,hi.anchorOffset),this.impreciseHead=di.precise?null:new DOMPos(hi.focusNode,hi.focusOffset)}suppressWidgetCursorChange(ws,oi){return this.hasComposition&&oi.empty&&isEquivalentPosition(ws.focusNode,ws.focusOffset,ws.anchorNode,ws.anchorOffset)&&this.posFromDOM(ws.focusNode,ws.focusOffset)==oi.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:ws}=this,oi=ws.state.selection.main,si=getSelection(ws.root),{anchorNode:ii,anchorOffset:ai}=ws.observer.selectionRange;if(!si||!oi.empty||!oi.assoc||!si.modify)return;let li=LineView.find(this,oi.head);if(!li)return;let ci=li.posAtStart;if(oi.head==ci||oi.head==ci+li.length)return;let ui=this.coordsAt(oi.head,-1),di=this.coordsAt(oi.head,1);if(!ui||!di||ui.bottom>di.top)return;let hi=this.domAtPos(oi.head+oi.assoc);si.collapse(hi.node,hi.offset),si.modify("move",oi.assoc<0?"forward":"backward","lineboundary"),ws.observer.readSelectionRange();let pi=ws.observer.selectionRange;ws.docView.posFromDOM(pi.anchorNode,pi.anchorOffset)!=oi.from&&si.collapse(ii,ai)}moveToLine(ws){let oi=this.dom,si;if(ws.node!=oi)return ws;for(let ii=ws.offset;!si&&ii<oi.childNodes.length;ii++){let ai=ContentView.get(oi.childNodes[ii]);ai instanceof LineView&&(si=ai.domAtPos(0))}for(let ii=ws.offset-1;!si&&ii>=0;ii--){let ai=ContentView.get(oi.childNodes[ii]);ai instanceof LineView&&(si=ai.domAtPos(ai.length))}return si?new DOMPos(si.node,si.offset,!0):ws}nearest(ws){for(let oi=ws;oi;){let si=ContentView.get(oi);if(si&&si.rootView==this)return si;oi=oi.parentNode}return null}posFromDOM(ws,oi){let si=this.nearest(ws);if(!si)throw new RangeError("Trying to find position for a DOM position outside of the document");return si.localPosFromDOM(ws,oi)+si.posAtStart}domAtPos(ws){let{i:oi,off:si}=this.childCursor().findPos(ws,-1);for(;oi<this.children.length-1;){let ii=this.children[oi];if(si<ii.length||ii instanceof LineView)break;oi++,si=0}return this.children[oi].domAtPos(si)}coordsAt(ws,oi){let si=null,ii=0;for(let ai=this.length,li=this.children.length-1;li>=0;li--){let ci=this.children[li],ui=ai-ci.breakAfter,di=ui-ci.length;if(ui<ws)break;if(di<=ws&&(di<ws||ci.covers(-1))&&(ui>ws||ci.covers(1))&&(!si||ci instanceof LineView&&!(si instanceof LineView&&oi>=0)))si=ci,ii=di;else if(si&&di==ws&&ui==ws&&ci instanceof BlockWidgetView&&Math.abs(oi)<2){if(ci.deco.startSide<0)break;li&&(si=null)}ai=di}return si?si.coordsAt(ws-ii,oi):null}coordsForChar(ws){let{i:oi,off:si}=this.childPos(ws,1),ii=this.children[oi];if(!(ii instanceof LineView))return null;for(;ii.children.length;){let{i:ci,off:ui}=ii.childPos(si,1);for(;;ci++){if(ci==ii.children.length)return null;if((ii=ii.children[ci]).length)break}si=ui}if(!(ii instanceof TextView))return null;let ai=findClusterBreak(ii.text,si);if(ai==si)return null;let li=textRange(ii.dom,si,ai).getClientRects();for(let ci=0;ci<li.length;ci++){let ui=li[ci];if(ci==li.length-1||ui.top<ui.bottom&&ui.left<ui.right)return ui}return null}measureVisibleLineHeights(ws){let oi=[],{from:si,to:ii}=ws,ai=this.view.contentDOM.clientWidth,li=ai>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,ci=-1,ui=this.view.textDirection==Direction.LTR;for(let di=0,hi=0;hi<this.children.length;hi++){let pi=this.children[hi],ha=di+pi.length;if(ha>ii)break;if(di>=si){let ga=pi.dom.getBoundingClientRect();if(oi.push(ga.height),li){let va=pi.dom.lastChild,ba=va?clientRectsFor(va):[];if(ba.length){let wa=ba[ba.length-1],xa=ui?wa.right-ga.left:ga.right-wa.left;xa>ci&&(ci=xa,this.minWidth=ai,this.minWidthFrom=di,this.minWidthTo=ha)}}}di=ha+pi.breakAfter}return oi}textDirectionAt(ws){let{i:oi}=this.childPos(ws,1);return getComputedStyle(this.children[oi].dom).direction=="rtl"?Direction.RTL:Direction.LTR}measureTextSize(){for(let ai of this.children)if(ai instanceof LineView){let li=ai.measureTextSize();if(li)return li}let ws=document.createElement("div"),oi,si,ii;return ws.className="cm-line",ws.style.width="99999px",ws.style.position="absolute",ws.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(ws);let ai=clientRectsFor(ws.firstChild)[0];oi=ws.getBoundingClientRect().height,si=ai?ai.width/27:7,ii=ai?ai.height:oi,ws.remove()}),{lineHeight:oi,charWidth:si,textHeight:ii}}childCursor(ws=this.length){let oi=this.children.length;return oi&&(ws-=this.children[--oi].length),new ChildCursor(this.children,ws,oi)}computeBlockGapDeco(){let ws=[],oi=this.view.viewState;for(let si=0,ii=0;;ii++){let ai=ii==oi.viewports.length?null:oi.viewports[ii],li=ai?ai.from-1:this.length;if(li>si){let ci=(oi.lineBlockAt(li).bottom-oi.lineBlockAt(si).top)/this.view.scaleY;ws.push(Decoration.replace({widget:new BlockGapWidget(ci),block:!0,inclusive:!0,isBlockGap:!0}).range(si,li))}if(!ai)break;si=ai.to+1}return Decoration.set(ws)}updateDeco(){let ws=1,oi=this.view.state.facet(decorations).map(ai=>(this.dynamicDecorationMap[ws++]=typeof ai=="function")?ai(this.view):ai),si=!1,ii=this.view.state.facet(outerDecorations).map((ai,li)=>{let ci=typeof ai=="function";return ci&&(si=!0),ci?ai(this.view):ai});for(ii.length&&(this.dynamicDecorationMap[ws++]=si,oi.push(RangeSet.join(ii))),this.decorations=[this.editContextFormatting,...oi,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];ws<this.decorations.length;)this.dynamicDecorationMap[ws++]=!1;return this.decorations}scrollIntoView(ws){if(ws.isSnapshot){let di=this.view.viewState.lineBlockAt(ws.range.head);this.view.scrollDOM.scrollTop=di.top-ws.yMargin,this.view.scrollDOM.scrollLeft=ws.xMargin;return}for(let di of this.view.state.facet(scrollHandler))try{if(di(this.view,ws.range,ws))return!0}catch(hi){logException(this.view.state,hi,"scroll handler")}let{range:oi}=ws,si=this.coordsAt(oi.head,oi.empty?oi.assoc:oi.head>oi.anchor?-1:1),ii;if(!si)return;!oi.empty&&(ii=this.coordsAt(oi.anchor,oi.anchor>oi.head?-1:1))&&(si={left:Math.min(si.left,ii.left),top:Math.min(si.top,ii.top),right:Math.max(si.right,ii.right),bottom:Math.max(si.bottom,ii.bottom)});let ai=getScrollMargins(this.view),li={left:si.left-ai.left,top:si.top-ai.top,right:si.right+ai.right,bottom:si.bottom+ai.bottom},{offsetWidth:ci,offsetHeight:ui}=this.view.scrollDOM;scrollRectIntoView(this.view.scrollDOM,li,oi.head<oi.anchor?-1:1,ws.x,ws.y,Math.max(Math.min(ws.xMargin,ci),-ci),Math.max(Math.min(ws.yMargin,ui),-ui),this.view.textDirection==Direction.LTR)}}function betweenUneditable(Ws){return Ws.node.nodeType==1&&Ws.node.firstChild&&(Ws.offset==0||Ws.node.childNodes[Ws.offset-1].contentEditable=="false")&&(Ws.offset==Ws.node.childNodes.length||Ws.node.childNodes[Ws.offset].contentEditable=="false")}function findCompositionNode(Ws,ws){let oi=Ws.observer.selectionRange;if(!oi.focusNode)return null;let si=textNodeBefore(oi.focusNode,oi.focusOffset),ii=textNodeAfter(oi.focusNode,oi.focusOffset),ai=si||ii;if(ii&&si&&ii.node!=si.node){let ci=ContentView.get(ii.node);if(!ci||ci instanceof TextView&&ci.text!=ii.node.nodeValue)ai=ii;else if(Ws.docView.lastCompositionAfterCursor){let ui=ContentView.get(si.node);!ui||ui instanceof TextView&&ui.text!=si.node.nodeValue||(ai=ii)}}if(Ws.docView.lastCompositionAfterCursor=ai!=si,!ai)return null;let li=ws-ai.offset;return{from:li,to:li+ai.node.nodeValue.length,node:ai.node}}function findCompositionRange(Ws,ws,oi){let si=findCompositionNode(Ws,oi);if(!si)return null;let{node:ii,from:ai,to:li}=si,ci=ii.nodeValue;if(/[\n\r]/.test(ci)||Ws.state.doc.sliceString(si.from,si.to)!=ci)return null;let ui=ws.invertedDesc,di=new ChangedRange(ui.mapPos(ai),ui.mapPos(li),ai,li),hi=[];for(let pi=ii.parentNode;;pi=pi.parentNode){let ha=ContentView.get(pi);if(ha instanceof MarkView)hi.push({node:pi,deco:ha.mark});else{if(ha instanceof LineView||pi.nodeName=="DIV"&&pi.parentNode==Ws.contentDOM)return{range:di,text:ii,marks:hi,line:pi};if(pi!=Ws.contentDOM)hi.push({node:pi,deco:new MarkDecoration({inclusive:!0,attributes:getAttrs(pi),tagName:pi.tagName.toLowerCase()})});else return null}}}function nextToUneditable(Ws,ws){return Ws.nodeType!=1?0:(ws&&Ws.childNodes[ws-1].contentEditable=="false"?1:0)|(ws<Ws.childNodes.length&&Ws.childNodes[ws].contentEditable=="false"?2:0)}let DecorationComparator$1=class{constructor(){this.changes=[]}compareRange(Ws,ws){addRange(Ws,ws,this.changes)}comparePoint(Ws,ws){addRange(Ws,ws,this.changes)}boundChange(Ws){addRange(Ws,Ws,this.changes)}};function findChangedDeco(Ws,ws,oi){let si=new DecorationComparator$1;return RangeSet.compare(Ws,ws,oi,si),si.changes}function inUneditable(Ws,ws){for(let oi=Ws;oi&&oi!=ws;oi=oi.assignedSlot||oi.parentNode)if(oi.nodeType==1&&oi.contentEditable=="false")return!0;return!1}function touchesComposition(Ws,ws){let oi=!1;return ws&&Ws.iterChangedRanges((si,ii)=>{si<ws.to&&ii>ws.from&&(oi=!0)}),oi}function groupAt(Ws,ws,oi=1){let si=Ws.charCategorizer(ws),ii=Ws.doc.lineAt(ws),ai=ws-ii.from;if(ii.length==0)return EditorSelection.cursor(ws);ai==0?oi=1:ai==ii.length&&(oi=-1);let li=ai,ci=ai;oi<0?li=findClusterBreak(ii.text,ai,!1):ci=findClusterBreak(ii.text,ai);let ui=si(ii.text.slice(li,ci));for(;li>0;){let di=findClusterBreak(ii.text,li,!1);if(si(ii.text.slice(di,li))!=ui)break;li=di}for(;ci<ii.length;){let di=findClusterBreak(ii.text,ci);if(si(ii.text.slice(ci,di))!=ui)break;ci=di}return EditorSelection.range(li+ii.from,ci+ii.from)}function getdx(Ws,ws){return ws.left>Ws?ws.left-Ws:Math.max(0,Ws-ws.right)}function getdy(Ws,ws){return ws.top>Ws?ws.top-Ws:Math.max(0,Ws-ws.bottom)}function yOverlap(Ws,ws){return Ws.top<ws.bottom-1&&Ws.bottom>ws.top+1}function upTop(Ws,ws){return ws<Ws.top?{top:ws,left:Ws.left,right:Ws.right,bottom:Ws.bottom}:Ws}function upBot(Ws,ws){return ws>Ws.bottom?{top:Ws.top,left:Ws.left,right:Ws.right,bottom:ws}:Ws}function domPosAtCoords(Ws,ws,oi){let si,ii,ai,li,ci=!1,ui,di,hi,pi;for(let va=Ws.firstChild;va;va=va.nextSibling){let ba=clientRectsFor(va);for(let wa=0;wa<ba.length;wa++){let xa=ba[wa];ii&&yOverlap(ii,xa)&&(xa=upTop(upBot(xa,ii.bottom),ii.top));let Ca=getdx(ws,xa),el=getdy(oi,xa);if(Ca==0&&el==0)return va.nodeType==3?domPosInText(va,ws,oi):domPosAtCoords(va,ws,oi);if(!si||li>el||li==el&&ai>Ca){si=va,ii=xa,ai=Ca,li=el;let ku=el?oi<xa.top?-1:1:Ca?ws<xa.left?-1:1:0;ci=!ku||(ku>0?wa<ba.length-1:wa>0)}Ca==0?oi>xa.bottom&&(!hi||hi.bottom<xa.bottom)?(ui=va,hi=xa):oi<xa.top&&(!pi||pi.top>xa.top)&&(di=va,pi=xa):hi&&yOverlap(hi,xa)?hi=upBot(hi,xa.bottom):pi&&yOverlap(pi,xa)&&(pi=upTop(pi,xa.top))}}if(hi&&hi.bottom>=oi?(si=ui,ii=hi):pi&&pi.top<=oi&&(si=di,ii=pi),!si)return{node:Ws,offset:0};let ha=Math.max(ii.left,Math.min(ii.right,ws));if(si.nodeType==3)return domPosInText(si,ha,oi);if(ci&&si.contentEditable!="false")return domPosAtCoords(si,ha,oi);let ga=Array.prototype.indexOf.call(Ws.childNodes,si)+(ws>=(ii.left+ii.right)/2?1:0);return{node:Ws,offset:ga}}function domPosInText(Ws,ws,oi){let si=Ws.nodeValue.length,ii=-1,ai=1e9,li=0;for(let ci=0;ci<si;ci++){let ui=textRange(Ws,ci,ci+1).getClientRects();for(let di=0;di<ui.length;di++){let hi=ui[di];if(hi.top==hi.bottom)continue;li||(li=ws-hi.left);let pi=(hi.top>oi?hi.top-oi:oi-hi.bottom)-1;if(hi.left-1<=ws&&hi.right+1>=ws&&pi<ai){let ha=ws>=(hi.left+hi.right)/2,ga=ha;if((browser.chrome||browser.gecko)&&textRange(Ws,ci).getBoundingClientRect().left==hi.right&&(ga=!ha),pi<=0)return{node:Ws,offset:ci+(ga?1:0)};ii=ci+(ga?1:0),ai=pi}}}return{node:Ws,offset:ii>-1?ii:li>0?Ws.nodeValue.length:0}}function posAtCoords(Ws,ws,oi,si=-1){var ii,ai;let li=Ws.contentDOM.getBoundingClientRect(),ci=li.top+Ws.viewState.paddingTop,ui,{docHeight:di}=Ws.viewState,{x:hi,y:pi}=ws,ha=pi-ci;if(ha<0)return 0;if(ha>di)return Ws.state.doc.length;for(let ku=Ws.viewState.heightOracle.textHeight/2,gd=!1;ui=Ws.elementAtHeight(ha),ui.type!=BlockType.Text;)for(;ha=si>0?ui.bottom+ku:ui.top-ku,!(ha>=0&&ha<=di);){if(gd)return oi?null:0;gd=!0,si=-si}pi=ci+ha;let ga=ui.from;if(ga<Ws.viewport.from)return Ws.viewport.from==0?0:oi?null:posAtCoordsImprecise(Ws,li,ui,hi,pi);if(ga>Ws.viewport.to)return Ws.viewport.to==Ws.state.doc.length?Ws.state.doc.length:oi?null:posAtCoordsImprecise(Ws,li,ui,hi,pi);let va=Ws.dom.ownerDocument,ba=Ws.root.elementFromPoint?Ws.root:va,wa=ba.elementFromPoint(hi,pi);wa&&!Ws.contentDOM.contains(wa)&&(wa=null),wa||(hi=Math.max(li.left+1,Math.min(li.right-1,hi)),wa=ba.elementFromPoint(hi,pi),wa&&!Ws.contentDOM.contains(wa)&&(wa=null));let xa,Ca=-1;if(wa&&((ii=Ws.docView.nearest(wa))===null||ii===void 0?void 0:ii.isEditable)!=!1){if(va.caretPositionFromPoint){let ku=va.caretPositionFromPoint(hi,pi);ku&&({offsetNode:xa,offset:Ca}=ku)}else if(va.caretRangeFromPoint){let ku=va.caretRangeFromPoint(hi,pi);ku&&({startContainer:xa,startOffset:Ca}=ku,(!Ws.contentDOM.contains(xa)||browser.safari&&isSuspiciousSafariCaretResult(xa,Ca,hi)||browser.chrome&&isSuspiciousChromeCaretResult(xa,Ca,hi))&&(xa=void 0))}xa&&(Ca=Math.min(maxOffset(xa),Ca))}if(!xa||!Ws.docView.dom.contains(xa)){let ku=LineView.find(Ws.docView,ga);if(!ku)return ha>ui.top+ui.height/2?ui.to:ui.from;({node:xa,offset:Ca}=domPosAtCoords(ku.dom,hi,pi))}let el=Ws.docView.nearest(xa);if(!el)return null;if(el.isWidget&&((ai=el.dom)===null||ai===void 0?void 0:ai.nodeType)==1){let ku=el.dom.getBoundingClientRect();return ws.y<ku.top||ws.y<=ku.bottom&&ws.x<=(ku.left+ku.right)/2?el.posAtStart:el.posAtEnd}else return el.localPosFromDOM(xa,Ca)+el.posAtStart}function posAtCoordsImprecise(Ws,ws,oi,si,ii){let ai=Math.round((si-ws.left)*Ws.defaultCharacterWidth);if(Ws.lineWrapping&&oi.height>Ws.defaultLineHeight*1.5){let ci=Ws.viewState.heightOracle.textHeight,ui=Math.floor((ii-oi.top-(Ws.defaultLineHeight-ci)*.5)/ci);ai+=ui*Ws.viewState.heightOracle.lineLength}let li=Ws.state.sliceDoc(oi.from,oi.to);return oi.from+findColumn(li,ai,Ws.state.tabSize)}function isSuspiciousSafariCaretResult(Ws,ws,oi){let si;if(Ws.nodeType!=3||ws!=(si=Ws.nodeValue.length))return!1;for(let ii=Ws.nextSibling;ii;ii=ii.nextSibling)if(ii.nodeType!=1||ii.nodeName!="BR")return!1;return textRange(Ws,si-1,si).getBoundingClientRect().left>oi}function isSuspiciousChromeCaretResult(Ws,ws,oi){if(ws!=0)return!1;for(let ii=Ws;;){let ai=ii.parentNode;if(!ai||ai.nodeType!=1||ai.firstChild!=ii)return!1;if(ai.classList.contains("cm-line"))break;ii=ai}let si=Ws.nodeType==1?Ws.getBoundingClientRect():textRange(Ws,0,Math.max(Ws.nodeValue.length,1)).getBoundingClientRect();return oi-si.left>5}function blockAt(Ws,ws){let oi=Ws.lineBlockAt(ws);if(Array.isArray(oi.type)){for(let si of oi.type)if(si.to>ws||si.to==ws&&(si.to==oi.to||si.type==BlockType.Text))return si}return oi}function moveToLineBoundary(Ws,ws,oi,si){let ii=blockAt(Ws,ws.head),ai=!si||ii.type!=BlockType.Text||!(Ws.lineWrapping||ii.widgetLineBreaks)?null:Ws.coordsAtPos(ws.assoc<0&&ws.head>ii.from?ws.head-1:ws.head);if(ai){let li=Ws.dom.getBoundingClientRect(),ci=Ws.textDirectionAt(ii.from),ui=Ws.posAtCoords({x:oi==(ci==Direction.LTR)?li.right-1:li.left+1,y:(ai.top+ai.bottom)/2});if(ui!=null)return EditorSelection.cursor(ui,oi?-1:1)}return EditorSelection.cursor(oi?ii.to:ii.from,oi?-1:1)}function moveByChar(Ws,ws,oi,si){let ii=Ws.state.doc.lineAt(ws.head),ai=Ws.bidiSpans(ii),li=Ws.textDirectionAt(ii.from);for(let ci=ws,ui=null;;){let di=moveVisually(ii,ai,li,ci,oi),hi=movedOver;if(!di){if(ii.number==(oi?Ws.state.doc.lines:1))return ci;hi=`
319
- `,ii=Ws.state.doc.line(ii.number+(oi?1:-1)),ai=Ws.bidiSpans(ii),di=Ws.visualLineSide(ii,!oi)}if(ui){if(!ui(hi))return ci}else{if(!si)return di;ui=si(hi)}ci=di}}function byGroup(Ws,ws,oi){let si=Ws.state.charCategorizer(ws),ii=si(oi);return ai=>{let li=si(ai);return ii==CharCategory.Space&&(ii=li),ii==li}}function moveVertically(Ws,ws,oi,si){let ii=ws.head,ai=oi?1:-1;if(ii==(oi?Ws.state.doc.length:0))return EditorSelection.cursor(ii,ws.assoc);let li=ws.goalColumn,ci,ui=Ws.contentDOM.getBoundingClientRect(),di=Ws.coordsAtPos(ii,ws.assoc||-1),hi=Ws.documentTop;if(di)li==null&&(li=di.left-ui.left),ci=ai<0?di.top:di.bottom;else{let ga=Ws.viewState.lineBlockAt(ii);li==null&&(li=Math.min(ui.right-ui.left,Ws.defaultCharacterWidth*(ii-ga.from))),ci=(ai<0?ga.top:ga.bottom)+hi}let pi=ui.left+li,ha=si??Ws.viewState.heightOracle.textHeight>>1;for(let ga=0;;ga+=10){let va=ci+(ha+ga)*ai,ba=posAtCoords(Ws,{x:pi,y:va},!1,ai);if(va<ui.top||va>ui.bottom||(ai<0?ba<ii:ba>ii)){let wa=Ws.docView.coordsForChar(ba),xa=!wa||va<wa.top?-1:1;return EditorSelection.cursor(ba,xa,void 0,li)}}}function skipAtomicRanges(Ws,ws,oi){for(;;){let si=0;for(let ii of Ws)ii.between(ws-1,ws+1,(ai,li,ci)=>{if(ws>ai&&ws<li){let ui=si||oi||(ws-ai<li-ws?-1:1);ws=ui<0?ai:li,si=ui}});if(!si)return ws}}function skipAtoms(Ws,ws,oi){let si=skipAtomicRanges(Ws.state.facet(atomicRanges).map(ii=>ii(Ws)),oi.from,ws.head>oi.from?-1:1);return si==oi.from?oi:EditorSelection.cursor(si,si<oi.from?1:-1)}const LineBreakPlaceholder="￿";class DOMReader{constructor(ws,oi){this.points=ws,this.text="",this.lineSeparator=oi.facet(EditorState.lineSeparator)}append(ws){this.text+=ws}lineBreak(){this.text+=LineBreakPlaceholder}readRange(ws,oi){if(!ws)return this;let si=ws.parentNode;for(let ii=ws;;){this.findPointBefore(si,ii);let ai=this.text.length;this.readNode(ii);let li=ii.nextSibling;if(li==oi)break;let ci=ContentView.get(ii),ui=ContentView.get(li);(ci&&ui?ci.breakAfter:(ci?ci.breakAfter:isBlockElement(ii))||isBlockElement(li)&&(ii.nodeName!="BR"||ii.cmIgnore)&&this.text.length>ai)&&this.lineBreak(),ii=li}return this.findPointBefore(si,oi),this}readTextNode(ws){let oi=ws.nodeValue;for(let si of this.points)si.node==ws&&(si.pos=this.text.length+Math.min(si.offset,oi.length));for(let si=0,ii=this.lineSeparator?null:/\r\n?|\n/g;;){let ai=-1,li=1,ci;if(this.lineSeparator?(ai=oi.indexOf(this.lineSeparator,si),li=this.lineSeparator.length):(ci=ii.exec(oi))&&(ai=ci.index,li=ci[0].length),this.append(oi.slice(si,ai<0?oi.length:ai)),ai<0)break;if(this.lineBreak(),li>1)for(let ui of this.points)ui.node==ws&&ui.pos>this.text.length&&(ui.pos-=li-1);si=ai+li}}readNode(ws){if(ws.cmIgnore)return;let oi=ContentView.get(ws),si=oi&&oi.overrideDOMText;if(si!=null){this.findPointInside(ws,si.length);for(let ii=si.iter();!ii.next().done;)ii.lineBreak?this.lineBreak():this.append(ii.value)}else ws.nodeType==3?this.readTextNode(ws):ws.nodeName=="BR"?ws.nextSibling&&this.lineBreak():ws.nodeType==1&&this.readRange(ws.firstChild,null)}findPointBefore(ws,oi){for(let si of this.points)si.node==ws&&ws.childNodes[si.offset]==oi&&(si.pos=this.text.length)}findPointInside(ws,oi){for(let si of this.points)(ws.nodeType==3?si.node==ws:ws.contains(si.node))&&(si.pos=this.text.length+(isAtEnd(ws,si.node,si.offset)?oi:0))}}function isAtEnd(Ws,ws,oi){for(;;){if(!ws||oi<maxOffset(ws))return!1;if(ws==Ws)return!0;oi=domIndex(ws)+1,ws=ws.parentNode}}class DOMPoint{constructor(ws,oi){this.node=ws,this.offset=oi,this.pos=-1}}class DOMChange{constructor(ws,oi,si,ii){this.typeOver=ii,this.bounds=null,this.text="",this.domChanged=oi>-1;let{impreciseHead:ai,impreciseAnchor:li}=ws.docView;if(ws.state.readOnly&&oi>-1)this.newSel=null;else if(oi>-1&&(this.bounds=ws.docView.domBoundsAround(oi,si,0))){let ci=ai||li?[]:selectionPoints(ws),ui=new DOMReader(ci,ws.state);ui.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=ui.text,this.newSel=selectionFromPoints(ci,this.bounds.from)}else{let ci=ws.observer.selectionRange,ui=ai&&ai.node==ci.focusNode&&ai.offset==ci.focusOffset||!contains(ws.contentDOM,ci.focusNode)?ws.state.selection.main.head:ws.docView.posFromDOM(ci.focusNode,ci.focusOffset),di=li&&li.node==ci.anchorNode&&li.offset==ci.anchorOffset||!contains(ws.contentDOM,ci.anchorNode)?ws.state.selection.main.anchor:ws.docView.posFromDOM(ci.anchorNode,ci.anchorOffset),hi=ws.viewport;if((browser.ios||browser.chrome)&&ws.state.selection.main.empty&&ui!=di&&(hi.from>0||hi.to<ws.state.doc.length)){let pi=Math.min(ui,di),ha=Math.max(ui,di),ga=hi.from-pi,va=hi.to-ha;(ga==0||ga==1||pi==0)&&(va==0||va==-1||ha==ws.state.doc.length)&&(ui=0,di=ws.state.doc.length)}this.newSel=EditorSelection.single(di,ui)}}}function applyDOMChange(Ws,ws){let oi,{newSel:si}=ws,ii=Ws.state.selection.main,ai=Ws.inputState.lastKeyTime>Date.now()-100?Ws.inputState.lastKeyCode:-1;if(ws.bounds){let{from:li,to:ci}=ws.bounds,ui=ii.from,di=null;(ai===8||browser.android&&ws.text.length<ci-li)&&(ui=ii.to,di="end");let hi=findDiff(Ws.state.doc.sliceString(li,ci,LineBreakPlaceholder),ws.text,ui-li,di);hi&&(browser.chrome&&ai==13&&hi.toB==hi.from+2&&ws.text.slice(hi.from,hi.toB)==LineBreakPlaceholder+LineBreakPlaceholder&&hi.toB--,oi={from:li+hi.from,to:li+hi.toA,insert:Text.of(ws.text.slice(hi.from,hi.toB).split(LineBreakPlaceholder))})}else si&&(!Ws.hasFocus&&Ws.state.facet(editable)||si.main.eq(ii))&&(si=null);if(!oi&&!si)return!1;if(!oi&&ws.typeOver&&!ii.empty&&si&&si.main.empty?oi={from:ii.from,to:ii.to,insert:Ws.state.doc.slice(ii.from,ii.to)}:(browser.mac||browser.android)&&oi&&oi.from==oi.to&&oi.from==ii.head-1&&/^\. ?$/.test(oi.insert.toString())&&Ws.contentDOM.getAttribute("autocorrect")=="off"?(si&&oi.insert.length==2&&(si=EditorSelection.single(si.main.anchor-1,si.main.head-1)),oi={from:oi.from,to:oi.to,insert:Text.of([oi.insert.toString().replace("."," ")])}):oi&&oi.from>=ii.from&&oi.to<=ii.to&&(oi.from!=ii.from||oi.to!=ii.to)&&ii.to-ii.from-(oi.to-oi.from)<=4?oi={from:ii.from,to:ii.to,insert:Ws.state.doc.slice(ii.from,oi.from).append(oi.insert).append(Ws.state.doc.slice(oi.to,ii.to))}:browser.chrome&&oi&&oi.from==oi.to&&oi.from==ii.head&&oi.insert.toString()==`
320
- `&&Ws.lineWrapping&&(si&&(si=EditorSelection.single(si.main.anchor-1,si.main.head-1)),oi={from:ii.from,to:ii.to,insert:Text.of([" "])}),oi)return applyDOMChangeInner(Ws,oi,si,ai);if(si&&!si.main.eq(ii)){let li=!1,ci="select";return Ws.inputState.lastSelectionTime>Date.now()-50&&(Ws.inputState.lastSelectionOrigin=="select"&&(li=!0),ci=Ws.inputState.lastSelectionOrigin),Ws.dispatch({selection:si,scrollIntoView:li,userEvent:ci}),!0}else return!1}function applyDOMChangeInner(Ws,ws,oi,si=-1){if(browser.ios&&Ws.inputState.flushIOSKey(ws))return!0;let ii=Ws.state.selection.main;if(browser.android&&(ws.to==ii.to&&(ws.from==ii.from||ws.from==ii.from-1&&Ws.state.sliceDoc(ws.from,ii.from)==" ")&&ws.insert.length==1&&ws.insert.lines==2&&dispatchKey(Ws.contentDOM,"Enter",13)||(ws.from==ii.from-1&&ws.to==ii.to&&ws.insert.length==0||si==8&&ws.insert.length<ws.to-ws.from&&ws.to>ii.head)&&dispatchKey(Ws.contentDOM,"Backspace",8)||ws.from==ii.from&&ws.to==ii.to+1&&ws.insert.length==0&&dispatchKey(Ws.contentDOM,"Delete",46)))return!0;let ai=ws.insert.toString();Ws.inputState.composing>=0&&Ws.inputState.composing++;let li,ci=()=>li||(li=applyDefaultInsert(Ws,ws,oi));return Ws.state.facet(inputHandler$1).some(ui=>ui(Ws,ws.from,ws.to,ai,ci))||Ws.dispatch(ci()),!0}function applyDefaultInsert(Ws,ws,oi){let si,ii=Ws.state,ai=ii.selection.main;if(ws.from>=ai.from&&ws.to<=ai.to&&ws.to-ws.from>=(ai.to-ai.from)/3&&(!oi||oi.main.empty&&oi.main.from==ws.from+ws.insert.length)&&Ws.inputState.composing<0){let ci=ai.from<ws.from?ii.sliceDoc(ai.from,ws.from):"",ui=ai.to>ws.to?ii.sliceDoc(ws.to,ai.to):"";si=ii.replaceSelection(Ws.state.toText(ci+ws.insert.sliceString(0,void 0,Ws.state.lineBreak)+ui))}else{let ci=ii.changes(ws),ui=oi&&oi.main.to<=ci.newLength?oi.main:void 0;if(ii.selection.ranges.length>1&&Ws.inputState.composing>=0&&ws.to<=ai.to&&ws.to>=ai.to-10){let di=Ws.state.sliceDoc(ws.from,ws.to),hi,pi=oi&&findCompositionNode(Ws,oi.main.head);if(pi){let va=ws.insert.length-(ws.to-ws.from);hi={from:pi.from,to:pi.to-va}}else hi=Ws.state.doc.lineAt(ai.head);let ha=ai.to-ws.to,ga=ai.to-ai.from;si=ii.changeByRange(va=>{if(va.from==ai.from&&va.to==ai.to)return{changes:ci,range:ui||va.map(ci)};let ba=va.to-ha,wa=ba-di.length;if(va.to-va.from!=ga||Ws.state.sliceDoc(wa,ba)!=di||va.to>=hi.from&&va.from<=hi.to)return{range:va};let xa=ii.changes({from:wa,to:ba,insert:ws.insert}),Ca=va.to-ai.to;return{changes:xa,range:ui?EditorSelection.range(Math.max(0,ui.anchor+Ca),Math.max(0,ui.head+Ca)):va.map(xa)}})}else si={changes:ci,selection:ui&&ii.selection.replaceRange(ui)}}let li="input.type";return(Ws.composing||Ws.inputState.compositionPendingChange&&Ws.inputState.compositionEndedAt>Date.now()-50)&&(Ws.inputState.compositionPendingChange=!1,li+=".compose",Ws.inputState.compositionFirstChange&&(li+=".start",Ws.inputState.compositionFirstChange=!1)),ii.update(si,{userEvent:li,scrollIntoView:!0})}function findDiff(Ws,ws,oi,si){let ii=Math.min(Ws.length,ws.length),ai=0;for(;ai<ii&&Ws.charCodeAt(ai)==ws.charCodeAt(ai);)ai++;if(ai==ii&&Ws.length==ws.length)return null;let li=Ws.length,ci=ws.length;for(;li>0&&ci>0&&Ws.charCodeAt(li-1)==ws.charCodeAt(ci-1);)li--,ci--;if(si=="end"){let ui=Math.max(0,ai-Math.min(li,ci));oi-=li+ui-ai}if(li<ai&&Ws.length<ws.length){let ui=oi<=ai&&oi>=li?ai-oi:0;ai-=ui,ci=ai+(ci-li),li=ai}else if(ci<ai){let ui=oi<=ai&&oi>=ci?ai-oi:0;ai-=ui,li=ai+(li-ci),ci=ai}return{from:ai,toA:li,toB:ci}}function selectionPoints(Ws){let ws=[];if(Ws.root.activeElement!=Ws.contentDOM)return ws;let{anchorNode:oi,anchorOffset:si,focusNode:ii,focusOffset:ai}=Ws.observer.selectionRange;return oi&&(ws.push(new DOMPoint(oi,si)),(ii!=oi||ai!=si)&&ws.push(new DOMPoint(ii,ai))),ws}function selectionFromPoints(Ws,ws){if(Ws.length==0)return null;let oi=Ws[0].pos,si=Ws.length==2?Ws[1].pos:oi;return oi>-1&&si>-1?EditorSelection.single(oi+ws,si+ws):null}class InputState{setSelectionOrigin(ws){this.lastSelectionOrigin=ws,this.lastSelectionTime=Date.now()}constructor(ws){this.view=ws,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=ws.hasFocus,browser.safari&&ws.contentDOM.addEventListener("input",()=>null),browser.gecko&&firefoxCopyCutHack(ws.contentDOM.ownerDocument)}handleEvent(ws){!eventBelongsToEditor(this.view,ws)||this.ignoreDuringComposition(ws)||ws.type=="keydown"&&this.keydown(ws)||this.runHandlers(ws.type,ws)}runHandlers(ws,oi){let si=this.handlers[ws];if(si){for(let ii of si.observers)ii(this.view,oi);for(let ii of si.handlers){if(oi.defaultPrevented)break;if(ii(this.view,oi)){oi.preventDefault();break}}}}ensureHandlers(ws){let oi=computeHandlers(ws),si=this.handlers,ii=this.view.contentDOM;for(let ai in oi)if(ai!="scroll"){let li=!oi[ai].handlers.length,ci=si[ai];ci&&li!=!ci.handlers.length&&(ii.removeEventListener(ai,this.handleEvent),ci=null),ci||ii.addEventListener(ai,this.handleEvent,{passive:li})}for(let ai in si)ai!="scroll"&&!oi[ai]&&ii.removeEventListener(ai,this.handleEvent);this.handlers=oi}keydown(ws){if(this.lastKeyCode=ws.keyCode,this.lastKeyTime=Date.now(),ws.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&ws.keyCode!=27&&modifierCodes.indexOf(ws.keyCode)<0&&(this.tabFocusMode=-1),browser.android&&browser.chrome&&!ws.synthetic&&(ws.keyCode==13||ws.keyCode==8))return this.view.observer.delayAndroidKey(ws.key,ws.keyCode),!0;let oi;return browser.ios&&!ws.synthetic&&!ws.altKey&&!ws.metaKey&&((oi=PendingKeys.find(si=>si.keyCode==ws.keyCode))&&!ws.ctrlKey||EmacsyPendingKeys.indexOf(ws.key)>-1&&ws.ctrlKey&&!ws.shiftKey)?(this.pendingIOSKey=oi||ws,setTimeout(()=>this.flushIOSKey(),250),!0):(ws.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(ws){let oi=this.pendingIOSKey;return!oi||oi.key=="Enter"&&ws&&ws.from<ws.to&&/^\S+$/.test(ws.insert.toString())?!1:(this.pendingIOSKey=void 0,dispatchKey(this.view.contentDOM,oi.key,oi.keyCode,oi instanceof KeyboardEvent?oi:void 0))}ignoreDuringComposition(ws){return/^key/.test(ws.type)?this.composing>0?!0:browser.safari&&!browser.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(ws){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=ws}update(ws){this.view.observer.update(ws),this.mouseSelection&&this.mouseSelection.update(ws),this.draggedContent&&ws.docChanged&&(this.draggedContent=this.draggedContent.map(ws.changes)),ws.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function bindHandler(Ws,ws){return(oi,si)=>{try{return ws.call(Ws,si,oi)}catch(ii){logException(oi.state,ii)}}}function computeHandlers(Ws){let ws=Object.create(null);function oi(si){return ws[si]||(ws[si]={observers:[],handlers:[]})}for(let si of Ws){let ii=si.spec;if(ii&&ii.domEventHandlers)for(let ai in ii.domEventHandlers){let li=ii.domEventHandlers[ai];li&&oi(ai).handlers.push(bindHandler(si.value,li))}if(ii&&ii.domEventObservers)for(let ai in ii.domEventObservers){let li=ii.domEventObservers[ai];li&&oi(ai).observers.push(bindHandler(si.value,li))}}for(let si in handlers)oi(si).handlers.push(handlers[si]);for(let si in observers)oi(si).observers.push(observers[si]);return ws}const PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],EmacsyPendingKeys="dthko",modifierCodes=[16,17,18,20,91,92,224,225],dragScrollMargin=6;function dragScrollSpeed(Ws){return Math.max(0,Ws)*.7+8}function dist(Ws,ws){return Math.max(Math.abs(Ws.clientX-ws.clientX),Math.abs(Ws.clientY-ws.clientY))}class MouseSelection{constructor(ws,oi,si,ii){this.view=ws,this.startEvent=oi,this.style=si,this.mustSelect=ii,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=oi,this.scrollParents=scrollableParents(ws.contentDOM),this.atoms=ws.state.facet(atomicRanges).map(li=>li(ws));let ai=ws.contentDOM.ownerDocument;ai.addEventListener("mousemove",this.move=this.move.bind(this)),ai.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=oi.shiftKey,this.multiple=ws.state.facet(EditorState.allowMultipleSelections)&&addsSelectionRange(ws,oi),this.dragging=isInPrimarySelection(ws,oi)&&getClickType(oi)==1?null:!1}start(ws){this.dragging===!1&&this.select(ws)}move(ws){if(ws.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&dist(this.startEvent,ws)<10)return;this.select(this.lastEvent=ws);let oi=0,si=0,ii=0,ai=0,li=this.view.win.innerWidth,ci=this.view.win.innerHeight;this.scrollParents.x&&({left:ii,right:li}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:ai,bottom:ci}=this.scrollParents.y.getBoundingClientRect());let ui=getScrollMargins(this.view);ws.clientX-ui.left<=ii+dragScrollMargin?oi=-dragScrollSpeed(ii-ws.clientX):ws.clientX+ui.right>=li-dragScrollMargin&&(oi=dragScrollSpeed(ws.clientX-li)),ws.clientY-ui.top<=ai+dragScrollMargin?si=-dragScrollSpeed(ai-ws.clientY):ws.clientY+ui.bottom>=ci-dragScrollMargin&&(si=dragScrollSpeed(ws.clientY-ci)),this.setScrollSpeed(oi,si)}up(ws){this.dragging==null&&this.select(this.lastEvent),this.dragging||ws.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let ws=this.view.contentDOM.ownerDocument;ws.removeEventListener("mousemove",this.move),ws.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(ws,oi){this.scrollSpeed={x:ws,y:oi},ws||oi?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:ws,y:oi}=this.scrollSpeed;ws&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=ws,ws=0),oi&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=oi,oi=0),(ws||oi)&&this.view.win.scrollBy(ws,oi),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(ws){let oi=null;for(let si=0;si<ws.ranges.length;si++){let ii=ws.ranges[si],ai=null;if(ii.empty){let li=skipAtomicRanges(this.atoms,ii.from,0);li!=ii.from&&(ai=EditorSelection.cursor(li,-1))}else{let li=skipAtomicRanges(this.atoms,ii.from,-1),ci=skipAtomicRanges(this.atoms,ii.to,1);(li!=ii.from||ci!=ii.to)&&(ai=EditorSelection.range(ii.from==ii.anchor?li:ci,ii.from==ii.head?li:ci))}ai&&(oi||(oi=ws.ranges.slice()),oi[si]=ai)}return oi?EditorSelection.create(oi,ws.mainIndex):ws}select(ws){let{view:oi}=this,si=this.skipAtoms(this.style.get(ws,this.extend,this.multiple));(this.mustSelect||!si.eq(oi.state.selection,this.dragging===!1))&&this.view.dispatch({selection:si,userEvent:"select.pointer"}),this.mustSelect=!1}update(ws){ws.transactions.some(oi=>oi.isUserEvent("input.type"))?this.destroy():this.style.update(ws)&&setTimeout(()=>this.select(this.lastEvent),20)}}function addsSelectionRange(Ws,ws){let oi=Ws.state.facet(clickAddsSelectionRange);return oi.length?oi[0](ws):browser.mac?ws.metaKey:ws.ctrlKey}function dragMovesSelection(Ws,ws){let oi=Ws.state.facet(dragMovesSelection$1);return oi.length?oi[0](ws):browser.mac?!ws.altKey:!ws.ctrlKey}function isInPrimarySelection(Ws,ws){let{main:oi}=Ws.state.selection;if(oi.empty)return!1;let si=getSelection(Ws.root);if(!si||si.rangeCount==0)return!0;let ii=si.getRangeAt(0).getClientRects();for(let ai=0;ai<ii.length;ai++){let li=ii[ai];if(li.left<=ws.clientX&&li.right>=ws.clientX&&li.top<=ws.clientY&&li.bottom>=ws.clientY)return!0}return!1}function eventBelongsToEditor(Ws,ws){if(!ws.bubbles)return!0;if(ws.defaultPrevented)return!1;for(let oi=ws.target,si;oi!=Ws.contentDOM;oi=oi.parentNode)if(!oi||oi.nodeType==11||(si=ContentView.get(oi))&&si.ignoreEvent(ws))return!1;return!0}const handlers=Object.create(null),observers=Object.create(null),brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(Ws){let ws=Ws.dom.parentNode;if(!ws)return;let oi=ws.appendChild(document.createElement("textarea"));oi.style.cssText="position: fixed; left: -10000px; top: 10px",oi.focus(),setTimeout(()=>{Ws.focus(),oi.remove(),doPaste(Ws,oi.value)},50)}function textFilter(Ws,ws,oi){for(let si of Ws.facet(ws))oi=si(oi,Ws);return oi}function doPaste(Ws,ws){ws=textFilter(Ws.state,clipboardInputFilter,ws);let{state:oi}=Ws,si,ii=1,ai=oi.toText(ws),li=ai.lines==oi.selection.ranges.length;if(lastLinewiseCopy!=null&&oi.selection.ranges.every(ci=>ci.empty)&&lastLinewiseCopy==ai.toString()){let ci=-1;si=oi.changeByRange(ui=>{let di=oi.doc.lineAt(ui.from);if(di.from==ci)return{range:ui};ci=di.from;let hi=oi.toText((li?ai.line(ii++).text:ws)+oi.lineBreak);return{changes:{from:di.from,insert:hi},range:EditorSelection.cursor(ui.from+hi.length)}})}else li?si=oi.changeByRange(ci=>{let ui=ai.line(ii++);return{changes:{from:ci.from,to:ci.to,insert:ui.text},range:EditorSelection.cursor(ci.from+ui.length)}}):si=oi.replaceSelection(ai);Ws.dispatch(si,{userEvent:"input.paste",scrollIntoView:!0})}observers.scroll=Ws=>{Ws.inputState.lastScrollTop=Ws.scrollDOM.scrollTop,Ws.inputState.lastScrollLeft=Ws.scrollDOM.scrollLeft};handlers.keydown=(Ws,ws)=>(Ws.inputState.setSelectionOrigin("select"),ws.keyCode==27&&Ws.inputState.tabFocusMode!=0&&(Ws.inputState.tabFocusMode=Date.now()+2e3),!1);observers.touchstart=(Ws,ws)=>{Ws.inputState.lastTouchTime=Date.now(),Ws.inputState.setSelectionOrigin("select.pointer")};observers.touchmove=Ws=>{Ws.inputState.setSelectionOrigin("select.pointer")};handlers.mousedown=(Ws,ws)=>{if(Ws.observer.flush(),Ws.inputState.lastTouchTime>Date.now()-2e3)return!1;let oi=null;for(let si of Ws.state.facet(mouseSelectionStyle))if(oi=si(Ws,ws),oi)break;if(!oi&&ws.button==0&&(oi=basicMouseSelection(Ws,ws)),oi){let si=!Ws.hasFocus;Ws.inputState.startMouseSelection(new MouseSelection(Ws,ws,oi,si)),si&&Ws.observer.ignore(()=>{focusPreventScroll(Ws.contentDOM);let ai=Ws.root.activeElement;ai&&!ai.contains(Ws.contentDOM)&&ai.blur()});let ii=Ws.inputState.mouseSelection;if(ii)return ii.start(ws),ii.dragging===!1}return!1};function rangeForClick(Ws,ws,oi,si){if(si==1)return EditorSelection.cursor(ws,oi);if(si==2)return groupAt(Ws.state,ws,oi);{let ii=LineView.find(Ws.docView,ws),ai=Ws.state.doc.lineAt(ii?ii.posAtEnd:ws),li=ii?ii.posAtStart:ai.from,ci=ii?ii.posAtEnd:ai.to;return ci<Ws.state.doc.length&&ci==ai.to&&ci++,EditorSelection.range(li,ci)}}let inside=(Ws,ws,oi)=>ws>=oi.top&&ws<=oi.bottom&&Ws>=oi.left&&Ws<=oi.right;function findPositionSide(Ws,ws,oi,si){let ii=LineView.find(Ws.docView,ws);if(!ii)return 1;let ai=ws-ii.posAtStart;if(ai==0)return 1;if(ai==ii.length)return-1;let li=ii.coordsAt(ai,-1);if(li&&inside(oi,si,li))return-1;let ci=ii.coordsAt(ai,1);return ci&&inside(oi,si,ci)?1:li&&li.bottom>=si?-1:1}function queryPos(Ws,ws){let oi=Ws.posAtCoords({x:ws.clientX,y:ws.clientY},!1);return{pos:oi,bias:findPositionSide(Ws,oi,ws.clientX,ws.clientY)}}const BadMouseDetail=browser.ie&&browser.ie_version<=11;let lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(Ws){if(!BadMouseDetail)return Ws.detail;let ws=lastMouseDown,oi=lastMouseDownTime;return lastMouseDown=Ws,lastMouseDownTime=Date.now(),lastMouseDownCount=!ws||oi>Date.now()-400&&Math.abs(ws.clientX-Ws.clientX)<2&&Math.abs(ws.clientY-Ws.clientY)<2?(lastMouseDownCount+1)%3:1}function basicMouseSelection(Ws,ws){let oi=queryPos(Ws,ws),si=getClickType(ws),ii=Ws.state.selection;return{update(ai){ai.docChanged&&(oi.pos=ai.changes.mapPos(oi.pos),ii=ii.map(ai.changes))},get(ai,li,ci){let ui=queryPos(Ws,ai),di,hi=rangeForClick(Ws,ui.pos,ui.bias,si);if(oi.pos!=ui.pos&&!li){let pi=rangeForClick(Ws,oi.pos,oi.bias,si),ha=Math.min(pi.from,hi.from),ga=Math.max(pi.to,hi.to);hi=ha<hi.from?EditorSelection.range(ha,ga):EditorSelection.range(ga,ha)}return li?ii.replaceRange(ii.main.extend(hi.from,hi.to)):ci&&si==1&&ii.ranges.length>1&&(di=removeRangeAround(ii,ui.pos))?di:ci?ii.addRange(hi):EditorSelection.create([hi])}}}function removeRangeAround(Ws,ws){for(let oi=0;oi<Ws.ranges.length;oi++){let{from:si,to:ii}=Ws.ranges[oi];if(si<=ws&&ii>=ws)return EditorSelection.create(Ws.ranges.slice(0,oi).concat(Ws.ranges.slice(oi+1)),Ws.mainIndex==oi?0:Ws.mainIndex-(Ws.mainIndex>oi?1:0))}return null}handlers.dragstart=(Ws,ws)=>{let{selection:{main:oi}}=Ws.state;if(ws.target.draggable){let ii=Ws.docView.nearest(ws.target);if(ii&&ii.isWidget){let ai=ii.posAtStart,li=ai+ii.length;(ai>=oi.to||li<=oi.from)&&(oi=EditorSelection.range(ai,li))}}let{inputState:si}=Ws;return si.mouseSelection&&(si.mouseSelection.dragging=!0),si.draggedContent=oi,ws.dataTransfer&&(ws.dataTransfer.setData("Text",textFilter(Ws.state,clipboardOutputFilter,Ws.state.sliceDoc(oi.from,oi.to))),ws.dataTransfer.effectAllowed="copyMove"),!1};handlers.dragend=Ws=>(Ws.inputState.draggedContent=null,!1);function dropText(Ws,ws,oi,si){if(oi=textFilter(Ws.state,clipboardInputFilter,oi),!oi)return;let ii=Ws.posAtCoords({x:ws.clientX,y:ws.clientY},!1),{draggedContent:ai}=Ws.inputState,li=si&&ai&&dragMovesSelection(Ws,ws)?{from:ai.from,to:ai.to}:null,ci={from:ii,insert:oi},ui=Ws.state.changes(li?[li,ci]:ci);Ws.focus(),Ws.dispatch({changes:ui,selection:{anchor:ui.mapPos(ii,-1),head:ui.mapPos(ii,1)},userEvent:li?"move.drop":"input.drop"}),Ws.inputState.draggedContent=null}handlers.drop=(Ws,ws)=>{if(!ws.dataTransfer)return!1;if(Ws.state.readOnly)return!0;let oi=ws.dataTransfer.files;if(oi&&oi.length){let si=Array(oi.length),ii=0,ai=()=>{++ii==oi.length&&dropText(Ws,ws,si.filter(li=>li!=null).join(Ws.state.lineBreak),!1)};for(let li=0;li<oi.length;li++){let ci=new FileReader;ci.onerror=ai,ci.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(ci.result)||(si[li]=ci.result),ai()},ci.readAsText(oi[li])}return!0}else{let si=ws.dataTransfer.getData("Text");if(si)return dropText(Ws,ws,si,!0),!0}return!1};handlers.paste=(Ws,ws)=>{if(Ws.state.readOnly)return!0;Ws.observer.flush();let oi=brokenClipboardAPI?null:ws.clipboardData;return oi?(doPaste(Ws,oi.getData("text/plain")||oi.getData("text/uri-list")),!0):(capturePaste(Ws),!1)};function captureCopy(Ws,ws){let oi=Ws.dom.parentNode;if(!oi)return;let si=oi.appendChild(document.createElement("textarea"));si.style.cssText="position: fixed; left: -10000px; top: 10px",si.value=ws,si.focus(),si.selectionEnd=ws.length,si.selectionStart=0,setTimeout(()=>{si.remove(),Ws.focus()},50)}function copiedRange(Ws){let ws=[],oi=[],si=!1;for(let ii of Ws.selection.ranges)ii.empty||(ws.push(Ws.sliceDoc(ii.from,ii.to)),oi.push(ii));if(!ws.length){let ii=-1;for(let{from:ai}of Ws.selection.ranges){let li=Ws.doc.lineAt(ai);li.number>ii&&(ws.push(li.text),oi.push({from:li.from,to:Math.min(Ws.doc.length,li.to+1)})),ii=li.number}si=!0}return{text:textFilter(Ws,clipboardOutputFilter,ws.join(Ws.lineBreak)),ranges:oi,linewise:si}}let lastLinewiseCopy=null;handlers.copy=handlers.cut=(Ws,ws)=>{let{text:oi,ranges:si,linewise:ii}=copiedRange(Ws.state);if(!oi&&!ii)return!1;lastLinewiseCopy=ii?oi:null,ws.type=="cut"&&!Ws.state.readOnly&&Ws.dispatch({changes:si,scrollIntoView:!0,userEvent:"delete.cut"});let ai=brokenClipboardAPI?null:ws.clipboardData;return ai?(ai.clearData(),ai.setData("text/plain",oi),!0):(captureCopy(Ws,oi),!1)};const isFocusChange=Annotation.define();function focusChangeTransaction(Ws,ws){let oi=[];for(let si of Ws.facet(focusChangeEffect)){let ii=si(Ws,ws);ii&&oi.push(ii)}return oi?Ws.update({effects:oi,annotations:isFocusChange.of(!0)}):null}function updateForFocusChange(Ws){setTimeout(()=>{let ws=Ws.hasFocus;if(ws!=Ws.inputState.notifiedFocused){let oi=focusChangeTransaction(Ws.state,ws);oi?Ws.dispatch(oi):Ws.update([])}},10)}observers.focus=Ws=>{Ws.inputState.lastFocusTime=Date.now(),!Ws.scrollDOM.scrollTop&&(Ws.inputState.lastScrollTop||Ws.inputState.lastScrollLeft)&&(Ws.scrollDOM.scrollTop=Ws.inputState.lastScrollTop,Ws.scrollDOM.scrollLeft=Ws.inputState.lastScrollLeft),updateForFocusChange(Ws)};observers.blur=Ws=>{Ws.observer.clearSelectionRange(),updateForFocusChange(Ws)};observers.compositionstart=observers.compositionupdate=Ws=>{Ws.observer.editContext||(Ws.inputState.compositionFirstChange==null&&(Ws.inputState.compositionFirstChange=!0),Ws.inputState.composing<0&&(Ws.inputState.composing=0))};observers.compositionend=Ws=>{Ws.observer.editContext||(Ws.inputState.composing=-1,Ws.inputState.compositionEndedAt=Date.now(),Ws.inputState.compositionPendingKey=!0,Ws.inputState.compositionPendingChange=Ws.observer.pendingRecords().length>0,Ws.inputState.compositionFirstChange=null,browser.chrome&&browser.android?Ws.observer.flushSoon():Ws.inputState.compositionPendingChange?Promise.resolve().then(()=>Ws.observer.flush()):setTimeout(()=>{Ws.inputState.composing<0&&Ws.docView.hasComposition&&Ws.update([])},50))};observers.contextmenu=Ws=>{Ws.inputState.lastContextMenu=Date.now()};handlers.beforeinput=(Ws,ws)=>{var oi,si;if(ws.inputType=="insertReplacementText"&&Ws.observer.editContext){let ai=(oi=ws.dataTransfer)===null||oi===void 0?void 0:oi.getData("text/plain"),li=ws.getTargetRanges();if(ai&&li.length){let ci=li[0],ui=Ws.posAtDOM(ci.startContainer,ci.startOffset),di=Ws.posAtDOM(ci.endContainer,ci.endOffset);return applyDOMChangeInner(Ws,{from:ui,to:di,insert:Ws.state.toText(ai)},null),!0}}let ii;if(browser.chrome&&browser.android&&(ii=PendingKeys.find(ai=>ai.inputType==ws.inputType))&&(Ws.observer.delayAndroidKey(ii.key,ii.keyCode),ii.key=="Backspace"||ii.key=="Delete")){let ai=((si=window.visualViewport)===null||si===void 0?void 0:si.height)||0;setTimeout(()=>{var li;(((li=window.visualViewport)===null||li===void 0?void 0:li.height)||0)>ai+10&&Ws.hasFocus&&(Ws.contentDOM.blur(),Ws.focus())},100)}return browser.ios&&ws.inputType=="deleteContentForward"&&Ws.observer.flushSoon(),browser.safari&&ws.inputType=="insertText"&&Ws.inputState.composing>=0&&setTimeout(()=>observers.compositionend(Ws,ws),20),!1};const appliedFirefoxHack=new Set;function firefoxCopyCutHack(Ws){appliedFirefoxHack.has(Ws)||(appliedFirefoxHack.add(Ws),Ws.addEventListener("copy",()=>{}),Ws.addEventListener("cut",()=>{}))}const wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];let heightChangeFlag=!1;function clearHeightChangeFlag(){heightChangeFlag=!1}class HeightOracle{constructor(ws){this.lineWrapping=ws,this.doc=Text.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(ws,oi){let si=this.doc.lineAt(oi).number-this.doc.lineAt(ws).number+1;return this.lineWrapping&&(si+=Math.max(0,Math.ceil((oi-ws-si*this.lineLength*.5)/this.lineLength))),this.lineHeight*si}heightForLine(ws){return this.lineWrapping?(1+Math.max(0,Math.ceil((ws-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(ws){return this.doc=ws,this}mustRefreshForWrapping(ws){return wrappingWhiteSpace.indexOf(ws)>-1!=this.lineWrapping}mustRefreshForHeights(ws){let oi=!1;for(let si=0;si<ws.length;si++){let ii=ws[si];ii<0?si++:this.heightSamples[Math.floor(ii*10)]||(oi=!0,this.heightSamples[Math.floor(ii*10)]=!0)}return oi}refresh(ws,oi,si,ii,ai,li){let ci=wrappingWhiteSpace.indexOf(ws)>-1,ui=Math.round(oi)!=Math.round(this.lineHeight)||this.lineWrapping!=ci;if(this.lineWrapping=ci,this.lineHeight=oi,this.charWidth=si,this.textHeight=ii,this.lineLength=ai,ui){this.heightSamples={};for(let di=0;di<li.length;di++){let hi=li[di];hi<0?di++:this.heightSamples[Math.floor(hi*10)]=!0}}return ui}}class MeasuredHeights{constructor(ws,oi){this.from=ws,this.heights=oi,this.index=0}get more(){return this.index<this.heights.length}}class BlockInfo{constructor(ws,oi,si,ii,ai){this.from=ws,this.length=oi,this.top=si,this.height=ii,this._content=ai}get type(){return typeof this._content=="number"?BlockType.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof PointDecoration?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(ws){let oi=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(ws._content)?ws._content:[ws]);return new BlockInfo(this.from,this.length+ws.length,this.top,this.height+ws.height,oi)}}var QueryType$1=function(Ws){return Ws[Ws.ByPos=0]="ByPos",Ws[Ws.ByHeight=1]="ByHeight",Ws[Ws.ByPosNoHeight=2]="ByPosNoHeight",Ws}(QueryType$1||(QueryType$1={}));const Epsilon=.001;class HeightMap{constructor(ws,oi,si=2){this.length=ws,this.height=oi,this.flags=si}get outdated(){return(this.flags&2)>0}set outdated(ws){this.flags=(ws?2:0)|this.flags&-3}setHeight(ws){this.height!=ws&&(Math.abs(this.height-ws)>Epsilon&&(heightChangeFlag=!0),this.height=ws)}replace(ws,oi,si){return HeightMap.of(si)}decomposeLeft(ws,oi){oi.push(this)}decomposeRight(ws,oi){oi.push(this)}applyChanges(ws,oi,si,ii){let ai=this,li=si.doc;for(let ci=ii.length-1;ci>=0;ci--){let{fromA:ui,toA:di,fromB:hi,toB:pi}=ii[ci],ha=ai.lineAt(ui,QueryType$1.ByPosNoHeight,si.setDoc(oi),0,0),ga=ha.to>=di?ha:ai.lineAt(di,QueryType$1.ByPosNoHeight,si,0,0);for(pi+=ga.to-di,di=ga.to;ci>0&&ha.from<=ii[ci-1].toA;)ui=ii[ci-1].fromA,hi=ii[ci-1].fromB,ci--,ui<ha.from&&(ha=ai.lineAt(ui,QueryType$1.ByPosNoHeight,si,0,0));hi+=ha.from-ui,ui=ha.from;let va=NodeBuilder.build(si.setDoc(li),ws,hi,pi);ai=replace(ai,ai.replace(ui,di,va))}return ai.updateHeight(si,0)}static empty(){return new HeightMapText(0,0)}static of(ws){if(ws.length==1)return ws[0];let oi=0,si=ws.length,ii=0,ai=0;for(;;)if(oi==si)if(ii>ai*2){let ci=ws[oi-1];ci.break?ws.splice(--oi,1,ci.left,null,ci.right):ws.splice(--oi,1,ci.left,ci.right),si+=1+ci.break,ii-=ci.size}else if(ai>ii*2){let ci=ws[si];ci.break?ws.splice(si,1,ci.left,null,ci.right):ws.splice(si,1,ci.left,ci.right),si+=2+ci.break,ai-=ci.size}else break;else if(ii<ai){let ci=ws[oi++];ci&&(ii+=ci.size)}else{let ci=ws[--si];ci&&(ai+=ci.size)}let li=0;return ws[oi-1]==null?(li=1,oi--):ws[oi]==null&&(li=1,si++),new HeightMapBranch(HeightMap.of(ws.slice(0,oi)),li,HeightMap.of(ws.slice(si)))}}function replace(Ws,ws){return Ws==ws?Ws:(Ws.constructor!=ws.constructor&&(heightChangeFlag=!0),ws)}HeightMap.prototype.size=1;class HeightMapBlock extends HeightMap{constructor(ws,oi,si){super(ws,oi),this.deco=si}blockAt(ws,oi,si,ii){return new BlockInfo(ii,this.length,si,this.height,this.deco||0)}lineAt(ws,oi,si,ii,ai){return this.blockAt(0,si,ii,ai)}forEachLine(ws,oi,si,ii,ai,li){ws<=ai+this.length&&oi>=ai&&li(this.blockAt(0,si,ii,ai))}updateHeight(ws,oi=0,si=!1,ii){return ii&&ii.from<=oi&&ii.more&&this.setHeight(ii.heights[ii.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class HeightMapText extends HeightMapBlock{constructor(ws,oi){super(ws,oi,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(ws,oi,si,ii){return new BlockInfo(ii,this.length,si,this.height,this.breaks)}replace(ws,oi,si){let ii=si[0];return si.length==1&&(ii instanceof HeightMapText||ii instanceof HeightMapGap&&ii.flags&4)&&Math.abs(this.length-ii.length)<10?(ii instanceof HeightMapGap?ii=new HeightMapText(ii.length,this.height):ii.height=this.height,this.outdated||(ii.outdated=!1),ii):HeightMap.of(si)}updateHeight(ws,oi=0,si=!1,ii){return ii&&ii.from<=oi&&ii.more?this.setHeight(ii.heights[ii.index++]):(si||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,ws.heightForLine(this.length-this.collapsed))+this.breaks*ws.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class HeightMapGap extends HeightMap{constructor(ws){super(ws,0)}heightMetrics(ws,oi){let si=ws.doc.lineAt(oi).number,ii=ws.doc.lineAt(oi+this.length).number,ai=ii-si+1,li,ci=0;if(ws.lineWrapping){let ui=Math.min(this.height,ws.lineHeight*ai);li=ui/ai,this.length>ai+1&&(ci=(this.height-ui)/(this.length-ai-1))}else li=this.height/ai;return{firstLine:si,lastLine:ii,perLine:li,perChar:ci}}blockAt(ws,oi,si,ii){let{firstLine:ai,lastLine:li,perLine:ci,perChar:ui}=this.heightMetrics(oi,ii);if(oi.lineWrapping){let di=ii+(ws<oi.lineHeight?0:Math.round(Math.max(0,Math.min(1,(ws-si)/this.height))*this.length)),hi=oi.doc.lineAt(di),pi=ci+hi.length*ui,ha=Math.max(si,ws-pi/2);return new BlockInfo(hi.from,hi.length,ha,pi,0)}else{let di=Math.max(0,Math.min(li-ai,Math.floor((ws-si)/ci))),{from:hi,length:pi}=oi.doc.line(ai+di);return new BlockInfo(hi,pi,si+ci*di,ci,0)}}lineAt(ws,oi,si,ii,ai){if(oi==QueryType$1.ByHeight)return this.blockAt(ws,si,ii,ai);if(oi==QueryType$1.ByPosNoHeight){let{from:ga,to:va}=si.doc.lineAt(ws);return new BlockInfo(ga,va-ga,0,0,0)}let{firstLine:li,perLine:ci,perChar:ui}=this.heightMetrics(si,ai),di=si.doc.lineAt(ws),hi=ci+di.length*ui,pi=di.number-li,ha=ii+ci*pi+ui*(di.from-ai-pi);return new BlockInfo(di.from,di.length,Math.max(ii,Math.min(ha,ii+this.height-hi)),hi,0)}forEachLine(ws,oi,si,ii,ai,li){ws=Math.max(ws,ai),oi=Math.min(oi,ai+this.length);let{firstLine:ci,perLine:ui,perChar:di}=this.heightMetrics(si,ai);for(let hi=ws,pi=ii;hi<=oi;){let ha=si.doc.lineAt(hi);if(hi==ws){let va=ha.number-ci;pi+=ui*va+di*(ws-ai-va)}let ga=ui+di*ha.length;li(new BlockInfo(ha.from,ha.length,pi,ga,0)),pi+=ga,hi=ha.to+1}}replace(ws,oi,si){let ii=this.length-oi;if(ii>0){let ai=si[si.length-1];ai instanceof HeightMapGap?si[si.length-1]=new HeightMapGap(ai.length+ii):si.push(null,new HeightMapGap(ii-1))}if(ws>0){let ai=si[0];ai instanceof HeightMapGap?si[0]=new HeightMapGap(ws+ai.length):si.unshift(new HeightMapGap(ws-1),null)}return HeightMap.of(si)}decomposeLeft(ws,oi){oi.push(new HeightMapGap(ws-1),null)}decomposeRight(ws,oi){oi.push(null,new HeightMapGap(this.length-ws-1))}updateHeight(ws,oi=0,si=!1,ii){let ai=oi+this.length;if(ii&&ii.from<=oi+this.length&&ii.more){let li=[],ci=Math.max(oi,ii.from),ui=-1;for(ii.from>oi&&li.push(new HeightMapGap(ii.from-oi-1).updateHeight(ws,oi));ci<=ai&&ii.more;){let hi=ws.doc.lineAt(ci).length;li.length&&li.push(null);let pi=ii.heights[ii.index++];ui==-1?ui=pi:Math.abs(pi-ui)>=Epsilon&&(ui=-2);let ha=new HeightMapText(hi,pi);ha.outdated=!1,li.push(ha),ci+=hi+1}ci<=ai&&li.push(null,new HeightMapGap(ai-ci).updateHeight(ws,ci));let di=HeightMap.of(li);return(ui<0||Math.abs(di.height-this.height)>=Epsilon||Math.abs(ui-this.heightMetrics(ws,oi).perLine)>=Epsilon)&&(heightChangeFlag=!0),replace(this,di)}else(si||this.outdated)&&(this.setHeight(ws.heightForGap(oi,oi+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class HeightMapBranch extends HeightMap{constructor(ws,oi,si){super(ws.length+oi+si.length,ws.height+si.height,oi|(ws.outdated||si.outdated?2:0)),this.left=ws,this.right=si,this.size=ws.size+si.size}get break(){return this.flags&1}blockAt(ws,oi,si,ii){let ai=si+this.left.height;return ws<ai?this.left.blockAt(ws,oi,si,ii):this.right.blockAt(ws,oi,ai,ii+this.left.length+this.break)}lineAt(ws,oi,si,ii,ai){let li=ii+this.left.height,ci=ai+this.left.length+this.break,ui=oi==QueryType$1.ByHeight?ws<li:ws<ci,di=ui?this.left.lineAt(ws,oi,si,ii,ai):this.right.lineAt(ws,oi,si,li,ci);if(this.break||(ui?di.to<ci:di.from>ci))return di;let hi=oi==QueryType$1.ByPosNoHeight?QueryType$1.ByPosNoHeight:QueryType$1.ByPos;return ui?di.join(this.right.lineAt(ci,hi,si,li,ci)):this.left.lineAt(ci,hi,si,ii,ai).join(di)}forEachLine(ws,oi,si,ii,ai,li){let ci=ii+this.left.height,ui=ai+this.left.length+this.break;if(this.break)ws<ui&&this.left.forEachLine(ws,oi,si,ii,ai,li),oi>=ui&&this.right.forEachLine(ws,oi,si,ci,ui,li);else{let di=this.lineAt(ui,QueryType$1.ByPos,si,ii,ai);ws<di.from&&this.left.forEachLine(ws,di.from-1,si,ii,ai,li),di.to>=ws&&di.from<=oi&&li(di),oi>di.to&&this.right.forEachLine(di.to+1,oi,si,ci,ui,li)}}replace(ws,oi,si){let ii=this.left.length+this.break;if(oi<ii)return this.balanced(this.left.replace(ws,oi,si),this.right);if(ws>this.left.length)return this.balanced(this.left,this.right.replace(ws-ii,oi-ii,si));let ai=[];ws>0&&this.decomposeLeft(ws,ai);let li=ai.length;for(let ci of si)ai.push(ci);if(ws>0&&mergeGaps(ai,li-1),oi<this.length){let ci=ai.length;this.decomposeRight(oi,ai),mergeGaps(ai,ci)}return HeightMap.of(ai)}decomposeLeft(ws,oi){let si=this.left.length;if(ws<=si)return this.left.decomposeLeft(ws,oi);oi.push(this.left),this.break&&(si++,ws>=si&&oi.push(null)),ws>si&&this.right.decomposeLeft(ws-si,oi)}decomposeRight(ws,oi){let si=this.left.length,ii=si+this.break;if(ws>=ii)return this.right.decomposeRight(ws-ii,oi);ws<si&&this.left.decomposeRight(ws,oi),this.break&&ws<ii&&oi.push(null),oi.push(this.right)}balanced(ws,oi){return ws.size>2*oi.size||oi.size>2*ws.size?HeightMap.of(this.break?[ws,null,oi]:[ws,oi]):(this.left=replace(this.left,ws),this.right=replace(this.right,oi),this.setHeight(ws.height+oi.height),this.outdated=ws.outdated||oi.outdated,this.size=ws.size+oi.size,this.length=ws.length+this.break+oi.length,this)}updateHeight(ws,oi=0,si=!1,ii){let{left:ai,right:li}=this,ci=oi+ai.length+this.break,ui=null;return ii&&ii.from<=oi+ai.length&&ii.more?ui=ai=ai.updateHeight(ws,oi,si,ii):ai.updateHeight(ws,oi,si),ii&&ii.from<=ci+li.length&&ii.more?ui=li=li.updateHeight(ws,ci,si,ii):li.updateHeight(ws,ci,si),ui?this.balanced(ai,li):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function mergeGaps(Ws,ws){let oi,si;Ws[ws]==null&&(oi=Ws[ws-1])instanceof HeightMapGap&&(si=Ws[ws+1])instanceof HeightMapGap&&Ws.splice(ws-1,3,new HeightMapGap(oi.length+1+si.length))}const relevantWidgetHeight=5;class NodeBuilder{constructor(ws,oi){this.pos=ws,this.oracle=oi,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=ws}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(ws,oi){if(this.lineStart>-1){let si=Math.min(oi,this.lineEnd),ii=this.nodes[this.nodes.length-1];ii instanceof HeightMapText?ii.length+=si-this.pos:(si>this.pos||!this.isCovered)&&this.nodes.push(new HeightMapText(si-this.pos,-1)),this.writtenTo=si,oi>si&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=oi}point(ws,oi,si){if(ws<oi||si.heightRelevant){let ii=si.widget?si.widget.estimatedHeight:0,ai=si.widget?si.widget.lineBreaks:0;ii<0&&(ii=this.oracle.lineHeight);let li=oi-ws;si.block?this.addBlock(new HeightMapBlock(li,ii,si)):(li||ai||ii>=relevantWidgetHeight)&&this.addLineDeco(ii,ai,li)}else oi>ws&&this.span(ws,oi);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:ws,to:oi}=this.oracle.doc.lineAt(this.pos);this.lineStart=ws,this.lineEnd=oi,this.writtenTo<ws&&((this.writtenTo<ws-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,ws-1)),this.nodes.push(null)),this.pos>ws&&this.nodes.push(new HeightMapText(this.pos-ws,-1)),this.writtenTo=this.pos}blankContent(ws,oi){let si=new HeightMapGap(oi-ws);return this.oracle.doc.lineAt(ws).to==oi&&(si.flags|=4),si}ensureLine(){this.enterLine();let ws=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(ws instanceof HeightMapText)return ws;let oi=new HeightMapText(0,-1);return this.nodes.push(oi),oi}addBlock(ws){this.enterLine();let oi=ws.deco;oi&&oi.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(ws),this.writtenTo=this.pos=this.pos+ws.length,oi&&oi.endSide>0&&(this.covering=ws)}addLineDeco(ws,oi,si){let ii=this.ensureLine();ii.length+=si,ii.collapsed+=si,ii.widgetHeight=Math.max(ii.widgetHeight,ws),ii.breaks+=oi,this.writtenTo=this.pos=this.pos+si}finish(ws){let oi=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(oi instanceof HeightMapText)&&!this.isCovered?this.nodes.push(new HeightMapText(0,-1)):(this.writtenTo<this.pos||oi==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let si=ws;for(let ii of this.nodes)ii instanceof HeightMapText&&ii.updateHeight(this.oracle,si),si+=ii?ii.length:1;return this.nodes}static build(ws,oi,si,ii){let ai=new NodeBuilder(si,ws);return RangeSet.spans(oi,si,ii,ai,0),ai.finish(si)}}function heightRelevantDecoChanges(Ws,ws,oi){let si=new DecorationComparator;return RangeSet.compare(Ws,ws,oi,si,0),si.changes}class DecorationComparator{constructor(){this.changes=[]}compareRange(){}comparePoint(ws,oi,si,ii){(ws<oi||si&&si.heightRelevant||ii&&ii.heightRelevant)&&addRange(ws,oi,this.changes,5)}}function visiblePixelRange(Ws,ws){let oi=Ws.getBoundingClientRect(),si=Ws.ownerDocument,ii=si.defaultView||window,ai=Math.max(0,oi.left),li=Math.min(ii.innerWidth,oi.right),ci=Math.max(0,oi.top),ui=Math.min(ii.innerHeight,oi.bottom);for(let di=Ws.parentNode;di&&di!=si.body;)if(di.nodeType==1){let hi=di,pi=window.getComputedStyle(hi);if((hi.scrollHeight>hi.clientHeight||hi.scrollWidth>hi.clientWidth)&&pi.overflow!="visible"){let ha=hi.getBoundingClientRect();ai=Math.max(ai,ha.left),li=Math.min(li,ha.right),ci=Math.max(ci,ha.top),ui=Math.min(di==Ws.parentNode?ii.innerHeight:ui,ha.bottom)}di=pi.position=="absolute"||pi.position=="fixed"?hi.offsetParent:hi.parentNode}else if(di.nodeType==11)di=di.host;else break;return{left:ai-oi.left,right:Math.max(ai,li)-oi.left,top:ci-(oi.top+ws),bottom:Math.max(ci,ui)-(oi.top+ws)}}function inWindow(Ws){let ws=Ws.getBoundingClientRect(),oi=Ws.ownerDocument.defaultView||window;return ws.left<oi.innerWidth&&ws.right>0&&ws.top<oi.innerHeight&&ws.bottom>0}function fullPixelRange(Ws,ws){let oi=Ws.getBoundingClientRect();return{left:0,right:oi.right-oi.left,top:ws,bottom:oi.bottom-(oi.top+ws)}}class LineGap{constructor(ws,oi,si,ii){this.from=ws,this.to=oi,this.size=si,this.displaySize=ii}static same(ws,oi){if(ws.length!=oi.length)return!1;for(let si=0;si<ws.length;si++){let ii=ws[si],ai=oi[si];if(ii.from!=ai.from||ii.to!=ai.to||ii.size!=ai.size)return!1}return!0}draw(ws,oi){return Decoration.replace({widget:new LineGapWidget(this.displaySize*(oi?ws.scaleY:ws.scaleX),oi)}).range(this.from,this.to)}}class LineGapWidget extends WidgetType{constructor(ws,oi){super(),this.size=ws,this.vertical=oi}eq(ws){return ws.size==this.size&&ws.vertical==this.vertical}toDOM(){let ws=document.createElement("div");return this.vertical?ws.style.height=this.size+"px":(ws.style.width=this.size+"px",ws.style.height="2px",ws.style.display="inline-block"),ws}get estimatedHeight(){return this.vertical?this.size:-1}}class ViewState{constructor(ws){this.state=ws,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=IdScaler,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Direction.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let oi=ws.facet(contentAttributes).some(si=>typeof si!="function"&&si.class=="cm-lineWrapping");this.heightOracle=new HeightOracle(oi),this.stateDeco=ws.facet(decorations).filter(si=>typeof si!="function"),this.heightMap=HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle.setDoc(ws.doc),[new ChangedRange(0,0,0,ws.doc.length)]);for(let si=0;si<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());si++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Decoration.set(this.lineGaps.map(si=>si.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let ws=[this.viewport],{main:oi}=this.state.selection;for(let si=0;si<=1;si++){let ii=si?oi.head:oi.anchor;if(!ws.some(({from:ai,to:li})=>ii>=ai&&ii<=li)){let{from:ai,to:li}=this.lineBlockAt(ii);ws.push(new Viewport(ai,li))}}return this.viewports=ws.sort((si,ii)=>si.from-ii.from),this.updateScaler()}updateScaler(){let ws=this.scaler;return this.scaler=this.heightMap.height<=7e6?IdScaler:new BigScaler(this.heightOracle,this.heightMap,this.viewports),ws.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,ws=>{this.viewportLines.push(scaleBlock(ws,this.scaler))})}update(ws,oi=null){this.state=ws.state;let si=this.stateDeco;this.stateDeco=this.state.facet(decorations).filter(hi=>typeof hi!="function");let ii=ws.changedRanges,ai=ChangedRange.extendWithRanges(ii,heightRelevantDecoChanges(si,this.stateDeco,ws?ws.changes:ChangeSet.empty(this.state.doc.length))),li=this.heightMap.height,ci=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);clearHeightChangeFlag(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,ws.startState.doc,this.heightOracle.setDoc(this.state.doc),ai),(this.heightMap.height!=li||heightChangeFlag)&&(ws.flags|=2),ci?(this.scrollAnchorPos=ws.changes.mapPos(ci.from,-1),this.scrollAnchorHeight=ci.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let ui=ai.length?this.mapViewport(this.viewport,ws.changes):this.viewport;(oi&&(oi.range.head<ui.from||oi.range.head>ui.to)||!this.viewportIsAppropriate(ui))&&(ui=this.getViewport(0,oi));let di=ui.from!=this.viewport.from||ui.to!=this.viewport.to;this.viewport=ui,ws.flags|=this.updateForViewport(),(di||!ws.changes.empty||ws.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,ws.changes))),ws.flags|=this.computeVisibleRanges(ws.changes),oi&&(this.scrollTarget=oi),!this.mustEnforceCursorAssoc&&ws.selectionSet&&ws.view.lineWrapping&&ws.state.selection.main.empty&&ws.state.selection.main.assoc&&!ws.state.facet(nativeSelectionHidden)&&(this.mustEnforceCursorAssoc=!0)}measure(ws){let oi=ws.contentDOM,si=window.getComputedStyle(oi),ii=this.heightOracle,ai=si.whiteSpace;this.defaultTextDirection=si.direction=="rtl"?Direction.RTL:Direction.LTR;let li=this.heightOracle.mustRefreshForWrapping(ai),ci=oi.getBoundingClientRect(),ui=li||this.mustMeasureContent||this.contentDOMHeight!=ci.height;this.contentDOMHeight=ci.height,this.mustMeasureContent=!1;let di=0,hi=0;if(ci.width&&ci.height){let{scaleX:ku,scaleY:gd}=getScale(oi,ci);(ku>.005&&Math.abs(this.scaleX-ku)>.005||gd>.005&&Math.abs(this.scaleY-gd)>.005)&&(this.scaleX=ku,this.scaleY=gd,di|=16,li=ui=!0)}let pi=(parseInt(si.paddingTop)||0)*this.scaleY,ha=(parseInt(si.paddingBottom)||0)*this.scaleY;(this.paddingTop!=pi||this.paddingBottom!=ha)&&(this.paddingTop=pi,this.paddingBottom=ha,di|=18),this.editorWidth!=ws.scrollDOM.clientWidth&&(ii.lineWrapping&&(ui=!0),this.editorWidth=ws.scrollDOM.clientWidth,di|=16);let ga=ws.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=ga&&(this.scrollAnchorHeight=-1,this.scrollTop=ga),this.scrolledToBottom=isScrolledToBottom(ws.scrollDOM);let va=(this.printing?fullPixelRange:visiblePixelRange)(oi,this.paddingTop),ba=va.top-this.pixelViewport.top,wa=va.bottom-this.pixelViewport.bottom;this.pixelViewport=va;let xa=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(xa!=this.inView&&(this.inView=xa,xa&&(ui=!0)),!this.inView&&!this.scrollTarget&&!inWindow(ws.dom))return 0;let Ca=ci.width;if((this.contentDOMWidth!=Ca||this.editorHeight!=ws.scrollDOM.clientHeight)&&(this.contentDOMWidth=ci.width,this.editorHeight=ws.scrollDOM.clientHeight,di|=16),ui){let ku=ws.docView.measureVisibleLineHeights(this.viewport);if(ii.mustRefreshForHeights(ku)&&(li=!0),li||ii.lineWrapping&&Math.abs(Ca-this.contentDOMWidth)>ii.charWidth){let{lineHeight:gd,charWidth:Ed,textHeight:Od}=ws.docView.measureTextSize();li=gd>0&&ii.refresh(ai,gd,Ed,Od,Ca/Ed,ku),li&&(ws.docView.minWidth=0,di|=16)}ba>0&&wa>0?hi=Math.max(ba,wa):ba<0&&wa<0&&(hi=Math.min(ba,wa)),clearHeightChangeFlag();for(let gd of this.viewports){let Ed=gd.from==this.viewport.from?ku:ws.docView.measureVisibleLineHeights(gd);this.heightMap=(li?HeightMap.empty().applyChanges(this.stateDeco,Text.empty,this.heightOracle,[new ChangedRange(0,0,0,ws.state.doc.length)]):this.heightMap).updateHeight(ii,0,li,new MeasuredHeights(gd.from,Ed))}heightChangeFlag&&(di|=2)}let el=!this.viewportIsAppropriate(this.viewport,hi)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return el&&(di&2&&(di|=this.updateScaler()),this.viewport=this.getViewport(hi,this.scrollTarget),di|=this.updateForViewport()),(di&2||el)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(li?[]:this.lineGaps,ws)),di|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,ws.docView.enforceCursorAssoc()),di}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(ws,oi){let si=.5-Math.max(-.5,Math.min(.5,ws/1e3/2)),ii=this.heightMap,ai=this.heightOracle,{visibleTop:li,visibleBottom:ci}=this,ui=new Viewport(ii.lineAt(li-si*1e3,QueryType$1.ByHeight,ai,0,0).from,ii.lineAt(ci+(1-si)*1e3,QueryType$1.ByHeight,ai,0,0).to);if(oi){let{head:di}=oi.range;if(di<ui.from||di>ui.to){let hi=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),pi=ii.lineAt(di,QueryType$1.ByPos,ai,0,0),ha;oi.y=="center"?ha=(pi.top+pi.bottom)/2-hi/2:oi.y=="start"||oi.y=="nearest"&&di<ui.from?ha=pi.top:ha=pi.bottom-hi,ui=new Viewport(ii.lineAt(ha-1e3/2,QueryType$1.ByHeight,ai,0,0).from,ii.lineAt(ha+hi+1e3/2,QueryType$1.ByHeight,ai,0,0).to)}}return ui}mapViewport(ws,oi){let si=oi.mapPos(ws.from,-1),ii=oi.mapPos(ws.to,1);return new Viewport(this.heightMap.lineAt(si,QueryType$1.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(ii,QueryType$1.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:ws,to:oi},si=0){if(!this.inView)return!0;let{top:ii}=this.heightMap.lineAt(ws,QueryType$1.ByPos,this.heightOracle,0,0),{bottom:ai}=this.heightMap.lineAt(oi,QueryType$1.ByPos,this.heightOracle,0,0),{visibleTop:li,visibleBottom:ci}=this;return(ws==0||ii<=li-Math.max(10,Math.min(-si,250)))&&(oi==this.state.doc.length||ai>=ci+Math.max(10,Math.min(si,250)))&&ii>li-2*1e3&&ai<ci+2*1e3}mapLineGaps(ws,oi){if(!ws.length||oi.empty)return ws;let si=[];for(let ii of ws)oi.touchesRange(ii.from,ii.to)||si.push(new LineGap(oi.mapPos(ii.from),oi.mapPos(ii.to),ii.size,ii.displaySize));return si}ensureLineGaps(ws,oi){let si=this.heightOracle.lineWrapping,ii=si?1e4:2e3,ai=ii>>1,li=ii<<1;if(this.defaultTextDirection!=Direction.LTR&&!si)return[];let ci=[],ui=(hi,pi,ha,ga)=>{if(pi-hi<ai)return;let va=this.state.selection.main,ba=[va.from];va.empty||ba.push(va.to);for(let xa of ba)if(xa>hi&&xa<pi){ui(hi,xa-10,ha,ga),ui(xa+10,pi,ha,ga);return}let wa=find(ws,xa=>xa.from>=ha.from&&xa.to<=ha.to&&Math.abs(xa.from-hi)<ai&&Math.abs(xa.to-pi)<ai&&!ba.some(Ca=>xa.from<Ca&&xa.to>Ca));if(!wa){if(pi<ha.to&&oi&&si&&oi.visibleRanges.some(el=>el.from<=pi&&el.to>=pi)){let el=oi.moveToLineBoundary(EditorSelection.cursor(pi),!1,!0).head;el>hi&&(pi=el)}let xa=this.gapSize(ha,hi,pi,ga),Ca=si||xa<2e6?xa:2e6;wa=new LineGap(hi,pi,xa,Ca)}ci.push(wa)},di=hi=>{if(hi.length<li||hi.type!=BlockType.Text)return;let pi=lineStructure(hi.from,hi.to,this.stateDeco);if(pi.total<li)return;let ha=this.scrollTarget?this.scrollTarget.range.head:null,ga,va;if(si){let ba=ii/this.heightOracle.lineLength*this.heightOracle.lineHeight,wa,xa;if(ha!=null){let Ca=findFraction(pi,ha),el=((this.visibleBottom-this.visibleTop)/2+ba)/hi.height;wa=Ca-el,xa=Ca+el}else wa=(this.visibleTop-hi.top-ba)/hi.height,xa=(this.visibleBottom-hi.top+ba)/hi.height;ga=findPosition(pi,wa),va=findPosition(pi,xa)}else{let ba=pi.total*this.heightOracle.charWidth,wa=ii*this.heightOracle.charWidth,xa=0;if(ba>2e6)for(let Ed of ws)Ed.from>=hi.from&&Ed.from<hi.to&&Ed.size!=Ed.displaySize&&Ed.from*this.heightOracle.charWidth+xa<this.pixelViewport.left&&(xa=Ed.size-Ed.displaySize);let Ca=this.pixelViewport.left+xa,el=this.pixelViewport.right+xa,ku,gd;if(ha!=null){let Ed=findFraction(pi,ha),Od=((el-Ca)/2+wa)/ba;ku=Ed-Od,gd=Ed+Od}else ku=(Ca-wa)/ba,gd=(el+wa)/ba;ga=findPosition(pi,ku),va=findPosition(pi,gd)}ga>hi.from&&ui(hi.from,ga,hi,pi),va<hi.to&&ui(va,hi.to,hi,pi)};for(let hi of this.viewportLines)Array.isArray(hi.type)?hi.type.forEach(di):di(hi);return ci}gapSize(ws,oi,si,ii){let ai=findFraction(ii,si)-findFraction(ii,oi);return this.heightOracle.lineWrapping?ws.height*ai:ii.total*this.heightOracle.charWidth*ai}updateLineGaps(ws){LineGap.same(ws,this.lineGaps)||(this.lineGaps=ws,this.lineGapDeco=Decoration.set(ws.map(oi=>oi.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(ws){let oi=this.stateDeco;this.lineGaps.length&&(oi=oi.concat(this.lineGapDeco));let si=[];RangeSet.spans(oi,this.viewport.from,this.viewport.to,{span(ai,li){si.push({from:ai,to:li})},point(){}},20);let ii=0;if(si.length!=this.visibleRanges.length)ii=12;else for(let ai=0;ai<si.length&&!(ii&8);ai++){let li=this.visibleRanges[ai],ci=si[ai];(li.from!=ci.from||li.to!=ci.to)&&(ii|=4,ws&&ws.mapPos(li.from,-1)==ci.from&&ws.mapPos(li.to,1)==ci.to||(ii|=8))}return this.visibleRanges=si,ii}lineBlockAt(ws){return ws>=this.viewport.from&&ws<=this.viewport.to&&this.viewportLines.find(oi=>oi.from<=ws&&oi.to>=ws)||scaleBlock(this.heightMap.lineAt(ws,QueryType$1.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(ws){return ws>=this.viewportLines[0].top&&ws<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(oi=>oi.top<=ws&&oi.bottom>=ws)||scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(ws),QueryType$1.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(ws){let oi=this.lineBlockAtHeight(ws+8);return oi.from>=this.viewport.from||this.viewportLines[0].top-ws>200?oi:this.viewportLines[0]}elementAtHeight(ws){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(ws),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Viewport{constructor(ws,oi){this.from=ws,this.to=oi}}function lineStructure(Ws,ws,oi){let si=[],ii=Ws,ai=0;return RangeSet.spans(oi,Ws,ws,{span(){},point(li,ci){li>ii&&(si.push({from:ii,to:li}),ai+=li-ii),ii=ci}},20),ii<ws&&(si.push({from:ii,to:ws}),ai+=ws-ii),{total:ai,ranges:si}}function findPosition({total:Ws,ranges:ws},oi){if(oi<=0)return ws[0].from;if(oi>=1)return ws[ws.length-1].to;let si=Math.floor(Ws*oi);for(let ii=0;;ii++){let{from:ai,to:li}=ws[ii],ci=li-ai;if(si<=ci)return ai+si;si-=ci}}function findFraction(Ws,ws){let oi=0;for(let{from:si,to:ii}of Ws.ranges){if(ws<=ii){oi+=ws-si;break}oi+=ii-si}return oi/Ws.total}function find(Ws,ws){for(let oi of Ws)if(ws(oi))return oi}const IdScaler={toDOM(Ws){return Ws},fromDOM(Ws){return Ws},scale:1,eq(Ws){return Ws==this}};class BigScaler{constructor(ws,oi,si){let ii=0,ai=0,li=0;this.viewports=si.map(({from:ci,to:ui})=>{let di=oi.lineAt(ci,QueryType$1.ByPos,ws,0,0).top,hi=oi.lineAt(ui,QueryType$1.ByPos,ws,0,0).bottom;return ii+=hi-di,{from:ci,to:ui,top:di,bottom:hi,domTop:0,domBottom:0}}),this.scale=(7e6-ii)/(oi.height-ii);for(let ci of this.viewports)ci.domTop=li+(ci.top-ai)*this.scale,li=ci.domBottom=ci.domTop+(ci.bottom-ci.top),ai=ci.bottom}toDOM(ws){for(let oi=0,si=0,ii=0;;oi++){let ai=oi<this.viewports.length?this.viewports[oi]:null;if(!ai||ws<ai.top)return ii+(ws-si)*this.scale;if(ws<=ai.bottom)return ai.domTop+(ws-ai.top);si=ai.bottom,ii=ai.domBottom}}fromDOM(ws){for(let oi=0,si=0,ii=0;;oi++){let ai=oi<this.viewports.length?this.viewports[oi]:null;if(!ai||ws<ai.domTop)return si+(ws-ii)/this.scale;if(ws<=ai.domBottom)return ai.top+(ws-ai.domTop);si=ai.bottom,ii=ai.domBottom}}eq(ws){return ws instanceof BigScaler?this.scale==ws.scale&&this.viewports.length==ws.viewports.length&&this.viewports.every((oi,si)=>oi.from==ws.viewports[si].from&&oi.to==ws.viewports[si].to):!1}}function scaleBlock(Ws,ws){if(ws.scale==1)return Ws;let oi=ws.toDOM(Ws.top),si=ws.toDOM(Ws.bottom);return new BlockInfo(Ws.from,Ws.length,oi,si-oi,Array.isArray(Ws._content)?Ws._content.map(ii=>scaleBlock(ii,ws)):Ws._content)}const theme=Facet.define({combine:Ws=>Ws.join(" ")}),darkTheme=Facet.define({combine:Ws=>Ws.indexOf(!0)>-1}),baseThemeID=StyleModule.newName(),baseLightID=StyleModule.newName(),baseDarkID=StyleModule.newName(),lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(Ws,ws,oi){return new StyleModule(ws,{finish(si){return/&/.test(si)?si.replace(/&\w*/,ii=>{if(ii=="&")return Ws;if(!oi||!oi[ii])throw new RangeError(`Unsupported selector: ${ii}`);return oi[ii]}):Ws+" "+si}})}const baseTheme$1$2=buildTheme("."+baseThemeID,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs),observeOptions={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},useCharData=browser.ie&&browser.ie_version<=11;class DOMObserver{constructor(ws){this.view=ws,this.active=!1,this.editContext=null,this.selectionRange=new DOMSelectionState,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=ws.contentDOM,this.observer=new MutationObserver(oi=>{for(let si of oi)this.queue.push(si);(browser.ie&&browser.ie_version<=11||browser.ios&&ws.composing)&&oi.some(si=>si.type=="childList"&&si.removedNodes.length||si.type=="characterData"&&si.oldValue.length>si.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ws.constructor.EDIT_CONTEXT!==!1&&!(browser.chrome&&browser.chrome_version<126)&&(this.editContext=new EditContextManager(ws),ws.state.facet(editable)&&(ws.contentDOM.editContext=this.editContext.editContext)),useCharData&&(this.onCharData=oi=>{this.queue.push({target:oi.target,type:"characterData",oldValue:oi.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var oi;((oi=this.view.docView)===null||oi===void 0?void 0:oi.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(ws.scrollDOM)),this.addWindowListeners(this.win=ws.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(oi=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),oi.length>0&&oi[oi.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(oi=>{oi.length>0&&oi[oi.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(ws){this.view.inputState.runHandlers("scroll",ws),this.intersecting&&this.view.measure()}onScroll(ws){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(ws)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(ws){(ws.type=="change"||!ws.type)&&!ws.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(ws){if(this.gapIntersection&&(ws.length!=this.gaps.length||this.gaps.some((oi,si)=>oi!=ws[si]))){this.gapIntersection.disconnect();for(let oi of ws)this.gapIntersection.observe(oi);this.gaps=ws}}onSelectionChange(ws){let oi=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:si}=this,ii=this.selectionRange;if(si.state.facet(editable)?si.root.activeElement!=this.dom:!hasSelection(this.dom,ii))return;let ai=ii.anchorNode&&si.docView.nearest(ii.anchorNode);if(ai&&ai.ignoreEvent(ws)){oi||(this.selectionChanged=!1);return}(browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!si.state.selection.main.empty&&ii.focusNode&&isEquivalentPosition(ii.focusNode,ii.focusOffset,ii.anchorNode,ii.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:ws}=this,oi=getSelection(ws.root);if(!oi)return!1;let si=browser.safari&&ws.root.nodeType==11&&ws.root.activeElement==this.dom&&safariSelectionRangeHack(this.view,oi)||oi;if(!si||this.selectionRange.eq(si))return!1;let ii=hasSelection(this.dom,si);return ii&&!this.selectionChanged&&ws.inputState.lastFocusTime>Date.now()-200&&ws.inputState.lastTouchTime<Date.now()-300&&atElementStart(this.dom,si)?(this.view.inputState.lastFocusTime=0,ws.docView.updateSelection(),!1):(this.selectionRange.setRange(si),ii&&(this.selectionChanged=!0),!0)}setSelectionRange(ws,oi){this.selectionRange.set(ws.node,ws.offset,oi.node,oi.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let ws=0,oi=null;for(let si=this.dom;si;)if(si.nodeType==1)!oi&&ws<this.scrollTargets.length&&this.scrollTargets[ws]==si?ws++:oi||(oi=this.scrollTargets.slice(0,ws)),oi&&oi.push(si),si=si.assignedSlot||si.parentNode;else if(si.nodeType==11)si=si.host;else break;if(ws<this.scrollTargets.length&&!oi&&(oi=this.scrollTargets.slice(0,ws)),oi){for(let si of this.scrollTargets)si.removeEventListener("scroll",this.onScroll);for(let si of this.scrollTargets=oi)si.addEventListener("scroll",this.onScroll)}}ignore(ws){if(!this.active)return ws();try{return this.stop(),ws()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,observeOptions),useCharData&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),useCharData&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(ws,oi){var si;if(!this.delayedAndroidKey){let ii=()=>{let ai=this.delayedAndroidKey;ai&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=ai.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&ai.force&&dispatchKey(this.dom,ai.key,ai.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(ii)}(!this.delayedAndroidKey||ws=="Enter")&&(this.delayedAndroidKey={key:ws,keyCode:oi,force:this.lastChange<Date.now()-50||!!(!((si=this.delayedAndroidKey)===null||si===void 0)&&si.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let ws of this.observer.takeRecords())this.queue.push(ws);return this.queue}processRecords(){let ws=this.pendingRecords();ws.length&&(this.queue=[]);let oi=-1,si=-1,ii=!1;for(let ai of ws){let li=this.readMutation(ai);li&&(li.typeOver&&(ii=!0),oi==-1?{from:oi,to:si}=li:(oi=Math.min(li.from,oi),si=Math.max(li.to,si)))}return{from:oi,to:si,typeOver:ii}}readChange(){let{from:ws,to:oi,typeOver:si}=this.processRecords(),ii=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(ws<0&&!ii)return null;ws>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let ai=new DOMChange(this.view,ws,oi,si);return this.view.docView.domChanged={newSel:ai.newSel?ai.newSel.main:null},ai}flush(ws=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;ws&&this.readSelectionRange();let oi=this.readChange();if(!oi)return this.view.requestMeasure(),!1;let si=this.view.state,ii=applyDOMChange(this.view,oi);return this.view.state==si&&(oi.domChanged||oi.newSel&&!oi.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),ii}readMutation(ws){let oi=this.view.docView.nearest(ws.target);if(!oi||oi.ignoreMutation(ws))return null;if(oi.markDirty(ws.type=="attributes"),ws.type=="attributes"&&(oi.flags|=4),ws.type=="childList"){let si=findChild(oi,ws.previousSibling||ws.target.previousSibling,-1),ii=findChild(oi,ws.nextSibling||ws.target.nextSibling,1);return{from:si?oi.posAfter(si):oi.posAtStart,to:ii?oi.posBefore(ii):oi.posAtEnd,typeOver:!1}}else return ws.type=="characterData"?{from:oi.posAtStart,to:oi.posAtEnd,typeOver:ws.target.nodeValue==ws.oldValue}:null}setWindow(ws){ws!=this.win&&(this.removeWindowListeners(this.win),this.win=ws,this.addWindowListeners(this.win))}addWindowListeners(ws){ws.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):ws.addEventListener("beforeprint",this.onPrint),ws.addEventListener("scroll",this.onScroll),ws.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(ws){ws.removeEventListener("scroll",this.onScroll),ws.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):ws.removeEventListener("beforeprint",this.onPrint),ws.document.removeEventListener("selectionchange",this.onSelectionChange)}update(ws){this.editContext&&(this.editContext.update(ws),ws.startState.facet(editable)!=ws.state.facet(editable)&&(ws.view.contentDOM.editContext=ws.state.facet(editable)?this.editContext.editContext:null))}destroy(){var ws,oi,si;this.stop(),(ws=this.intersection)===null||ws===void 0||ws.disconnect(),(oi=this.gapIntersection)===null||oi===void 0||oi.disconnect(),(si=this.resizeScroll)===null||si===void 0||si.disconnect();for(let ii of this.scrollTargets)ii.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function findChild(Ws,ws,oi){for(;ws;){let si=ContentView.get(ws);if(si&&si.parent==Ws)return si;let ii=ws.parentNode;ws=ii!=Ws.dom?ii:oi>0?ws.nextSibling:ws.previousSibling}return null}function buildSelectionRangeFromRange(Ws,ws){let oi=ws.startContainer,si=ws.startOffset,ii=ws.endContainer,ai=ws.endOffset,li=Ws.docView.domAtPos(Ws.state.selection.main.anchor);return isEquivalentPosition(li.node,li.offset,ii,ai)&&([oi,si,ii,ai]=[ii,ai,oi,si]),{anchorNode:oi,anchorOffset:si,focusNode:ii,focusOffset:ai}}function safariSelectionRangeHack(Ws,ws){if(ws.getComposedRanges){let ii=ws.getComposedRanges(Ws.root)[0];if(ii)return buildSelectionRangeFromRange(Ws,ii)}let oi=null;function si(ii){ii.preventDefault(),ii.stopImmediatePropagation(),oi=ii.getTargetRanges()[0]}return Ws.contentDOM.addEventListener("beforeinput",si,!0),Ws.dom.ownerDocument.execCommand("indent"),Ws.contentDOM.removeEventListener("beforeinput",si,!0),oi?buildSelectionRangeFromRange(Ws,oi):null}class EditContextManager{constructor(ws){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(ws.state);let oi=this.editContext=new window.EditContext({text:ws.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,ws.state.selection.main.anchor))),selectionEnd:this.toContextPos(ws.state.selection.main.head)});this.handlers.textupdate=si=>{let ii=ws.state.selection.main,{anchor:ai,head:li}=ii,ci=this.toEditorPos(si.updateRangeStart),ui=this.toEditorPos(si.updateRangeEnd);ws.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:si.updateRangeStart,editorBase:ci,drifted:!1});let di={from:ci,to:ui,insert:Text.of(si.text.split(`
321
- `))};if(di.from==this.from&&ai<this.from?di.from=ai:di.to==this.to&&ai>this.to&&(di.to=ai),di.from==di.to&&!di.insert.length){let hi=EditorSelection.single(this.toEditorPos(si.selectionStart),this.toEditorPos(si.selectionEnd));hi.main.eq(ii)||ws.dispatch({selection:hi,userEvent:"select"});return}if((browser.mac||browser.android)&&di.from==li-1&&/^\. ?$/.test(si.text)&&ws.contentDOM.getAttribute("autocorrect")=="off"&&(di={from:ci,to:ui,insert:Text.of([si.text.replace("."," ")])}),this.pendingContextChange=di,!ws.state.readOnly){let hi=this.to-this.from+(di.to-di.from+di.insert.length);applyDOMChangeInner(ws,di,EditorSelection.single(this.toEditorPos(si.selectionStart,hi),this.toEditorPos(si.selectionEnd,hi)))}this.pendingContextChange&&(this.revertPending(ws.state),this.setSelection(ws.state))},this.handlers.characterboundsupdate=si=>{let ii=[],ai=null;for(let li=this.toEditorPos(si.rangeStart),ci=this.toEditorPos(si.rangeEnd);li<ci;li++){let ui=ws.coordsForChar(li);ai=ui&&new DOMRect(ui.left,ui.top,ui.right-ui.left,ui.bottom-ui.top)||ai||new DOMRect,ii.push(ai)}oi.updateCharacterBounds(si.rangeStart,ii)},this.handlers.textformatupdate=si=>{let ii=[];for(let ai of si.getTextFormats()){let li=ai.underlineStyle,ci=ai.underlineThickness;if(li!="None"&&ci!="None"){let ui=this.toEditorPos(ai.rangeStart),di=this.toEditorPos(ai.rangeEnd);if(ui<di){let hi=`text-decoration: underline ${li=="Dashed"?"dashed ":li=="Squiggle"?"wavy ":""}${ci=="Thin"?1:2}px`;ii.push(Decoration.mark({attributes:{style:hi}}).range(ui,di))}}}ws.dispatch({effects:setEditContextFormatting.of(Decoration.set(ii))})},this.handlers.compositionstart=()=>{ws.inputState.composing<0&&(ws.inputState.composing=0,ws.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(ws.inputState.composing=-1,ws.inputState.compositionFirstChange=null,this.composing){let{drifted:si}=this.composing;this.composing=null,si&&this.reset(ws.state)}};for(let si in this.handlers)oi.addEventListener(si,this.handlers[si]);this.measureReq={read:si=>{this.editContext.updateControlBounds(si.contentDOM.getBoundingClientRect());let ii=getSelection(si.root);ii&&ii.rangeCount&&this.editContext.updateSelectionBounds(ii.getRangeAt(0).getBoundingClientRect())}}}applyEdits(ws){let oi=0,si=!1,ii=this.pendingContextChange;return ws.changes.iterChanges((ai,li,ci,ui,di)=>{if(si)return;let hi=di.length-(li-ai);if(ii&&li>=ii.to)if(ii.from==ai&&ii.to==li&&ii.insert.eq(di)){ii=this.pendingContextChange=null,oi+=hi,this.to+=hi;return}else ii=null,this.revertPending(ws.state);if(ai+=oi,li+=oi,li<=this.from)this.from+=hi,this.to+=hi;else if(ai<this.to){if(ai<this.from||li>this.to||this.to-this.from+di.length>3e4){si=!0;return}this.editContext.updateText(this.toContextPos(ai),this.toContextPos(li),di.toString()),this.to+=hi}oi+=hi}),ii&&!si&&this.revertPending(ws.state),!si}update(ws){let oi=this.pendingContextChange;this.composing&&(this.composing.drifted||ws.transactions.some(si=>!si.isUserEvent("input.type")&&si.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=ws.changes.mapPos(this.composing.editorBase)):!this.applyEdits(ws)||!this.rangeIsValid(ws.state)?(this.pendingContextChange=null,this.reset(ws.state)):(ws.docChanged||ws.selectionSet||oi)&&this.setSelection(ws.state),(ws.geometryChanged||ws.docChanged||ws.selectionSet)&&ws.view.requestMeasure(this.measureReq)}resetRange(ws){let{head:oi}=ws.selection.main;this.from=Math.max(0,oi-1e4),this.to=Math.min(ws.doc.length,oi+1e4)}reset(ws){this.resetRange(ws),this.editContext.updateText(0,this.editContext.text.length,ws.doc.sliceString(this.from,this.to)),this.setSelection(ws)}revertPending(ws){let oi=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(oi.from),this.toContextPos(oi.from+oi.insert.length),ws.doc.sliceString(oi.from,oi.to))}setSelection(ws){let{main:oi}=ws.selection,si=this.toContextPos(Math.max(this.from,Math.min(this.to,oi.anchor))),ii=this.toContextPos(oi.head);(this.editContext.selectionStart!=si||this.editContext.selectionEnd!=ii)&&this.editContext.updateSelection(si,ii)}rangeIsValid(ws){let{head:oi}=ws.selection.main;return!(this.from>0&&oi-this.from<500||this.to<ws.doc.length&&this.to-oi<500||this.to-this.from>1e4*3)}toEditorPos(ws,oi=this.to-this.from){ws=Math.min(ws,oi);let si=this.composing;return si&&si.drifted?si.editorBase+(ws-si.contextBase):ws+this.from}toContextPos(ws){let oi=this.composing;return oi&&oi.drifted?oi.contextBase+(ws-oi.editorBase):ws-this.from}destroy(){for(let ws in this.handlers)this.editContext.removeEventListener(ws,this.handlers[ws])}}class EditorView{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(ws={}){var oi;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),ws.parent&&ws.parent.appendChild(this.dom);let{dispatch:si}=ws;this.dispatchTransactions=ws.dispatchTransactions||si&&(ii=>ii.forEach(ai=>si(ai,this)))||(ii=>this.update(ii)),this.dispatch=this.dispatch.bind(this),this._root=ws.root||getRoot(ws.parent)||document,this.viewState=new ViewState(ws.state||EditorState.create(ws)),ws.scrollTo&&ws.scrollTo.is(scrollIntoView$1)&&(this.viewState.scrollTarget=ws.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(viewPlugin).map(ii=>new PluginInstance(ii));for(let ii of this.plugins)ii.update(this);this.observer=new DOMObserver(this),this.inputState=new InputState(this),this.inputState.ensureHandlers(this.plugins),this.docView=new DocView(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((oi=document.fonts)===null||oi===void 0)&&oi.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...ws){let oi=ws.length==1&&ws[0]instanceof Transaction?ws:ws.length==1&&Array.isArray(ws[0])?ws[0]:[this.state.update(...ws)];this.dispatchTransactions(oi,this)}update(ws){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let oi=!1,si=!1,ii,ai=this.state;for(let ha of ws){if(ha.startState!=ai)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");ai=ha.state}if(this.destroyed){this.viewState.state=ai;return}let li=this.hasFocus,ci=0,ui=null;ws.some(ha=>ha.annotation(isFocusChange))?(this.inputState.notifiedFocused=li,ci=1):li!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=li,ui=focusChangeTransaction(ai,li),ui||(ci=1));let di=this.observer.delayedAndroidKey,hi=null;if(di?(this.observer.clearDelayedAndroidKey(),hi=this.observer.readChange(),(hi&&!this.state.doc.eq(ai.doc)||!this.state.selection.eq(ai.selection))&&(hi=null)):this.observer.clear(),ai.facet(EditorState.phrases)!=this.state.facet(EditorState.phrases))return this.setState(ai);ii=ViewUpdate.create(this,ai,ws),ii.flags|=ci;let pi=this.viewState.scrollTarget;try{this.updateState=2;for(let ha of ws){if(pi&&(pi=pi.map(ha.changes)),ha.scrollIntoView){let{main:ga}=ha.state.selection;pi=new ScrollTarget(ga.empty?ga:EditorSelection.cursor(ga.head,ga.head>ga.anchor?-1:1))}for(let ga of ha.effects)ga.is(scrollIntoView$1)&&(pi=ga.value.clip(this.state))}this.viewState.update(ii,pi),this.bidiCache=CachedOrder.update(this.bidiCache,ii.changes),ii.empty||(this.updatePlugins(ii),this.inputState.update(ii)),oi=this.docView.update(ii),this.state.facet(styleModule)!=this.styleModules&&this.mountStyles(),si=this.updateAttrs(),this.showAnnouncements(ws),this.docView.updateSelection(oi,ws.some(ha=>ha.isUserEvent("select.pointer")))}finally{this.updateState=0}if(ii.startState.facet(theme)!=ii.state.facet(theme)&&(this.viewState.mustMeasureContent=!0),(oi||si||pi||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),oi&&this.docViewUpdate(),!ii.empty)for(let ha of this.state.facet(updateListener))try{ha(ii)}catch(ga){logException(this.state,ga,"update listener")}(ui||hi)&&Promise.resolve().then(()=>{ui&&this.state==ui.startState&&this.dispatch(ui),hi&&!applyDOMChange(this,hi)&&di.force&&dispatchKey(this.contentDOM,di.key,di.keyCode)})}setState(ws){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=ws;return}this.updateState=2;let oi=this.hasFocus;try{for(let si of this.plugins)si.destroy(this);this.viewState=new ViewState(ws),this.plugins=ws.facet(viewPlugin).map(si=>new PluginInstance(si)),this.pluginMap.clear();for(let si of this.plugins)si.update(this);this.docView.destroy(),this.docView=new DocView(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}oi&&this.focus(),this.requestMeasure()}updatePlugins(ws){let oi=ws.startState.facet(viewPlugin),si=ws.state.facet(viewPlugin);if(oi!=si){let ii=[];for(let ai of si){let li=oi.indexOf(ai);if(li<0)ii.push(new PluginInstance(ai));else{let ci=this.plugins[li];ci.mustUpdate=ws,ii.push(ci)}}for(let ai of this.plugins)ai.mustUpdate!=ws&&ai.destroy(this);this.plugins=ii,this.pluginMap.clear()}else for(let ii of this.plugins)ii.mustUpdate=ws;for(let ii=0;ii<this.plugins.length;ii++)this.plugins[ii].update(this);oi!=si&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let ws of this.plugins){let oi=ws.value;if(oi&&oi.docViewUpdate)try{oi.docViewUpdate(this)}catch(si){logException(this.state,si,"doc view update listener")}}}measure(ws=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,ws&&this.observer.forceFlush();let oi=null,si=this.scrollDOM,ii=si.scrollTop*this.scaleY,{scrollAnchorPos:ai,scrollAnchorHeight:li}=this.viewState;Math.abs(ii-this.viewState.scrollTop)>1&&(li=-1),this.viewState.scrollAnchorHeight=-1;try{for(let ci=0;;ci++){if(li<0)if(isScrolledToBottom(si))ai=-1,li=this.viewState.heightMap.height;else{let ga=this.viewState.scrollAnchorAt(ii);ai=ga.from,li=ga.top}this.updateState=1;let ui=this.viewState.measure(this);if(!ui&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(ci>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let di=[];ui&4||([this.measureRequests,di]=[di,this.measureRequests]);let hi=di.map(ga=>{try{return ga.read(this)}catch(va){return logException(this.state,va),BadMeasure}}),pi=ViewUpdate.create(this,this.state,[]),ha=!1;pi.flags|=ui,oi?oi.flags|=ui:oi=pi,this.updateState=2,pi.empty||(this.updatePlugins(pi),this.inputState.update(pi),this.updateAttrs(),ha=this.docView.update(pi),ha&&this.docViewUpdate());for(let ga=0;ga<di.length;ga++)if(hi[ga]!=BadMeasure)try{let va=di[ga];va.write&&va.write(hi[ga],this)}catch(va){logException(this.state,va)}if(ha&&this.docView.updateSelection(!0),!pi.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,li=-1;continue}else{let ga=(ai<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(ai).top)-li;if(ga>1||ga<-1){ii=ii+ga,si.scrollTop=ii/this.scaleY,li=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(oi&&!oi.empty)for(let ci of this.state.facet(updateListener))ci(oi)}get themeClasses(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(theme)}updateAttrs(){let ws=attrsFromFacet(this,editorAttributes,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),oi={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(editable)?"true":"false",class:"cm-content",style:`${browser.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(oi["aria-readonly"]="true"),attrsFromFacet(this,contentAttributes,oi);let si=this.observer.ignore(()=>{let ii=updateAttrs(this.contentDOM,this.contentAttrs,oi),ai=updateAttrs(this.dom,this.editorAttrs,ws);return ii||ai});return this.editorAttrs=ws,this.contentAttrs=oi,si}showAnnouncements(ws){let oi=!0;for(let si of ws)for(let ii of si.effects)if(ii.is(EditorView.announce)){oi&&(this.announceDOM.textContent=""),oi=!1;let ai=this.announceDOM.appendChild(document.createElement("div"));ai.textContent=ii.value}}mountStyles(){this.styleModules=this.state.facet(styleModule);let ws=this.state.facet(EditorView.cspNonce);StyleModule.mount(this.root,this.styleModules.concat(baseTheme$1$2).reverse(),ws?{nonce:ws}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(ws){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),ws){if(this.measureRequests.indexOf(ws)>-1)return;if(ws.key!=null){for(let oi=0;oi<this.measureRequests.length;oi++)if(this.measureRequests[oi].key===ws.key){this.measureRequests[oi]=ws;return}}this.measureRequests.push(ws)}}plugin(ws){let oi=this.pluginMap.get(ws);return(oi===void 0||oi&&oi.spec!=ws)&&this.pluginMap.set(ws,oi=this.plugins.find(si=>si.spec==ws)||null),oi&&oi.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(ws){return this.readMeasured(),this.viewState.elementAtHeight(ws)}lineBlockAtHeight(ws){return this.readMeasured(),this.viewState.lineBlockAtHeight(ws)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(ws){return this.viewState.lineBlockAt(ws)}get contentHeight(){return this.viewState.contentHeight}moveByChar(ws,oi,si){return skipAtoms(this,ws,moveByChar(this,ws,oi,si))}moveByGroup(ws,oi){return skipAtoms(this,ws,moveByChar(this,ws,oi,si=>byGroup(this,ws.head,si)))}visualLineSide(ws,oi){let si=this.bidiSpans(ws),ii=this.textDirectionAt(ws.from),ai=si[oi?si.length-1:0];return EditorSelection.cursor(ai.side(oi,ii)+ws.from,ai.forward(!oi,ii)?1:-1)}moveToLineBoundary(ws,oi,si=!0){return moveToLineBoundary(this,ws,oi,si)}moveVertically(ws,oi,si){return skipAtoms(this,ws,moveVertically(this,ws,oi,si))}domAtPos(ws){return this.docView.domAtPos(ws)}posAtDOM(ws,oi=0){return this.docView.posFromDOM(ws,oi)}posAtCoords(ws,oi=!0){return this.readMeasured(),posAtCoords(this,ws,oi)}coordsAtPos(ws,oi=1){this.readMeasured();let si=this.docView.coordsAt(ws,oi);if(!si||si.left==si.right)return si;let ii=this.state.doc.lineAt(ws),ai=this.bidiSpans(ii),li=ai[BidiSpan.find(ai,ws-ii.from,-1,oi)];return flattenRect(si,li.dir==Direction.LTR==oi>0)}coordsForChar(ws){return this.readMeasured(),this.docView.coordsForChar(ws)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(ws){return!this.state.facet(perLineTextDirection)||ws<this.viewport.from||ws>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(ws))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(ws){if(ws.length>MaxBidiLine)return trivialOrder(ws.length);let oi=this.textDirectionAt(ws.from),si;for(let ai of this.bidiCache)if(ai.from==ws.from&&ai.dir==oi&&(ai.fresh||isolatesEq(ai.isolates,si=getIsolatedRanges(this,ws))))return ai.order;si||(si=getIsolatedRanges(this,ws));let ii=computeOrder(ws.text,oi,si);return this.bidiCache.push(new CachedOrder(ws.from,ws.to,oi,si,!0,ii)),ii}get hasFocus(){var ws;return(this.dom.ownerDocument.hasFocus()||browser.safari&&((ws=this.inputState)===null||ws===void 0?void 0:ws.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{focusPreventScroll(this.contentDOM),this.docView.updateSelection()})}setRoot(ws){this._root!=ws&&(this._root=ws,this.observer.setWindow((ws.nodeType==9?ws:ws.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let ws of this.plugins)ws.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(ws,oi={}){return scrollIntoView$1.of(new ScrollTarget(typeof ws=="number"?EditorSelection.cursor(ws):ws,oi.y,oi.x,oi.yMargin,oi.xMargin))}scrollSnapshot(){let{scrollTop:ws,scrollLeft:oi}=this.scrollDOM,si=this.viewState.scrollAnchorAt(ws);return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(si.from),"start","start",si.top-ws,oi,!0))}setTabFocusMode(ws){ws==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof ws=="boolean"?this.inputState.tabFocusMode=ws?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+ws)}static domEventHandlers(ws){return ViewPlugin.define(()=>({}),{eventHandlers:ws})}static domEventObservers(ws){return ViewPlugin.define(()=>({}),{eventObservers:ws})}static theme(ws,oi){let si=StyleModule.newName(),ii=[theme.of(si),styleModule.of(buildTheme(`.${si}`,ws))];return oi&&oi.dark&&ii.push(darkTheme.of(!0)),ii}static baseTheme(ws){return Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,ws,lightDarkIDs)))}static findFromDOM(ws){var oi;let si=ws.querySelector(".cm-content"),ii=si&&ContentView.get(si)||ContentView.get(ws);return((oi=ii==null?void 0:ii.rootView)===null||oi===void 0?void 0:oi.view)||null}}EditorView.styleModule=styleModule;EditorView.inputHandler=inputHandler$1;EditorView.clipboardInputFilter=clipboardInputFilter;EditorView.clipboardOutputFilter=clipboardOutputFilter;EditorView.scrollHandler=scrollHandler;EditorView.focusChangeEffect=focusChangeEffect;EditorView.perLineTextDirection=perLineTextDirection;EditorView.exceptionSink=exceptionSink;EditorView.updateListener=updateListener;EditorView.editable=editable;EditorView.mouseSelectionStyle=mouseSelectionStyle;EditorView.dragMovesSelection=dragMovesSelection$1;EditorView.clickAddsSelectionRange=clickAddsSelectionRange;EditorView.decorations=decorations;EditorView.outerDecorations=outerDecorations;EditorView.atomicRanges=atomicRanges;EditorView.bidiIsolatedRanges=bidiIsolatedRanges;EditorView.scrollMargins=scrollMargins;EditorView.darkTheme=darkTheme;EditorView.cspNonce=Facet.define({combine:Ws=>Ws.length?Ws[0]:""});EditorView.contentAttributes=contentAttributes;EditorView.editorAttributes=editorAttributes;EditorView.lineWrapping=EditorView.contentAttributes.of({class:"cm-lineWrapping"});EditorView.announce=StateEffect.define();const MaxBidiLine=4096,BadMeasure={};class CachedOrder{constructor(ws,oi,si,ii,ai,li){this.from=ws,this.to=oi,this.dir=si,this.isolates=ii,this.fresh=ai,this.order=li}static update(ws,oi){if(oi.empty&&!ws.some(ai=>ai.fresh))return ws;let si=[],ii=ws.length?ws[ws.length-1].dir:Direction.LTR;for(let ai=Math.max(0,ws.length-10);ai<ws.length;ai++){let li=ws[ai];li.dir==ii&&!oi.touchesRange(li.from,li.to)&&si.push(new CachedOrder(oi.mapPos(li.from,1),oi.mapPos(li.to,-1),li.dir,li.isolates,!1,li.order))}return si}}function attrsFromFacet(Ws,ws,oi){for(let si=Ws.state.facet(ws),ii=si.length-1;ii>=0;ii--){let ai=si[ii],li=typeof ai=="function"?ai(Ws):ai;li&&combineAttrs(li,oi)}return oi}const currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(Ws,ws){const oi=Ws.split(/-(?!$)/);let si=oi[oi.length-1];si=="Space"&&(si=" ");let ii,ai,li,ci;for(let ui=0;ui<oi.length-1;++ui){const di=oi[ui];if(/^(cmd|meta|m)$/i.test(di))ci=!0;else if(/^a(lt)?$/i.test(di))ii=!0;else if(/^(c|ctrl|control)$/i.test(di))ai=!0;else if(/^s(hift)?$/i.test(di))li=!0;else if(/^mod$/i.test(di))ws=="mac"?ci=!0:ai=!0;else throw new Error("Unrecognized modifier name: "+di)}return ii&&(si="Alt-"+si),ai&&(si="Ctrl-"+si),ci&&(si="Meta-"+si),li&&(si="Shift-"+si),si}function modifiers(Ws,ws,oi){return ws.altKey&&(Ws="Alt-"+Ws),ws.ctrlKey&&(Ws="Ctrl-"+Ws),ws.metaKey&&(Ws="Meta-"+Ws),oi!==!1&&ws.shiftKey&&(Ws="Shift-"+Ws),Ws}const handleKeyEvents=Prec.default(EditorView.domEventHandlers({keydown(Ws,ws){return runHandlers(getKeymap(ws.state),Ws,ws,"editor")}})),keymap=Facet.define({enables:handleKeyEvents}),Keymaps=new WeakMap;function getKeymap(Ws){let ws=Ws.facet(keymap),oi=Keymaps.get(ws);return oi||Keymaps.set(ws,oi=buildKeymap(ws.reduce((si,ii)=>si.concat(ii),[]))),oi}function runScopeHandlers(Ws,ws,oi){return runHandlers(getKeymap(Ws.state),ws,Ws,oi)}let storedPrefix=null;const PrefixTimeout=4e3;function buildKeymap(Ws,ws=currentPlatform){let oi=Object.create(null),si=Object.create(null),ii=(li,ci)=>{let ui=si[li];if(ui==null)si[li]=ci;else if(ui!=ci)throw new Error("Key binding "+li+" is used both as a regular binding and as a multi-stroke prefix")},ai=(li,ci,ui,di,hi)=>{var pi,ha;let ga=oi[li]||(oi[li]=Object.create(null)),va=ci.split(/ (?!$)/).map(xa=>normalizeKeyName(xa,ws));for(let xa=1;xa<va.length;xa++){let Ca=va.slice(0,xa).join(" ");ii(Ca,!0),ga[Ca]||(ga[Ca]={preventDefault:!0,stopPropagation:!1,run:[el=>{let ku=storedPrefix={view:el,prefix:Ca,scope:li};return setTimeout(()=>{storedPrefix==ku&&(storedPrefix=null)},PrefixTimeout),!0}]})}let ba=va.join(" ");ii(ba,!1);let wa=ga[ba]||(ga[ba]={preventDefault:!1,stopPropagation:!1,run:((ha=(pi=ga._any)===null||pi===void 0?void 0:pi.run)===null||ha===void 0?void 0:ha.slice())||[]});ui&&wa.run.push(ui),di&&(wa.preventDefault=!0),hi&&(wa.stopPropagation=!0)};for(let li of Ws){let ci=li.scope?li.scope.split(" "):["editor"];if(li.any)for(let di of ci){let hi=oi[di]||(oi[di]=Object.create(null));hi._any||(hi._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:pi}=li;for(let ha in hi)hi[ha].run.push(ga=>pi(ga,currentKeyEvent))}let ui=li[ws]||li.key;if(ui)for(let di of ci)ai(di,ui,li.run,li.preventDefault,li.stopPropagation),li.shift&&ai(di,"Shift-"+ui,li.shift,li.preventDefault,li.stopPropagation)}return oi}let currentKeyEvent=null;function runHandlers(Ws,ws,oi,si){currentKeyEvent=ws;let ii=keyName(ws),ai=codePointAt(ii,0),li=codePointSize(ai)==ii.length&&ii!=" ",ci="",ui=!1,di=!1,hi=!1;storedPrefix&&storedPrefix.view==oi&&storedPrefix.scope==si&&(ci=storedPrefix.prefix+" ",modifierCodes.indexOf(ws.keyCode)<0&&(di=!0,storedPrefix=null));let pi=new Set,ha=wa=>{if(wa){for(let xa of wa.run)if(!pi.has(xa)&&(pi.add(xa),xa(oi)))return wa.stopPropagation&&(hi=!0),!0;wa.preventDefault&&(wa.stopPropagation&&(hi=!0),di=!0)}return!1},ga=Ws[si],va,ba;return ga&&(ha(ga[ci+modifiers(ii,ws,!li)])?ui=!0:li&&(ws.altKey||ws.metaKey||ws.ctrlKey)&&!(browser.windows&&ws.ctrlKey&&ws.altKey)&&(va=base[ws.keyCode])&&va!=ii?(ha(ga[ci+modifiers(va,ws,!0)])||ws.shiftKey&&(ba=shift[ws.keyCode])!=ii&&ba!=va&&ha(ga[ci+modifiers(ba,ws,!1)]))&&(ui=!0):li&&ws.shiftKey&&ha(ga[ci+modifiers(ii,ws,!0)])&&(ui=!0),!ui&&ha(ga._any)&&(ui=!0)),di&&(ui=!0),ui&&hi&&ws.stopPropagation(),currentKeyEvent=null,ui}class RectangleMarker{constructor(ws,oi,si,ii,ai){this.className=ws,this.left=oi,this.top=si,this.width=ii,this.height=ai}draw(){let ws=document.createElement("div");return ws.className=this.className,this.adjust(ws),ws}update(ws,oi){return oi.className!=this.className?!1:(this.adjust(ws),!0)}adjust(ws){ws.style.left=this.left+"px",ws.style.top=this.top+"px",this.width!=null&&(ws.style.width=this.width+"px"),ws.style.height=this.height+"px"}eq(ws){return this.left==ws.left&&this.top==ws.top&&this.width==ws.width&&this.height==ws.height&&this.className==ws.className}static forRange(ws,oi,si){if(si.empty){let ii=ws.coordsAtPos(si.head,si.assoc||1);if(!ii)return[];let ai=getBase(ws);return[new RectangleMarker(oi,ii.left-ai.left,ii.top-ai.top,null,ii.bottom-ii.top)]}else return rectanglesForRange(ws,oi,si)}}function getBase(Ws){let ws=Ws.scrollDOM.getBoundingClientRect();return{left:(Ws.textDirection==Direction.LTR?ws.left:ws.right-Ws.scrollDOM.clientWidth*Ws.scaleX)-Ws.scrollDOM.scrollLeft*Ws.scaleX,top:ws.top-Ws.scrollDOM.scrollTop*Ws.scaleY}}function wrappedLine(Ws,ws,oi,si){let ii=Ws.coordsAtPos(ws,oi*2);if(!ii)return si;let ai=Ws.dom.getBoundingClientRect(),li=(ii.top+ii.bottom)/2,ci=Ws.posAtCoords({x:ai.left+1,y:li}),ui=Ws.posAtCoords({x:ai.right-1,y:li});return ci==null||ui==null?si:{from:Math.max(si.from,Math.min(ci,ui)),to:Math.min(si.to,Math.max(ci,ui))}}function rectanglesForRange(Ws,ws,oi){if(oi.to<=Ws.viewport.from||oi.from>=Ws.viewport.to)return[];let si=Math.max(oi.from,Ws.viewport.from),ii=Math.min(oi.to,Ws.viewport.to),ai=Ws.textDirection==Direction.LTR,li=Ws.contentDOM,ci=li.getBoundingClientRect(),ui=getBase(Ws),di=li.querySelector(".cm-line"),hi=di&&window.getComputedStyle(di),pi=ci.left+(hi?parseInt(hi.paddingLeft)+Math.min(0,parseInt(hi.textIndent)):0),ha=ci.right-(hi?parseInt(hi.paddingRight):0),ga=blockAt(Ws,si),va=blockAt(Ws,ii),ba=ga.type==BlockType.Text?ga:null,wa=va.type==BlockType.Text?va:null;if(ba&&(Ws.lineWrapping||ga.widgetLineBreaks)&&(ba=wrappedLine(Ws,si,1,ba)),wa&&(Ws.lineWrapping||va.widgetLineBreaks)&&(wa=wrappedLine(Ws,ii,-1,wa)),ba&&wa&&ba.from==wa.from&&ba.to==wa.to)return Ca(el(oi.from,oi.to,ba));{let gd=ba?el(oi.from,null,ba):ku(ga,!1),Ed=wa?el(null,oi.to,wa):ku(va,!0),Od=[];return(ba||ga).to<(wa||va).from-(ba&&wa?1:0)||ga.widgetLineBreaks>1&&gd.bottom+Ws.defaultLineHeight/2<Ed.top?Od.push(xa(pi,gd.bottom,ha,Ed.top)):gd.bottom<Ed.top&&Ws.elementAtHeight((gd.bottom+Ed.top)/2).type==BlockType.Text&&(gd.bottom=Ed.top=(gd.bottom+Ed.top)/2),Ca(gd).concat(Od).concat(Ca(Ed))}function xa(gd,Ed,Od,Nd){return new RectangleMarker(ws,gd-ui.left,Ed-ui.top,Od-gd,Nd-Ed)}function Ca({top:gd,bottom:Ed,horizontal:Od}){let Nd=[];for(let Pd=0;Pd<Od.length;Pd+=2)Nd.push(xa(Od[Pd],gd,Od[Pd+1],Ed));return Nd}function el(gd,Ed,Od){let Nd=1e9,Pd=-1e9,Ld=[];function rf(Td,wd,Cd,sf,of){let Wd=Ws.coordsAtPos(Td,Td==Od.to?-2:2),df=Ws.coordsAtPos(Cd,Cd==Od.from?2:-2);!Wd||!df||(Nd=Math.min(Wd.top,df.top,Nd),Pd=Math.max(Wd.bottom,df.bottom,Pd),of==Direction.LTR?Ld.push(ai&&wd?pi:Wd.left,ai&&sf?ha:df.right):Ld.push(!ai&&sf?pi:df.left,!ai&&wd?ha:Wd.right))}let kd=gd??Od.from,Md=Ed??Od.to;for(let Td of Ws.visibleRanges)if(Td.to>kd&&Td.from<Md)for(let wd=Math.max(Td.from,kd),Cd=Math.min(Td.to,Md);;){let sf=Ws.state.doc.lineAt(wd);for(let of of Ws.bidiSpans(sf)){let Wd=of.from+sf.from,df=of.to+sf.from;if(Wd>=Cd)break;df>wd&&rf(Math.max(Wd,wd),gd==null&&Wd<=kd,Math.min(df,Cd),Ed==null&&df>=Md,of.dir)}if(wd=sf.to+1,wd>=Cd)break}return Ld.length==0&&rf(kd,gd==null,Md,Ed==null,Ws.textDirection),{top:Nd,bottom:Pd,horizontal:Ld}}function ku(gd,Ed){let Od=ci.top+(Ed?gd.top:gd.bottom);return{top:Od,bottom:Od,horizontal:[]}}}function sameMarker(Ws,ws){return Ws.constructor==ws.constructor&&Ws.eq(ws)}class LayerView{constructor(ws,oi){this.view=ws,this.layer=oi,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=ws.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),oi.above&&this.dom.classList.add("cm-layer-above"),oi.class&&this.dom.classList.add(oi.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(ws.state),ws.requestMeasure(this.measureReq),oi.mount&&oi.mount(this.dom,ws)}update(ws){ws.startState.facet(layerOrder)!=ws.state.facet(layerOrder)&&this.setOrder(ws.state),(this.layer.update(ws,this.dom)||ws.geometryChanged)&&(this.scale(),ws.view.requestMeasure(this.measureReq))}docViewUpdate(ws){this.layer.updateOnDocViewUpdate!==!1&&ws.requestMeasure(this.measureReq)}setOrder(ws){let oi=0,si=ws.facet(layerOrder);for(;oi<si.length&&si[oi]!=this.layer;)oi++;this.dom.style.zIndex=String((this.layer.above?150:-1)-oi)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:ws,scaleY:oi}=this.view;(ws!=this.scaleX||oi!=this.scaleY)&&(this.scaleX=ws,this.scaleY=oi,this.dom.style.transform=`scale(${1/ws}, ${1/oi})`)}draw(ws){if(ws.length!=this.drawn.length||ws.some((oi,si)=>!sameMarker(oi,this.drawn[si]))){let oi=this.dom.firstChild,si=0;for(let ii of ws)ii.update&&oi&&ii.constructor&&this.drawn[si].constructor&&ii.update(oi,this.drawn[si])?(oi=oi.nextSibling,si++):this.dom.insertBefore(ii.draw(),oi);for(;oi;){let ii=oi.nextSibling;oi.remove(),oi=ii}this.drawn=ws}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const layerOrder=Facet.define();function layer(Ws){return[ViewPlugin.define(ws=>new LayerView(ws,Ws)),layerOrder.of(Ws)]}const CanHidePrimary=!(browser.ios&&browser.webkit&&browser.webkit_version<534),selectionConfig=Facet.define({combine(Ws){return combineConfig(Ws,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(ws,oi)=>Math.min(ws,oi),drawRangeCursor:(ws,oi)=>ws||oi})}});function drawSelection(Ws={}){return[selectionConfig.of(Ws),cursorLayer,selectionLayer,hideNativeSelection,nativeSelectionHidden.of(!0)]}function configChanged(Ws){return Ws.startState.facet(selectionConfig)!=Ws.state.facet(selectionConfig)}const cursorLayer=layer({above:!0,markers(Ws){let{state:ws}=Ws,oi=ws.facet(selectionConfig),si=[];for(let ii of ws.selection.ranges){let ai=ii==ws.selection.main;if(ii.empty?!ai||CanHidePrimary:oi.drawRangeCursor){let li=ai?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",ci=ii.empty?ii:EditorSelection.cursor(ii.head,ii.head>ii.anchor?-1:1);for(let ui of RectangleMarker.forRange(Ws,li,ci))si.push(ui)}}return si},update(Ws,ws){Ws.transactions.some(si=>si.selection)&&(ws.style.animationName=ws.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let oi=configChanged(Ws);return oi&&setBlinkRate(Ws.state,ws),Ws.docChanged||Ws.selectionSet||oi},mount(Ws,ws){setBlinkRate(ws.state,Ws)},class:"cm-cursorLayer"});function setBlinkRate(Ws,ws){ws.style.animationDuration=Ws.facet(selectionConfig).cursorBlinkRate+"ms"}const selectionLayer=layer({above:!1,markers(Ws){return Ws.state.selection.ranges.map(ws=>ws.empty?[]:RectangleMarker.forRange(Ws,"cm-selectionBackground",ws)).reduce((ws,oi)=>ws.concat(oi))},update(Ws,ws){return Ws.docChanged||Ws.selectionSet||Ws.viewportChanged||configChanged(Ws)},class:"cm-selectionLayer"}),themeSpec={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};CanHidePrimary&&(themeSpec[".cm-line"].caretColor=themeSpec[".cm-content"].caretColor="transparent !important");const hideNativeSelection=Prec.highest(EditorView.theme(themeSpec)),setDropCursorPos=StateEffect.define({map(Ws,ws){return Ws==null?null:ws.mapPos(Ws)}}),dropCursorPos=StateField.define({create(){return null},update(Ws,ws){return Ws!=null&&(Ws=ws.changes.mapPos(Ws)),ws.effects.reduce((oi,si)=>si.is(setDropCursorPos)?si.value:oi,Ws)}}),drawDropCursor=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(Ws){var ws;let oi=Ws.state.field(dropCursorPos);oi==null?this.cursor!=null&&((ws=this.cursor)===null||ws===void 0||ws.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(Ws.startState.field(dropCursorPos)!=oi||Ws.docChanged||Ws.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:Ws}=this,ws=Ws.state.field(dropCursorPos),oi=ws!=null&&Ws.coordsAtPos(ws);if(!oi)return null;let si=Ws.scrollDOM.getBoundingClientRect();return{left:oi.left-si.left+Ws.scrollDOM.scrollLeft*Ws.scaleX,top:oi.top-si.top+Ws.scrollDOM.scrollTop*Ws.scaleY,height:oi.bottom-oi.top}}drawCursor(Ws){if(this.cursor){let{scaleX:ws,scaleY:oi}=this.view;Ws?(this.cursor.style.left=Ws.left/ws+"px",this.cursor.style.top=Ws.top/oi+"px",this.cursor.style.height=Ws.height/oi+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(Ws){this.view.state.field(dropCursorPos)!=Ws&&this.view.dispatch({effects:setDropCursorPos.of(Ws)})}},{eventObservers:{dragover(Ws){this.setDropPos(this.view.posAtCoords({x:Ws.clientX,y:Ws.clientY}))},dragleave(Ws){(Ws.target==this.view.contentDOM||!this.view.contentDOM.contains(Ws.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dropCursor(){return[dropCursorPos,drawDropCursor]}function iterMatches(Ws,ws,oi,si,ii){ws.lastIndex=0;for(let ai=Ws.iterRange(oi,si),li=oi,ci;!ai.next().done;li+=ai.value.length)if(!ai.lineBreak)for(;ci=ws.exec(ai.value);)ii(li+ci.index,ci)}function matchRanges(Ws,ws){let oi=Ws.visibleRanges;if(oi.length==1&&oi[0].from==Ws.viewport.from&&oi[0].to==Ws.viewport.to)return oi;let si=[];for(let{from:ii,to:ai}of oi)ii=Math.max(Ws.state.doc.lineAt(ii).from,ii-ws),ai=Math.min(Ws.state.doc.lineAt(ai).to,ai+ws),si.length&&si[si.length-1].to>=ii?si[si.length-1].to=ai:si.push({from:ii,to:ai});return si}class MatchDecorator{constructor(ws){const{regexp:oi,decoration:si,decorate:ii,boundary:ai,maxLength:li=1e3}=ws;if(!oi.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=oi,ii)this.addMatch=(ci,ui,di,hi)=>ii(hi,di,di+ci[0].length,ci,ui);else if(typeof si=="function")this.addMatch=(ci,ui,di,hi)=>{let pi=si(ci,ui,di);pi&&hi(di,di+ci[0].length,pi)};else if(si)this.addMatch=(ci,ui,di,hi)=>hi(di,di+ci[0].length,si);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=ai,this.maxLength=li}createDeco(ws){let oi=new RangeSetBuilder,si=oi.add.bind(oi);for(let{from:ii,to:ai}of matchRanges(ws,this.maxLength))iterMatches(ws.state.doc,this.regexp,ii,ai,(li,ci)=>this.addMatch(ci,ws,li,si));return oi.finish()}updateDeco(ws,oi){let si=1e9,ii=-1;return ws.docChanged&&ws.changes.iterChanges((ai,li,ci,ui)=>{ui>=ws.view.viewport.from&&ci<=ws.view.viewport.to&&(si=Math.min(ci,si),ii=Math.max(ui,ii))}),ws.viewportMoved||ii-si>1e3?this.createDeco(ws.view):ii>-1?this.updateRange(ws.view,oi.map(ws.changes),si,ii):oi}updateRange(ws,oi,si,ii){for(let ai of ws.visibleRanges){let li=Math.max(ai.from,si),ci=Math.min(ai.to,ii);if(ci>li){let ui=ws.state.doc.lineAt(li),di=ui.to<ci?ws.state.doc.lineAt(ci):ui,hi=Math.max(ai.from,ui.from),pi=Math.min(ai.to,di.to);if(this.boundary){for(;li>ui.from;li--)if(this.boundary.test(ui.text[li-1-ui.from])){hi=li;break}for(;ci<di.to;ci++)if(this.boundary.test(di.text[ci-di.from])){pi=ci;break}}let ha=[],ga,va=(ba,wa,xa)=>ha.push(xa.range(ba,wa));if(ui==di)for(this.regexp.lastIndex=hi-ui.from;(ga=this.regexp.exec(ui.text))&&ga.index<pi-ui.from;)this.addMatch(ga,ws,ga.index+ui.from,va);else iterMatches(ws.state.doc,this.regexp,hi,pi,(ba,wa)=>this.addMatch(wa,ws,ba,va));oi=oi.update({filterFrom:hi,filterTo:pi,filter:(ba,wa)=>ba<hi||wa>pi,add:ha})}}return oi}}const UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g",Specials=new RegExp(`[\0-\b
322
- --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,UnicodeRegexpSupport),Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let _supportsTabSize=null;function supportsTabSize(){var Ws;if(_supportsTabSize==null&&typeof document<"u"&&document.body){let ws=document.body.style;_supportsTabSize=((Ws=ws.tabSize)!==null&&Ws!==void 0?Ws:ws.MozTabSize)!=null}return _supportsTabSize||!1}const specialCharConfig=Facet.define({combine(Ws){let ws=combineConfig(Ws,{render:null,specialChars:Specials,addSpecialChars:null});return(ws.replaceTabs=!supportsTabSize())&&(ws.specialChars=new RegExp(" |"+ws.specialChars.source,UnicodeRegexpSupport)),ws.addSpecialChars&&(ws.specialChars=new RegExp(ws.specialChars.source+"|"+ws.addSpecialChars.source,UnicodeRegexpSupport)),ws}});function highlightSpecialChars(Ws={}){return[specialCharConfig.of(Ws),specialCharPlugin()]}let _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.decorations=Decoration.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(Ws.state.facet(specialCharConfig)),this.decorations=this.decorator.createDeco(Ws)}makeDecorator(Ws){return new MatchDecorator({regexp:Ws.specialChars,decoration:(ws,oi,si)=>{let{doc:ii}=oi.state,ai=codePointAt(ws[0],0);if(ai==9){let li=ii.lineAt(si),ci=oi.state.tabSize,ui=countColumn(li.text,ci,si-li.from);return Decoration.replace({widget:new TabWidget((ci-ui%ci)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[ai]||(this.decorationCache[ai]=Decoration.replace({widget:new SpecialCharWidget(Ws,ai)}))},boundary:Ws.replaceTabs?void 0:/[^]/})}update(Ws){let ws=Ws.state.facet(specialCharConfig);Ws.startState.facet(specialCharConfig)!=ws?(this.decorator=this.makeDecorator(ws),this.decorations=this.decorator.createDeco(Ws.view)):this.decorations=this.decorator.updateDeco(Ws,this.decorations)}},{decorations:Ws=>Ws.decorations}))}const DefaultPlaceholder="•";function placeholder$1(Ws){return Ws>=32?DefaultPlaceholder:Ws==10?"␤":String.fromCharCode(9216+Ws)}class SpecialCharWidget extends WidgetType{constructor(ws,oi){super(),this.options=ws,this.code=oi}eq(ws){return ws.code==this.code}toDOM(ws){let oi=placeholder$1(this.code),si=ws.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16)),ii=this.options.render&&this.options.render(this.code,si,oi);if(ii)return ii;let ai=document.createElement("span");return ai.textContent=oi,ai.title=si,ai.setAttribute("aria-label",si),ai.className="cm-specialChar",ai}ignoreEvent(){return!1}}class TabWidget extends WidgetType{constructor(ws){super(),this.width=ws}eq(ws){return ws.width==this.width}toDOM(){let ws=document.createElement("span");return ws.textContent=" ",ws.className="cm-tab",ws.style.width=this.width+"px",ws}ignoreEvent(){return!1}}function highlightActiveLine(){return activeLineHighlighter}const lineDeco=Decoration.line({class:"cm-activeLine"}),activeLineHighlighter=ViewPlugin.fromClass(class{constructor(Ws){this.decorations=this.getDeco(Ws)}update(Ws){(Ws.docChanged||Ws.selectionSet)&&(this.decorations=this.getDeco(Ws.view))}getDeco(Ws){let ws=-1,oi=[];for(let si of Ws.state.selection.ranges){let ii=Ws.lineBlockAt(si.head);ii.from>ws&&(oi.push(lineDeco.range(ii.from)),ws=ii.from)}return Decoration.set(oi)}},{decorations:Ws=>Ws.decorations}),MaxOff=2e3;function rectangleFor(Ws,ws,oi){let si=Math.min(ws.line,oi.line),ii=Math.max(ws.line,oi.line),ai=[];if(ws.off>MaxOff||oi.off>MaxOff||ws.col<0||oi.col<0){let li=Math.min(ws.off,oi.off),ci=Math.max(ws.off,oi.off);for(let ui=si;ui<=ii;ui++){let di=Ws.doc.line(ui);di.length<=ci&&ai.push(EditorSelection.range(di.from+li,di.to+ci))}}else{let li=Math.min(ws.col,oi.col),ci=Math.max(ws.col,oi.col);for(let ui=si;ui<=ii;ui++){let di=Ws.doc.line(ui),hi=findColumn(di.text,li,Ws.tabSize,!0);if(hi<0)ai.push(EditorSelection.cursor(di.to));else{let pi=findColumn(di.text,ci,Ws.tabSize);ai.push(EditorSelection.range(di.from+hi,di.from+pi))}}}return ai}function absoluteColumn(Ws,ws){let oi=Ws.coordsAtPos(Ws.viewport.from);return oi?Math.round(Math.abs((oi.left-ws)/Ws.defaultCharacterWidth)):-1}function getPos(Ws,ws){let oi=Ws.posAtCoords({x:ws.clientX,y:ws.clientY},!1),si=Ws.state.doc.lineAt(oi),ii=oi-si.from,ai=ii>MaxOff?-1:ii==si.length?absoluteColumn(Ws,ws.clientX):countColumn(si.text,Ws.state.tabSize,oi-si.from);return{line:si.number,col:ai,off:ii}}function rectangleSelectionStyle(Ws,ws){let oi=getPos(Ws,ws),si=Ws.state.selection;return oi?{update(ii){if(ii.docChanged){let ai=ii.changes.mapPos(ii.startState.doc.line(oi.line).from),li=ii.state.doc.lineAt(ai);oi={line:li.number,col:oi.col,off:Math.min(oi.off,li.length)},si=si.map(ii.changes)}},get(ii,ai,li){let ci=getPos(Ws,ii);if(!ci)return si;let ui=rectangleFor(Ws.state,oi,ci);return ui.length?li?EditorSelection.create(ui.concat(si.ranges)):EditorSelection.create(ui):si}}:null}function rectangularSelection(Ws){let ws=oi=>oi.altKey&&oi.button==0;return EditorView.mouseSelectionStyle.of((oi,si)=>ws(si)?rectangleSelectionStyle(oi,si):null)}const keys={Alt:[18,Ws=>!!Ws.altKey],Control:[17,Ws=>!!Ws.ctrlKey],Shift:[16,Ws=>!!Ws.shiftKey],Meta:[91,Ws=>!!Ws.metaKey]},showCrosshair={style:"cursor: crosshair"};function crosshairCursor(Ws={}){let[ws,oi]=keys[Ws.key||"Alt"],si=ViewPlugin.fromClass(class{constructor(ii){this.view=ii,this.isDown=!1}set(ii){this.isDown!=ii&&(this.isDown=ii,this.view.update([]))}},{eventObservers:{keydown(ii){this.set(ii.keyCode==ws||oi(ii))},keyup(ii){(ii.keyCode==ws||!oi(ii))&&this.set(!1)},mousemove(ii){this.set(oi(ii))}}});return[si,EditorView.contentAttributes.of(ii=>{var ai;return!((ai=ii.plugin(si))===null||ai===void 0)&&ai.isDown?showCrosshair:null})]}const Outside="-10000px";class TooltipViewManager{constructor(ws,oi,si,ii){this.facet=oi,this.createTooltipView=si,this.removeTooltipView=ii,this.input=ws.state.facet(oi),this.tooltips=this.input.filter(li=>li);let ai=null;this.tooltipViews=this.tooltips.map(li=>ai=si(li,ai))}update(ws,oi){var si;let ii=ws.state.facet(this.facet),ai=ii.filter(ui=>ui);if(ii===this.input){for(let ui of this.tooltipViews)ui.update&&ui.update(ws);return!1}let li=[],ci=oi?[]:null;for(let ui=0;ui<ai.length;ui++){let di=ai[ui],hi=-1;if(di){for(let pi=0;pi<this.tooltips.length;pi++){let ha=this.tooltips[pi];ha&&ha.create==di.create&&(hi=pi)}if(hi<0)li[ui]=this.createTooltipView(di,ui?li[ui-1]:null),ci&&(ci[ui]=!!di.above);else{let pi=li[ui]=this.tooltipViews[hi];ci&&(ci[ui]=oi[hi]),pi.update&&pi.update(ws)}}}for(let ui of this.tooltipViews)li.indexOf(ui)<0&&(this.removeTooltipView(ui),(si=ui.destroy)===null||si===void 0||si.call(ui));return oi&&(ci.forEach((ui,di)=>oi[di]=ui),oi.length=ci.length),this.input=ii,this.tooltips=ai,this.tooltipViews=li,!0}}function windowSpace(Ws){let{win:ws}=Ws;return{top:0,left:0,bottom:ws.innerHeight,right:ws.innerWidth}}const tooltipConfig=Facet.define({combine:Ws=>{var ws,oi,si;return{position:browser.ios?"absolute":((ws=Ws.find(ii=>ii.position))===null||ws===void 0?void 0:ws.position)||"fixed",parent:((oi=Ws.find(ii=>ii.parent))===null||oi===void 0?void 0:oi.parent)||null,tooltipSpace:((si=Ws.find(ii=>ii.tooltipSpace))===null||si===void 0?void 0:si.tooltipSpace)||windowSpace}}}),knownHeight=new WeakMap,tooltipPlugin=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let ws=Ws.state.facet(tooltipConfig);this.position=ws.position,this.parent=ws.parent,this.classes=Ws.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new TooltipViewManager(Ws,showTooltip,(oi,si)=>this.createTooltip(oi,si),oi=>{this.resizeObserver&&this.resizeObserver.unobserve(oi.dom),oi.dom.remove()}),this.above=this.manager.tooltips.map(oi=>!!oi.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(oi=>{Date.now()>this.lastTransaction-50&&oi.length>0&&oi[oi.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),Ws.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let Ws of this.manager.tooltipViews)this.intersectionObserver.observe(Ws.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(Ws){Ws.transactions.length&&(this.lastTransaction=Date.now());let ws=this.manager.update(Ws,this.above);ws&&this.observeIntersection();let oi=ws||Ws.geometryChanged,si=Ws.state.facet(tooltipConfig);if(si.position!=this.position&&!this.madeAbsolute){this.position=si.position;for(let ii of this.manager.tooltipViews)ii.dom.style.position=this.position;oi=!0}if(si.parent!=this.parent){this.parent&&this.container.remove(),this.parent=si.parent,this.createContainer();for(let ii of this.manager.tooltipViews)this.container.appendChild(ii.dom);oi=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);oi&&this.maybeMeasure()}createTooltip(Ws,ws){let oi=Ws.create(this.view),si=ws?ws.dom:null;if(oi.dom.classList.add("cm-tooltip"),Ws.arrow&&!oi.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let ii=document.createElement("div");ii.className="cm-tooltip-arrow",oi.dom.appendChild(ii)}return oi.dom.style.position=this.position,oi.dom.style.top=Outside,oi.dom.style.left="0px",this.container.insertBefore(oi.dom,si),oi.mount&&oi.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(oi.dom),oi}destroy(){var Ws,ws,oi;this.view.win.removeEventListener("resize",this.measureSoon);for(let si of this.manager.tooltipViews)si.dom.remove(),(Ws=si.destroy)===null||Ws===void 0||Ws.call(si);this.parent&&this.container.remove(),(ws=this.resizeObserver)===null||ws===void 0||ws.disconnect(),(oi=this.intersectionObserver)===null||oi===void 0||oi.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let Ws=1,ws=1,oi=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:ai}=this.manager.tooltipViews[0];if(browser.gecko)oi=ai.offsetParent!=this.container.ownerDocument.body;else if(ai.style.top==Outside&&ai.style.left=="0px"){let li=ai.getBoundingClientRect();oi=Math.abs(li.top+1e4)>1||Math.abs(li.left)>1}}if(oi||this.position=="absolute")if(this.parent){let ai=this.parent.getBoundingClientRect();ai.width&&ai.height&&(Ws=ai.width/this.parent.offsetWidth,ws=ai.height/this.parent.offsetHeight)}else({scaleX:Ws,scaleY:ws}=this.view.viewState);let si=this.view.scrollDOM.getBoundingClientRect(),ii=getScrollMargins(this.view);return{visible:{left:si.left+ii.left,top:si.top+ii.top,right:si.right-ii.right,bottom:si.bottom-ii.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((ai,li)=>{let ci=this.manager.tooltipViews[li];return ci.getCoords?ci.getCoords(ai.pos):this.view.coordsAtPos(ai.pos)}),size:this.manager.tooltipViews.map(({dom:ai})=>ai.getBoundingClientRect()),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view),scaleX:Ws,scaleY:ws,makeAbsolute:oi}}writeMeasure(Ws){var ws;if(Ws.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let ci of this.manager.tooltipViews)ci.dom.style.position="absolute"}let{visible:oi,space:si,scaleX:ii,scaleY:ai}=Ws,li=[];for(let ci=0;ci<this.manager.tooltips.length;ci++){let ui=this.manager.tooltips[ci],di=this.manager.tooltipViews[ci],{dom:hi}=di,pi=Ws.pos[ci],ha=Ws.size[ci];if(!pi||ui.clip!==!1&&(pi.bottom<=Math.max(oi.top,si.top)||pi.top>=Math.min(oi.bottom,si.bottom)||pi.right<Math.max(oi.left,si.left)-.1||pi.left>Math.min(oi.right,si.right)+.1)){hi.style.top=Outside;continue}let ga=ui.arrow?di.dom.querySelector(".cm-tooltip-arrow"):null,va=ga?7:0,ba=ha.right-ha.left,wa=(ws=knownHeight.get(di))!==null&&ws!==void 0?ws:ha.bottom-ha.top,xa=di.offset||noOffset,Ca=this.view.textDirection==Direction.LTR,el=ha.width>si.right-si.left?Ca?si.left:si.right-ha.width:Ca?Math.max(si.left,Math.min(pi.left-(ga?14:0)+xa.x,si.right-ba)):Math.min(Math.max(si.left,pi.left-ba+(ga?14:0)-xa.x),si.right-ba),ku=this.above[ci];!ui.strictSide&&(ku?pi.top-wa-va-xa.y<si.top:pi.bottom+wa+va+xa.y>si.bottom)&&ku==si.bottom-pi.bottom>pi.top-si.top&&(ku=this.above[ci]=!ku);let gd=(ku?pi.top-si.top:si.bottom-pi.bottom)-va;if(gd<wa&&di.resize!==!1){if(gd<this.view.defaultLineHeight){hi.style.top=Outside;continue}knownHeight.set(di,wa),hi.style.height=(wa=gd)/ai+"px"}else hi.style.height&&(hi.style.height="");let Ed=ku?pi.top-wa-va-xa.y:pi.bottom+va+xa.y,Od=el+ba;if(di.overlap!==!0)for(let Nd of li)Nd.left<Od&&Nd.right>el&&Nd.top<Ed+wa&&Nd.bottom>Ed&&(Ed=ku?Nd.top-wa-2-va:Nd.bottom+va+2);if(this.position=="absolute"?(hi.style.top=(Ed-Ws.parent.top)/ai+"px",setLeftStyle(hi,(el-Ws.parent.left)/ii)):(hi.style.top=Ed/ai+"px",setLeftStyle(hi,el/ii)),ga){let Nd=pi.left+(Ca?xa.x:-xa.x)-(el+14-7);ga.style.left=Nd/ii+"px"}di.overlap!==!0&&li.push({left:el,top:Ed,right:Od,bottom:Ed+wa}),hi.classList.toggle("cm-tooltip-above",ku),hi.classList.toggle("cm-tooltip-below",!ku),di.positioned&&di.positioned(Ws.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let Ws of this.manager.tooltipViews)Ws.dom.style.top=Outside}},{eventObservers:{scroll(){this.maybeMeasure()}}});function setLeftStyle(Ws,ws){let oi=parseInt(Ws.style.left,10);(isNaN(oi)||Math.abs(ws-oi)>1)&&(Ws.style.left=ws+"px")}const baseTheme$5=EditorView.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),noOffset={x:0,y:0},showTooltip=Facet.define({enables:[tooltipPlugin,baseTheme$5]}),showHoverTooltip=Facet.define({combine:Ws=>Ws.reduce((ws,oi)=>ws.concat(oi),[])});class HoverTooltipHost{static create(ws){return new HoverTooltipHost(ws)}constructor(ws){this.view=ws,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new TooltipViewManager(ws,showHoverTooltip,(oi,si)=>this.createHostedView(oi,si),oi=>oi.dom.remove())}createHostedView(ws,oi){let si=ws.create(this.view);return si.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(si.dom,oi?oi.dom.nextSibling:this.dom.firstChild),this.mounted&&si.mount&&si.mount(this.view),si}mount(ws){for(let oi of this.manager.tooltipViews)oi.mount&&oi.mount(ws);this.mounted=!0}positioned(ws){for(let oi of this.manager.tooltipViews)oi.positioned&&oi.positioned(ws)}update(ws){this.manager.update(ws)}destroy(){var ws;for(let oi of this.manager.tooltipViews)(ws=oi.destroy)===null||ws===void 0||ws.call(oi)}passProp(ws){let oi;for(let si of this.manager.tooltipViews){let ii=si[ws];if(ii!==void 0){if(oi===void 0)oi=ii;else if(oi!==ii)return}}return oi}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const showHoverTooltipHost=showTooltip.compute([showHoverTooltip],Ws=>{let ws=Ws.facet(showHoverTooltip);return ws.length===0?null:{pos:Math.min(...ws.map(oi=>oi.pos)),end:Math.max(...ws.map(oi=>{var si;return(si=oi.end)!==null&&si!==void 0?si:oi.pos})),create:HoverTooltipHost.create,above:ws[0].above,arrow:ws.some(oi=>oi.arrow)}});class HoverPlugin{constructor(ws,oi,si,ii,ai){this.view=ws,this.source=oi,this.field=si,this.setHover=ii,this.hoverTime=ai,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:ws.dom,time:0},this.checkHover=this.checkHover.bind(this),ws.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),ws.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let ws=Date.now()-this.lastMove.time;ws<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-ws):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:ws,lastMove:oi}=this,si=ws.docView.nearest(oi.target);if(!si)return;let ii,ai=1;if(si instanceof WidgetView)ii=si.posAtStart;else{if(ii=ws.posAtCoords(oi),ii==null)return;let ci=ws.coordsAtPos(ii);if(!ci||oi.y<ci.top||oi.y>ci.bottom||oi.x<ci.left-ws.defaultCharacterWidth||oi.x>ci.right+ws.defaultCharacterWidth)return;let ui=ws.bidiSpans(ws.state.doc.lineAt(ii)).find(hi=>hi.from<=ii&&hi.to>=ii),di=ui&&ui.dir==Direction.RTL?-1:1;ai=oi.x<ci.left?-di:di}let li=this.source(ws,ii,ai);if(li!=null&&li.then){let ci=this.pending={pos:ii};li.then(ui=>{this.pending==ci&&(this.pending=null,ui&&!(Array.isArray(ui)&&!ui.length)&&ws.dispatch({effects:this.setHover.of(Array.isArray(ui)?ui:[ui])}))},ui=>logException(ws.state,ui,"hover tooltip"))}else li&&!(Array.isArray(li)&&!li.length)&&ws.dispatch({effects:this.setHover.of(Array.isArray(li)?li:[li])})}get tooltip(){let ws=this.view.plugin(tooltipPlugin),oi=ws?ws.manager.tooltips.findIndex(si=>si.create==HoverTooltipHost.create):-1;return oi>-1?ws.manager.tooltipViews[oi]:null}mousemove(ws){var oi,si;this.lastMove={x:ws.clientX,y:ws.clientY,target:ws.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:ii,tooltip:ai}=this;if(ii.length&&ai&&!isInTooltip(ai.dom,ws)||this.pending){let{pos:li}=ii[0]||this.pending,ci=(si=(oi=ii[0])===null||oi===void 0?void 0:oi.end)!==null&&si!==void 0?si:li;(li==ci?this.view.posAtCoords(this.lastMove)!=li:!isOverRange(this.view,li,ci,ws.clientX,ws.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(ws){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:oi}=this;if(oi.length){let{tooltip:si}=this;si&&si.dom.contains(ws.relatedTarget)?this.watchTooltipLeave(si.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(ws){let oi=si=>{ws.removeEventListener("mouseleave",oi),this.active.length&&!this.view.dom.contains(si.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};ws.addEventListener("mouseleave",oi)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const tooltipMargin=4;function isInTooltip(Ws,ws){let{left:oi,right:si,top:ii,bottom:ai}=Ws.getBoundingClientRect(),li;if(li=Ws.querySelector(".cm-tooltip-arrow")){let ci=li.getBoundingClientRect();ii=Math.min(ci.top,ii),ai=Math.max(ci.bottom,ai)}return ws.clientX>=oi-tooltipMargin&&ws.clientX<=si+tooltipMargin&&ws.clientY>=ii-tooltipMargin&&ws.clientY<=ai+tooltipMargin}function isOverRange(Ws,ws,oi,si,ii,ai){let li=Ws.scrollDOM.getBoundingClientRect(),ci=Ws.documentTop+Ws.documentPadding.top+Ws.contentHeight;if(li.left>si||li.right<si||li.top>ii||Math.min(li.bottom,ci)<ii)return!1;let ui=Ws.posAtCoords({x:si,y:ii},!1);return ui>=ws&&ui<=oi}function hoverTooltip(Ws,ws={}){let oi=StateEffect.define(),si=StateField.define({create(){return[]},update(ii,ai){if(ii.length&&(ws.hideOnChange&&(ai.docChanged||ai.selection)?ii=[]:ws.hideOn&&(ii=ii.filter(li=>!ws.hideOn(ai,li))),ai.docChanged)){let li=[];for(let ci of ii){let ui=ai.changes.mapPos(ci.pos,-1,MapMode.TrackDel);if(ui!=null){let di=Object.assign(Object.create(null),ci);di.pos=ui,di.end!=null&&(di.end=ai.changes.mapPos(di.end)),li.push(di)}}ii=li}for(let li of ai.effects)li.is(oi)&&(ii=li.value),li.is(closeHoverTooltipEffect)&&(ii=[]);return ii},provide:ii=>showHoverTooltip.from(ii)});return{active:si,extension:[si,ViewPlugin.define(ii=>new HoverPlugin(ii,Ws,si,oi,ws.hoverTime||300)),showHoverTooltipHost]}}function getTooltip(Ws,ws){let oi=Ws.plugin(tooltipPlugin);if(!oi)return null;let si=oi.manager.tooltips.indexOf(ws);return si<0?null:oi.manager.tooltipViews[si]}const closeHoverTooltipEffect=StateEffect.define(),panelConfig=Facet.define({combine(Ws){let ws,oi;for(let si of Ws)ws=ws||si.topContainer,oi=oi||si.bottomContainer;return{topContainer:ws,bottomContainer:oi}}});function getPanel(Ws,ws){let oi=Ws.plugin(panelPlugin),si=oi?oi.specs.indexOf(ws):-1;return si>-1?oi.panels[si]:null}const panelPlugin=ViewPlugin.fromClass(class{constructor(Ws){this.input=Ws.state.facet(showPanel),this.specs=this.input.filter(oi=>oi),this.panels=this.specs.map(oi=>oi(Ws));let ws=Ws.state.facet(panelConfig);this.top=new PanelGroup(Ws,!0,ws.topContainer),this.bottom=new PanelGroup(Ws,!1,ws.bottomContainer),this.top.sync(this.panels.filter(oi=>oi.top)),this.bottom.sync(this.panels.filter(oi=>!oi.top));for(let oi of this.panels)oi.dom.classList.add("cm-panel"),oi.mount&&oi.mount()}update(Ws){let ws=Ws.state.facet(panelConfig);this.top.container!=ws.topContainer&&(this.top.sync([]),this.top=new PanelGroup(Ws.view,!0,ws.topContainer)),this.bottom.container!=ws.bottomContainer&&(this.bottom.sync([]),this.bottom=new PanelGroup(Ws.view,!1,ws.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let oi=Ws.state.facet(showPanel);if(oi!=this.input){let si=oi.filter(ui=>ui),ii=[],ai=[],li=[],ci=[];for(let ui of si){let di=this.specs.indexOf(ui),hi;di<0?(hi=ui(Ws.view),ci.push(hi)):(hi=this.panels[di],hi.update&&hi.update(Ws)),ii.push(hi),(hi.top?ai:li).push(hi)}this.specs=si,this.panels=ii,this.top.sync(ai),this.bottom.sync(li);for(let ui of ci)ui.dom.classList.add("cm-panel"),ui.mount&&ui.mount()}else for(let si of this.panels)si.update&&si.update(Ws)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:Ws=>EditorView.scrollMargins.of(ws=>{let oi=ws.plugin(Ws);return oi&&{top:oi.top.scrollMargin(),bottom:oi.bottom.scrollMargin()}})});class PanelGroup{constructor(ws,oi,si){this.view=ws,this.top=oi,this.container=si,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(ws){for(let oi of this.panels)oi.destroy&&ws.indexOf(oi)<0&&oi.destroy();this.panels=ws,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let oi=this.container||this.view.dom;oi.insertBefore(this.dom,this.top?oi.firstChild:null)}let ws=this.dom.firstChild;for(let oi of this.panels)if(oi.dom.parentNode==this.dom){for(;ws!=oi.dom;)ws=rm(ws);ws=ws.nextSibling}else this.dom.insertBefore(oi.dom,ws);for(;ws;)ws=rm(ws)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let ws of this.classes.split(" "))ws&&this.container.classList.remove(ws);for(let ws of(this.classes=this.view.themeClasses).split(" "))ws&&this.container.classList.add(ws)}}}function rm(Ws){let ws=Ws.nextSibling;return Ws.remove(),ws}const showPanel=Facet.define({enables:panelPlugin});class GutterMarker extends RangeValue{compare(ws){return this==ws||this.constructor==ws.constructor&&this.eq(ws)}eq(ws){return!1}destroy(ws){}}GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=void 0;GutterMarker.prototype.mapMode=MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=!0;const gutterLineClass=Facet.define(),gutterWidgetClass=Facet.define(),defaults$1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>RangeSet.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},activeGutters=Facet.define();function gutter(Ws){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults$1),Ws))]}const unfixGutters=Facet.define({combine:Ws=>Ws.some(ws=>ws)});function gutters(Ws){return[gutterView]}const gutterView=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.prevViewport=Ws.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=Ws.state.facet(activeGutters).map(ws=>new SingleGutterView(Ws,ws));for(let ws of this.gutters)this.dom.appendChild(ws.dom);this.fixed=!Ws.state.facet(unfixGutters),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),Ws.scrollDOM.insertBefore(this.dom,Ws.contentDOM)}update(Ws){if(this.updateGutters(Ws)){let ws=this.prevViewport,oi=Ws.view.viewport,si=Math.min(ws.to,oi.to)-Math.max(ws.from,oi.from);this.syncGutters(si<(oi.to-oi.from)*.8)}Ws.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(unfixGutters)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=Ws.view.viewport}syncGutters(Ws){let ws=this.dom.nextSibling;Ws&&this.dom.remove();let oi=RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from),si=[],ii=this.gutters.map(ai=>new UpdateContext(ai,this.view.viewport,-this.view.documentPadding.top));for(let ai of this.view.viewportLineBlocks)if(si.length&&(si=[]),Array.isArray(ai.type)){let li=!0;for(let ci of ai.type)if(ci.type==BlockType.Text&&li){advanceCursor(oi,si,ci.from);for(let ui of ii)ui.line(this.view,ci,si);li=!1}else if(ci.widget)for(let ui of ii)ui.widget(this.view,ci)}else if(ai.type==BlockType.Text){advanceCursor(oi,si,ai.from);for(let li of ii)li.line(this.view,ai,si)}else if(ai.widget)for(let li of ii)li.widget(this.view,ai);for(let ai of ii)ai.finish();Ws&&this.view.scrollDOM.insertBefore(this.dom,ws)}updateGutters(Ws){let ws=Ws.startState.facet(activeGutters),oi=Ws.state.facet(activeGutters),si=Ws.docChanged||Ws.heightChanged||Ws.viewportChanged||!RangeSet.eq(Ws.startState.facet(gutterLineClass),Ws.state.facet(gutterLineClass),Ws.view.viewport.from,Ws.view.viewport.to);if(ws==oi)for(let ii of this.gutters)ii.update(Ws)&&(si=!0);else{si=!0;let ii=[];for(let ai of oi){let li=ws.indexOf(ai);li<0?ii.push(new SingleGutterView(this.view,ai)):(this.gutters[li].update(Ws),ii.push(this.gutters[li]))}for(let ai of this.gutters)ai.dom.remove(),ii.indexOf(ai)<0&&ai.destroy();for(let ai of ii)this.dom.appendChild(ai.dom);this.gutters=ii}return si}destroy(){for(let Ws of this.gutters)Ws.destroy();this.dom.remove()}},{provide:Ws=>EditorView.scrollMargins.of(ws=>{let oi=ws.plugin(Ws);return!oi||oi.gutters.length==0||!oi.fixed?null:ws.textDirection==Direction.LTR?{left:oi.dom.offsetWidth*ws.scaleX}:{right:oi.dom.offsetWidth*ws.scaleX}})});function asArray$1(Ws){return Array.isArray(Ws)?Ws:[Ws]}function advanceCursor(Ws,ws,oi){for(;Ws.value&&Ws.from<=oi;)Ws.from==oi&&ws.push(Ws.value),Ws.next()}class UpdateContext{constructor(ws,oi,si){this.gutter=ws,this.height=si,this.i=0,this.cursor=RangeSet.iter(ws.markers,oi.from)}addElement(ws,oi,si){let{gutter:ii}=this,ai=(oi.top-this.height)/ws.scaleY,li=oi.height/ws.scaleY;if(this.i==ii.elements.length){let ci=new GutterElement(ws,li,ai,si);ii.elements.push(ci),ii.dom.appendChild(ci.dom)}else ii.elements[this.i].update(ws,li,ai,si);this.height=oi.bottom,this.i++}line(ws,oi,si){let ii=[];advanceCursor(this.cursor,ii,oi.from),si.length&&(ii=ii.concat(si));let ai=this.gutter.config.lineMarker(ws,oi,ii);ai&&ii.unshift(ai);let li=this.gutter;ii.length==0&&!li.config.renderEmptyElements||this.addElement(ws,oi,ii)}widget(ws,oi){let si=this.gutter.config.widgetMarker(ws,oi.widget,oi),ii=si?[si]:null;for(let ai of ws.state.facet(gutterWidgetClass)){let li=ai(ws,oi.widget,oi);li&&(ii||(ii=[])).push(li)}ii&&this.addElement(ws,oi,ii)}finish(){let ws=this.gutter;for(;ws.elements.length>this.i;){let oi=ws.elements.pop();ws.dom.removeChild(oi.dom),oi.destroy()}}}class SingleGutterView{constructor(ws,oi){this.view=ws,this.config=oi,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let si in oi.domEventHandlers)this.dom.addEventListener(si,ii=>{let ai=ii.target,li;if(ai!=this.dom&&this.dom.contains(ai)){for(;ai.parentNode!=this.dom;)ai=ai.parentNode;let ui=ai.getBoundingClientRect();li=(ui.top+ui.bottom)/2}else li=ii.clientY;let ci=ws.lineBlockAtHeight(li-ws.documentTop);oi.domEventHandlers[si](ws,ci,ii)&&ii.preventDefault()});this.markers=asArray$1(oi.markers(ws)),oi.initialSpacer&&(this.spacer=new GutterElement(ws,0,0,[oi.initialSpacer(ws)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(ws){let oi=this.markers;if(this.markers=asArray$1(this.config.markers(ws.view)),this.spacer&&this.config.updateSpacer){let ii=this.config.updateSpacer(this.spacer.markers[0],ws);ii!=this.spacer.markers[0]&&this.spacer.update(ws.view,0,0,[ii])}let si=ws.view.viewport;return!RangeSet.eq(this.markers,oi,si.from,si.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(ws):!1)}destroy(){for(let ws of this.elements)ws.destroy()}}class GutterElement{constructor(ws,oi,si,ii){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(ws,oi,si,ii)}update(ws,oi,si,ii){this.height!=oi&&(this.height=oi,this.dom.style.height=oi+"px"),this.above!=si&&(this.dom.style.marginTop=(this.above=si)?si+"px":""),sameMarkers(this.markers,ii)||this.setMarkers(ws,ii)}setMarkers(ws,oi){let si="cm-gutterElement",ii=this.dom.firstChild;for(let ai=0,li=0;;){let ci=li,ui=ai<oi.length?oi[ai++]:null,di=!1;if(ui){let hi=ui.elementClass;hi&&(si+=" "+hi);for(let pi=li;pi<this.markers.length;pi++)if(this.markers[pi].compare(ui)){ci=pi,di=!0;break}}else ci=this.markers.length;for(;li<ci;){let hi=this.markers[li++];if(hi.toDOM){hi.destroy(ii);let pi=ii.nextSibling;ii.remove(),ii=pi}}if(!ui)break;ui.toDOM&&(di?ii=ii.nextSibling:this.dom.insertBefore(ui.toDOM(ws),ii)),di&&li++}this.dom.className=si,this.markers=oi}destroy(){this.setMarkers(null,[])}}function sameMarkers(Ws,ws){if(Ws.length!=ws.length)return!1;for(let oi=0;oi<Ws.length;oi++)if(!Ws[oi].compare(ws[oi]))return!1;return!0}const lineNumberMarkers=Facet.define(),lineNumberWidgetMarker=Facet.define(),lineNumberConfig=Facet.define({combine(Ws){return combineConfig(Ws,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(ws,oi){let si=Object.assign({},ws);for(let ii in oi){let ai=si[ii],li=oi[ii];si[ii]=ai?(ci,ui,di)=>ai(ci,ui,di)||li(ci,ui,di):li}return si}})}});class NumberMarker extends GutterMarker{constructor(ws){super(),this.number=ws}eq(ws){return this.number==ws.number}toDOM(){return document.createTextNode(this.number)}}function formatNumber(Ws,ws){return Ws.state.facet(lineNumberConfig).formatNumber(ws,Ws.state)}const lineNumberGutter=activeGutters.compute([lineNumberConfig],Ws=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(ws){return ws.state.facet(lineNumberMarkers)},lineMarker(ws,oi,si){return si.some(ii=>ii.toDOM)?null:new NumberMarker(formatNumber(ws,ws.state.doc.lineAt(oi.from).number))},widgetMarker:(ws,oi,si)=>{for(let ii of ws.state.facet(lineNumberWidgetMarker)){let ai=ii(ws,oi,si);if(ai)return ai}return null},lineMarkerChange:ws=>ws.startState.facet(lineNumberConfig)!=ws.state.facet(lineNumberConfig),initialSpacer(ws){return new NumberMarker(formatNumber(ws,maxLineNumber(ws.state.doc.lines)))},updateSpacer(ws,oi){let si=formatNumber(oi.view,maxLineNumber(oi.view.state.doc.lines));return si==ws.number?ws:new NumberMarker(si)},domEventHandlers:Ws.facet(lineNumberConfig).domEventHandlers}));function lineNumbers(Ws={}){return[lineNumberConfig.of(Ws),gutters(),lineNumberGutter]}function maxLineNumber(Ws){let ws=9;for(;ws<Ws;)ws=ws*10+9;return ws}const activeLineGutterMarker=new class extends GutterMarker{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},activeLineGutterHighlighter=gutterLineClass.compute(["selection"],Ws=>{let ws=[],oi=-1;for(let si of Ws.selection.ranges){let ii=Ws.doc.lineAt(si.head).from;ii>oi&&(oi=ii,ws.push(activeLineGutterMarker.range(ii)))}return RangeSet.of(ws)});function highlightActiveLineGutter(){return activeLineGutterHighlighter}const DefaultBufferLength=1024;let nextPropID=0,Range$2=class{constructor(Ws,ws){this.from=Ws,this.to=ws}};class NodeProp{constructor(ws={}){this.id=nextPropID++,this.perNode=!!ws.perNode,this.deserialize=ws.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(ws){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof ws!="function"&&(ws=NodeType.match(ws)),oi=>{let si=ws(oi);return si===void 0?null:[this,si]}}}NodeProp.closedBy=new NodeProp({deserialize:Ws=>Ws.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:Ws=>Ws.split(" ")});NodeProp.group=new NodeProp({deserialize:Ws=>Ws.split(" ")});NodeProp.isolate=new NodeProp({deserialize:Ws=>{if(Ws&&Ws!="rtl"&&Ws!="ltr"&&Ws!="auto")throw new RangeError("Invalid value for isolate: "+Ws);return Ws||"auto"}});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});class MountedTree{constructor(ws,oi,si){this.tree=ws,this.overlay=oi,this.parser=si}static get(ws){return ws&&ws.props&&ws.props[NodeProp.mounted.id]}}const noProps=Object.create(null);class NodeType{constructor(ws,oi,si,ii=0){this.name=ws,this.props=oi,this.id=si,this.flags=ii}static define(ws){let oi=ws.props&&ws.props.length?Object.create(null):noProps,si=(ws.top?1:0)|(ws.skipped?2:0)|(ws.error?4:0)|(ws.name==null?8:0),ii=new NodeType(ws.name||"",oi,ws.id,si);if(ws.props){for(let ai of ws.props)if(Array.isArray(ai)||(ai=ai(ii)),ai){if(ai[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");oi[ai[0].id]=ai[1]}}return ii}prop(ws){return this.props[ws.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(ws){if(typeof ws=="string"){if(this.name==ws)return!0;let oi=this.prop(NodeProp.group);return oi?oi.indexOf(ws)>-1:!1}return this.id==ws}static match(ws){let oi=Object.create(null);for(let si in ws)for(let ii of si.split(" "))oi[ii]=ws[si];return si=>{for(let ii=si.prop(NodeProp.group),ai=-1;ai<(ii?ii.length:0);ai++){let li=oi[ai<0?si.name:ii[ai]];if(li)return li}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(ws){this.types=ws;for(let oi=0;oi<ws.length;oi++)if(ws[oi].id!=oi)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...ws){let oi=[];for(let si of this.types){let ii=null;for(let ai of ws){let li=ai(si);li&&(ii||(ii=Object.assign({},si.props)),ii[li[0].id]=li[1])}oi.push(ii?new NodeType(si.name,ii,si.id,si.flags):si)}return new NodeSet(oi)}}const CachedNode=new WeakMap,CachedInnerNode=new WeakMap;var IterMode;(function(Ws){Ws[Ws.ExcludeBuffers=1]="ExcludeBuffers",Ws[Ws.IncludeAnonymous=2]="IncludeAnonymous",Ws[Ws.IgnoreMounts=4]="IgnoreMounts",Ws[Ws.IgnoreOverlays=8]="IgnoreOverlays"})(IterMode||(IterMode={}));class Tree{constructor(ws,oi,si,ii,ai){if(this.type=ws,this.children=oi,this.positions=si,this.length=ii,this.props=null,ai&&ai.length){this.props=Object.create(null);for(let[li,ci]of ai)this.props[typeof li=="number"?li:li.id]=ci}}toString(){let ws=MountedTree.get(this);if(ws&&!ws.overlay)return ws.tree.toString();let oi="";for(let si of this.children){let ii=si.toString();ii&&(oi&&(oi+=","),oi+=ii)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(oi.length?"("+oi+")":""):oi}cursor(ws=0){return new TreeCursor(this.topNode,ws)}cursorAt(ws,oi=0,si=0){let ii=CachedNode.get(this)||this.topNode,ai=new TreeCursor(ii);return ai.moveTo(ws,oi),CachedNode.set(this,ai._tree),ai}get topNode(){return new TreeNode(this,0,0,null)}resolve(ws,oi=0){let si=resolveNode(CachedNode.get(this)||this.topNode,ws,oi,!1);return CachedNode.set(this,si),si}resolveInner(ws,oi=0){let si=resolveNode(CachedInnerNode.get(this)||this.topNode,ws,oi,!0);return CachedInnerNode.set(this,si),si}resolveStack(ws,oi=0){return stackIterator(this,ws,oi)}iterate(ws){let{enter:oi,leave:si,from:ii=0,to:ai=this.length}=ws,li=ws.mode||0,ci=(li&IterMode.IncludeAnonymous)>0;for(let ui=this.cursor(li|IterMode.IncludeAnonymous);;){let di=!1;if(ui.from<=ai&&ui.to>=ii&&(!ci&&ui.type.isAnonymous||oi(ui)!==!1)){if(ui.firstChild())continue;di=!0}for(;di&&si&&(ci||!ui.type.isAnonymous)&&si(ui),!ui.nextSibling();){if(!ui.parent())return;di=!0}}}prop(ws){return ws.perNode?this.props?this.props[ws.id]:void 0:this.type.prop(ws)}get propValues(){let ws=[];if(this.props)for(let oi in this.props)ws.push([+oi,this.props[oi]]);return ws}balance(ws={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(oi,si,ii)=>new Tree(this.type,oi,si,ii,this.propValues),ws.makeTree||((oi,si,ii)=>new Tree(NodeType.none,oi,si,ii)))}static build(ws){return buildTree(ws)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(ws,oi){this.buffer=ws,this.index=oi}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(ws,oi,si){this.buffer=ws,this.length=oi,this.set=si}get type(){return NodeType.none}toString(){let ws=[];for(let oi=0;oi<this.buffer.length;)ws.push(this.childString(oi)),oi=this.buffer[oi+3];return ws.join(",")}childString(ws){let oi=this.buffer[ws],si=this.buffer[ws+3],ii=this.set.types[oi],ai=ii.name;if(/\W/.test(ai)&&!ii.isError&&(ai=JSON.stringify(ai)),ws+=4,si==ws)return ai;let li=[];for(;ws<si;)li.push(this.childString(ws)),ws=this.buffer[ws+3];return ai+"("+li.join(",")+")"}findChild(ws,oi,si,ii,ai){let{buffer:li}=this,ci=-1;for(let ui=ws;ui!=oi&&!(checkSide(ai,ii,li[ui+1],li[ui+2])&&(ci=ui,si>0));ui=li[ui+3]);return ci}slice(ws,oi,si){let ii=this.buffer,ai=new Uint16Array(oi-ws),li=0;for(let ci=ws,ui=0;ci<oi;){ai[ui++]=ii[ci++],ai[ui++]=ii[ci++]-si;let di=ai[ui++]=ii[ci++]-si;ai[ui++]=ii[ci++]-ws,li=Math.max(li,di)}return new TreeBuffer(ai,li,this.set)}}function checkSide(Ws,ws,oi,si){switch(Ws){case-2:return oi<ws;case-1:return si>=ws&&oi<ws;case 0:return oi<ws&&si>ws;case 1:return oi<=ws&&si>ws;case 2:return si>ws;case 4:return!0}}function resolveNode(Ws,ws,oi,si){for(var ii;Ws.from==Ws.to||(oi<1?Ws.from>=ws:Ws.from>ws)||(oi>-1?Ws.to<=ws:Ws.to<ws);){let li=!si&&Ws instanceof TreeNode&&Ws.index<0?null:Ws.parent;if(!li)return Ws;Ws=li}let ai=si?0:IterMode.IgnoreOverlays;if(si)for(let li=Ws,ci=li.parent;ci;li=ci,ci=li.parent)li instanceof TreeNode&&li.index<0&&((ii=ci.enter(ws,oi,ai))===null||ii===void 0?void 0:ii.from)!=li.from&&(Ws=ci);for(;;){let li=Ws.enter(ws,oi,ai);if(!li)return Ws;Ws=li}}class BaseNode{cursor(ws=0){return new TreeCursor(this,ws)}getChild(ws,oi=null,si=null){let ii=getChildren(this,ws,oi,si);return ii.length?ii[0]:null}getChildren(ws,oi=null,si=null){return getChildren(this,ws,oi,si)}resolve(ws,oi=0){return resolveNode(this,ws,oi,!1)}resolveInner(ws,oi=0){return resolveNode(this,ws,oi,!0)}matchContext(ws){return matchNodeContext(this.parent,ws)}enterUnfinishedNodesBefore(ws){let oi=this.childBefore(ws),si=this;for(;oi;){let ii=oi.lastChild;if(!ii||ii.to!=oi.to)break;ii.type.isError&&ii.from==ii.to?(si=oi,oi=ii.prevSibling):oi=ii}return si}get node(){return this}get next(){return this.parent}}class TreeNode extends BaseNode{constructor(ws,oi,si,ii){super(),this._tree=ws,this.from=oi,this.index=si,this._parent=ii}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(ws,oi,si,ii,ai=0){for(let li=this;;){for(let{children:ci,positions:ui}=li._tree,di=oi>0?ci.length:-1;ws!=di;ws+=oi){let hi=ci[ws],pi=ui[ws]+li.from;if(checkSide(ii,si,pi,pi+hi.length)){if(hi instanceof TreeBuffer){if(ai&IterMode.ExcludeBuffers)continue;let ha=hi.findChild(0,hi.buffer.length,oi,si-pi,ii);if(ha>-1)return new BufferNode(new BufferContext(li,hi,ws,pi),null,ha)}else if(ai&IterMode.IncludeAnonymous||!hi.type.isAnonymous||hasChild(hi)){let ha;if(!(ai&IterMode.IgnoreMounts)&&(ha=MountedTree.get(hi))&&!ha.overlay)return new TreeNode(ha.tree,pi,ws,li);let ga=new TreeNode(hi,pi,ws,li);return ai&IterMode.IncludeAnonymous||!ga.type.isAnonymous?ga:ga.nextChild(oi<0?hi.children.length-1:0,oi,si,ii)}}}if(ai&IterMode.IncludeAnonymous||!li.type.isAnonymous||(li.index>=0?ws=li.index+oi:ws=oi<0?-1:li._parent._tree.children.length,li=li._parent,!li))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(ws){return this.nextChild(0,1,ws,2)}childBefore(ws){return this.nextChild(this._tree.children.length-1,-1,ws,-2)}enter(ws,oi,si=0){let ii;if(!(si&IterMode.IgnoreOverlays)&&(ii=MountedTree.get(this._tree))&&ii.overlay){let ai=ws-this.from;for(let{from:li,to:ci}of ii.overlay)if((oi>0?li<=ai:li<ai)&&(oi<0?ci>=ai:ci>ai))return new TreeNode(ii.tree,ii.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,ws,oi,si)}nextSignificantParent(){let ws=this;for(;ws.type.isAnonymous&&ws._parent;)ws=ws._parent;return ws}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function getChildren(Ws,ws,oi,si){let ii=Ws.cursor(),ai=[];if(!ii.firstChild())return ai;if(oi!=null){for(let li=!1;!li;)if(li=ii.type.is(oi),!ii.nextSibling())return ai}for(;;){if(si!=null&&ii.type.is(si))return ai;if(ii.type.is(ws)&&ai.push(ii.node),!ii.nextSibling())return si==null?ai:[]}}function matchNodeContext(Ws,ws,oi=ws.length-1){for(let si=Ws;oi>=0;si=si.parent){if(!si)return!1;if(!si.type.isAnonymous){if(ws[oi]&&ws[oi]!=si.name)return!1;oi--}}return!0}class BufferContext{constructor(ws,oi,si,ii){this.parent=ws,this.buffer=oi,this.index=si,this.start=ii}}class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(ws,oi,si){super(),this.context=ws,this._parent=oi,this.index=si,this.type=ws.buffer.set.types[ws.buffer.buffer[si]]}child(ws,oi,si){let{buffer:ii}=this.context,ai=ii.findChild(this.index+4,ii.buffer[this.index+3],ws,oi-this.context.start,si);return ai<0?null:new BufferNode(this.context,this,ai)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(ws){return this.child(1,ws,2)}childBefore(ws){return this.child(-1,ws,-2)}enter(ws,oi,si=0){if(si&IterMode.ExcludeBuffers)return null;let{buffer:ii}=this.context,ai=ii.findChild(this.index+4,ii.buffer[this.index+3],oi>0?1:-1,ws-this.context.start,oi);return ai<0?null:new BufferNode(this.context,this,ai)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(ws){return this._parent?null:this.context.parent.nextChild(this.context.index+ws,ws,0,4)}get nextSibling(){let{buffer:ws}=this.context,oi=ws.buffer[this.index+3];return oi<(this._parent?ws.buffer[this._parent.index+3]:ws.buffer.length)?new BufferNode(this.context,this._parent,oi):this.externalSibling(1)}get prevSibling(){let{buffer:ws}=this.context,oi=this._parent?this._parent.index+4:0;return this.index==oi?this.externalSibling(-1):new BufferNode(this.context,this._parent,ws.findChild(oi,this.index,-1,0,4))}get tree(){return null}toTree(){let ws=[],oi=[],{buffer:si}=this.context,ii=this.index+4,ai=si.buffer[this.index+3];if(ai>ii){let li=si.buffer[this.index+1];ws.push(si.slice(ii,ai,li)),oi.push(0)}return new Tree(this.type,ws,oi,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function iterStack(Ws){if(!Ws.length)return null;let ws=0,oi=Ws[0];for(let ai=1;ai<Ws.length;ai++){let li=Ws[ai];(li.from>oi.from||li.to<oi.to)&&(oi=li,ws=ai)}let si=oi instanceof TreeNode&&oi.index<0?null:oi.parent,ii=Ws.slice();return si?ii[ws]=si:ii.splice(ws,1),new StackIterator(ii,oi)}class StackIterator{constructor(ws,oi){this.heads=ws,this.node=oi}get next(){return iterStack(this.heads)}}function stackIterator(Ws,ws,oi){let si=Ws.resolveInner(ws,oi),ii=null;for(let ai=si instanceof TreeNode?si:si.context.parent;ai;ai=ai.parent)if(ai.index<0){let li=ai.parent;(ii||(ii=[si])).push(li.resolve(ws,oi)),ai=li}else{let li=MountedTree.get(ai.tree);if(li&&li.overlay&&li.overlay[0].from<=ws&&li.overlay[li.overlay.length-1].to>=ws){let ci=new TreeNode(li.tree,li.overlay[0].from+ai.from,-1,ai);(ii||(ii=[si])).push(resolveNode(ci,ws,oi,!1))}}return ii?iterStack(ii):si}class TreeCursor{get name(){return this.type.name}constructor(ws,oi=0){if(this.mode=oi,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,ws instanceof TreeNode)this.yieldNode(ws);else{this._tree=ws.context.parent,this.buffer=ws.context;for(let si=ws._parent;si;si=si._parent)this.stack.unshift(si.index);this.bufferNode=ws,this.yieldBuf(ws.index)}}yieldNode(ws){return ws?(this._tree=ws,this.type=ws.type,this.from=ws.from,this.to=ws.to,!0):!1}yieldBuf(ws,oi){this.index=ws;let{start:si,buffer:ii}=this.buffer;return this.type=oi||ii.set.types[ii.buffer[ws]],this.from=si+ii.buffer[ws+1],this.to=si+ii.buffer[ws+2],!0}yield(ws){return ws?ws instanceof TreeNode?(this.buffer=null,this.yieldNode(ws)):(this.buffer=ws.context,this.yieldBuf(ws.index,ws.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(ws,oi,si){if(!this.buffer)return this.yield(this._tree.nextChild(ws<0?this._tree._tree.children.length-1:0,ws,oi,si,this.mode));let{buffer:ii}=this.buffer,ai=ii.findChild(this.index+4,ii.buffer[this.index+3],ws,oi-this.buffer.start,si);return ai<0?!1:(this.stack.push(this.index),this.yieldBuf(ai))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(ws){return this.enterChild(1,ws,2)}childBefore(ws){return this.enterChild(-1,ws,-2)}enter(ws,oi,si=this.mode){return this.buffer?si&IterMode.ExcludeBuffers?!1:this.enterChild(1,ws,oi):this.yield(this._tree.enter(ws,oi,si))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let ws=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(ws)}sibling(ws){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+ws,ws,0,4,this.mode)):!1;let{buffer:oi}=this.buffer,si=this.stack.length-1;if(ws<0){let ii=si<0?0:this.stack[si]+4;if(this.index!=ii)return this.yieldBuf(oi.findChild(ii,this.index,-1,0,4))}else{let ii=oi.buffer[this.index+3];if(ii<(si<0?oi.buffer.length:oi.buffer[this.stack[si]+3]))return this.yieldBuf(ii)}return si<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+ws,ws,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(ws){let oi,si,{buffer:ii}=this;if(ii){if(ws>0){if(this.index<ii.buffer.buffer.length)return!1}else for(let ai=0;ai<this.index;ai++)if(ii.buffer.buffer[ai+3]<this.index)return!1;({index:oi,parent:si}=ii)}else({index:oi,_parent:si}=this._tree);for(;si;{index:oi,_parent:si}=si)if(oi>-1)for(let ai=oi+ws,li=ws<0?-1:si._tree.children.length;ai!=li;ai+=ws){let ci=si._tree.children[ai];if(this.mode&IterMode.IncludeAnonymous||ci instanceof TreeBuffer||!ci.type.isAnonymous||hasChild(ci))return!1}return!0}move(ws,oi){if(oi&&this.enterChild(ws,0,4))return!0;for(;;){if(this.sibling(ws))return!0;if(this.atLastNode(ws)||!this.parent())return!1}}next(ws=!0){return this.move(1,ws)}prev(ws=!0){return this.move(-1,ws)}moveTo(ws,oi=0){for(;(this.from==this.to||(oi<1?this.from>=ws:this.from>ws)||(oi>-1?this.to<=ws:this.to<ws))&&this.parent(););for(;this.enterChild(1,ws,oi););return this}get node(){if(!this.buffer)return this._tree;let ws=this.bufferNode,oi=null,si=0;if(ws&&ws.context==this.buffer)e:for(let ii=this.index,ai=this.stack.length;ai>=0;){for(let li=ws;li;li=li._parent)if(li.index==ii){if(ii==this.index)return li;oi=li,si=ai+1;break e}ii=this.stack[--ai]}for(let ii=si;ii<this.stack.length;ii++)oi=new BufferNode(this.buffer,oi,this.stack[ii]);return this.bufferNode=new BufferNode(this.buffer,oi,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(ws,oi){for(let si=0;;){let ii=!1;if(this.type.isAnonymous||ws(this)!==!1){if(this.firstChild()){si++;continue}this.type.isAnonymous||(ii=!0)}for(;;){if(ii&&oi&&oi(this),ii=this.type.isAnonymous,!si)return;if(this.nextSibling())break;this.parent(),si--,ii=!0}}}matchContext(ws){if(!this.buffer)return matchNodeContext(this.node.parent,ws);let{buffer:oi}=this.buffer,{types:si}=oi.set;for(let ii=ws.length-1,ai=this.stack.length-1;ii>=0;ai--){if(ai<0)return matchNodeContext(this._tree,ws,ii);let li=si[oi.buffer[this.stack[ai]]];if(!li.isAnonymous){if(ws[ii]&&ws[ii]!=li.name)return!1;ii--}}return!0}}function hasChild(Ws){return Ws.children.some(ws=>ws instanceof TreeBuffer||!ws.type.isAnonymous||hasChild(ws))}function buildTree(Ws){var ws;let{buffer:oi,nodeSet:si,maxBufferLength:ii=DefaultBufferLength,reused:ai=[],minRepeatType:li=si.types.length}=Ws,ci=Array.isArray(oi)?new FlatBufferCursor(oi,oi.length):oi,ui=si.types,di=0,hi=0;function pi(gd,Ed,Od,Nd,Pd,Ld){let{id:rf,start:kd,end:Md,size:Td}=ci,wd=hi,Cd=di;for(;Td<0;)if(ci.next(),Td==-1){let hf=ai[rf];Od.push(hf),Nd.push(kd-gd);return}else if(Td==-3){di=rf;return}else if(Td==-4){hi=rf;return}else throw new RangeError(`Unrecognized record size: ${Td}`);let sf=ui[rf],of,Wd,df=kd-gd;if(Md-kd<=ii&&(Wd=wa(ci.pos-Ed,Pd))){let hf=new Uint16Array(Wd.size-Wd.skip),xd=ci.pos-Wd.size,Fd=hf.length;for(;ci.pos>xd;)Fd=xa(Wd.start,hf,Fd);of=new TreeBuffer(hf,Md-Wd.start,si),df=Wd.start-gd}else{let hf=ci.pos-Td;ci.next();let xd=[],Fd=[],Vd=rf>=li?rf:-1,af=0,ff=Md;for(;ci.pos>hf;)Vd>=0&&ci.id==Vd&&ci.size>=0?(ci.end<=ff-ii&&(va(xd,Fd,kd,af,ci.end,ff,Vd,wd,Cd),af=xd.length,ff=ci.end),ci.next()):Ld>2500?ha(kd,hf,xd,Fd):pi(kd,hf,xd,Fd,Vd,Ld+1);if(Vd>=0&&af>0&&af<xd.length&&va(xd,Fd,kd,af,kd,ff,Vd,wd,Cd),xd.reverse(),Fd.reverse(),Vd>-1&&af>0){let uf=ga(sf,Cd);of=balanceRange(sf,xd,Fd,0,xd.length,0,Md-kd,uf,uf)}else of=ba(sf,xd,Fd,Md-kd,wd-Md,Cd)}Od.push(of),Nd.push(df)}function ha(gd,Ed,Od,Nd){let Pd=[],Ld=0,rf=-1;for(;ci.pos>Ed;){let{id:kd,start:Md,end:Td,size:wd}=ci;if(wd>4)ci.next();else{if(rf>-1&&Md<rf)break;rf<0&&(rf=Td-ii),Pd.push(kd,Md,Td),Ld++,ci.next()}}if(Ld){let kd=new Uint16Array(Ld*4),Md=Pd[Pd.length-2];for(let Td=Pd.length-3,wd=0;Td>=0;Td-=3)kd[wd++]=Pd[Td],kd[wd++]=Pd[Td+1]-Md,kd[wd++]=Pd[Td+2]-Md,kd[wd++]=wd;Od.push(new TreeBuffer(kd,Pd[2]-Md,si)),Nd.push(Md-gd)}}function ga(gd,Ed){return(Od,Nd,Pd)=>{let Ld=0,rf=Od.length-1,kd,Md;if(rf>=0&&(kd=Od[rf])instanceof Tree){if(!rf&&kd.type==gd&&kd.length==Pd)return kd;(Md=kd.prop(NodeProp.lookAhead))&&(Ld=Nd[rf]+kd.length+Md)}return ba(gd,Od,Nd,Pd,Ld,Ed)}}function va(gd,Ed,Od,Nd,Pd,Ld,rf,kd,Md){let Td=[],wd=[];for(;gd.length>Nd;)Td.push(gd.pop()),wd.push(Ed.pop()+Od-Pd);gd.push(ba(si.types[rf],Td,wd,Ld-Pd,kd-Ld,Md)),Ed.push(Pd-Od)}function ba(gd,Ed,Od,Nd,Pd,Ld,rf){if(Ld){let kd=[NodeProp.contextHash,Ld];rf=rf?[kd].concat(rf):[kd]}if(Pd>25){let kd=[NodeProp.lookAhead,Pd];rf=rf?[kd].concat(rf):[kd]}return new Tree(gd,Ed,Od,Nd,rf)}function wa(gd,Ed){let Od=ci.fork(),Nd=0,Pd=0,Ld=0,rf=Od.end-ii,kd={size:0,start:0,skip:0};e:for(let Md=Od.pos-gd;Od.pos>Md;){let Td=Od.size;if(Od.id==Ed&&Td>=0){kd.size=Nd,kd.start=Pd,kd.skip=Ld,Ld+=4,Nd+=4,Od.next();continue}let wd=Od.pos-Td;if(Td<0||wd<Md||Od.start<rf)break;let Cd=Od.id>=li?4:0,sf=Od.start;for(Od.next();Od.pos>wd;){if(Od.size<0)if(Od.size==-3)Cd+=4;else break e;else Od.id>=li&&(Cd+=4);Od.next()}Pd=sf,Nd+=Td,Ld+=Cd}return(Ed<0||Nd==gd)&&(kd.size=Nd,kd.start=Pd,kd.skip=Ld),kd.size>4?kd:void 0}function xa(gd,Ed,Od){let{id:Nd,start:Pd,end:Ld,size:rf}=ci;if(ci.next(),rf>=0&&Nd<li){let kd=Od;if(rf>4){let Md=ci.pos-(rf-4);for(;ci.pos>Md;)Od=xa(gd,Ed,Od)}Ed[--Od]=kd,Ed[--Od]=Ld-gd,Ed[--Od]=Pd-gd,Ed[--Od]=Nd}else rf==-3?di=Nd:rf==-4&&(hi=Nd);return Od}let Ca=[],el=[];for(;ci.pos>0;)pi(Ws.start||0,Ws.bufferStart||0,Ca,el,-1,0);let ku=(ws=Ws.length)!==null&&ws!==void 0?ws:Ca.length?el[0]+Ca[0].length:0;return new Tree(ui[Ws.topID],Ca.reverse(),el.reverse(),ku)}const nodeSizeCache=new WeakMap;function nodeSize(Ws,ws){if(!Ws.isAnonymous||ws instanceof TreeBuffer||ws.type!=Ws)return 1;let oi=nodeSizeCache.get(ws);if(oi==null){oi=1;for(let si of ws.children){if(si.type!=Ws||!(si instanceof Tree)){oi=1;break}oi+=nodeSize(Ws,si)}nodeSizeCache.set(ws,oi)}return oi}function balanceRange(Ws,ws,oi,si,ii,ai,li,ci,ui){let di=0;for(let va=si;va<ii;va++)di+=nodeSize(Ws,ws[va]);let hi=Math.ceil(di*1.5/8),pi=[],ha=[];function ga(va,ba,wa,xa,Ca){for(let el=wa;el<xa;){let ku=el,gd=ba[el],Ed=nodeSize(Ws,va[el]);for(el++;el<xa;el++){let Od=nodeSize(Ws,va[el]);if(Ed+Od>=hi)break;Ed+=Od}if(el==ku+1){if(Ed>hi){let Od=va[ku];ga(Od.children,Od.positions,0,Od.children.length,ba[ku]+Ca);continue}pi.push(va[ku])}else{let Od=ba[el-1]+va[el-1].length-gd;pi.push(balanceRange(Ws,va,ba,ku,el,gd,Od,null,ui))}ha.push(gd+Ca-ai)}}return ga(ws,oi,si,ii,0),(ci||ui)(pi,ha,li)}class TreeFragment{constructor(ws,oi,si,ii,ai=!1,li=!1){this.from=ws,this.to=oi,this.tree=si,this.offset=ii,this.open=(ai?1:0)|(li?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(ws,oi=[],si=!1){let ii=[new TreeFragment(0,ws.length,ws,0,!1,si)];for(let ai of oi)ai.to>ws.length&&ii.push(ai);return ii}static applyChanges(ws,oi,si=128){if(!oi.length)return ws;let ii=[],ai=1,li=ws.length?ws[0]:null;for(let ci=0,ui=0,di=0;;ci++){let hi=ci<oi.length?oi[ci]:null,pi=hi?hi.fromA:1e9;if(pi-ui>=si)for(;li&&li.from<pi;){let ha=li;if(ui>=ha.from||pi<=ha.to||di){let ga=Math.max(ha.from,ui)-di,va=Math.min(ha.to,pi)-di;ha=ga>=va?null:new TreeFragment(ga,va,ha.tree,ha.offset+di,ci>0,!!hi)}if(ha&&ii.push(ha),li.to>pi)break;li=ai<ws.length?ws[ai++]:null}if(!hi)break;ui=hi.toA,di=hi.toA-hi.toB}return ii}}class Parser{startParse(ws,oi,si){return typeof ws=="string"&&(ws=new StringInput(ws)),si=si?si.length?si.map(ii=>new Range$2(ii.from,ii.to)):[new Range$2(0,0)]:[new Range$2(0,ws.length)],this.createParse(ws,oi||[],si)}parse(ws,oi,si){let ii=this.startParse(ws,oi,si);for(;;){let ai=ii.advance();if(ai)return ai}}}class StringInput{constructor(ws){this.string=ws}get length(){return this.string.length}chunk(ws){return this.string.slice(ws)}get lineChunks(){return!1}read(ws,oi){return this.string.slice(ws,oi)}}new NodeProp({perNode:!0});let nextTagID=0;class Tag{constructor(ws,oi,si,ii){this.name=ws,this.set=oi,this.base=si,this.modified=ii,this.id=nextTagID++}toString(){let{name:ws}=this;for(let oi of this.modified)oi.name&&(ws=`${oi.name}(${ws})`);return ws}static define(ws,oi){let si=typeof ws=="string"?ws:"?";if(ws instanceof Tag&&(oi=ws),oi!=null&&oi.base)throw new Error("Can not derive from a modified tag");let ii=new Tag(si,[],null,[]);if(ii.set.push(ii),oi)for(let ai of oi.set)ii.set.push(ai);return ii}static defineModifier(ws){let oi=new Modifier(ws);return si=>si.modified.indexOf(oi)>-1?si:Modifier.get(si.base||si,si.modified.concat(oi).sort((ii,ai)=>ii.id-ai.id))}}let nextModifierID=0;class Modifier{constructor(ws){this.name=ws,this.instances=[],this.id=nextModifierID++}static get(ws,oi){if(!oi.length)return ws;let si=oi[0].instances.find(ci=>ci.base==ws&&sameArray(oi,ci.modified));if(si)return si;let ii=[],ai=new Tag(ws.name,ii,ws,oi);for(let ci of oi)ci.instances.push(ai);let li=powerSet(oi);for(let ci of ws.set)if(!ci.modified.length)for(let ui of li)ii.push(Modifier.get(ci,ui));return ai}}function sameArray(Ws,ws){return Ws.length==ws.length&&Ws.every((oi,si)=>oi==ws[si])}function powerSet(Ws){let ws=[[]];for(let oi=0;oi<Ws.length;oi++)for(let si=0,ii=ws.length;si<ii;si++)ws.push(ws[si].concat(Ws[oi]));return ws.sort((oi,si)=>si.length-oi.length)}function styleTags(Ws){let ws=Object.create(null);for(let oi in Ws){let si=Ws[oi];Array.isArray(si)||(si=[si]);for(let ii of oi.split(" "))if(ii){let ai=[],li=2,ci=ii;for(let pi=0;;){if(ci=="..."&&pi>0&&pi+3==ii.length){li=1;break}let ha=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(ci);if(!ha)throw new RangeError("Invalid path: "+ii);if(ai.push(ha[0]=="*"?"":ha[0][0]=='"'?JSON.parse(ha[0]):ha[0]),pi+=ha[0].length,pi==ii.length)break;let ga=ii[pi++];if(pi==ii.length&&ga=="!"){li=0;break}if(ga!="/")throw new RangeError("Invalid path: "+ii);ci=ii.slice(pi)}let ui=ai.length-1,di=ai[ui];if(!di)throw new RangeError("Invalid path: "+ii);let hi=new Rule(si,li,ui>0?ai.slice(0,ui):null);ws[di]=hi.sort(ws[di])}}return ruleNodeProp.add(ws)}const ruleNodeProp=new NodeProp;class Rule{constructor(ws,oi,si,ii){this.tags=ws,this.mode=oi,this.context=si,this.next=ii}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(ws){return!ws||ws.depth<this.depth?(this.next=ws,this):(ws.next=this.sort(ws.next),ws)}get depth(){return this.context?this.context.length:0}}Rule.empty=new Rule([],2,null);function tagHighlighter(Ws,ws){let oi=Object.create(null);for(let ai of Ws)if(!Array.isArray(ai.tag))oi[ai.tag.id]=ai.class;else for(let li of ai.tag)oi[li.id]=ai.class;let{scope:si,all:ii=null}=ws||{};return{style:ai=>{let li=ii;for(let ci of ai)for(let ui of ci.set){let di=oi[ui.id];if(di){li=li?li+" "+di:di;break}}return li},scope:si}}function highlightTags(Ws,ws){let oi=null;for(let si of Ws){let ii=si.style(ws);ii&&(oi=oi?oi+" "+ii:ii)}return oi}function highlightTree(Ws,ws,oi,si=0,ii=Ws.length){let ai=new HighlightBuilder(si,Array.isArray(ws)?ws:[ws],oi);ai.highlightRange(Ws.cursor(),si,ii,"",ai.highlighters),ai.flush(ii)}class HighlightBuilder{constructor(ws,oi,si){this.at=ws,this.highlighters=oi,this.span=si,this.class=""}startSpan(ws,oi){oi!=this.class&&(this.flush(ws),ws>this.at&&(this.at=ws),this.class=oi)}flush(ws){ws>this.at&&this.class&&this.span(this.at,ws,this.class)}highlightRange(ws,oi,si,ii,ai){let{type:li,from:ci,to:ui}=ws;if(ci>=si||ui<=oi)return;li.isTop&&(ai=this.highlighters.filter(ga=>!ga.scope||ga.scope(li)));let di=ii,hi=getStyleTags(ws)||Rule.empty,pi=highlightTags(ai,hi.tags);if(pi&&(di&&(di+=" "),di+=pi,hi.mode==1&&(ii+=(ii?" ":"")+pi)),this.startSpan(Math.max(oi,ci),di),hi.opaque)return;let ha=ws.tree&&ws.tree.prop(NodeProp.mounted);if(ha&&ha.overlay){let ga=ws.node.enter(ha.overlay[0].from+ci,1),va=this.highlighters.filter(wa=>!wa.scope||wa.scope(ha.tree.type)),ba=ws.firstChild();for(let wa=0,xa=ci;;wa++){let Ca=wa<ha.overlay.length?ha.overlay[wa]:null,el=Ca?Ca.from+ci:ui,ku=Math.max(oi,xa),gd=Math.min(si,el);if(ku<gd&&ba)for(;ws.from<gd&&(this.highlightRange(ws,ku,gd,ii,ai),this.startSpan(Math.min(gd,ws.to),di),!(ws.to>=el||!ws.nextSibling())););if(!Ca||el>si)break;xa=Ca.to+ci,xa>oi&&(this.highlightRange(ga.cursor(),Math.max(oi,Ca.from+ci),Math.min(si,xa),"",va),this.startSpan(Math.min(si,xa),di))}ba&&ws.parent()}else if(ws.firstChild()){ha&&(ii="");do if(!(ws.to<=oi)){if(ws.from>=si)break;this.highlightRange(ws,oi,si,ii,ai),this.startSpan(Math.min(si,ws.to),di)}while(ws.nextSibling());ws.parent()}}}function getStyleTags(Ws){let ws=Ws.type.prop(ruleNodeProp);for(;ws&&ws.context&&!Ws.matchContext(ws.context);)ws=ws.next;return ws||null}const t$1=Tag.define,comment=t$1(),name$1=t$1(),typeName=t$1(name$1),propertyName=t$1(name$1),literal=t$1(),string=t$1(literal),number=t$1(literal),content=t$1(),heading=t$1(content),keyword=t$1(),operator=t$1(),punctuation=t$1(),bracket=t$1(punctuation),meta=t$1(),tags={comment,lineComment:t$1(comment),blockComment:t$1(comment),docComment:t$1(comment),name:name$1,variableName:t$1(name$1),typeName,tagName:t$1(typeName),propertyName,attributeName:t$1(propertyName),className:t$1(name$1),labelName:t$1(name$1),namespace:t$1(name$1),macroName:t$1(name$1),literal,string,docString:t$1(string),character:t$1(string),attributeValue:t$1(string),number,integer:t$1(number),float:t$1(number),bool:t$1(literal),regexp:t$1(literal),escape:t$1(literal),color:t$1(literal),url:t$1(literal),keyword,self:t$1(keyword),null:t$1(keyword),atom:t$1(keyword),unit:t$1(keyword),modifier:t$1(keyword),operatorKeyword:t$1(keyword),controlKeyword:t$1(keyword),definitionKeyword:t$1(keyword),moduleKeyword:t$1(keyword),operator,derefOperator:t$1(operator),arithmeticOperator:t$1(operator),logicOperator:t$1(operator),bitwiseOperator:t$1(operator),compareOperator:t$1(operator),updateOperator:t$1(operator),definitionOperator:t$1(operator),typeOperator:t$1(operator),controlOperator:t$1(operator),punctuation,separator:t$1(punctuation),bracket,angleBracket:t$1(bracket),squareBracket:t$1(bracket),paren:t$1(bracket),brace:t$1(bracket),content,heading,heading1:t$1(heading),heading2:t$1(heading),heading3:t$1(heading),heading4:t$1(heading),heading5:t$1(heading),heading6:t$1(heading),contentSeparator:t$1(content),list:t$1(content),quote:t$1(content),emphasis:t$1(content),strong:t$1(content),link:t$1(content),monospace:t$1(content),strikethrough:t$1(content),inserted:t$1(),deleted:t$1(),changed:t$1(),invalid:t$1(),meta,documentMeta:t$1(meta),annotation:t$1(meta),processingInstruction:t$1(meta),definition:Tag.defineModifier("definition"),constant:Tag.defineModifier("constant"),function:Tag.defineModifier("function"),standard:Tag.defineModifier("standard"),local:Tag.defineModifier("local"),special:Tag.defineModifier("special")};for(let Ws in tags){let ws=tags[Ws];ws instanceof Tag&&(ws.name=Ws)}tagHighlighter([{tag:tags.link,class:"tok-link"},{tag:tags.heading,class:"tok-heading"},{tag:tags.emphasis,class:"tok-emphasis"},{tag:tags.strong,class:"tok-strong"},{tag:tags.keyword,class:"tok-keyword"},{tag:tags.atom,class:"tok-atom"},{tag:tags.bool,class:"tok-bool"},{tag:tags.url,class:"tok-url"},{tag:tags.labelName,class:"tok-labelName"},{tag:tags.inserted,class:"tok-inserted"},{tag:tags.deleted,class:"tok-deleted"},{tag:tags.literal,class:"tok-literal"},{tag:tags.string,class:"tok-string"},{tag:tags.number,class:"tok-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],class:"tok-string2"},{tag:tags.variableName,class:"tok-variableName"},{tag:tags.local(tags.variableName),class:"tok-variableName tok-local"},{tag:tags.definition(tags.variableName),class:"tok-variableName tok-definition"},{tag:tags.special(tags.variableName),class:"tok-variableName2"},{tag:tags.definition(tags.propertyName),class:"tok-propertyName tok-definition"},{tag:tags.typeName,class:"tok-typeName"},{tag:tags.namespace,class:"tok-namespace"},{tag:tags.className,class:"tok-className"},{tag:tags.macroName,class:"tok-macroName"},{tag:tags.propertyName,class:"tok-propertyName"},{tag:tags.operator,class:"tok-operator"},{tag:tags.comment,class:"tok-comment"},{tag:tags.meta,class:"tok-meta"},{tag:tags.invalid,class:"tok-invalid"},{tag:tags.punctuation,class:"tok-punctuation"}]);var _a;const languageDataProp=new NodeProp;function defineLanguageFacet(Ws){return Facet.define({combine:Ws?ws=>ws.concat(Ws):void 0})}const sublanguageProp=new NodeProp;class Language{constructor(ws,oi,si=[],ii=""){this.data=ws,this.name=ii,EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(EditorState.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=oi,this.extension=[language.of(this),EditorState.languageData.of((ai,li,ci)=>{let ui=topNodeAt(ai,li,ci),di=ui.type.prop(languageDataProp);if(!di)return[];let hi=ai.facet(di),pi=ui.type.prop(sublanguageProp);if(pi){let ha=ui.resolve(li-ui.from,ci);for(let ga of pi)if(ga.test(ha,ai)){let va=ai.facet(ga.facet);return ga.type=="replace"?va:va.concat(hi)}}return hi})].concat(si)}isActiveAt(ws,oi,si=-1){return topNodeAt(ws,oi,si).type.prop(languageDataProp)==this.data}findRegions(ws){let oi=ws.facet(language);if((oi==null?void 0:oi.data)==this.data)return[{from:0,to:ws.doc.length}];if(!oi||!oi.allowsNesting)return[];let si=[],ii=(ai,li)=>{if(ai.prop(languageDataProp)==this.data){si.push({from:li,to:li+ai.length});return}let ci=ai.prop(NodeProp.mounted);if(ci){if(ci.tree.prop(languageDataProp)==this.data){if(ci.overlay)for(let ui of ci.overlay)si.push({from:ui.from+li,to:ui.to+li});else si.push({from:li,to:li+ai.length});return}else if(ci.overlay){let ui=si.length;if(ii(ci.tree,ci.overlay[0].from+li),si.length>ui)return}}for(let ui=0;ui<ai.children.length;ui++){let di=ai.children[ui];di instanceof Tree&&ii(di,ai.positions[ui]+li)}};return ii(syntaxTree(ws),0),si}get allowsNesting(){return!0}}Language.setState=StateEffect.define();function topNodeAt(Ws,ws,oi){let si=Ws.facet(language),ii=syntaxTree(Ws).topNode;if(!si||si.allowsNesting)for(let ai=ii;ai;ai=ai.enter(ws,oi,IterMode.ExcludeBuffers))ai.type.isTop&&(ii=ai);return ii}class LRLanguage extends Language{constructor(ws,oi,si){super(ws,oi,[],si),this.parser=oi}static define(ws){let oi=defineLanguageFacet(ws.languageData);return new LRLanguage(oi,ws.parser.configure({props:[languageDataProp.add(si=>si.isTop?oi:void 0)]}),ws.name)}configure(ws,oi){return new LRLanguage(this.data,this.parser.configure(ws),oi||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function syntaxTree(Ws){let ws=Ws.field(Language.state,!1);return ws?ws.tree:Tree.empty}class DocInput{constructor(ws){this.doc=ws,this.cursorPos=0,this.string="",this.cursor=ws.iter()}get length(){return this.doc.length}syncTo(ws){return this.string=this.cursor.next(ws-this.cursorPos).value,this.cursorPos=ws+this.string.length,this.cursorPos-this.string.length}chunk(ws){return this.syncTo(ws),this.string}get lineChunks(){return!0}read(ws,oi){let si=this.cursorPos-this.string.length;return ws<si||oi>=this.cursorPos?this.doc.sliceString(ws,oi):this.string.slice(ws-si,oi-si)}}let currentContext=null;class ParseContext{constructor(ws,oi,si=[],ii,ai,li,ci,ui){this.parser=ws,this.state=oi,this.fragments=si,this.tree=ii,this.treeLen=ai,this.viewport=li,this.skipped=ci,this.scheduleOn=ui,this.parse=null,this.tempSkipped=[]}static create(ws,oi,si){return new ParseContext(ws,oi,[],Tree.empty,0,si,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(ws,oi){return oi!=null&&oi>=this.state.doc.length&&(oi=void 0),this.tree!=Tree.empty&&this.isDone(oi??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var si;if(typeof ws=="number"){let ii=Date.now()+ws;ws=()=>Date.now()>ii}for(this.parse||(this.parse=this.startParse()),oi!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>oi)&&oi<this.state.doc.length&&this.parse.stopAt(oi);;){let ii=this.parse.advance();if(ii)if(this.fragments=this.withoutTempSkipped(TreeFragment.addTree(ii,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(si=this.parse.stoppedAt)!==null&&si!==void 0?si:this.state.doc.length,this.tree=ii,this.parse=null,this.treeLen<(oi??this.state.doc.length))this.parse=this.startParse();else return!0;if(ws())return!1}})}takeTree(){let ws,oi;this.parse&&(ws=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>ws)&&this.parse.stopAt(ws),this.withContext(()=>{for(;!(oi=this.parse.advance()););}),this.treeLen=ws,this.tree=oi,this.fragments=this.withoutTempSkipped(TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(ws){let oi=currentContext;currentContext=this;try{return ws()}finally{currentContext=oi}}withoutTempSkipped(ws){for(let oi;oi=this.tempSkipped.pop();)ws=cutFragments(ws,oi.from,oi.to);return ws}changes(ws,oi){let{fragments:si,tree:ii,treeLen:ai,viewport:li,skipped:ci}=this;if(this.takeTree(),!ws.empty){let ui=[];if(ws.iterChangedRanges((di,hi,pi,ha)=>ui.push({fromA:di,toA:hi,fromB:pi,toB:ha})),si=TreeFragment.applyChanges(si,ui),ii=Tree.empty,ai=0,li={from:ws.mapPos(li.from,-1),to:ws.mapPos(li.to,1)},this.skipped.length){ci=[];for(let di of this.skipped){let hi=ws.mapPos(di.from,1),pi=ws.mapPos(di.to,-1);hi<pi&&ci.push({from:hi,to:pi})}}}return new ParseContext(this.parser,oi,si,ii,ai,li,ci,this.scheduleOn)}updateViewport(ws){if(this.viewport.from==ws.from&&this.viewport.to==ws.to)return!1;this.viewport=ws;let oi=this.skipped.length;for(let si=0;si<this.skipped.length;si++){let{from:ii,to:ai}=this.skipped[si];ii<ws.to&&ai>ws.from&&(this.fragments=cutFragments(this.fragments,ii,ai),this.skipped.splice(si--,1))}return this.skipped.length>=oi?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(ws,oi){this.skipped.push({from:ws,to:oi})}static getSkippingParser(ws){return new class extends Parser{createParse(oi,si,ii){let ai=ii[0].from,li=ii[ii.length-1].to;return{parsedPos:ai,advance(){let ci=currentContext;if(ci){for(let ui of ii)ci.tempSkipped.push(ui);ws&&(ci.scheduleOn=ci.scheduleOn?Promise.all([ci.scheduleOn,ws]):ws)}return this.parsedPos=li,new Tree(NodeType.none,[],[],li-ai)},stoppedAt:null,stopAt(){}}}}}isDone(ws){ws=Math.min(ws,this.state.doc.length);let oi=this.fragments;return this.treeLen>=ws&&oi.length&&oi[0].from==0&&oi[0].to>=ws}static get(){return currentContext}}function cutFragments(Ws,ws,oi){return TreeFragment.applyChanges(Ws,[{fromA:ws,toA:oi,fromB:ws,toB:oi}])}class LanguageState{constructor(ws){this.context=ws,this.tree=ws.tree}apply(ws){if(!ws.docChanged&&this.tree==this.context.tree)return this;let oi=this.context.changes(ws.changes,ws.state),si=this.context.treeLen==ws.startState.doc.length?void 0:Math.max(ws.changes.mapPos(this.context.treeLen),oi.viewport.to);return oi.work(20,si)||oi.takeTree(),new LanguageState(oi)}static init(ws){let oi=Math.min(3e3,ws.doc.length),si=ParseContext.create(ws.facet(language).parser,ws,{from:0,to:oi});return si.work(20,oi)||si.takeTree(),new LanguageState(si)}}Language.state=StateField.define({create:LanguageState.init,update(Ws,ws){for(let oi of ws.effects)if(oi.is(Language.setState))return oi.value;return ws.startState.facet(language)!=ws.state.facet(language)?LanguageState.init(ws.state):Ws.apply(ws)}});let requestIdle=Ws=>{let ws=setTimeout(()=>Ws(),500);return()=>clearTimeout(ws)};typeof requestIdleCallback<"u"&&(requestIdle=Ws=>{let ws=-1,oi=setTimeout(()=>{ws=requestIdleCallback(Ws,{timeout:400})},100);return()=>ws<0?clearTimeout(oi):cancelIdleCallback(ws)});const isInputPending=typeof navigator<"u"&&!((_a=navigator.scheduling)===null||_a===void 0)&&_a.isInputPending?()=>navigator.scheduling.isInputPending():null,parseWorker=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(Ws){let ws=this.view.state.field(Language.state).context;(ws.updateViewport(Ws.view.viewport)||this.view.viewport.to>ws.treeLen)&&this.scheduleWork(),(Ws.docChanged||Ws.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(ws)}scheduleWork(){if(this.working)return;let{state:Ws}=this.view,ws=Ws.field(Language.state);(ws.tree!=ws.context.tree||!ws.context.isDone(Ws.doc.length))&&(this.working=requestIdle(this.work))}work(Ws){this.working=null;let ws=Date.now();if(this.chunkEnd<ws&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=ws+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:oi,viewport:{to:si}}=this.view,ii=oi.field(Language.state);if(ii.tree==ii.context.tree&&ii.context.isDone(si+1e5))return;let ai=Date.now()+Math.min(this.chunkBudget,100,Ws&&!isInputPending?Math.max(25,Ws.timeRemaining()-5):1e9),li=ii.context.treeLen<si&&oi.doc.length>si+1e3,ci=ii.context.work(()=>isInputPending&&isInputPending()||Date.now()>ai,si+(li?0:1e5));this.chunkBudget-=Date.now()-ws,(ci||this.chunkBudget<=0)&&(ii.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(ii.context))})),this.chunkBudget>0&&!(ci&&!li)&&this.scheduleWork(),this.checkAsyncSchedule(ii.context)}checkAsyncSchedule(Ws){Ws.scheduleOn&&(this.workScheduled++,Ws.scheduleOn.then(()=>this.scheduleWork()).catch(ws=>logException(this.view.state,ws)).then(()=>this.workScheduled--),Ws.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),language=Facet.define({combine(Ws){return Ws.length?Ws[0]:null},enables:Ws=>[Language.state,parseWorker,EditorView.contentAttributes.compute([Ws],ws=>{let oi=ws.facet(Ws);return oi&&oi.name?{"data-language":oi.name}:{}})]});class LanguageSupport{constructor(ws,oi=[]){this.language=ws,this.support=oi,this.extension=[ws,oi]}}const indentService=Facet.define(),indentUnit=Facet.define({combine:Ws=>{if(!Ws.length)return" ";let ws=Ws[0];if(!ws||/\S/.test(ws)||Array.from(ws).some(oi=>oi!=ws[0]))throw new Error("Invalid indent unit: "+JSON.stringify(Ws[0]));return ws}});function getIndentUnit(Ws){let ws=Ws.facet(indentUnit);return ws.charCodeAt(0)==9?Ws.tabSize*ws.length:ws.length}function indentString(Ws,ws){let oi="",si=Ws.tabSize,ii=Ws.facet(indentUnit)[0];if(ii==" "){for(;ws>=si;)oi+=" ",ws-=si;ii=" "}for(let ai=0;ai<ws;ai++)oi+=ii;return oi}function getIndentation(Ws,ws){Ws instanceof EditorState&&(Ws=new IndentContext(Ws));for(let si of Ws.state.facet(indentService)){let ii=si(Ws,ws);if(ii!==void 0)return ii}let oi=syntaxTree(Ws.state);return oi.length>=ws?syntaxIndentation(Ws,oi,ws):null}class IndentContext{constructor(ws,oi={}){this.state=ws,this.options=oi,this.unit=getIndentUnit(ws)}lineAt(ws,oi=1){let si=this.state.doc.lineAt(ws),{simulateBreak:ii,simulateDoubleBreak:ai}=this.options;return ii!=null&&ii>=si.from&&ii<=si.to?ai&&ii==ws?{text:"",from:ws}:(oi<0?ii<ws:ii<=ws)?{text:si.text.slice(ii-si.from),from:ii}:{text:si.text.slice(0,ii-si.from),from:si.from}:si}textAfterPos(ws,oi=1){if(this.options.simulateDoubleBreak&&ws==this.options.simulateBreak)return"";let{text:si,from:ii}=this.lineAt(ws,oi);return si.slice(ws-ii,Math.min(si.length,ws+100-ii))}column(ws,oi=1){let{text:si,from:ii}=this.lineAt(ws,oi),ai=this.countColumn(si,ws-ii),li=this.options.overrideIndentation?this.options.overrideIndentation(ii):-1;return li>-1&&(ai+=li-this.countColumn(si,si.search(/\S|$/))),ai}countColumn(ws,oi=ws.length){return countColumn(ws,this.state.tabSize,oi)}lineIndent(ws,oi=1){let{text:si,from:ii}=this.lineAt(ws,oi),ai=this.options.overrideIndentation;if(ai){let li=ai(ii);if(li>-1)return li}return this.countColumn(si,si.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const indentNodeProp=new NodeProp;function syntaxIndentation(Ws,ws,oi){let si=ws.resolveStack(oi),ii=ws.resolveInner(oi,-1).resolve(oi,0).enterUnfinishedNodesBefore(oi);if(ii!=si.node){let ai=[];for(let li=ii;li&&!(li.from==si.node.from&&li.type==si.node.type);li=li.parent)ai.push(li);for(let li=ai.length-1;li>=0;li--)si={node:ai[li],next:si}}return indentFor(si,Ws,oi)}function indentFor(Ws,ws,oi){for(let si=Ws;si;si=si.next){let ii=indentStrategy(si.node);if(ii)return ii(TreeIndentContext.create(ws,oi,si))}return 0}function ignoreClosed(Ws){return Ws.pos==Ws.options.simulateBreak&&Ws.options.simulateDoubleBreak}function indentStrategy(Ws){let ws=Ws.type.prop(indentNodeProp);if(ws)return ws;let oi=Ws.firstChild,si;if(oi&&(si=oi.type.prop(NodeProp.closedBy))){let ii=Ws.lastChild,ai=ii&&si.indexOf(ii.name)>-1;return li=>delimitedStrategy(li,!0,1,void 0,ai&&!ignoreClosed(li)?ii.from:void 0)}return Ws.parent==null?topIndent:null}function topIndent(){return 0}class TreeIndentContext extends IndentContext{constructor(ws,oi,si){super(ws.state,ws.options),this.base=ws,this.pos=oi,this.context=si}get node(){return this.context.node}static create(ws,oi,si){return new TreeIndentContext(ws,oi,si)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(ws){let oi=this.state.doc.lineAt(ws.from);for(;;){let si=ws.resolve(oi.from);for(;si.parent&&si.parent.from==si.from;)si=si.parent;if(isParent(si,ws))break;oi=this.state.doc.lineAt(si.from)}return this.lineIndent(oi.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}}function isParent(Ws,ws){for(let oi=ws;oi;oi=oi.parent)if(Ws==oi)return!0;return!1}function bracketedAligned(Ws){let ws=Ws.node,oi=ws.childAfter(ws.from),si=ws.lastChild;if(!oi)return null;let ii=Ws.options.simulateBreak,ai=Ws.state.doc.lineAt(oi.from),li=ii==null||ii<=ai.from?ai.to:Math.min(ai.to,ii);for(let ci=oi.to;;){let ui=ws.childAfter(ci);if(!ui||ui==si)return null;if(!ui.type.isSkipped){if(ui.from>=li)return null;let di=/^ */.exec(ai.text.slice(oi.to-ai.from))[0].length;return{from:oi.from,to:oi.to+di}}ci=ui.to}}function delimitedIndent({closing:Ws,align:ws=!0,units:oi=1}){return si=>delimitedStrategy(si,ws,oi,Ws)}function delimitedStrategy(Ws,ws,oi,si,ii){let ai=Ws.textAfter,li=ai.match(/^\s*/)[0].length,ci=si&&ai.slice(li,li+si.length)==si||ii==Ws.pos+li,ui=ws?bracketedAligned(Ws):null;return ui?ci?Ws.column(ui.from):Ws.column(ui.to):Ws.baseIndent+(ci?0:Ws.unit*oi)}function continuedIndent({except:Ws,units:ws=1}={}){return oi=>{let si=Ws&&Ws.test(oi.textAfter);return oi.baseIndent+(si?0:ws*oi.unit)}}const DontIndentBeyond=200;function indentOnInput(){return EditorState.transactionFilter.of(Ws=>{if(!Ws.docChanged||!Ws.isUserEvent("input.type")&&!Ws.isUserEvent("input.complete"))return Ws;let ws=Ws.startState.languageDataAt("indentOnInput",Ws.startState.selection.main.head);if(!ws.length)return Ws;let oi=Ws.newDoc,{head:si}=Ws.newSelection.main,ii=oi.lineAt(si);if(si>ii.from+DontIndentBeyond)return Ws;let ai=oi.sliceString(ii.from,si);if(!ws.some(di=>di.test(ai)))return Ws;let{state:li}=Ws,ci=-1,ui=[];for(let{head:di}of li.selection.ranges){let hi=li.doc.lineAt(di);if(hi.from==ci)continue;ci=hi.from;let pi=getIndentation(li,hi.from);if(pi==null)continue;let ha=/^\s*/.exec(hi.text)[0],ga=indentString(li,pi);ha!=ga&&ui.push({from:hi.from,to:hi.from+ha.length,insert:ga})}return ui.length?[Ws,{changes:ui,sequential:!0}]:Ws})}const foldService=Facet.define(),foldNodeProp=new NodeProp;function foldInside(Ws){let ws=Ws.firstChild,oi=Ws.lastChild;return ws&&ws.to<oi.from?{from:ws.to,to:oi.type.isError?Ws.to:oi.from}:null}function syntaxFolding(Ws,ws,oi){let si=syntaxTree(Ws);if(si.length<oi)return null;let ii=si.resolveStack(oi,1),ai=null;for(let li=ii;li;li=li.next){let ci=li.node;if(ci.to<=oi||ci.from>oi)continue;if(ai&&ci.from<ws)break;let ui=ci.type.prop(foldNodeProp);if(ui&&(ci.to<si.length-50||si.length==Ws.doc.length||!isUnfinished(ci))){let di=ui(ci,Ws);di&&di.from<=oi&&di.from>=ws&&di.to>oi&&(ai=di)}}return ai}function isUnfinished(Ws){let ws=Ws.lastChild;return ws&&ws.to==Ws.to&&ws.type.isError}function foldable(Ws,ws,oi){for(let si of Ws.facet(foldService)){let ii=si(Ws,ws,oi);if(ii)return ii}return syntaxFolding(Ws,ws,oi)}function mapRange(Ws,ws){let oi=ws.mapPos(Ws.from,1),si=ws.mapPos(Ws.to,-1);return oi>=si?void 0:{from:oi,to:si}}const foldEffect=StateEffect.define({map:mapRange}),unfoldEffect=StateEffect.define({map:mapRange});function selectedLines(Ws){let ws=[];for(let{head:oi}of Ws.state.selection.ranges)ws.some(si=>si.from<=oi&&si.to>=oi)||ws.push(Ws.lineBlockAt(oi));return ws}const foldState=StateField.define({create(){return Decoration.none},update(Ws,ws){Ws=Ws.map(ws.changes);for(let oi of ws.effects)if(oi.is(foldEffect)&&!foldExists(Ws,oi.value.from,oi.value.to)){let{preparePlaceholder:si}=ws.state.facet(foldConfig),ii=si?Decoration.replace({widget:new PreparedFoldWidget(si(ws.state,oi.value))}):foldWidget;Ws=Ws.update({add:[ii.range(oi.value.from,oi.value.to)]})}else oi.is(unfoldEffect)&&(Ws=Ws.update({filter:(si,ii)=>oi.value.from!=si||oi.value.to!=ii,filterFrom:oi.value.from,filterTo:oi.value.to}));if(ws.selection){let oi=!1,{head:si}=ws.selection.main;Ws.between(si,si,(ii,ai)=>{ii<si&&ai>si&&(oi=!0)}),oi&&(Ws=Ws.update({filterFrom:si,filterTo:si,filter:(ii,ai)=>ai<=si||ii>=si}))}return Ws},provide:Ws=>EditorView.decorations.from(Ws),toJSON(Ws,ws){let oi=[];return Ws.between(0,ws.doc.length,(si,ii)=>{oi.push(si,ii)}),oi},fromJSON(Ws){if(!Array.isArray(Ws)||Ws.length%2)throw new RangeError("Invalid JSON for fold state");let ws=[];for(let oi=0;oi<Ws.length;){let si=Ws[oi++],ii=Ws[oi++];if(typeof si!="number"||typeof ii!="number")throw new RangeError("Invalid JSON for fold state");ws.push(foldWidget.range(si,ii))}return Decoration.set(ws,!0)}});function findFold(Ws,ws,oi){var si;let ii=null;return(si=Ws.field(foldState,!1))===null||si===void 0||si.between(ws,oi,(ai,li)=>{(!ii||ii.from>ai)&&(ii={from:ai,to:li})}),ii}function foldExists(Ws,ws,oi){let si=!1;return Ws.between(ws,ws,(ii,ai)=>{ii==ws&&ai==oi&&(si=!0)}),si}function maybeEnable(Ws,ws){return Ws.field(foldState,!1)?ws:ws.concat(StateEffect.appendConfig.of(codeFolding()))}const foldCode=Ws=>{for(let ws of selectedLines(Ws)){let oi=foldable(Ws.state,ws.from,ws.to);if(oi)return Ws.dispatch({effects:maybeEnable(Ws.state,[foldEffect.of(oi),announceFold(Ws,oi)])}),!0}return!1},unfoldCode=Ws=>{if(!Ws.state.field(foldState,!1))return!1;let ws=[];for(let oi of selectedLines(Ws)){let si=findFold(Ws.state,oi.from,oi.to);si&&ws.push(unfoldEffect.of(si),announceFold(Ws,si,!1))}return ws.length&&Ws.dispatch({effects:ws}),ws.length>0};function announceFold(Ws,ws,oi=!0){let si=Ws.state.doc.lineAt(ws.from).number,ii=Ws.state.doc.lineAt(ws.to).number;return EditorView.announce.of(`${Ws.state.phrase(oi?"Folded lines":"Unfolded lines")} ${si} ${Ws.state.phrase("to")} ${ii}.`)}const foldAll=Ws=>{let{state:ws}=Ws,oi=[];for(let si=0;si<ws.doc.length;){let ii=Ws.lineBlockAt(si),ai=foldable(ws,ii.from,ii.to);ai&&oi.push(foldEffect.of(ai)),si=(ai?Ws.lineBlockAt(ai.to):ii).to+1}return oi.length&&Ws.dispatch({effects:maybeEnable(Ws.state,oi)}),!!oi.length},unfoldAll=Ws=>{let ws=Ws.state.field(foldState,!1);if(!ws||!ws.size)return!1;let oi=[];return ws.between(0,Ws.state.doc.length,(si,ii)=>{oi.push(unfoldEffect.of({from:si,to:ii}))}),Ws.dispatch({effects:oi}),!0},foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}],defaultConfig={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},foldConfig=Facet.define({combine(Ws){return combineConfig(Ws,defaultConfig)}});function codeFolding(Ws){return[foldState,baseTheme$1$1]}function widgetToDOM(Ws,ws){let{state:oi}=Ws,si=oi.facet(foldConfig),ii=li=>{let ci=Ws.lineBlockAt(Ws.posAtDOM(li.target)),ui=findFold(Ws.state,ci.from,ci.to);ui&&Ws.dispatch({effects:unfoldEffect.of(ui)}),li.preventDefault()};if(si.placeholderDOM)return si.placeholderDOM(Ws,ii,ws);let ai=document.createElement("span");return ai.textContent=si.placeholderText,ai.setAttribute("aria-label",oi.phrase("folded code")),ai.title=oi.phrase("unfold"),ai.className="cm-foldPlaceholder",ai.onclick=ii,ai}const foldWidget=Decoration.replace({widget:new class extends WidgetType{toDOM(Ws){return widgetToDOM(Ws,null)}}});class PreparedFoldWidget extends WidgetType{constructor(ws){super(),this.value=ws}eq(ws){return this.value==ws.value}toDOM(ws){return widgetToDOM(ws,this.value)}}const foldGutterDefaults={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class FoldMarker extends GutterMarker{constructor(ws,oi){super(),this.config=ws,this.open=oi}eq(ws){return this.config==ws.config&&this.open==ws.open}toDOM(ws){if(this.config.markerDOM)return this.config.markerDOM(this.open);let oi=document.createElement("span");return oi.textContent=this.open?this.config.openText:this.config.closedText,oi.title=ws.state.phrase(this.open?"Fold line":"Unfold line"),oi}}function foldGutter(Ws={}){let ws=Object.assign(Object.assign({},foldGutterDefaults),Ws),oi=new FoldMarker(ws,!0),si=new FoldMarker(ws,!1),ii=ViewPlugin.fromClass(class{constructor(li){this.from=li.viewport.from,this.markers=this.buildMarkers(li)}update(li){(li.docChanged||li.viewportChanged||li.startState.facet(language)!=li.state.facet(language)||li.startState.field(foldState,!1)!=li.state.field(foldState,!1)||syntaxTree(li.startState)!=syntaxTree(li.state)||ws.foldingChanged(li))&&(this.markers=this.buildMarkers(li.view))}buildMarkers(li){let ci=new RangeSetBuilder;for(let ui of li.viewportLineBlocks){let di=findFold(li.state,ui.from,ui.to)?si:foldable(li.state,ui.from,ui.to)?oi:null;di&&ci.add(ui.from,ui.from,di)}return ci.finish()}}),{domEventHandlers:ai}=ws;return[ii,gutter({class:"cm-foldGutter",markers(li){var ci;return((ci=li.plugin(ii))===null||ci===void 0?void 0:ci.markers)||RangeSet.empty},initialSpacer(){return new FoldMarker(ws,!1)},domEventHandlers:Object.assign(Object.assign({},ai),{click:(li,ci,ui)=>{if(ai.click&&ai.click(li,ci,ui))return!0;let di=findFold(li.state,ci.from,ci.to);if(di)return li.dispatch({effects:unfoldEffect.of(di)}),!0;let hi=foldable(li.state,ci.from,ci.to);return hi?(li.dispatch({effects:foldEffect.of(hi)}),!0):!1}})}),codeFolding()]}const baseTheme$1$1=EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class HighlightStyle{constructor(ws,oi){this.specs=ws;let si;function ii(ci){let ui=StyleModule.newName();return(si||(si=Object.create(null)))["."+ui]=ci,ui}const ai=typeof oi.all=="string"?oi.all:oi.all?ii(oi.all):void 0,li=oi.scope;this.scope=li instanceof Language?ci=>ci.prop(languageDataProp)==li.data:li?ci=>ci==li:void 0,this.style=tagHighlighter(ws.map(ci=>({tag:ci.tag,class:ci.class||ii(Object.assign({},ci,{tag:null}))})),{all:ai}).style,this.module=si?new StyleModule(si):null,this.themeType=oi.themeType}static define(ws,oi){return new HighlightStyle(ws,oi||{})}}const highlighterFacet=Facet.define(),fallbackHighlighter=Facet.define({combine(Ws){return Ws.length?[Ws[0]]:null}});function getHighlighters(Ws){let ws=Ws.facet(highlighterFacet);return ws.length?ws:Ws.facet(fallbackHighlighter)}function syntaxHighlighting(Ws,ws){let oi=[treeHighlighter],si;return Ws instanceof HighlightStyle&&(Ws.module&&oi.push(EditorView.styleModule.of(Ws.module)),si=Ws.themeType),ws!=null&&ws.fallback?oi.push(fallbackHighlighter.of(Ws)):si?oi.push(highlighterFacet.computeN([EditorView.darkTheme],ii=>ii.facet(EditorView.darkTheme)==(si=="dark")?[Ws]:[])):oi.push(highlighterFacet.of(Ws)),oi}class TreeHighlighter{constructor(ws){this.markCache=Object.create(null),this.tree=syntaxTree(ws.state),this.decorations=this.buildDeco(ws,getHighlighters(ws.state)),this.decoratedTo=ws.viewport.to}update(ws){let oi=syntaxTree(ws.state),si=getHighlighters(ws.state),ii=si!=getHighlighters(ws.startState),{viewport:ai}=ws.view,li=ws.changes.mapPos(this.decoratedTo,1);oi.length<ai.to&&!ii&&oi.type==this.tree.type&&li>=ai.to?(this.decorations=this.decorations.map(ws.changes),this.decoratedTo=li):(oi!=this.tree||ws.viewportChanged||ii)&&(this.tree=oi,this.decorations=this.buildDeco(ws.view,si),this.decoratedTo=ai.to)}buildDeco(ws,oi){if(!oi||!this.tree.length)return Decoration.none;let si=new RangeSetBuilder;for(let{from:ii,to:ai}of ws.visibleRanges)highlightTree(this.tree,oi,(li,ci,ui)=>{si.add(li,ci,this.markCache[ui]||(this.markCache[ui]=Decoration.mark({class:ui})))},ii,ai);return si.finish()}}const treeHighlighter=Prec.high(ViewPlugin.fromClass(TreeHighlighter,{decorations:Ws=>Ws.decorations})),defaultHighlightStyle=HighlightStyle.define([{tag:tags.meta,color:"#404740"},{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.invalid,color:"#f00"}]),baseTheme$4=EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DefaultScanDist=1e4,DefaultBrackets="()[]{}",bracketMatchingConfig=Facet.define({combine(Ws){return combineConfig(Ws,{afterCursor:!0,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist,renderMatch:defaultRenderMatch})}}),matchingMark=Decoration.mark({class:"cm-matchingBracket"}),nonmatchingMark=Decoration.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(Ws){let ws=[],oi=Ws.matched?matchingMark:nonmatchingMark;return ws.push(oi.range(Ws.start.from,Ws.start.to)),Ws.end&&ws.push(oi.range(Ws.end.from,Ws.end.to)),ws}const bracketMatchingState=StateField.define({create(){return Decoration.none},update(Ws,ws){if(!ws.docChanged&&!ws.selection)return Ws;let oi=[],si=ws.state.facet(bracketMatchingConfig);for(let ii of ws.state.selection.ranges){if(!ii.empty)continue;let ai=matchBrackets(ws.state,ii.head,-1,si)||ii.head>0&&matchBrackets(ws.state,ii.head-1,1,si)||si.afterCursor&&(matchBrackets(ws.state,ii.head,1,si)||ii.head<ws.state.doc.length&&matchBrackets(ws.state,ii.head+1,-1,si));ai&&(oi=oi.concat(si.renderMatch(ai,ws.state)))}return Decoration.set(oi,!0)},provide:Ws=>EditorView.decorations.from(Ws)}),bracketMatchingUnique=[bracketMatchingState,baseTheme$4];function bracketMatching(Ws={}){return[bracketMatchingConfig.of(Ws),bracketMatchingUnique]}const bracketMatchingHandle=new NodeProp;function matchingNodes(Ws,ws,oi){let si=Ws.prop(ws<0?NodeProp.openedBy:NodeProp.closedBy);if(si)return si;if(Ws.name.length==1){let ii=oi.indexOf(Ws.name);if(ii>-1&&ii%2==(ws<0?1:0))return[oi[ii+ws]]}return null}function findHandle(Ws){let ws=Ws.type.prop(bracketMatchingHandle);return ws?ws(Ws.node):Ws}function matchBrackets(Ws,ws,oi,si={}){let ii=si.maxScanDistance||DefaultScanDist,ai=si.brackets||DefaultBrackets,li=syntaxTree(Ws),ci=li.resolveInner(ws,oi);for(let ui=ci;ui;ui=ui.parent){let di=matchingNodes(ui.type,oi,ai);if(di&&ui.from<ui.to){let hi=findHandle(ui);if(hi&&(oi>0?ws>=hi.from&&ws<hi.to:ws>hi.from&&ws<=hi.to))return matchMarkedBrackets(Ws,ws,oi,ui,hi,di,ai)}}return matchPlainBrackets(Ws,ws,oi,li,ci.type,ii,ai)}function matchMarkedBrackets(Ws,ws,oi,si,ii,ai,li){let ci=si.parent,ui={from:ii.from,to:ii.to},di=0,hi=ci==null?void 0:ci.cursor();if(hi&&(oi<0?hi.childBefore(si.from):hi.childAfter(si.to)))do if(oi<0?hi.to<=si.from:hi.from>=si.to){if(di==0&&ai.indexOf(hi.type.name)>-1&&hi.from<hi.to){let pi=findHandle(hi);return{start:ui,end:pi?{from:pi.from,to:pi.to}:void 0,matched:!0}}else if(matchingNodes(hi.type,oi,li))di++;else if(matchingNodes(hi.type,-oi,li)){if(di==0){let pi=findHandle(hi);return{start:ui,end:pi&&pi.from<pi.to?{from:pi.from,to:pi.to}:void 0,matched:!1}}di--}}while(oi<0?hi.prevSibling():hi.nextSibling());return{start:ui,matched:!1}}function matchPlainBrackets(Ws,ws,oi,si,ii,ai,li){let ci=oi<0?Ws.sliceDoc(ws-1,ws):Ws.sliceDoc(ws,ws+1),ui=li.indexOf(ci);if(ui<0||ui%2==0!=oi>0)return null;let di={from:oi<0?ws-1:ws,to:oi>0?ws+1:ws},hi=Ws.doc.iterRange(ws,oi>0?Ws.doc.length:0),pi=0;for(let ha=0;!hi.next().done&&ha<=ai;){let ga=hi.value;oi<0&&(ha+=ga.length);let va=ws+ha*oi;for(let ba=oi>0?0:ga.length-1,wa=oi>0?ga.length:-1;ba!=wa;ba+=oi){let xa=li.indexOf(ga[ba]);if(!(xa<0||si.resolveInner(va+ba,1).type!=ii))if(xa%2==0==oi>0)pi++;else{if(pi==1)return{start:di,end:{from:va+ba,to:va+ba+1},matched:xa>>1==ui>>1};pi--}}oi>0&&(ha+=ga.length)}return hi.done?{start:di,matched:!1}:null}const noTokens=Object.create(null),typeArray=[NodeType.none],warned=[],byTag=Object.create(null),defaultTable=Object.create(null);for(let[Ws,ws]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])defaultTable[Ws]=createTokenType(noTokens,ws);function warnForPart(Ws,ws){warned.indexOf(Ws)>-1||(warned.push(Ws),console.warn(ws))}function createTokenType(Ws,ws){let oi=[];for(let ci of ws.split(" ")){let ui=[];for(let di of ci.split(".")){let hi=Ws[di]||tags[di];hi?typeof hi=="function"?ui.length?ui=ui.map(hi):warnForPart(di,`Modifier ${di} used at start of tag`):ui.length?warnForPart(di,`Tag ${di} used as modifier`):ui=Array.isArray(hi)?hi:[hi]:warnForPart(di,`Unknown highlighting tag ${di}`)}for(let di of ui)oi.push(di)}if(!oi.length)return 0;let si=ws.replace(/ /g,"_"),ii=si+" "+oi.map(ci=>ci.id),ai=byTag[ii];if(ai)return ai.id;let li=byTag[ii]=NodeType.define({id:typeArray.length,name:si,props:[styleTags({[si]:oi})]});return typeArray.push(li),li.id}Direction.RTL,Direction.LTR;const createTheme=({variant:Ws,settings:ws,styles:oi})=>{const si=EditorView.theme({"&":{backgroundColor:ws.background,color:ws.foreground},".cm-content":{caretColor:ws.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:ws.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ws.selection},".cm-activeLine":{backgroundColor:ws.lineHighlight},".cm-gutters":{backgroundColor:ws.gutterBackground,color:ws.gutterForeground},".cm-activeLineGutter":{backgroundColor:ws.lineHighlight}},{dark:Ws==="dark"}),ii=HighlightStyle.define(oi);return[si,syntaxHighlighting(ii)]};createTheme({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:tags.comment,color:"#404080"},{tag:[tags.string,tags.regexp],color:"#999999"},{tag:tags.number,color:"#7090B0"},{tag:[tags.bool,tags.null],color:"#8080A0"},{tag:[tags.punctuation,tags.derefOperator],color:"#805080"},{tag:tags.keyword,color:"#60B0FF"},{tag:tags.definitionKeyword,color:"#B0FFF0"},{tag:tags.moduleKeyword,color:"#60B0FF"},{tag:tags.operator,color:"#A0A0FF"},{tag:[tags.variableName,tags.self],color:"#008080"},{tag:tags.operatorKeyword,color:"#A0A0FF"},{tag:tags.controlKeyword,color:"#80A0FF"},{tag:tags.className,color:"#70E080"},{tag:[tags.function(tags.propertyName),tags.propertyName],color:"#50A0A0"},{tag:tags.tagName,color:"#009090"},{tag:tags.modifier,color:"#B0FFF0"},{tag:[tags.squareBracket,tags.attributeName],color:"#D0D0FF"}]});const ayuLight=createTheme({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:tags.comment,color:"#787b8099"},{tag:tags.string,color:"#86b300"},{tag:tags.regexp,color:"#4cbf99"},{tag:[tags.number,tags.bool,tags.null],color:"#ffaa33"},{tag:tags.variableName,color:"#5c6166"},{tag:[tags.definitionKeyword,tags.modifier],color:"#fa8d3e"},{tag:[tags.keyword,tags.special(tags.brace)],color:"#fa8d3e"},{tag:tags.operator,color:"#ed9366"},{tag:tags.separator,color:"#5c6166b3"},{tag:tags.punctuation,color:"#5c6166"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#f2ae49"},{tag:[tags.className,tags.definition(tags.typeName)],color:"#22a4e6"},{tag:[tags.tagName,tags.typeName,tags.self,tags.labelName],color:"#55b4d4"},{tag:tags.angleBracket,color:"#55b4d480"},{tag:tags.attributeName,color:"#f2ae49"}]});createTheme({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:tags.comment,color:"#6E6E6E"},{tag:[tags.string,tags.regexp,tags.special(tags.brace)],color:"#5C81B3"},{tag:tags.number,color:"#C1E1B8"},{tag:tags.bool,color:"#53667D"},{tag:[tags.definitionKeyword,tags.modifier,tags.function(tags.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[tags.keyword,tags.moduleKeyword,tags.operatorKeyword,tags.operator],color:"#697A8E",fontWeight:"bold"},{tag:[tags.variableName,tags.attributeName],color:"#708E67"},{tag:[tags.function(tags.variableName),tags.definition(tags.propertyName),tags.derefOperator],color:"#fff"},{tag:tags.tagName,color:"#A3D295"}]});createTheme({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:tags.comment,color:"#666666"},{tag:[tags.string,tags.special(tags.brace)],color:"#54BE0D"},{tag:tags.regexp,color:"#E9C062"},{tag:tags.number,color:"#CF6A4C"},{tag:[tags.keyword,tags.operator],color:"#5EA6EA"},{tag:tags.variableName,color:"#7587A6"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F9EE98"},{tag:[tags.propertyName,tags.function(tags.variableName)],color:"#937121"},{tag:[tags.typeName,tags.angleBracket,tags.tagName],color:"#9B859D"}]});createTheme({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:tags.comment,color:"#6B4E32"},{tag:[tags.keyword,tags.operator,tags.derefOperator],color:"#EF5D32"},{tag:tags.className,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.typeName,tags.propertyName,tags.function(tags.variableName),tags.definition(tags.variableName)],color:"#EFAC32"},{tag:tags.definition(tags.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:tags.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[tags.number,tags.bool],color:"#6C99BB"},{tag:[tags.variableName,tags.self],color:"#7DAF9C"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#D9D762"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#EFCB43"}]});createTheme({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:tags.comment,color:"#404040"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#00D8FF"},{tag:tags.number,color:"#E62286"},{tag:[tags.variableName,tags.attributeName,tags.self],color:"#E62286",fontWeight:"bold"},{tag:tags.function(tags.variableName),color:"#fff",fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:tags.comment,color:"#BCC8BA"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#5D90CD"},{tag:[tags.number,tags.bool,tags.null],color:"#46A609"},{tag:tags.keyword,color:"#AF956F"},{tag:[tags.definitionKeyword,tags.modifier],color:"#C52727"},{tag:[tags.angleBracket,tags.tagName,tags.attributeName],color:"#606060"},{tag:tags.self,color:"#000"}]});createTheme({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:tags.comment,color:"#0088FF"},{tag:tags.string,color:"#3AD900"},{tag:tags.regexp,color:"#80FFC2"},{tag:[tags.number,tags.bool,tags.null],color:"#FF628C"},{tag:[tags.definitionKeyword,tags.modifier],color:"#FFEE80"},{tag:tags.variableName,color:"#CCCCCC"},{tag:tags.self,color:"#FF80E1"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.definition(tags.typeName),tags.labelName],color:"#FFDD00"},{tag:[tags.keyword,tags.operator],color:"#FF9D00"},{tag:[tags.propertyName,tags.typeName],color:"#80FFBB"},{tag:tags.special(tags.brace),color:"#EDEF7D"},{tag:tags.attributeName,color:"#9EFFFF"},{tag:tags.derefOperator,color:"#fff"}]});createTheme({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:tags.comment,color:"#AEAEAE"},{tag:[tags.string,tags.special(tags.brace),tags.regexp],color:"#8DFF8E"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.function(tags.definition(tags.variableName)),tags.definition(tags.typeName)],color:"#A3EBFF"},{tag:[tags.number,tags.bool,tags.null],color:"#62E9BD"},{tag:[tags.keyword,tags.operator],color:"#2BF1DC"},{tag:[tags.definitionKeyword,tags.modifier],color:"#F8FBB1"},{tag:[tags.variableName,tags.self],color:"#B683CA"},{tag:[tags.angleBracket,tags.tagName,tags.typeName,tags.propertyName],color:"#60A4F1"},{tag:tags.derefOperator,color:"#E0E0E0"},{tag:tags.attributeName,color:"#7BACCA"}]});createTheme({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:tags.comment,color:"#6272a4"},{tag:[tags.string,tags.special(tags.brace)],color:"#f1fa8c"},{tag:[tags.number,tags.self,tags.bool,tags.null],color:"#bd93f9"},{tag:[tags.keyword,tags.operator],color:"#ff79c6"},{tag:[tags.definitionKeyword,tags.typeName],color:"#8be9fd"},{tag:tags.definition(tags.typeName),color:"#f8f8f2"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.attributeName],color:"#50fa7b"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:tags.comment,color:"#AAAAAA"},{tag:[tags.keyword,tags.operator,tags.typeName,tags.tagName,tags.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[tags.attributeName,tags.definition(tags.propertyName)],color:"#4F9FD0"},{tag:[tags.className,tags.string,tags.special(tags.brace)],color:"#CF4F5F"},{tag:tags.number,color:"#CF4F5F",fontWeight:"bold"},{tag:tags.variableName,fontWeight:"bold"}]});createTheme({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:tags.comment,color:"#9995b7"},{tag:tags.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#ff5792"},{tag:[tags.className,tags.tagName,tags.definition(tags.typeName)],color:"#0094f0"},{tag:[tags.number,tags.bool,tags.null,tags.special(tags.brace)],color:"#5842ff"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#0095a8"},{tag:tags.typeName,color:"#b3694d"},{tag:[tags.propertyName,tags.variableName],color:"#fa8900"},{tag:tags.operator,color:"#ff5792"},{tag:tags.self,color:"#e64100"},{tag:[tags.string,tags.regexp],color:"#00b368"},{tag:[tags.paren,tags.bracket],color:"#0431fa"},{tag:tags.labelName,color:"#00bdd6"},{tag:tags.attributeName,color:"#e64100"},{tag:tags.angleBracket,color:"#9995b7"}]});createTheme({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:tags.comment,color:"#9893a5"},{tag:[tags.bool,tags.null],color:"#286983"},{tag:tags.number,color:"#d7827e"},{tag:tags.className,color:"#d7827e"},{tag:[tags.angleBracket,tags.tagName,tags.typeName],color:"#56949f"},{tag:tags.attributeName,color:"#907aa9"},{tag:tags.punctuation,color:"#797593"},{tag:[tags.keyword,tags.modifier],color:"#286983"},{tag:[tags.string,tags.regexp],color:"#ea9d34"},{tag:tags.variableName,color:"#d7827e"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:tags.comment,color:"#CFCFCF"},{tag:[tags.number,tags.bool,tags.null],color:"#E66C29"},{tag:[tags.className,tags.definition(tags.propertyName),tags.function(tags.variableName),tags.labelName,tags.definition(tags.typeName)],color:"#2EB43B"},{tag:tags.keyword,color:"#D8B229"},{tag:tags.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[tags.definitionKeyword,tags.modifier],color:"#925A47"},{tag:tags.string,color:"#704D3D"},{tag:tags.typeName,color:"#2F8996"},{tag:[tags.variableName,tags.propertyName],color:"#77ACB0"},{tag:tags.self,color:"#77ACB0",fontWeight:"bold"},{tag:tags.regexp,color:"#E3965E"},{tag:[tags.tagName,tags.angleBracket],color:"#BAA827"},{tag:tags.attributeName,color:"#B06520"},{tag:tags.derefOperator,color:"#000"}]});createTheme({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:tags.comment,color:"#93A1A1"},{tag:tags.string,color:"#2AA198"},{tag:tags.regexp,color:"#D30102"},{tag:tags.number,color:"#D33682"},{tag:tags.variableName,color:"#268BD2"},{tag:[tags.keyword,tags.operator,tags.punctuation],color:"#859900"},{tag:[tags.definitionKeyword,tags.modifier],color:"#073642",fontWeight:"bold"},{tag:[tags.className,tags.self,tags.definition(tags.propertyName)],color:"#268BD2"},{tag:tags.function(tags.variableName),color:"#268BD2"},{tag:[tags.bool,tags.null],color:"#B58900"},{tag:tags.tagName,color:"#268BD2",fontWeight:"bold"},{tag:tags.angleBracket,color:"#93A1A1"},{tag:tags.attributeName,color:"#93A1A1"},{tag:tags.typeName,color:"#859900"}]});createTheme({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:tags.comment,color:"#8E908C"},{tag:[tags.variableName,tags.self,tags.propertyName,tags.attributeName,tags.regexp],color:"#C82829"},{tag:[tags.number,tags.bool,tags.null],color:"#F5871F"},{tag:[tags.className,tags.typeName,tags.definition(tags.typeName)],color:"#C99E00"},{tag:[tags.string,tags.special(tags.brace)],color:"#718C00"},{tag:tags.operator,color:"#3E999F"},{tag:[tags.definition(tags.propertyName),tags.function(tags.variableName)],color:"#4271AE"},{tag:tags.keyword,color:"#8959A8"},{tag:tags.derefOperator,color:"#4D4D4C"}]});function objectValues(Ws){const ws=Object.keys(Ws),oi=ws.length,si=new Array(oi);for(let ii=0;ii<oi;++ii)si[ii]=Ws[ws[ii]];return si}function hintList(Ws,ws){return filterAndSortList(ws,normalizeText(Ws.string))}function filterAndSortList(Ws,ws){if(!ws||ws.trim()===""||ws.trim()===":"||ws.trim()==="{")return filterNonEmpty(Ws,si=>!si.isDeprecated);const oi=Ws.map(si=>({proximity:getProximity(normalizeText(si.label),ws),entry:si}));return filterNonEmpty(filterNonEmpty(oi,si=>si.proximity<=2),si=>!si.entry.isDeprecated).sort((si,ii)=>(si.entry.isDeprecated?1:0)-(ii.entry.isDeprecated?1:0)||si.proximity-ii.proximity||si.entry.label.length-ii.entry.label.length).map(si=>si.entry)}function filterNonEmpty(Ws,ws){const oi=Ws.filter(ws);return oi.length===0?Ws:oi}function normalizeText(Ws){return Ws.toLowerCase().replaceAll(/\W/g,"")}function getProximity(Ws,ws){let oi=lexicalDistance(ws,Ws);return Ws.length>ws.length&&(oi-=Ws.length-ws.length-1,oi+=Ws.indexOf(ws)===0?0:.5),oi}function lexicalDistance(Ws,ws){let oi,si;const ii=[],ai=Ws.length,li=ws.length;for(oi=0;oi<=ai;oi++)ii[oi]=[oi];for(si=1;si<=li;si++)ii[0][si]=si;for(oi=1;oi<=ai;oi++)for(si=1;si<=li;si++){const ci=Ws[oi-1]===ws[si-1]?0:1;ii[oi][si]=Math.min(ii[oi-1][si]+1,ii[oi][si-1]+1,ii[oi-1][si-1]+ci),oi>1&&si>1&&Ws[oi-1]===ws[si-2]&&Ws[oi-2]===ws[si-1]&&(ii[oi][si]=Math.min(ii[oi][si],ii[oi-2][si-2]+ci))}return ii[ai][li]}const insertSuffix=Ws=>` {
323
- $1
324
- }`,getInsertText=(Ws,ws,oi)=>{if(!ws)return oi??Ws;const si=getNamedType(ws);return isObjectType(si)||isInputObjectType(si)||isListType(si)||isAbstractType(si)?Ws+insertSuffix():oi??Ws},getInputInsertText=(Ws,ws,oi)=>{if(isListType(ws)){const si=getNamedType(ws.ofType);return Ws+`[${getInsertText("",si,"$1")}]`}return getInsertText(Ws,ws,oi)},getFieldInsertText=Ws=>{const ws=Ws.args.filter(oi=>oi.type.toString().endsWith("!"));if(ws.length)return Ws.name+`(${ws.map((oi,si)=>`${oi.name}: $${si+1}`)}) ${getInsertText("",Ws.type,`
325
- `)}`};var DocumentUri;(function(Ws){function ws(oi){return typeof oi=="string"}Ws.is=ws})(DocumentUri||(DocumentUri={}));var URI;(function(Ws){function ws(oi){return typeof oi=="string"}Ws.is=ws})(URI||(URI={}));var integer;(function(Ws){Ws.MIN_VALUE=-2147483648,Ws.MAX_VALUE=2147483647;function ws(oi){return typeof oi=="number"&&Ws.MIN_VALUE<=oi&&oi<=Ws.MAX_VALUE}Ws.is=ws})(integer||(integer={}));var uinteger;(function(Ws){Ws.MIN_VALUE=0,Ws.MAX_VALUE=2147483647;function ws(oi){return typeof oi=="number"&&Ws.MIN_VALUE<=oi&&oi<=Ws.MAX_VALUE}Ws.is=ws})(uinteger||(uinteger={}));var Position$2;(function(Ws){function ws(si,ii){return si===Number.MAX_VALUE&&(si=uinteger.MAX_VALUE),ii===Number.MAX_VALUE&&(ii=uinteger.MAX_VALUE),{line:si,character:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.objectLiteral(ii)&&Is.uinteger(ii.line)&&Is.uinteger(ii.character)}Ws.is=oi})(Position$2||(Position$2={}));var Range$1;(function(Ws){function ws(si,ii,ai,li){if(Is.uinteger(si)&&Is.uinteger(ii)&&Is.uinteger(ai)&&Is.uinteger(li))return{start:Position$2.create(si,ii),end:Position$2.create(ai,li)};if(Position$2.is(si)&&Position$2.is(ii))return{start:si,end:ii};throw new Error(`Range#create called with invalid arguments[${si}, ${ii}, ${ai}, ${li}]`)}Ws.create=ws;function oi(si){let ii=si;return Is.objectLiteral(ii)&&Position$2.is(ii.start)&&Position$2.is(ii.end)}Ws.is=oi})(Range$1||(Range$1={}));var Location;(function(Ws){function ws(si,ii){return{uri:si,range:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.objectLiteral(ii)&&Range$1.is(ii.range)&&(Is.string(ii.uri)||Is.undefined(ii.uri))}Ws.is=oi})(Location||(Location={}));var LocationLink;(function(Ws){function ws(si,ii,ai,li){return{targetUri:si,targetRange:ii,targetSelectionRange:ai,originSelectionRange:li}}Ws.create=ws;function oi(si){let ii=si;return Is.objectLiteral(ii)&&Range$1.is(ii.targetRange)&&Is.string(ii.targetUri)&&Range$1.is(ii.targetSelectionRange)&&(Range$1.is(ii.originSelectionRange)||Is.undefined(ii.originSelectionRange))}Ws.is=oi})(LocationLink||(LocationLink={}));var Color;(function(Ws){function ws(si,ii,ai,li){return{red:si,green:ii,blue:ai,alpha:li}}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Is.numberRange(ii.red,0,1)&&Is.numberRange(ii.green,0,1)&&Is.numberRange(ii.blue,0,1)&&Is.numberRange(ii.alpha,0,1)}Ws.is=oi})(Color||(Color={}));var ColorInformation;(function(Ws){function ws(si,ii){return{range:si,color:ii}}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Range$1.is(ii.range)&&Color.is(ii.color)}Ws.is=oi})(ColorInformation||(ColorInformation={}));var ColorPresentation;(function(Ws){function ws(si,ii,ai){return{label:si,textEdit:ii,additionalTextEdits:ai}}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Is.string(ii.label)&&(Is.undefined(ii.textEdit)||TextEdit.is(ii))&&(Is.undefined(ii.additionalTextEdits)||Is.typedArray(ii.additionalTextEdits,TextEdit.is))}Ws.is=oi})(ColorPresentation||(ColorPresentation={}));var FoldingRangeKind;(function(Ws){Ws.Comment="comment",Ws.Imports="imports",Ws.Region="region"})(FoldingRangeKind||(FoldingRangeKind={}));var FoldingRange;(function(Ws){function ws(si,ii,ai,li,ci,ui){const di={startLine:si,endLine:ii};return Is.defined(ai)&&(di.startCharacter=ai),Is.defined(li)&&(di.endCharacter=li),Is.defined(ci)&&(di.kind=ci),Is.defined(ui)&&(di.collapsedText=ui),di}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Is.uinteger(ii.startLine)&&Is.uinteger(ii.startLine)&&(Is.undefined(ii.startCharacter)||Is.uinteger(ii.startCharacter))&&(Is.undefined(ii.endCharacter)||Is.uinteger(ii.endCharacter))&&(Is.undefined(ii.kind)||Is.string(ii.kind))}Ws.is=oi})(FoldingRange||(FoldingRange={}));var DiagnosticRelatedInformation;(function(Ws){function ws(si,ii){return{location:si,message:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Location.is(ii.location)&&Is.string(ii.message)}Ws.is=oi})(DiagnosticRelatedInformation||(DiagnosticRelatedInformation={}));var DiagnosticSeverity;(function(Ws){Ws.Error=1,Ws.Warning=2,Ws.Information=3,Ws.Hint=4})(DiagnosticSeverity||(DiagnosticSeverity={}));var DiagnosticTag;(function(Ws){Ws.Unnecessary=1,Ws.Deprecated=2})(DiagnosticTag||(DiagnosticTag={}));var CodeDescription;(function(Ws){function ws(oi){const si=oi;return Is.objectLiteral(si)&&Is.string(si.href)}Ws.is=ws})(CodeDescription||(CodeDescription={}));var Diagnostic;(function(Ws){function ws(si,ii,ai,li,ci,ui){let di={range:si,message:ii};return Is.defined(ai)&&(di.severity=ai),Is.defined(li)&&(di.code=li),Is.defined(ci)&&(di.source=ci),Is.defined(ui)&&(di.relatedInformation=ui),di}Ws.create=ws;function oi(si){var ii;let ai=si;return Is.defined(ai)&&Range$1.is(ai.range)&&Is.string(ai.message)&&(Is.number(ai.severity)||Is.undefined(ai.severity))&&(Is.integer(ai.code)||Is.string(ai.code)||Is.undefined(ai.code))&&(Is.undefined(ai.codeDescription)||Is.string((ii=ai.codeDescription)===null||ii===void 0?void 0:ii.href))&&(Is.string(ai.source)||Is.undefined(ai.source))&&(Is.undefined(ai.relatedInformation)||Is.typedArray(ai.relatedInformation,DiagnosticRelatedInformation.is))}Ws.is=oi})(Diagnostic||(Diagnostic={}));var Command;(function(Ws){function ws(si,ii,...ai){let li={title:si,command:ii};return Is.defined(ai)&&ai.length>0&&(li.arguments=ai),li}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.string(ii.title)&&Is.string(ii.command)}Ws.is=oi})(Command||(Command={}));var TextEdit;(function(Ws){function ws(ai,li){return{range:ai,newText:li}}Ws.replace=ws;function oi(ai,li){return{range:{start:ai,end:ai},newText:li}}Ws.insert=oi;function si(ai){return{range:ai,newText:""}}Ws.del=si;function ii(ai){const li=ai;return Is.objectLiteral(li)&&Is.string(li.newText)&&Range$1.is(li.range)}Ws.is=ii})(TextEdit||(TextEdit={}));var ChangeAnnotation;(function(Ws){function ws(si,ii,ai){const li={label:si};return ii!==void 0&&(li.needsConfirmation=ii),ai!==void 0&&(li.description=ai),li}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Is.string(ii.label)&&(Is.boolean(ii.needsConfirmation)||ii.needsConfirmation===void 0)&&(Is.string(ii.description)||ii.description===void 0)}Ws.is=oi})(ChangeAnnotation||(ChangeAnnotation={}));var ChangeAnnotationIdentifier;(function(Ws){function ws(oi){const si=oi;return Is.string(si)}Ws.is=ws})(ChangeAnnotationIdentifier||(ChangeAnnotationIdentifier={}));var AnnotatedTextEdit;(function(Ws){function ws(ai,li,ci){return{range:ai,newText:li,annotationId:ci}}Ws.replace=ws;function oi(ai,li,ci){return{range:{start:ai,end:ai},newText:li,annotationId:ci}}Ws.insert=oi;function si(ai,li){return{range:ai,newText:"",annotationId:li}}Ws.del=si;function ii(ai){const li=ai;return TextEdit.is(li)&&(ChangeAnnotation.is(li.annotationId)||ChangeAnnotationIdentifier.is(li.annotationId))}Ws.is=ii})(AnnotatedTextEdit||(AnnotatedTextEdit={}));var TextDocumentEdit;(function(Ws){function ws(si,ii){return{textDocument:si,edits:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&OptionalVersionedTextDocumentIdentifier.is(ii.textDocument)&&Array.isArray(ii.edits)}Ws.is=oi})(TextDocumentEdit||(TextDocumentEdit={}));var CreateFile;(function(Ws){function ws(si,ii,ai){let li={kind:"create",uri:si};return ii!==void 0&&(ii.overwrite!==void 0||ii.ignoreIfExists!==void 0)&&(li.options=ii),ai!==void 0&&(li.annotationId=ai),li}Ws.create=ws;function oi(si){let ii=si;return ii&&ii.kind==="create"&&Is.string(ii.uri)&&(ii.options===void 0||(ii.options.overwrite===void 0||Is.boolean(ii.options.overwrite))&&(ii.options.ignoreIfExists===void 0||Is.boolean(ii.options.ignoreIfExists)))&&(ii.annotationId===void 0||ChangeAnnotationIdentifier.is(ii.annotationId))}Ws.is=oi})(CreateFile||(CreateFile={}));var RenameFile;(function(Ws){function ws(si,ii,ai,li){let ci={kind:"rename",oldUri:si,newUri:ii};return ai!==void 0&&(ai.overwrite!==void 0||ai.ignoreIfExists!==void 0)&&(ci.options=ai),li!==void 0&&(ci.annotationId=li),ci}Ws.create=ws;function oi(si){let ii=si;return ii&&ii.kind==="rename"&&Is.string(ii.oldUri)&&Is.string(ii.newUri)&&(ii.options===void 0||(ii.options.overwrite===void 0||Is.boolean(ii.options.overwrite))&&(ii.options.ignoreIfExists===void 0||Is.boolean(ii.options.ignoreIfExists)))&&(ii.annotationId===void 0||ChangeAnnotationIdentifier.is(ii.annotationId))}Ws.is=oi})(RenameFile||(RenameFile={}));var DeleteFile;(function(Ws){function ws(si,ii,ai){let li={kind:"delete",uri:si};return ii!==void 0&&(ii.recursive!==void 0||ii.ignoreIfNotExists!==void 0)&&(li.options=ii),ai!==void 0&&(li.annotationId=ai),li}Ws.create=ws;function oi(si){let ii=si;return ii&&ii.kind==="delete"&&Is.string(ii.uri)&&(ii.options===void 0||(ii.options.recursive===void 0||Is.boolean(ii.options.recursive))&&(ii.options.ignoreIfNotExists===void 0||Is.boolean(ii.options.ignoreIfNotExists)))&&(ii.annotationId===void 0||ChangeAnnotationIdentifier.is(ii.annotationId))}Ws.is=oi})(DeleteFile||(DeleteFile={}));var WorkspaceEdit;(function(Ws){function ws(oi){let si=oi;return si&&(si.changes!==void 0||si.documentChanges!==void 0)&&(si.documentChanges===void 0||si.documentChanges.every(ii=>Is.string(ii.kind)?CreateFile.is(ii)||RenameFile.is(ii)||DeleteFile.is(ii):TextDocumentEdit.is(ii)))}Ws.is=ws})(WorkspaceEdit||(WorkspaceEdit={}));var TextDocumentIdentifier;(function(Ws){function ws(si){return{uri:si}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.string(ii.uri)}Ws.is=oi})(TextDocumentIdentifier||(TextDocumentIdentifier={}));var VersionedTextDocumentIdentifier;(function(Ws){function ws(si,ii){return{uri:si,version:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.string(ii.uri)&&Is.integer(ii.version)}Ws.is=oi})(VersionedTextDocumentIdentifier||(VersionedTextDocumentIdentifier={}));var OptionalVersionedTextDocumentIdentifier;(function(Ws){function ws(si,ii){return{uri:si,version:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.string(ii.uri)&&(ii.version===null||Is.integer(ii.version))}Ws.is=oi})(OptionalVersionedTextDocumentIdentifier||(OptionalVersionedTextDocumentIdentifier={}));var TextDocumentItem;(function(Ws){function ws(si,ii,ai,li){return{uri:si,languageId:ii,version:ai,text:li}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.string(ii.uri)&&Is.string(ii.languageId)&&Is.integer(ii.version)&&Is.string(ii.text)}Ws.is=oi})(TextDocumentItem||(TextDocumentItem={}));var MarkupKind;(function(Ws){Ws.PlainText="plaintext",Ws.Markdown="markdown";function ws(oi){const si=oi;return si===Ws.PlainText||si===Ws.Markdown}Ws.is=ws})(MarkupKind||(MarkupKind={}));var MarkupContent;(function(Ws){function ws(oi){const si=oi;return Is.objectLiteral(oi)&&MarkupKind.is(si.kind)&&Is.string(si.value)}Ws.is=ws})(MarkupContent||(MarkupContent={}));var CompletionItemKind$1;(function(Ws){Ws.Text=1,Ws.Method=2,Ws.Function=3,Ws.Constructor=4,Ws.Field=5,Ws.Variable=6,Ws.Class=7,Ws.Interface=8,Ws.Module=9,Ws.Property=10,Ws.Unit=11,Ws.Value=12,Ws.Enum=13,Ws.Keyword=14,Ws.Snippet=15,Ws.Color=16,Ws.File=17,Ws.Reference=18,Ws.Folder=19,Ws.EnumMember=20,Ws.Constant=21,Ws.Struct=22,Ws.Event=23,Ws.Operator=24,Ws.TypeParameter=25})(CompletionItemKind$1||(CompletionItemKind$1={}));var InsertTextFormat;(function(Ws){Ws.PlainText=1,Ws.Snippet=2})(InsertTextFormat||(InsertTextFormat={}));var CompletionItemTag;(function(Ws){Ws.Deprecated=1})(CompletionItemTag||(CompletionItemTag={}));var InsertReplaceEdit;(function(Ws){function ws(si,ii,ai){return{newText:si,insert:ii,replace:ai}}Ws.create=ws;function oi(si){const ii=si;return ii&&Is.string(ii.newText)&&Range$1.is(ii.insert)&&Range$1.is(ii.replace)}Ws.is=oi})(InsertReplaceEdit||(InsertReplaceEdit={}));var InsertTextMode;(function(Ws){Ws.asIs=1,Ws.adjustIndentation=2})(InsertTextMode||(InsertTextMode={}));var CompletionItemLabelDetails;(function(Ws){function ws(oi){const si=oi;return si&&(Is.string(si.detail)||si.detail===void 0)&&(Is.string(si.description)||si.description===void 0)}Ws.is=ws})(CompletionItemLabelDetails||(CompletionItemLabelDetails={}));var CompletionItem;(function(Ws){function ws(oi){return{label:oi}}Ws.create=ws})(CompletionItem||(CompletionItem={}));var CompletionList;(function(Ws){function ws(oi,si){return{items:oi||[],isIncomplete:!!si}}Ws.create=ws})(CompletionList||(CompletionList={}));var MarkedString;(function(Ws){function ws(si){return si.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}Ws.fromPlainText=ws;function oi(si){const ii=si;return Is.string(ii)||Is.objectLiteral(ii)&&Is.string(ii.language)&&Is.string(ii.value)}Ws.is=oi})(MarkedString||(MarkedString={}));var Hover;(function(Ws){function ws(oi){let si=oi;return!!si&&Is.objectLiteral(si)&&(MarkupContent.is(si.contents)||MarkedString.is(si.contents)||Is.typedArray(si.contents,MarkedString.is))&&(oi.range===void 0||Range$1.is(oi.range))}Ws.is=ws})(Hover||(Hover={}));var ParameterInformation;(function(Ws){function ws(oi,si){return si?{label:oi,documentation:si}:{label:oi}}Ws.create=ws})(ParameterInformation||(ParameterInformation={}));var SignatureInformation;(function(Ws){function ws(oi,si,...ii){let ai={label:oi};return Is.defined(si)&&(ai.documentation=si),Is.defined(ii)?ai.parameters=ii:ai.parameters=[],ai}Ws.create=ws})(SignatureInformation||(SignatureInformation={}));var DocumentHighlightKind;(function(Ws){Ws.Text=1,Ws.Read=2,Ws.Write=3})(DocumentHighlightKind||(DocumentHighlightKind={}));var DocumentHighlight;(function(Ws){function ws(oi,si){let ii={range:oi};return Is.number(si)&&(ii.kind=si),ii}Ws.create=ws})(DocumentHighlight||(DocumentHighlight={}));var SymbolKind;(function(Ws){Ws.File=1,Ws.Module=2,Ws.Namespace=3,Ws.Package=4,Ws.Class=5,Ws.Method=6,Ws.Property=7,Ws.Field=8,Ws.Constructor=9,Ws.Enum=10,Ws.Interface=11,Ws.Function=12,Ws.Variable=13,Ws.Constant=14,Ws.String=15,Ws.Number=16,Ws.Boolean=17,Ws.Array=18,Ws.Object=19,Ws.Key=20,Ws.Null=21,Ws.EnumMember=22,Ws.Struct=23,Ws.Event=24,Ws.Operator=25,Ws.TypeParameter=26})(SymbolKind||(SymbolKind={}));var SymbolTag;(function(Ws){Ws.Deprecated=1})(SymbolTag||(SymbolTag={}));var SymbolInformation;(function(Ws){function ws(oi,si,ii,ai,li){let ci={name:oi,kind:si,location:{uri:ai,range:ii}};return li&&(ci.containerName=li),ci}Ws.create=ws})(SymbolInformation||(SymbolInformation={}));var WorkspaceSymbol;(function(Ws){function ws(oi,si,ii,ai){return ai!==void 0?{name:oi,kind:si,location:{uri:ii,range:ai}}:{name:oi,kind:si,location:{uri:ii}}}Ws.create=ws})(WorkspaceSymbol||(WorkspaceSymbol={}));var DocumentSymbol;(function(Ws){function ws(si,ii,ai,li,ci,ui){let di={name:si,detail:ii,kind:ai,range:li,selectionRange:ci};return ui!==void 0&&(di.children=ui),di}Ws.create=ws;function oi(si){let ii=si;return ii&&Is.string(ii.name)&&Is.number(ii.kind)&&Range$1.is(ii.range)&&Range$1.is(ii.selectionRange)&&(ii.detail===void 0||Is.string(ii.detail))&&(ii.deprecated===void 0||Is.boolean(ii.deprecated))&&(ii.children===void 0||Array.isArray(ii.children))&&(ii.tags===void 0||Array.isArray(ii.tags))}Ws.is=oi})(DocumentSymbol||(DocumentSymbol={}));var CodeActionKind;(function(Ws){Ws.Empty="",Ws.QuickFix="quickfix",Ws.Refactor="refactor",Ws.RefactorExtract="refactor.extract",Ws.RefactorInline="refactor.inline",Ws.RefactorRewrite="refactor.rewrite",Ws.Source="source",Ws.SourceOrganizeImports="source.organizeImports",Ws.SourceFixAll="source.fixAll"})(CodeActionKind||(CodeActionKind={}));var CodeActionTriggerKind;(function(Ws){Ws.Invoked=1,Ws.Automatic=2})(CodeActionTriggerKind||(CodeActionTriggerKind={}));var CodeActionContext;(function(Ws){function ws(si,ii,ai){let li={diagnostics:si};return ii!=null&&(li.only=ii),ai!=null&&(li.triggerKind=ai),li}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.typedArray(ii.diagnostics,Diagnostic.is)&&(ii.only===void 0||Is.typedArray(ii.only,Is.string))&&(ii.triggerKind===void 0||ii.triggerKind===CodeActionTriggerKind.Invoked||ii.triggerKind===CodeActionTriggerKind.Automatic)}Ws.is=oi})(CodeActionContext||(CodeActionContext={}));var CodeAction;(function(Ws){function ws(si,ii,ai){let li={title:si},ci=!0;return typeof ii=="string"?(ci=!1,li.kind=ii):Command.is(ii)?li.command=ii:li.edit=ii,ci&&ai!==void 0&&(li.kind=ai),li}Ws.create=ws;function oi(si){let ii=si;return ii&&Is.string(ii.title)&&(ii.diagnostics===void 0||Is.typedArray(ii.diagnostics,Diagnostic.is))&&(ii.kind===void 0||Is.string(ii.kind))&&(ii.edit!==void 0||ii.command!==void 0)&&(ii.command===void 0||Command.is(ii.command))&&(ii.isPreferred===void 0||Is.boolean(ii.isPreferred))&&(ii.edit===void 0||WorkspaceEdit.is(ii.edit))}Ws.is=oi})(CodeAction||(CodeAction={}));var CodeLens;(function(Ws){function ws(si,ii){let ai={range:si};return Is.defined(ii)&&(ai.data=ii),ai}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Range$1.is(ii.range)&&(Is.undefined(ii.command)||Command.is(ii.command))}Ws.is=oi})(CodeLens||(CodeLens={}));var FormattingOptions;(function(Ws){function ws(si,ii){return{tabSize:si,insertSpaces:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Is.uinteger(ii.tabSize)&&Is.boolean(ii.insertSpaces)}Ws.is=oi})(FormattingOptions||(FormattingOptions={}));var DocumentLink;(function(Ws){function ws(si,ii,ai){return{range:si,target:ii,data:ai}}Ws.create=ws;function oi(si){let ii=si;return Is.defined(ii)&&Range$1.is(ii.range)&&(Is.undefined(ii.target)||Is.string(ii.target))}Ws.is=oi})(DocumentLink||(DocumentLink={}));var SelectionRange;(function(Ws){function ws(si,ii){return{range:si,parent:ii}}Ws.create=ws;function oi(si){let ii=si;return Is.objectLiteral(ii)&&Range$1.is(ii.range)&&(ii.parent===void 0||Ws.is(ii.parent))}Ws.is=oi})(SelectionRange||(SelectionRange={}));var SemanticTokenTypes;(function(Ws){Ws.namespace="namespace",Ws.type="type",Ws.class="class",Ws.enum="enum",Ws.interface="interface",Ws.struct="struct",Ws.typeParameter="typeParameter",Ws.parameter="parameter",Ws.variable="variable",Ws.property="property",Ws.enumMember="enumMember",Ws.event="event",Ws.function="function",Ws.method="method",Ws.macro="macro",Ws.keyword="keyword",Ws.modifier="modifier",Ws.comment="comment",Ws.string="string",Ws.number="number",Ws.regexp="regexp",Ws.operator="operator",Ws.decorator="decorator"})(SemanticTokenTypes||(SemanticTokenTypes={}));var SemanticTokenModifiers;(function(Ws){Ws.declaration="declaration",Ws.definition="definition",Ws.readonly="readonly",Ws.static="static",Ws.deprecated="deprecated",Ws.abstract="abstract",Ws.async="async",Ws.modification="modification",Ws.documentation="documentation",Ws.defaultLibrary="defaultLibrary"})(SemanticTokenModifiers||(SemanticTokenModifiers={}));var SemanticTokens;(function(Ws){function ws(oi){const si=oi;return Is.objectLiteral(si)&&(si.resultId===void 0||typeof si.resultId=="string")&&Array.isArray(si.data)&&(si.data.length===0||typeof si.data[0]=="number")}Ws.is=ws})(SemanticTokens||(SemanticTokens={}));var InlineValueText;(function(Ws){function ws(si,ii){return{range:si,text:ii}}Ws.create=ws;function oi(si){const ii=si;return ii!=null&&Range$1.is(ii.range)&&Is.string(ii.text)}Ws.is=oi})(InlineValueText||(InlineValueText={}));var InlineValueVariableLookup;(function(Ws){function ws(si,ii,ai){return{range:si,variableName:ii,caseSensitiveLookup:ai}}Ws.create=ws;function oi(si){const ii=si;return ii!=null&&Range$1.is(ii.range)&&Is.boolean(ii.caseSensitiveLookup)&&(Is.string(ii.variableName)||ii.variableName===void 0)}Ws.is=oi})(InlineValueVariableLookup||(InlineValueVariableLookup={}));var InlineValueEvaluatableExpression;(function(Ws){function ws(si,ii){return{range:si,expression:ii}}Ws.create=ws;function oi(si){const ii=si;return ii!=null&&Range$1.is(ii.range)&&(Is.string(ii.expression)||ii.expression===void 0)}Ws.is=oi})(InlineValueEvaluatableExpression||(InlineValueEvaluatableExpression={}));var InlineValueContext;(function(Ws){function ws(si,ii){return{frameId:si,stoppedLocation:ii}}Ws.create=ws;function oi(si){const ii=si;return Is.defined(ii)&&Range$1.is(si.stoppedLocation)}Ws.is=oi})(InlineValueContext||(InlineValueContext={}));var InlayHintKind;(function(Ws){Ws.Type=1,Ws.Parameter=2;function ws(oi){return oi===1||oi===2}Ws.is=ws})(InlayHintKind||(InlayHintKind={}));var InlayHintLabelPart;(function(Ws){function ws(si){return{value:si}}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&(ii.tooltip===void 0||Is.string(ii.tooltip)||MarkupContent.is(ii.tooltip))&&(ii.location===void 0||Location.is(ii.location))&&(ii.command===void 0||Command.is(ii.command))}Ws.is=oi})(InlayHintLabelPart||(InlayHintLabelPart={}));var InlayHint;(function(Ws){function ws(si,ii,ai){const li={position:si,label:ii};return ai!==void 0&&(li.kind=ai),li}Ws.create=ws;function oi(si){const ii=si;return Is.objectLiteral(ii)&&Position$2.is(ii.position)&&(Is.string(ii.label)||Is.typedArray(ii.label,InlayHintLabelPart.is))&&(ii.kind===void 0||InlayHintKind.is(ii.kind))&&ii.textEdits===void 0||Is.typedArray(ii.textEdits,TextEdit.is)&&(ii.tooltip===void 0||Is.string(ii.tooltip)||MarkupContent.is(ii.tooltip))&&(ii.paddingLeft===void 0||Is.boolean(ii.paddingLeft))&&(ii.paddingRight===void 0||Is.boolean(ii.paddingRight))}Ws.is=oi})(InlayHint||(InlayHint={}));var StringValue;(function(Ws){function ws(oi){return{kind:"snippet",value:oi}}Ws.createSnippet=ws})(StringValue||(StringValue={}));var InlineCompletionItem;(function(Ws){function ws(oi,si,ii,ai){return{insertText:oi,filterText:si,range:ii,command:ai}}Ws.create=ws})(InlineCompletionItem||(InlineCompletionItem={}));var InlineCompletionList;(function(Ws){function ws(oi){return{items:oi}}Ws.create=ws})(InlineCompletionList||(InlineCompletionList={}));var InlineCompletionTriggerKind;(function(Ws){Ws.Invoked=0,Ws.Automatic=1})(InlineCompletionTriggerKind||(InlineCompletionTriggerKind={}));var SelectedCompletionInfo;(function(Ws){function ws(oi,si){return{range:oi,text:si}}Ws.create=ws})(SelectedCompletionInfo||(SelectedCompletionInfo={}));var InlineCompletionContext;(function(Ws){function ws(oi,si){return{triggerKind:oi,selectedCompletionInfo:si}}Ws.create=ws})(InlineCompletionContext||(InlineCompletionContext={}));var WorkspaceFolder;(function(Ws){function ws(oi){const si=oi;return Is.objectLiteral(si)&&URI.is(si.uri)&&Is.string(si.name)}Ws.is=ws})(WorkspaceFolder||(WorkspaceFolder={}));var TextDocument;(function(Ws){function ws(ai,li,ci,ui){return new FullTextDocument(ai,li,ci,ui)}Ws.create=ws;function oi(ai){let li=ai;return!!(Is.defined(li)&&Is.string(li.uri)&&(Is.undefined(li.languageId)||Is.string(li.languageId))&&Is.uinteger(li.lineCount)&&Is.func(li.getText)&&Is.func(li.positionAt)&&Is.func(li.offsetAt))}Ws.is=oi;function si(ai,li){let ci=ai.getText(),ui=ii(li,(hi,pi)=>{let ha=hi.range.start.line-pi.range.start.line;return ha===0?hi.range.start.character-pi.range.start.character:ha}),di=ci.length;for(let hi=ui.length-1;hi>=0;hi--){let pi=ui[hi],ha=ai.offsetAt(pi.range.start),ga=ai.offsetAt(pi.range.end);if(ga<=di)ci=ci.substring(0,ha)+pi.newText+ci.substring(ga,ci.length);else throw new Error("Overlapping edit");di=ha}return ci}Ws.applyEdits=si;function ii(ai,li){if(ai.length<=1)return ai;const ci=ai.length/2|0,ui=ai.slice(0,ci),di=ai.slice(ci);ii(ui,li),ii(di,li);let hi=0,pi=0,ha=0;for(;hi<ui.length&&pi<di.length;)li(ui[hi],di[pi])<=0?ai[ha++]=ui[hi++]:ai[ha++]=di[pi++];for(;hi<ui.length;)ai[ha++]=ui[hi++];for(;pi<di.length;)ai[ha++]=di[pi++];return ai}})(TextDocument||(TextDocument={}));class FullTextDocument{constructor(ws,oi,si,ii){this._uri=ws,this._languageId=oi,this._version=si,this._content=ii,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(ws){if(ws){let oi=this.offsetAt(ws.start),si=this.offsetAt(ws.end);return this._content.substring(oi,si)}return this._content}update(ws,oi){this._content=ws.text,this._version=oi,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let ws=[],oi=this._content,si=!0;for(let ii=0;ii<oi.length;ii++){si&&(ws.push(ii),si=!1);let ai=oi.charAt(ii);si=ai==="\r"||ai===`
326
- `,ai==="\r"&&ii+1<oi.length&&oi.charAt(ii+1)===`
327
- `&&ii++}si&&oi.length>0&&ws.push(oi.length),this._lineOffsets=ws}return this._lineOffsets}positionAt(ws){ws=Math.max(Math.min(ws,this._content.length),0);let oi=this.getLineOffsets(),si=0,ii=oi.length;if(ii===0)return Position$2.create(0,ws);for(;si<ii;){let li=Math.floor((si+ii)/2);oi[li]>ws?ii=li:si=li+1}let ai=si-1;return Position$2.create(ai,ws-oi[ai])}offsetAt(ws){let oi=this.getLineOffsets();if(ws.line>=oi.length)return this._content.length;if(ws.line<0)return 0;let si=oi[ws.line],ii=ws.line+1<oi.length?oi[ws.line+1]:this._content.length;return Math.max(Math.min(si+ws.character,ii),si)}get lineCount(){return this.getLineOffsets().length}}var Is;(function(Ws){const ws=Object.prototype.toString;function oi(ga){return typeof ga<"u"}Ws.defined=oi;function si(ga){return typeof ga>"u"}Ws.undefined=si;function ii(ga){return ga===!0||ga===!1}Ws.boolean=ii;function ai(ga){return ws.call(ga)==="[object String]"}Ws.string=ai;function li(ga){return ws.call(ga)==="[object Number]"}Ws.number=li;function ci(ga,va,ba){return ws.call(ga)==="[object Number]"&&va<=ga&&ga<=ba}Ws.numberRange=ci;function ui(ga){return ws.call(ga)==="[object Number]"&&-2147483648<=ga&&ga<=2147483647}Ws.integer=ui;function di(ga){return ws.call(ga)==="[object Number]"&&0<=ga&&ga<=2147483647}Ws.uinteger=di;function hi(ga){return ws.call(ga)==="[object Function]"}Ws.func=hi;function pi(ga){return ga!==null&&typeof ga=="object"}Ws.objectLiteral=pi;function ha(ga,va){return Array.isArray(ga)&&ga.every(va)}Ws.typedArray=ha})(Is||(Is={}));class CharacterStream{constructor(ws){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{const oi=this._sourceText.charAt(this._pos);return this._pos++,oi},this.eat=oi=>{if(this._testNextCharacter(oi))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=oi=>{let si=this._testNextCharacter(oi),ii=!1;for(si&&(ii=si,this._start=this._pos);si;)this._pos++,si=this._testNextCharacter(oi),ii=!0;return ii},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=oi=>{this._pos=oi},this.match=(oi,si=!0,ii=!1)=>{let ai=null,li=null;return typeof oi=="string"?(li=new RegExp(oi,ii?"i":"g").test(this._sourceText.slice(this._pos,this._pos+oi.length)),ai=oi):oi instanceof RegExp&&(li=this._sourceText.slice(this._pos).match(oi),ai=li==null?void 0:li[0]),li!=null&&(typeof oi=="string"||li instanceof Array&&this._sourceText.startsWith(li[0],this._pos))?(si&&(this._start=this._pos,ai&&ai.length&&(this._pos+=ai.length)),li):!1},this.backUp=oi=>{this._pos-=oi},this.column=()=>this._pos,this.indentation=()=>{const oi=this._sourceText.match(/\s*/);let si=0;if(oi&&oi.length!==0){const ii=oi[0];let ai=0;for(;ii.length>ai;)ii.charCodeAt(ai)===9?si+=2:si++,ai++}return si},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=ws}_testNextCharacter(ws){const oi=this._sourceText.charAt(this._pos);let si=!1;return typeof ws=="string"?si=oi===ws:si=ws instanceof RegExp?ws.test(oi):ws(oi),si}}function opt(Ws){return{ofRule:Ws}}function list(Ws,ws){return{ofRule:Ws,isList:!0,separator:ws}}function butNot(Ws,ws){const oi=Ws.match;return Ws.match=si=>{let ii=!1;return oi&&(ii=oi(si)),ii&&ws.every(ai=>ai.match&&!ai.match(si))},Ws}function t(Ws,ws){return{style:ws,match:oi=>oi.kind===Ws}}function p(Ws,ws){return{style:ws||"punctuation",match:oi=>oi.kind==="Punctuation"&&oi.value===Ws}}const isIgnored=Ws=>Ws===" "||Ws===" "||Ws===","||Ws===`
328
- `||Ws==="\r"||Ws==="\uFEFF"||Ws===" ",LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},ParseRules={Document:[list("Definition")],Definition(Ws){switch(Ws.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[word("query"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Mutation:[word("mutation"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],Subscription:[word("subscription"),opt(name("def")),opt("VariableDefinitions"),list("Directive"),"SelectionSet"],VariableDefinitions:[p("("),list("VariableDefinition"),p(")")],VariableDefinition:["Variable",p(":"),"Type",opt("DefaultValue")],Variable:[p("$","variable"),name("variable")],DefaultValue:[p("="),"Value"],SelectionSet:[p("{"),list("Selection"),p("}")],Selection(Ws,ws){return Ws.value==="..."?ws.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":ws.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("property"),p(":"),name("qualifier"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Field:[name("property"),opt("Arguments"),list("Directive"),opt("SelectionSet")],Arguments:[p("("),list("Argument"),p(")")],Argument:[name("attribute"),p(":"),"Value"],FragmentSpread:[p("..."),name("def"),list("Directive")],InlineFragment:[p("..."),opt("TypeCondition"),list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),opt(butNot(name("def"),[word("on")])),"TypeCondition",list("Directive"),"SelectionSet"],TypeCondition:[word("on"),"NamedType"],Value(Ws){switch(Ws.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(Ws.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(Ws.value){case"true":case"false":return"BooleanValue"}return Ws.value==="null"?"NullValue":"EnumValue"}},NumberValue:[t("Number","number")],StringValue:[{style:"string",match:Ws=>Ws.kind==="String",update(Ws,ws){ws.value.startsWith('"""')&&(Ws.inBlockstring=!ws.value.slice(3).endsWith('"""'))}}],BooleanValue:[t("Name","builtin")],NullValue:[t("Name","keyword")],EnumValue:[name("string-2")],ListValue:[p("["),list("Value"),p("]")],ObjectValue:[p("{"),list("ObjectField"),p("}")],ObjectField:[name("attribute"),p(":"),"Value"],Type(Ws){return Ws.value==="["?"ListType":"NonNullType"},ListType:[p("["),"Type",p("]"),opt(p("!"))],NonNullType:["NamedType",opt(p("!"))],NamedType:[type("atom")],Directive:[p("@","meta"),name("meta"),opt("Arguments")],DirectiveDef:[word("directive"),p("@","meta"),name("meta"),opt("ArgumentsDef"),word("on"),list("DirectiveLocation",p("|"))],InterfaceDef:[word("interface"),name("atom"),opt("Implements"),list("Directive"),p("{"),list("FieldDef"),p("}")],Implements:[word("implements"),list("NamedType",p("&"))],DirectiveLocation:[name("string-2")],SchemaDef:[word("schema"),list("Directive"),p("{"),list("OperationTypeDef"),p("}")],OperationTypeDef:[name("keyword"),p(":"),name("atom")],ScalarDef:[word("scalar"),name("atom"),list("Directive")],ObjectTypeDef:[word("type"),name("atom"),opt("Implements"),list("Directive"),p("{"),list("FieldDef"),p("}")],FieldDef:[name("property"),opt("ArgumentsDef"),p(":"),"Type",list("Directive")],ArgumentsDef:[p("("),list("InputValueDef"),p(")")],InputValueDef:[name("attribute"),p(":"),"Type",opt("DefaultValue"),list("Directive")],UnionDef:[word("union"),name("atom"),list("Directive"),p("="),list("UnionMember",p("|"))],UnionMember:["NamedType"],EnumDef:[word("enum"),name("atom"),list("Directive"),p("{"),list("EnumValueDef"),p("}")],EnumValueDef:[name("string-2"),list("Directive")],InputDef:[word("input"),name("atom"),list("Directive"),p("{"),list("InputValueDef"),p("}")],ExtendDef:[word("extend"),"ExtensionDefinition"],ExtensionDefinition(Ws){switch(Ws.value){case"schema":return Kind.SCHEMA_EXTENSION;case"scalar":return Kind.SCALAR_TYPE_EXTENSION;case"type":return Kind.OBJECT_TYPE_EXTENSION;case"interface":return Kind.INTERFACE_TYPE_EXTENSION;case"union":return Kind.UNION_TYPE_EXTENSION;case"enum":return Kind.ENUM_TYPE_EXTENSION;case"input":return Kind.INPUT_OBJECT_TYPE_EXTENSION}},[Kind.SCHEMA_EXTENSION]:["SchemaDef"],[Kind.SCALAR_TYPE_EXTENSION]:["ScalarDef"],[Kind.OBJECT_TYPE_EXTENSION]:["ObjectTypeDef"],[Kind.INTERFACE_TYPE_EXTENSION]:["InterfaceDef"],[Kind.UNION_TYPE_EXTENSION]:["UnionDef"],[Kind.ENUM_TYPE_EXTENSION]:["EnumDef"],[Kind.INPUT_OBJECT_TYPE_EXTENSION]:["InputDef"]};function word(Ws){return{style:"keyword",match:ws=>ws.kind==="Name"&&ws.value===Ws}}function name(Ws){return{style:Ws,match:ws=>ws.kind==="Name",update(ws,oi){ws.name=oi.value}}}function type(Ws){return{style:Ws,match:ws=>ws.kind==="Name",update(ws,oi){var si;!((si=ws.prevState)===null||si===void 0)&&si.prevState&&(ws.name=oi.value,ws.prevState.prevState.type=oi.value)}}}function onlineParser(Ws={eatWhitespace:ws=>ws.eatWhile(isIgnored),lexRules:LexRules,parseRules:ParseRules,editorConfig:{}}){return{startState(){const ws={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return pushRule(Ws.parseRules,ws,Kind.DOCUMENT),ws},token(ws,oi){return getToken(ws,oi,Ws)}}}function getToken(Ws,ws,oi){var si;if(ws.inBlockstring)return Ws.match(/.*"""/)?(ws.inBlockstring=!1,"string"):(Ws.skipToEnd(),"string");const{lexRules:ii,parseRules:ai,eatWhitespace:li,editorConfig:ci}=oi;if(ws.rule&&ws.rule.length===0?popRule(ws):ws.needsAdvance&&(ws.needsAdvance=!1,advanceRule(ws,!0)),Ws.sol()){const hi=(ci==null?void 0:ci.tabSize)||2;ws.indentLevel=Math.floor(Ws.indentation()/hi)}if(li(Ws))return"ws";const ui=lex(ii,Ws);if(!ui)return Ws.match(/\S+/)||Ws.match(/\s/),pushRule(SpecialParseRules,ws,"Invalid"),"invalidchar";if(ui.kind==="Comment")return pushRule(SpecialParseRules,ws,"Comment"),"comment";const di=assign({},ws);if(ui.kind==="Punctuation"){if(/^[{([]/.test(ui.value))ws.indentLevel!==void 0&&(ws.levels=(ws.levels||[]).concat(ws.indentLevel+1));else if(/^[})\]]/.test(ui.value)){const hi=ws.levels=(ws.levels||[]).slice(0,-1);ws.indentLevel&&hi.length>0&&hi.at(-1)<ws.indentLevel&&(ws.indentLevel=hi.at(-1))}}for(;ws.rule;){let hi=typeof ws.rule=="function"?ws.step===0?ws.rule(ui,Ws):null:ws.rule[ws.step];if(ws.needsSeparator&&(hi=hi==null?void 0:hi.separator),hi){if(hi.ofRule&&(hi=hi.ofRule),typeof hi=="string"){pushRule(ai,ws,hi);continue}if(!((si=hi.match)===null||si===void 0)&&si.call(hi,ui))return hi.update&&hi.update(ws,ui),ui.kind==="Punctuation"?advanceRule(ws,!0):ws.needsAdvance=!0,hi.style}unsuccessful(ws)}return assign(ws,di),pushRule(SpecialParseRules,ws,"Invalid"),"invalidchar"}function assign(Ws,ws){const oi=Object.keys(ws);for(let si=0;si<oi.length;si++)Ws[oi[si]]=ws[oi[si]];return Ws}const SpecialParseRules={Invalid:[],Comment:[]};function pushRule(Ws,ws,oi){if(!Ws[oi])throw new TypeError("Unknown rule: "+oi);ws.prevState=Object.assign({},ws),ws.kind=oi,ws.name=null,ws.type=null,ws.rule=Ws[oi],ws.step=0,ws.needsSeparator=!1}function popRule(Ws){Ws.prevState&&(Ws.kind=Ws.prevState.kind,Ws.name=Ws.prevState.name,Ws.type=Ws.prevState.type,Ws.rule=Ws.prevState.rule,Ws.step=Ws.prevState.step,Ws.needsSeparator=Ws.prevState.needsSeparator,Ws.prevState=Ws.prevState.prevState)}function advanceRule(Ws,ws){var oi;if(isList(Ws)&&Ws.rule){const si=Ws.rule[Ws.step];if(si.separator){const{separator:ii}=si;if(Ws.needsSeparator=!Ws.needsSeparator,!Ws.needsSeparator&&ii.ofRule)return}if(ws)return}for(Ws.needsSeparator=!1,Ws.step++;Ws.rule&&!(Array.isArray(Ws.rule)&&Ws.step<Ws.rule.length);)popRule(Ws),Ws.rule&&(isList(Ws)?!((oi=Ws.rule)===null||oi===void 0)&&oi[Ws.step].separator&&(Ws.needsSeparator=!Ws.needsSeparator):(Ws.needsSeparator=!1,Ws.step++))}function isList(Ws){const ws=Array.isArray(Ws.rule)&&typeof Ws.rule[Ws.step]!="string"&&Ws.rule[Ws.step];return ws&&ws.isList}function unsuccessful(Ws){for(;Ws.rule&&!(Array.isArray(Ws.rule)&&Ws.rule[Ws.step].ofRule);)popRule(Ws);Ws.rule&&advanceRule(Ws,!1)}function lex(Ws,ws){const oi=Object.keys(Ws);for(let si=0;si<oi.length;si++){const ii=ws.match(Ws[oi[si]]);if(ii&&ii instanceof Array)return{kind:oi[si],value:ii[0]}}}function runOnlineParser(Ws,ws){const oi=Ws.split(`
329
- `),si=onlineParser();let ii=si.startState(),ai="",li=new CharacterStream("");for(let ci=0;ci<oi.length;ci++){for(li=new CharacterStream(oi[ci]);!li.eol()&&(ai=si.token(li,ii),ws(li,ii,ai,ci)!=="BREAK"););ws(li,ii,ai,ci),ii.kind||(ii=si.startState())}return{start:li.getStartOfToken(),end:li.getCurrentPosition(),string:li.current(),state:ii,style:ai}}var GraphQLDocumentMode;(function(Ws){Ws.TYPE_SYSTEM="TYPE_SYSTEM",Ws.EXECUTABLE="EXECUTABLE",Ws.UNKNOWN="UNKNOWN"})(GraphQLDocumentMode||(GraphQLDocumentMode={}));const TYPE_SYSTEM_KINDS=[Kind.SCHEMA_DEFINITION,Kind.OPERATION_TYPE_DEFINITION,Kind.SCALAR_TYPE_DEFINITION,Kind.OBJECT_TYPE_DEFINITION,Kind.INTERFACE_TYPE_DEFINITION,Kind.UNION_TYPE_DEFINITION,Kind.ENUM_TYPE_DEFINITION,Kind.INPUT_OBJECT_TYPE_DEFINITION,Kind.DIRECTIVE_DEFINITION,Kind.SCHEMA_EXTENSION,Kind.SCALAR_TYPE_EXTENSION,Kind.OBJECT_TYPE_EXTENSION,Kind.INTERFACE_TYPE_EXTENSION,Kind.UNION_TYPE_EXTENSION,Kind.ENUM_TYPE_EXTENSION,Kind.INPUT_OBJECT_TYPE_EXTENSION],getParsedMode=Ws=>{let ws=GraphQLDocumentMode.UNKNOWN;if(Ws)try{visit(parse(Ws),{enter(oi){if(oi.kind==="Document"){ws=GraphQLDocumentMode.EXECUTABLE;return}return TYPE_SYSTEM_KINDS.includes(oi.kind)?(ws=GraphQLDocumentMode.TYPE_SYSTEM,BREAK):!1}})}catch{return ws}return ws};function getDocumentMode(Ws,ws){return ws!=null&&ws.endsWith(".graphqls")?GraphQLDocumentMode.TYPE_SYSTEM:getParsedMode(Ws)}function getTokenAtPosition(Ws,ws,oi=0){let si=null,ii=null,ai=null;const li=runOnlineParser(Ws,(ci,ui,di,hi)=>{if(!(hi!==ws.line||ci.getCurrentPosition()+oi<ws.character+1))return si=di,ii=Object.assign({},ui),ai=ci.current(),"BREAK"});return{start:li.start,end:li.end,string:ai||li.string,state:ii||li.state,style:si||li.style}}function getContextAtPosition(Ws,ws,oi,si,ii){const ai=getTokenAtPosition(Ws,ws,1);if(!ai)return null;const li=ai.state.kind==="Invalid"?ai.state.prevState:ai.state;if(!li)return null;const ci=getTypeInfo(oi,ai.state),ui=(ii==null?void 0:ii.mode)||getDocumentMode(Ws,ii==null?void 0:ii.uri);return{token:ai,state:li,typeInfo:ci,mode:ui}}function getFieldDef(Ws,ws,oi){return oi===SchemaMetaFieldDef.name&&Ws.getQueryType()===ws?SchemaMetaFieldDef:oi===TypeMetaFieldDef.name&&Ws.getQueryType()===ws?TypeMetaFieldDef:oi===TypeNameMetaFieldDef.name&&isCompositeType(ws)?TypeNameMetaFieldDef:"getFields"in ws?ws.getFields()[oi]:null}function forEachState(Ws,ws){const oi=[];let si=Ws;for(;si!=null&&si.kind;)oi.push(si),si=si.prevState;for(let ii=oi.length-1;ii>=0;ii--)ws(oi[ii])}function getDefinitionState(Ws){let ws;return forEachState(Ws,oi=>{switch(oi.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":ws=oi;break}}),ws}function getTypeInfo(Ws,ws){let oi,si,ii,ai,li,ci,ui,di,hi,pi,ha;return forEachState(ws,ga=>{var va;switch(ga.kind){case RuleKinds.QUERY:case"ShortQuery":pi=Ws.getQueryType();break;case RuleKinds.MUTATION:pi=Ws.getMutationType();break;case RuleKinds.SUBSCRIPTION:pi=Ws.getSubscriptionType();break;case RuleKinds.INLINE_FRAGMENT:case RuleKinds.FRAGMENT_DEFINITION:ga.type&&(pi=Ws.getType(ga.type));break;case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:{!pi||!ga.name?li=null:(li=hi?getFieldDef(Ws,hi,ga.name):null,pi=li?li.type:null);break}case RuleKinds.SELECTION_SET:hi=getNamedType(pi);break;case RuleKinds.DIRECTIVE:ii=ga.name?Ws.getDirective(ga.name):null;break;case RuleKinds.INTERFACE_DEF:ga.name&&(ui=null,ha=new GraphQLInterfaceType({name:ga.name,interfaces:[],fields:{}}));break;case RuleKinds.OBJECT_TYPE_DEF:ga.name&&(ha=null,ui=new GraphQLObjectType({name:ga.name,interfaces:[],fields:{}}));break;case RuleKinds.ARGUMENTS:{if(ga.prevState)switch(ga.prevState.kind){case RuleKinds.FIELD:si=li&&li.args;break;case RuleKinds.DIRECTIVE:si=ii&&ii.args;break;case RuleKinds.ALIASED_FIELD:{const el=(va=ga.prevState)===null||va===void 0?void 0:va.name;if(!el){si=null;break}const ku=hi?getFieldDef(Ws,hi,el):null;if(!ku){si=null;break}si=ku.args;break}default:si=null;break}else si=null;break}case RuleKinds.ARGUMENT:if(si){for(let el=0;el<si.length;el++)if(si[el].name===ga.name){oi=si[el];break}}ci=oi==null?void 0:oi.type;break;case RuleKinds.VARIABLE_DEFINITION:case RuleKinds.VARIABLE:pi=ci;break;case RuleKinds.ENUM_VALUE:const ba=getNamedType(ci);ai=ba instanceof GraphQLEnumType?ba.getValues().find(el=>el.value===ga.name):null;break;case RuleKinds.LIST_VALUE:const wa=getNullableType(ci);ci=wa instanceof GraphQLList?wa.ofType:null;break;case RuleKinds.OBJECT_VALUE:const xa=getNamedType(ci);di=xa instanceof GraphQLInputObjectType?xa.getFields():null;break;case RuleKinds.OBJECT_FIELD:const Ca=ga.name&&di?di[ga.name]:null;ci=Ca==null?void 0:Ca.type,li=Ca,pi=li?li.type:null;break;case RuleKinds.NAMED_TYPE:ga.name&&(pi=Ws.getType(ga.name));break}}),{argDef:oi,argDefs:si,directiveDef:ii,enumValue:ai,fieldDef:li,inputType:ci,objectFieldDefs:di,parentType:hi,type:pi,interfaceDef:ha,objectTypeDef:ui}}const AdditionalRuleKinds={ALIASED_FIELD:"AliasedField",ARGUMENTS:"Arguments",SHORT_QUERY:"ShortQuery",QUERY:"Query",MUTATION:"Mutation",SUBSCRIPTION:"Subscription",TYPE_CONDITION:"TypeCondition",INVALID:"Invalid",COMMENT:"Comment",SCHEMA_DEF:"SchemaDef",SCALAR_DEF:"ScalarDef",OBJECT_TYPE_DEF:"ObjectTypeDef",OBJECT_VALUE:"ObjectValue",LIST_VALUE:"ListValue",INTERFACE_DEF:"InterfaceDef",UNION_DEF:"UnionDef",ENUM_DEF:"EnumDef",ENUM_VALUE:"EnumValue",FIELD_DEF:"FieldDef",INPUT_DEF:"InputDef",INPUT_VALUE_DEF:"InputValueDef",ARGUMENTS_DEF:"ArgumentsDef",EXTEND_DEF:"ExtendDef",EXTENSION_DEFINITION:"ExtensionDefinition",DIRECTIVE_DEF:"DirectiveDef",IMPLEMENTS:"Implements",VARIABLE_DEFINITIONS:"VariableDefinitions",TYPE:"Type",VARIABLE:"Variable"},RuleKinds=Object.assign(Object.assign({},Kind),AdditionalRuleKinds);var CompletionItemKind;(function(Ws){Ws.Text=1,Ws.Method=2,Ws.Function=3,Ws.Constructor=4,Ws.Field=5,Ws.Variable=6,Ws.Class=7,Ws.Interface=8,Ws.Module=9,Ws.Property=10,Ws.Unit=11,Ws.Value=12,Ws.Enum=13,Ws.Keyword=14,Ws.Snippet=15,Ws.Color=16,Ws.File=17,Ws.Reference=18,Ws.Folder=19,Ws.EnumMember=20,Ws.Constant=21,Ws.Struct=22,Ws.Event=23,Ws.Operator=24,Ws.TypeParameter=25})(CompletionItemKind||(CompletionItemKind={}));const SuggestionCommand={command:"editor.action.triggerSuggest",title:"Suggestions"},collectFragmentDefs=Ws=>[];function getAutocompleteSuggestions(Ws,ws,oi,si,ii,ai){var li;const ci=Object.assign(Object.assign({},ai),{schema:Ws}),ui=getContextAtPosition(ws,oi,Ws,si,ai);if(!ui)return[];const{state:di,typeInfo:hi,mode:pi,token:ha}=ui,{kind:ga,step:va,prevState:ba}=di;if(ga===RuleKinds.DOCUMENT)return pi===GraphQLDocumentMode.TYPE_SYSTEM?getSuggestionsForTypeSystemDefinitions(ha):pi===GraphQLDocumentMode.EXECUTABLE?getSuggestionsForExecutableDefinitions(ha):getSuggestionsForUnknownDocumentMode(ha);if(ga===RuleKinds.EXTEND_DEF)return getSuggestionsForExtensionDefinitions(ha);if(((li=ba==null?void 0:ba.prevState)===null||li===void 0?void 0:li.kind)===RuleKinds.EXTENSION_DEFINITION&&di.name)return hintList(ha,[]);if((ba==null?void 0:ba.kind)===Kind.SCALAR_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(isScalarType).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if((ba==null?void 0:ba.kind)===Kind.OBJECT_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(xa=>isObjectType(xa)&&!xa.name.startsWith("__")).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if((ba==null?void 0:ba.kind)===Kind.INTERFACE_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(isInterfaceType).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if((ba==null?void 0:ba.kind)===Kind.UNION_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(isUnionType).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if((ba==null?void 0:ba.kind)===Kind.ENUM_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(xa=>isEnumType(xa)&&!xa.name.startsWith("__")).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if((ba==null?void 0:ba.kind)===Kind.INPUT_OBJECT_TYPE_EXTENSION)return hintList(ha,Object.values(Ws.getTypeMap()).filter(isInputObjectType).map(xa=>({label:xa.name,kind:CompletionItemKind.Function})));if(ga===RuleKinds.IMPLEMENTS||ga===RuleKinds.NAMED_TYPE&&(ba==null?void 0:ba.kind)===RuleKinds.IMPLEMENTS)return getSuggestionsForImplements(ha,di,Ws,ws,hi);if(ga===RuleKinds.SELECTION_SET||ga===RuleKinds.FIELD||ga===RuleKinds.ALIASED_FIELD)return getSuggestionsForFieldNames(ha,hi,ci);if(ga===RuleKinds.ARGUMENTS||ga===RuleKinds.ARGUMENT&&va===0){const{argDefs:xa}=hi;if(xa)return hintList(ha,xa.map(Ca=>{var el;return{label:Ca.name,insertText:getInputInsertText(Ca.name+": ",Ca.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand,labelDetails:{detail:" "+String(Ca.type)},documentation:(el=Ca.description)!==null&&el!==void 0?el:void 0,kind:CompletionItemKind.Variable,type:Ca.type}}))}if((ga===RuleKinds.OBJECT_VALUE||ga===RuleKinds.OBJECT_FIELD&&va===0)&&hi.objectFieldDefs){const xa=objectValues(hi.objectFieldDefs),Ca=ga===RuleKinds.OBJECT_VALUE?CompletionItemKind.Value:CompletionItemKind.Field;return hintList(ha,xa.map(el=>{var ku;return{label:el.name,detail:String(el.type),documentation:(ku=el==null?void 0:el.description)!==null&&ku!==void 0?ku:void 0,kind:Ca,type:el.type,insertText:getInputInsertText(el.name+": ",el.type),insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet,command:SuggestionCommand}}))}if(ga===RuleKinds.ENUM_VALUE||ga===RuleKinds.LIST_VALUE&&va===1||ga===RuleKinds.OBJECT_FIELD&&va===2||ga===RuleKinds.ARGUMENT&&va===2)return getSuggestionsForInputValues(ha,hi,ws,Ws);if(ga===RuleKinds.VARIABLE&&va===1){const xa=getNamedType(hi.inputType),Ca=getVariableCompletions(ws,Ws,ha);return hintList(ha,Ca.filter(el=>el.detail===(xa==null?void 0:xa.name)))}if(ga===RuleKinds.TYPE_CONDITION&&va===1||ga===RuleKinds.NAMED_TYPE&&ba!=null&&ba.kind===RuleKinds.TYPE_CONDITION)return getSuggestionsForFragmentTypeConditions(ha,hi,Ws);if(ga===RuleKinds.FRAGMENT_SPREAD&&va===1)return getSuggestionsForFragmentSpread(ha,hi,Ws,ws,Array.isArray(ii)?ii:collectFragmentDefs());const wa=unwrapType(di);return wa.kind===RuleKinds.FIELD_DEF?hintList(ha,Object.values(Ws.getTypeMap()).filter(xa=>isOutputType(xa)&&!xa.name.startsWith("__")).map(xa=>({label:xa.name,kind:CompletionItemKind.Function,insertText:ai!=null&&ai.fillLeafsOnComplete?xa.name+`
330
- `:xa.name,insertTextMode:InsertTextMode.adjustIndentation}))):wa.kind===RuleKinds.INPUT_VALUE_DEF&&va===2?hintList(ha,Object.values(Ws.getTypeMap()).filter(xa=>isInputType(xa)&&!xa.name.startsWith("__")).map(xa=>({label:xa.name,kind:CompletionItemKind.Function,insertText:ai!=null&&ai.fillLeafsOnComplete?xa.name+`
331
- $1`:xa.name,insertTextMode:InsertTextMode.adjustIndentation,insertTextFormat:InsertTextFormat.Snippet}))):ga===RuleKinds.VARIABLE_DEFINITION&&va===2||ga===RuleKinds.LIST_TYPE&&va===1||ga===RuleKinds.NAMED_TYPE&&ba&&(ba.kind===RuleKinds.VARIABLE_DEFINITION||ba.kind===RuleKinds.LIST_TYPE||ba.kind===RuleKinds.NON_NULL_TYPE)?getSuggestionsForVariableDefinition(ha,Ws):ga===RuleKinds.DIRECTIVE?getSuggestionsForDirective(ha,di,Ws):ga===RuleKinds.DIRECTIVE_DEF?getSuggestionsForDirectiveArguments(ha,di,Ws):[]}const typeSystemCompletionItems=[{label:"type",kind:CompletionItemKind.Function},{label:"interface",kind:CompletionItemKind.Function},{label:"union",kind:CompletionItemKind.Function},{label:"input",kind:CompletionItemKind.Function},{label:"scalar",kind:CompletionItemKind.Function},{label:"schema",kind:CompletionItemKind.Function}],executableCompletionItems=[{label:"query",kind:CompletionItemKind.Function},{label:"mutation",kind:CompletionItemKind.Function},{label:"subscription",kind:CompletionItemKind.Function},{label:"fragment",kind:CompletionItemKind.Function},{label:"{",kind:CompletionItemKind.Constructor}];function getSuggestionsForTypeSystemDefinitions(Ws){return hintList(Ws,[{label:"extend",kind:CompletionItemKind.Function},...typeSystemCompletionItems])}function getSuggestionsForExecutableDefinitions(Ws){return hintList(Ws,executableCompletionItems)}function getSuggestionsForUnknownDocumentMode(Ws){return hintList(Ws,[{label:"extend",kind:CompletionItemKind.Function},...executableCompletionItems,...typeSystemCompletionItems])}function getSuggestionsForExtensionDefinitions(Ws){return hintList(Ws,typeSystemCompletionItems)}function getSuggestionsForFieldNames(Ws,ws,oi){var si;if(ws.parentType){const{parentType:ii}=ws;let ai=[];return"getFields"in ii&&(ai=objectValues(ii.getFields())),isCompositeType(ii)&&ai.push(TypeNameMetaFieldDef),ii===((si=oi==null?void 0:oi.schema)===null||si===void 0?void 0:si.getQueryType())&&ai.push(SchemaMetaFieldDef,TypeMetaFieldDef),hintList(Ws,ai.map((li,ci)=>{var ui;const di={sortText:String(ci)+li.name,label:li.name,detail:String(li.type),documentation:(ui=li.description)!==null&&ui!==void 0?ui:void 0,deprecated:!!li.deprecationReason,isDeprecated:!!li.deprecationReason,deprecationReason:li.deprecationReason,kind:CompletionItemKind.Field,labelDetails:{detail:" "+li.type.toString()},type:li.type};return oi!=null&&oi.fillLeafsOnComplete&&(di.insertText=getFieldInsertText(li),di.insertText||(di.insertText=getInsertText(li.name,li.type,li.name+(Ws.state.needsAdvance?"":`
332
- `))),di.insertText&&(di.insertTextFormat=InsertTextFormat.Snippet,di.insertTextMode=InsertTextMode.adjustIndentation,di.command=SuggestionCommand)),di}))}return[]}function getSuggestionsForInputValues(Ws,ws,oi,si){const ii=getNamedType(ws.inputType),ai=getVariableCompletions(oi,si,Ws).filter(li=>li.detail===(ii==null?void 0:ii.name));if(ii instanceof GraphQLEnumType){const li=ii.getValues();return hintList(Ws,li.map(ci=>{var ui;return{label:ci.name,detail:String(ii),documentation:(ui=ci.description)!==null&&ui!==void 0?ui:void 0,deprecated:!!ci.deprecationReason,isDeprecated:!!ci.deprecationReason,deprecationReason:ci.deprecationReason,kind:CompletionItemKind.EnumMember,type:ii}}).concat(ai))}return ii===GraphQLBoolean?hintList(Ws,ai.concat([{label:"true",detail:String(GraphQLBoolean),documentation:"Not false.",kind:CompletionItemKind.Variable,type:GraphQLBoolean},{label:"false",detail:String(GraphQLBoolean),documentation:"Not true.",kind:CompletionItemKind.Variable,type:GraphQLBoolean}])):ai}function getSuggestionsForImplements(Ws,ws,oi,si,ii){if(ws.needsSeparator)return[];const ai=oi.getTypeMap(),li=objectValues(ai).filter(isInterfaceType),ci=li.map(({name:ha})=>ha),ui=new Set;runOnlineParser(si,(ha,ga)=>{var va,ba,wa,xa,Ca;if(ga.name&&(ga.kind===RuleKinds.INTERFACE_DEF&&!ci.includes(ga.name)&&ui.add(ga.name),ga.kind===RuleKinds.NAMED_TYPE&&((va=ga.prevState)===null||va===void 0?void 0:va.kind)===RuleKinds.IMPLEMENTS)){if(ii.interfaceDef){if(!((ba=ii.interfaceDef)===null||ba===void 0)&&ba.getInterfaces().find(({name:gd})=>gd===ga.name))return;const el=oi.getType(ga.name),ku=(wa=ii.interfaceDef)===null||wa===void 0?void 0:wa.toConfig();ii.interfaceDef=new GraphQLInterfaceType(Object.assign(Object.assign({},ku),{interfaces:[...ku.interfaces,el||new GraphQLInterfaceType({name:ga.name,fields:{}})]}))}else if(ii.objectTypeDef){if(!((xa=ii.objectTypeDef)===null||xa===void 0)&&xa.getInterfaces().find(({name:gd})=>gd===ga.name))return;const el=oi.getType(ga.name),ku=(Ca=ii.objectTypeDef)===null||Ca===void 0?void 0:Ca.toConfig();ii.objectTypeDef=new GraphQLObjectType(Object.assign(Object.assign({},ku),{interfaces:[...ku.interfaces,el||new GraphQLInterfaceType({name:ga.name,fields:{}})]}))}}});const di=ii.interfaceDef||ii.objectTypeDef,hi=((di==null?void 0:di.getInterfaces())||[]).map(({name:ha})=>ha),pi=li.concat([...ui].map(ha=>({name:ha}))).filter(({name:ha})=>ha!==(di==null?void 0:di.name)&&!hi.includes(ha));return hintList(Ws,pi.map(ha=>{const ga={label:ha.name,kind:CompletionItemKind.Interface,type:ha};return ha!=null&&ha.description&&(ga.documentation=ha.description),ga}))}function getSuggestionsForFragmentTypeConditions(Ws,ws,oi,si){let ii;if(ws.parentType)if(isAbstractType(ws.parentType)){const ai=assertAbstractType(ws.parentType),li=oi.getPossibleTypes(ai),ci=Object.create(null);for(const ui of li)for(const di of ui.getInterfaces())ci[di.name]=di;ii=li.concat(objectValues(ci))}else ii=[ws.parentType];else{const ai=oi.getTypeMap();ii=objectValues(ai).filter(li=>isCompositeType(li)&&!li.name.startsWith("__"))}return hintList(Ws,ii.map(ai=>{const li=getNamedType(ai);return{label:String(ai),documentation:(li==null?void 0:li.description)||"",kind:CompletionItemKind.Field}}))}function getSuggestionsForFragmentSpread(Ws,ws,oi,si,ii){if(!si)return[];const ai=oi.getTypeMap(),li=getDefinitionState(Ws.state),ci=getFragmentDefinitions(si);ii&&ii.length>0&&ci.push(...ii);const ui=ci.filter(di=>ai[di.typeCondition.name.value]&&!(li&&li.kind===RuleKinds.FRAGMENT_DEFINITION&&li.name===di.name.value)&&isCompositeType(ws.parentType)&&isCompositeType(ai[di.typeCondition.name.value])&&doTypesOverlap(oi,ws.parentType,ai[di.typeCondition.name.value]));return hintList(Ws,ui.map(di=>({label:di.name.value,detail:String(ai[di.typeCondition.name.value]),documentation:`fragment ${di.name.value} on ${di.typeCondition.name.value}`,labelDetails:{detail:`fragment ${di.name.value} on ${di.typeCondition.name.value}`},kind:CompletionItemKind.Field,type:ai[di.typeCondition.name.value]})))}const getParentDefinition=(Ws,ws)=>{var oi,si,ii,ai,li,ci,ui,di,hi,pi;if(((oi=Ws.prevState)===null||oi===void 0?void 0:oi.kind)===ws)return Ws.prevState;if(((ii=(si=Ws.prevState)===null||si===void 0?void 0:si.prevState)===null||ii===void 0?void 0:ii.kind)===ws)return Ws.prevState.prevState;if(((ci=(li=(ai=Ws.prevState)===null||ai===void 0?void 0:ai.prevState)===null||li===void 0?void 0:li.prevState)===null||ci===void 0?void 0:ci.kind)===ws)return Ws.prevState.prevState.prevState;if(((pi=(hi=(di=(ui=Ws.prevState)===null||ui===void 0?void 0:ui.prevState)===null||di===void 0?void 0:di.prevState)===null||hi===void 0?void 0:hi.prevState)===null||pi===void 0?void 0:pi.kind)===ws)return Ws.prevState.prevState.prevState.prevState};function getVariableCompletions(Ws,ws,oi){let si=null,ii;const ai=Object.create({});return runOnlineParser(Ws,(li,ci)=>{var ui;if((ci==null?void 0:ci.kind)===RuleKinds.VARIABLE&&ci.name&&(si=ci.name),(ci==null?void 0:ci.kind)===RuleKinds.NAMED_TYPE&&si){const di=getParentDefinition(ci,RuleKinds.TYPE);di!=null&&di.type&&(ii=ws.getType(di==null?void 0:di.type))}if(si&&ii&&!ai[si]){const di=oi.string==="$"||((ui=oi==null?void 0:oi.state)===null||ui===void 0?void 0:ui.kind)==="Variable"?si:"$"+si;ai[si]={detail:ii.toString(),insertText:di,label:"$"+si,rawInsert:di,type:ii,kind:CompletionItemKind.Variable},si=null,ii=null}}),objectValues(ai)}function getFragmentDefinitions(Ws){const ws=[];return runOnlineParser(Ws,(oi,si)=>{si.kind===RuleKinds.FRAGMENT_DEFINITION&&si.name&&si.type&&ws.push({kind:RuleKinds.FRAGMENT_DEFINITION,name:{kind:Kind.NAME,value:si.name},selectionSet:{kind:RuleKinds.SELECTION_SET,selections:[]},typeCondition:{kind:RuleKinds.NAMED_TYPE,name:{kind:Kind.NAME,value:si.type}}})}),ws}function getSuggestionsForVariableDefinition(Ws,ws,oi){const si=ws.getTypeMap(),ii=objectValues(si).filter(isInputType);return hintList(Ws,ii.map(ai=>({label:ai.name,documentation:(ai==null?void 0:ai.description)||"",kind:CompletionItemKind.Variable})))}function getSuggestionsForDirective(Ws,ws,oi,si){var ii;if(!((ii=ws.prevState)===null||ii===void 0)&&ii.kind){const ai=oi.getDirectives().filter(li=>canUseDirective(ws.prevState,li));return hintList(Ws,ai.map(li=>({label:li.name,documentation:(li==null?void 0:li.description)||"",kind:CompletionItemKind.Function})))}return[]}function getSuggestionsForDirectiveArguments(Ws,ws,oi,si){const ii=oi.getDirectives().find(ai=>ai.name===ws.name);return hintList(Ws,(ii==null?void 0:ii.args.map(ai=>({label:ai.name,documentation:ai.description||"",kind:CompletionItemKind.Field})))||[])}function canUseDirective(Ws,ws){if(!(Ws!=null&&Ws.kind))return!1;const{kind:oi,prevState:si}=Ws,{locations:ii}=ws;switch(oi){case RuleKinds.QUERY:return ii.includes(DirectiveLocation.QUERY);case RuleKinds.MUTATION:return ii.includes(DirectiveLocation.MUTATION);case RuleKinds.SUBSCRIPTION:return ii.includes(DirectiveLocation.SUBSCRIPTION);case RuleKinds.FIELD:case RuleKinds.ALIASED_FIELD:return ii.includes(DirectiveLocation.FIELD);case RuleKinds.FRAGMENT_DEFINITION:return ii.includes(DirectiveLocation.FRAGMENT_DEFINITION);case RuleKinds.FRAGMENT_SPREAD:return ii.includes(DirectiveLocation.FRAGMENT_SPREAD);case RuleKinds.INLINE_FRAGMENT:return ii.includes(DirectiveLocation.INLINE_FRAGMENT);case RuleKinds.SCHEMA_DEF:return ii.includes(DirectiveLocation.SCHEMA);case RuleKinds.SCALAR_DEF:return ii.includes(DirectiveLocation.SCALAR);case RuleKinds.OBJECT_TYPE_DEF:return ii.includes(DirectiveLocation.OBJECT);case RuleKinds.FIELD_DEF:return ii.includes(DirectiveLocation.FIELD_DEFINITION);case RuleKinds.INTERFACE_DEF:return ii.includes(DirectiveLocation.INTERFACE);case RuleKinds.UNION_DEF:return ii.includes(DirectiveLocation.UNION);case RuleKinds.ENUM_DEF:return ii.includes(DirectiveLocation.ENUM);case RuleKinds.ENUM_VALUE:return ii.includes(DirectiveLocation.ENUM_VALUE);case RuleKinds.INPUT_DEF:return ii.includes(DirectiveLocation.INPUT_OBJECT);case RuleKinds.INPUT_VALUE_DEF:switch(si==null?void 0:si.kind){case RuleKinds.ARGUMENTS_DEF:return ii.includes(DirectiveLocation.ARGUMENT_DEFINITION);case RuleKinds.INPUT_DEF:return ii.includes(DirectiveLocation.INPUT_FIELD_DEFINITION)}}return!1}function unwrapType(Ws){return Ws.prevState&&Ws.kind&&[RuleKinds.NAMED_TYPE,RuleKinds.LIST_TYPE,RuleKinds.TYPE,RuleKinds.NON_NULL_TYPE].includes(Ws.kind)?unwrapType(Ws.prevState):Ws}var nullthrows={exports:{}},hasRequiredNullthrows;function requireNullthrows(){if(hasRequiredNullthrows)return nullthrows.exports;hasRequiredNullthrows=1;function Ws(ws,oi){if(ws!=null)return ws;var si=new Error(oi!==void 0?oi:"Got unexpected "+ws);throw si.framesToPop=1,si}return nullthrows.exports=Ws,nullthrows.exports.default=Ws,Object.defineProperty(nullthrows.exports,"__esModule",{value:!0}),nullthrows.exports}requireNullthrows();class Range{constructor(ws,oi){this.containsPosition=si=>this.start.line===si.line?this.start.character<=si.character:this.end.line===si.line?this.end.character>=si.character:this.start.line<=si.line&&this.end.line>=si.line,this.start=ws,this.end=oi}setStart(ws,oi){this.start=new Position$1(ws,oi)}setEnd(ws,oi){this.end=new Position$1(ws,oi)}}let Position$1=class{constructor(Ws,ws){this.lessThanOrEqualTo=oi=>this.line<oi.line||this.line===oi.line&&this.character<=oi.character,this.line=Ws,this.character=ws}setLine(Ws){this.line=Ws}setCharacter(Ws){this.character=Ws}};function validateWithCustomRules(Ws,ws,oi,si,ii){const ai=specifiedRules.filter(li=>!(li===NoUnusedFragmentsRule||li===ExecutableDefinitionsRule));return validate(Ws,ws,ai).filter(li=>{if(li.message.includes("Unknown directive")&&li.nodes){const ci=li.nodes[0];if(ci&&ci.kind===Kind.DIRECTIVE){const ui=ci.name.value;if(ui==="arguments"||ui==="argumentDefinitions")return!1}}return!0})}const SEVERITY$1={Error:"Error",Warning:"Warning",Information:"Information",Hint:"Hint"},DIAGNOSTIC_SEVERITY={[SEVERITY$1.Error]:1,[SEVERITY$1.Warning]:2,[SEVERITY$1.Information]:3,[SEVERITY$1.Hint]:4},invariant=(Ws,ws)=>{if(!Ws)throw new Error(ws)};function getDiagnostics(Ws,ws=null,oi,si,ii){var ai,li;let ci=null;const ui=Ws;try{ci=parse(ui)}catch(di){if(di instanceof GraphQLError){const hi=getRange((li=(ai=di.locations)===null||ai===void 0?void 0:ai[0])!==null&&li!==void 0?li:{line:0,column:0},ui);return[{severity:DIAGNOSTIC_SEVERITY.Error,message:di.message,source:"GraphQL: Syntax",range:hi}]}throw di}return validateQuery(ci,ws)}function validateQuery(Ws,ws=null,oi,si){if(!ws)return[];const ii=validateWithCustomRules(ws,Ws).flatMap(li=>annotations(li,DIAGNOSTIC_SEVERITY.Error,"Validation")),ai=validate(ws,Ws,[NoDeprecatedCustomRule]).flatMap(li=>annotations(li,DIAGNOSTIC_SEVERITY.Warning,"Deprecation"));return ii.concat(ai)}function annotations(Ws,ws,oi){if(!Ws.nodes)return[];const si=[];for(const[ii,ai]of Ws.nodes.entries()){const li=ai.kind!=="Variable"&&"name"in ai&&ai.name!==void 0?ai.name:"variable"in ai&&ai.variable!==void 0?ai.variable:ai;if(li){invariant(Ws.locations,"GraphQL validation error requires locations.");const ci=Ws.locations[ii],ui=getLocation(li),di=ci.column+(ui.end-ui.start);si.push({source:`GraphQL: ${oi}`,message:Ws.message,severity:ws,range:new Range(new Position$1(ci.line-1,ci.column-1),new Position$1(ci.line-1,di))})}}return si}function getRange(Ws,ws){const oi=onlineParser(),si=oi.startState(),ii=ws.split(`
333
- `);invariant(ii.length>=Ws.line,"Query text must have more lines than where the error happened");let ai=null;for(let di=0;di<Ws.line;di++)for(ai=new CharacterStream(ii[di]);!ai.eol()&&oi.token(ai,si)!=="invalidchar";);invariant(ai,"Expected Parser stream to be available.");const li=Ws.line-1,ci=ai.getStartOfToken(),ui=ai.getCurrentPosition();return new Range(new Position$1(li,ci),new Position$1(li,ui))}function getLocation(Ws){const ws=Ws.loc;return invariant(ws,"Expected ASTNode to have a location."),ws}class Stack{constructor(ws,oi,si,ii,ai,li,ci,ui,di,hi=0,pi){this.p=ws,this.stack=oi,this.state=si,this.reducePos=ii,this.pos=ai,this.score=li,this.buffer=ci,this.bufferBase=ui,this.curContext=di,this.lookAhead=hi,this.parent=pi}toString(){return`[${this.stack.filter((ws,oi)=>oi%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(ws,oi,si=0){let ii=ws.parser.context;return new Stack(ws,[],oi,si,si,0,[],0,ii?new StackContext(ii,ii.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(ws,oi){this.stack.push(this.state,oi,this.bufferBase+this.buffer.length),this.state=ws}reduce(ws){var oi;let si=ws>>19,ii=ws&65535,{parser:ai}=this.p,li=this.reducePos<this.pos-25;li&&this.setLookAhead(this.pos);let ci=ai.dynamicPrecedence(ii);if(ci&&(this.score+=ci),si==0){this.pushState(ai.getGoto(this.state,ii,!0),this.reducePos),ii<ai.minRepeatTerm&&this.storeNode(ii,this.reducePos,this.reducePos,li?8:4,!0),this.reduceContext(ii,this.reducePos);return}let ui=this.stack.length-(si-1)*3-(ws&262144?6:0),di=ui?this.stack[ui-2]:this.p.ranges[0].from,hi=this.reducePos-di;hi>=2e3&&!(!((oi=this.p.parser.nodeSet.types[ii])===null||oi===void 0)&&oi.isAnonymous)&&(di==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=hi):this.p.lastBigReductionSize<hi&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=di,this.p.lastBigReductionSize=hi));let pi=ui?this.stack[ui-1]:0,ha=this.bufferBase+this.buffer.length-pi;if(ii<ai.minRepeatTerm||ws&131072){let ga=ai.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(ii,di,ga,ha+4,!0)}if(ws&262144)this.state=this.stack[ui];else{let ga=this.stack[ui-3];this.state=ai.getGoto(ga,ii,!0)}for(;this.stack.length>ui;)this.stack.pop();this.reduceContext(ii,di)}storeNode(ws,oi,si,ii=4,ai=!1){if(ws==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let li=this,ci=this.buffer.length;if(ci==0&&li.parent&&(ci=li.bufferBase-li.parent.bufferBase,li=li.parent),ci>0&&li.buffer[ci-4]==0&&li.buffer[ci-1]>-1){if(oi==si)return;if(li.buffer[ci-2]>=oi){li.buffer[ci-2]=si;return}}}if(!ai||this.pos==si)this.buffer.push(ws,oi,si,ii);else{let li=this.buffer.length;if(li>0&&this.buffer[li-4]!=0){let ci=!1;for(let ui=li;ui>0&&this.buffer[ui-2]>si;ui-=4)if(this.buffer[ui-1]>=0){ci=!0;break}if(ci)for(;li>0&&this.buffer[li-2]>si;)this.buffer[li]=this.buffer[li-4],this.buffer[li+1]=this.buffer[li-3],this.buffer[li+2]=this.buffer[li-2],this.buffer[li+3]=this.buffer[li-1],li-=4,ii>4&&(ii-=4)}this.buffer[li]=ws,this.buffer[li+1]=oi,this.buffer[li+2]=si,this.buffer[li+3]=ii}}shift(ws,oi,si,ii){if(ws&131072)this.pushState(ws&65535,this.pos);else if(ws&262144)this.pos=ii,this.shiftContext(oi,si),oi<=this.p.parser.maxNode&&this.buffer.push(oi,si,ii,4);else{let ai=ws,{parser:li}=this.p;(ii>this.pos||oi<=li.maxNode)&&(this.pos=ii,li.stateFlag(ai,1)||(this.reducePos=ii)),this.pushState(ai,si),this.shiftContext(oi,si),oi<=li.maxNode&&this.buffer.push(oi,si,ii,4)}}apply(ws,oi,si,ii){ws&65536?this.reduce(ws):this.shift(ws,oi,si,ii)}useNode(ws,oi){let si=this.p.reused.length-1;(si<0||this.p.reused[si]!=ws)&&(this.p.reused.push(ws),si++);let ii=this.pos;this.reducePos=this.pos=ii+ws.length,this.pushState(oi,ii),this.buffer.push(si,ii,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,ws,this,this.p.stream.reset(this.pos-ws.length)))}split(){let ws=this,oi=ws.buffer.length;for(;oi>0&&ws.buffer[oi-2]>ws.reducePos;)oi-=4;let si=ws.buffer.slice(oi),ii=ws.bufferBase+oi;for(;ws&&ii==ws.bufferBase;)ws=ws.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,si,ii,this.curContext,this.lookAhead,ws)}recoverByDelete(ws,oi){let si=ws<=this.p.parser.maxNode;si&&this.storeNode(ws,this.pos,oi,4),this.storeNode(0,this.pos,oi,si?8:4),this.pos=this.reducePos=oi,this.score-=190}canShift(ws){for(let oi=new SimulatedStack(this);;){let si=this.p.parser.stateSlot(oi.state,4)||this.p.parser.hasAction(oi.state,ws);if(si==0)return!1;if(!(si&65536))return!0;oi.reduce(si)}}recoverByInsert(ws){if(this.stack.length>=300)return[];let oi=this.p.parser.nextStates(this.state);if(oi.length>8||this.stack.length>=120){let ii=[];for(let ai=0,li;ai<oi.length;ai+=2)(li=oi[ai+1])!=this.state&&this.p.parser.hasAction(li,ws)&&ii.push(oi[ai],li);if(this.stack.length<120)for(let ai=0;ii.length<8&&ai<oi.length;ai+=2){let li=oi[ai+1];ii.some((ci,ui)=>ui&1&&ci==li)||ii.push(oi[ai],li)}oi=ii}let si=[];for(let ii=0;ii<oi.length&&si.length<4;ii+=2){let ai=oi[ii+1];if(ai==this.state)continue;let li=this.split();li.pushState(ai,this.pos),li.storeNode(0,li.pos,li.pos,4,!0),li.shiftContext(oi[ii],this.pos),li.reducePos=this.pos,li.score-=200,si.push(li)}return si}forceReduce(){let{parser:ws}=this.p,oi=ws.stateSlot(this.state,5);if(!(oi&65536))return!1;if(!ws.validAction(this.state,oi)){let si=oi>>19,ii=oi&65535,ai=this.stack.length-si*3;if(ai<0||ws.getGoto(this.stack[ai],ii,!1)<0){let li=this.findForcedReduction();if(li==null)return!1;oi=li}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(oi),!0}findForcedReduction(){let{parser:ws}=this.p,oi=[],si=(ii,ai)=>{if(!oi.includes(ii))return oi.push(ii),ws.allActions(ii,li=>{if(!(li&393216))if(li&65536){let ci=(li>>19)-ai;if(ci>1){let ui=li&65535,di=this.stack.length-ci*3;if(di>=0&&ws.getGoto(this.stack[di],ui,!1)>=0)return ci<<19|65536|ui}}else{let ci=si(li,ai+1);if(ci!=null)return ci}})};return si(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:ws}=this.p;return ws.data[ws.stateSlot(this.state,1)]==65535&&!ws.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(ws){if(this.state!=ws.state||this.stack.length!=ws.stack.length)return!1;for(let oi=0;oi<this.stack.length;oi+=3)if(this.stack[oi]!=ws.stack[oi])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(ws){return this.p.parser.dialect.flags[ws]}shiftContext(ws,oi){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,ws,this,this.p.stream.reset(oi)))}reduceContext(ws,oi){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,ws,this,this.p.stream.reset(oi)))}emitContext(){let ws=this.buffer.length-1;(ws<0||this.buffer[ws]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let ws=this.buffer.length-1;(ws<0||this.buffer[ws]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(ws){if(ws!=this.curContext.context){let oi=new StackContext(this.curContext.tracker,ws);oi.hash!=this.curContext.hash&&this.emitContext(),this.curContext=oi}}setLookAhead(ws){ws>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=ws)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(ws,oi){this.tracker=ws,this.context=oi,this.hash=ws.strict?ws.hash(oi):0}}class SimulatedStack{constructor(ws){this.start=ws,this.state=ws.state,this.stack=ws.stack,this.base=this.stack.length}reduce(ws){let oi=ws&65535,si=ws>>19;si==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(si-1)*3;let ii=this.start.p.parser.getGoto(this.stack[this.base-3],oi,!0);this.state=ii}}class StackBufferCursor{constructor(ws,oi,si){this.stack=ws,this.pos=oi,this.index=si,this.buffer=ws.buffer,this.index==0&&this.maybeNext()}static create(ws,oi=ws.bufferBase+ws.buffer.length){return new StackBufferCursor(ws,oi,oi-ws.bufferBase)}maybeNext(){let ws=this.stack.parent;ws!=null&&(this.index=this.stack.bufferBase-ws.bufferBase,this.stack=ws,this.buffer=ws.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}function decodeArray(Ws,ws=Uint16Array){if(typeof Ws!="string")return Ws;let oi=null;for(let si=0,ii=0;si<Ws.length;){let ai=0;for(;;){let li=Ws.charCodeAt(si++),ci=!1;if(li==126){ai=65535;break}li>=92&&li--,li>=34&&li--;let ui=li-32;if(ui>=46&&(ui-=46,ci=!0),ai+=ui,ci)break;ai*=46}oi?oi[ii++]=ai:oi=new ws(ai)}return oi}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(ws,oi){this.input=ws,this.ranges=oi,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=oi[0].from,this.range=oi[0],this.end=oi[oi.length-1].to,this.readNext()}resolveOffset(ws,oi){let si=this.range,ii=this.rangeIndex,ai=this.pos+ws;for(;ai<si.from;){if(!ii)return null;let li=this.ranges[--ii];ai-=si.from-li.to,si=li}for(;oi<0?ai>si.to:ai>=si.to;){if(ii==this.ranges.length-1)return null;let li=this.ranges[++ii];ai+=li.from-si.to,si=li}return ai}clipPos(ws){if(ws>=this.range.from&&ws<this.range.to)return ws;for(let oi of this.ranges)if(oi.to>ws)return Math.max(ws,oi.from);return this.end}peek(ws){let oi=this.chunkOff+ws,si,ii;if(oi>=0&&oi<this.chunk.length)si=this.pos+ws,ii=this.chunk.charCodeAt(oi);else{let ai=this.resolveOffset(ws,1);if(ai==null)return-1;if(si=ai,si>=this.chunk2Pos&&si<this.chunk2Pos+this.chunk2.length)ii=this.chunk2.charCodeAt(si-this.chunk2Pos);else{let li=this.rangeIndex,ci=this.range;for(;ci.to<=si;)ci=this.ranges[++li];this.chunk2=this.input.chunk(this.chunk2Pos=si),si+this.chunk2.length>ci.to&&(this.chunk2=this.chunk2.slice(0,ci.to-si)),ii=this.chunk2.charCodeAt(0)}}return si>=this.token.lookAhead&&(this.token.lookAhead=si+1),ii}acceptToken(ws,oi=0){let si=oi?this.resolveOffset(oi,-1):this.pos;if(si==null||si<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=ws,this.token.end=si}acceptTokenTo(ws,oi){this.token.value=ws,this.token.end=oi}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:ws,chunkPos:oi}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=ws,this.chunk2Pos=oi,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let ws=this.input.chunk(this.pos),oi=this.pos+ws.length;this.chunk=oi>this.range.to?ws.slice(0,this.range.to-this.pos):ws,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(ws=1){for(this.chunkOff+=ws;this.pos+ws>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();ws-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=ws,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(ws,oi){if(oi?(this.token=oi,oi.start=ws,oi.lookAhead=ws+1,oi.value=oi.extended=-1):this.token=nullToken,this.pos!=ws){if(this.pos=ws,ws==this.end)return this.setDone(),this;for(;ws<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;ws>=this.range.to;)this.range=this.ranges[++this.rangeIndex];ws>=this.chunkPos&&ws<this.chunkPos+this.chunk.length?this.chunkOff=ws-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(ws,oi){if(ws>=this.chunkPos&&oi<=this.chunkPos+this.chunk.length)return this.chunk.slice(ws-this.chunkPos,oi-this.chunkPos);if(ws>=this.chunk2Pos&&oi<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(ws-this.chunk2Pos,oi-this.chunk2Pos);if(ws>=this.range.from&&oi<=this.range.to)return this.input.read(ws,oi);let si="";for(let ii of this.ranges){if(ii.from>=oi)break;ii.to>ws&&(si+=this.input.read(Math.max(ii.from,ws),Math.min(ii.to,oi)))}return si}}class TokenGroup{constructor(ws,oi){this.data=ws,this.id=oi}token(ws,oi){let{parser:si}=oi.p;readToken(this.data,ws,oi,this.id,si.data,si.tokenPrecTable)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;function readToken(Ws,ws,oi,si,ii,ai){let li=0,ci=1<<si,{dialect:ui}=oi.p.parser;e:for(;ci&Ws[li];){let di=Ws[li+1];for(let ga=li+3;ga<di;ga+=2)if((Ws[ga+1]&ci)>0){let va=Ws[ga];if(ui.allows(va)&&(ws.token.value==-1||ws.token.value==va||overrides(va,ws.token.value,ii,ai))){ws.acceptToken(va);break}}let hi=ws.next,pi=0,ha=Ws[li+2];if(ws.next<0&&ha>pi&&Ws[di+ha*3-3]==65535){li=Ws[di+ha*3-1];continue e}for(;pi<ha;){let ga=pi+ha>>1,va=di+ga+(ga<<1),ba=Ws[va],wa=Ws[va+1]||65536;if(hi<ba)ha=ga;else if(hi>=wa)pi=ga+1;else{li=Ws[va+2],ws.advance();continue e}}break}}function findOffset(Ws,ws,oi){for(let si=ws,ii;(ii=Ws[si])!=65535;si++)if(ii==oi)return si-ws;return-1}function overrides(Ws,ws,oi,si){let ii=findOffset(oi,si,ws);return ii<0||findOffset(oi,si,Ws)<ii}const verbose=typeof process<"u"&&define_process_env_default&&/\bparse\b/.test(define_process_env_default.LOG);let stackIDs=null;function cutAt(Ws,ws,oi){let si=Ws.cursor(IterMode.IncludeAnonymous);for(si.moveTo(ws);;)if(!(oi<0?si.childBefore(ws):si.childAfter(ws)))for(;;){if((oi<0?si.to<ws:si.from>ws)&&!si.type.isError)return oi<0?Math.max(0,Math.min(si.to-1,ws-25)):Math.min(Ws.length,Math.max(si.from+1,ws+25));if(oi<0?si.prevSibling():si.nextSibling())break;if(!si.parent())return oi<0?0:Ws.length}}class FragmentCursor{constructor(ws,oi){this.fragments=ws,this.nodeSet=oi,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let ws=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(ws){for(this.safeFrom=ws.openStart?cutAt(ws.tree,ws.from+ws.offset,1)-ws.offset:ws.from,this.safeTo=ws.openEnd?cutAt(ws.tree,ws.to+ws.offset,-1)-ws.offset:ws.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(ws.tree),this.start.push(-ws.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(ws){if(ws<this.nextStart)return null;for(;this.fragment&&this.safeTo<=ws;)this.nextFragment();if(!this.fragment)return null;for(;;){let oi=this.trees.length-1;if(oi<0)return this.nextFragment(),null;let si=this.trees[oi],ii=this.index[oi];if(ii==si.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let ai=si.children[ii],li=this.start[oi]+si.positions[ii];if(li>ws)return this.nextStart=li,null;if(ai instanceof Tree){if(li==ws){if(li<this.safeFrom)return null;let ci=li+ai.length;if(ci<=this.safeTo){let ui=ai.prop(NodeProp.lookAhead);if(!ui||ci+ui<this.fragment.to)return ai}}this.index[oi]++,li+ai.length>=Math.max(this.safeFrom,ws)&&(this.trees.push(ai),this.start.push(li),this.index.push(0))}else this.index[oi]++,this.nextStart=li+ai.length}}}class TokenCache{constructor(ws,oi){this.stream=oi,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=ws.tokenizers.map(si=>new CachedToken)}getActions(ws){let oi=0,si=null,{parser:ii}=ws.p,{tokenizers:ai}=ii,li=ii.stateSlot(ws.state,3),ci=ws.curContext?ws.curContext.hash:0,ui=0;for(let di=0;di<ai.length;di++){if(!(1<<di&li))continue;let hi=ai[di],pi=this.tokens[di];if(!(si&&!hi.fallback)&&((hi.contextual||pi.start!=ws.pos||pi.mask!=li||pi.context!=ci)&&(this.updateCachedToken(pi,hi,ws),pi.mask=li,pi.context=ci),pi.lookAhead>pi.end+25&&(ui=Math.max(pi.lookAhead,ui)),pi.value!=0)){let ha=oi;if(pi.extended>-1&&(oi=this.addActions(ws,pi.extended,pi.end,oi)),oi=this.addActions(ws,pi.value,pi.end,oi),!hi.extend&&(si=pi,oi>ha))break}}for(;this.actions.length>oi;)this.actions.pop();return ui&&ws.setLookAhead(ui),!si&&ws.pos==this.stream.end&&(si=new CachedToken,si.value=ws.p.parser.eofTerm,si.start=si.end=ws.pos,oi=this.addActions(ws,si.value,si.end,oi)),this.mainToken=si,this.actions}getMainToken(ws){if(this.mainToken)return this.mainToken;let oi=new CachedToken,{pos:si,p:ii}=ws;return oi.start=si,oi.end=Math.min(si+1,ii.stream.end),oi.value=si==ii.stream.end?ii.parser.eofTerm:0,oi}updateCachedToken(ws,oi,si){let ii=this.stream.clipPos(si.pos);if(oi.token(this.stream.reset(ii,ws),si),ws.value>-1){let{parser:ai}=si.p;for(let li=0;li<ai.specialized.length;li++)if(ai.specialized[li]==ws.value){let ci=ai.specializers[li](this.stream.read(ws.start,ws.end),si);if(ci>=0&&si.p.parser.dialect.allows(ci>>1)){ci&1?ws.extended=ci>>1:ws.value=ci>>1;break}}}else ws.value=0,ws.end=this.stream.clipPos(ii+1)}putAction(ws,oi,si,ii){for(let ai=0;ai<ii;ai+=3)if(this.actions[ai]==ws)return ii;return this.actions[ii++]=ws,this.actions[ii++]=oi,this.actions[ii++]=si,ii}addActions(ws,oi,si,ii){let{state:ai}=ws,{parser:li}=ws.p,{data:ci}=li;for(let ui=0;ui<2;ui++)for(let di=li.stateSlot(ai,ui?2:1);;di+=3){if(ci[di]==65535)if(ci[di+1]==1)di=pair(ci,di+2);else{ii==0&&ci[di+1]==2&&(ii=this.putAction(pair(ci,di+2),oi,si,ii));break}ci[di]==oi&&(ii=this.putAction(pair(ci,di+1),oi,si,ii))}return ii}}class Parse{constructor(ws,oi,si,ii){this.parser=ws,this.input=oi,this.ranges=ii,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(oi,ii),this.tokens=new TokenCache(ws,this.stream),this.topTerm=ws.top[1];let{from:ai}=ii[0];this.stacks=[Stack.start(this,ws.top[0],ai)],this.fragments=si.length&&this.stream.end-ai>ws.bufferLength*4?new FragmentCursor(si,ws.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let ws=this.stacks,oi=this.minStackPos,si=this.stacks=[],ii,ai;if(this.bigReductionCount>300&&ws.length==1){let[li]=ws;for(;li.forceReduce()&&li.stack.length&&li.stack[li.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let li=0;li<ws.length;li++){let ci=ws[li];for(;;){if(this.tokens.mainToken=null,ci.pos>oi)si.push(ci);else{if(this.advanceStack(ci,si,ws))continue;{ii||(ii=[],ai=[]),ii.push(ci);let ui=this.tokens.getMainToken(ci);ai.push(ui.value,ui.end)}}break}}if(!si.length){let li=ii&&findFinished(ii);if(li)return verbose&&console.log("Finish with "+this.stackID(li)),this.stackToTree(li);if(this.parser.strict)throw verbose&&ii&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+oi);this.recovering||(this.recovering=5)}if(this.recovering&&ii){let li=this.stoppedAt!=null&&ii[0].pos>this.stoppedAt?ii[0]:this.runRecovery(ii,ai,si);if(li)return verbose&&console.log("Force-finish "+this.stackID(li)),this.stackToTree(li.forceAll())}if(this.recovering){let li=this.recovering==1?1:this.recovering*3;if(si.length>li)for(si.sort((ci,ui)=>ui.score-ci.score);si.length>li;)si.pop();si.some(ci=>ci.reducePos>oi)&&this.recovering--}else if(si.length>1){e:for(let li=0;li<si.length-1;li++){let ci=si[li];for(let ui=li+1;ui<si.length;ui++){let di=si[ui];if(ci.sameState(di)||ci.buffer.length>500&&di.buffer.length>500)if((ci.score-di.score||ci.buffer.length-di.buffer.length)>0)si.splice(ui--,1);else{si.splice(li--,1);continue e}}}si.length>12&&si.splice(12,si.length-12)}this.minStackPos=si[0].pos;for(let li=1;li<si.length;li++)si[li].pos<this.minStackPos&&(this.minStackPos=si[li].pos);return null}stopAt(ws){if(this.stoppedAt!=null&&this.stoppedAt<ws)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=ws}advanceStack(ws,oi,si){let ii=ws.pos,{parser:ai}=this,li=verbose?this.stackID(ws)+" -> ":"";if(this.stoppedAt!=null&&ii>this.stoppedAt)return ws.forceReduce()?ws:null;if(this.fragments){let di=ws.curContext&&ws.curContext.tracker.strict,hi=di?ws.curContext.hash:0;for(let pi=this.fragments.nodeAt(ii);pi;){let ha=this.parser.nodeSet.types[pi.type.id]==pi.type?ai.getGoto(ws.state,pi.type.id):-1;if(ha>-1&&pi.length&&(!di||(pi.prop(NodeProp.contextHash)||0)==hi))return ws.useNode(pi,ha),verbose&&console.log(li+this.stackID(ws)+` (via reuse of ${ai.getName(pi.type.id)})`),!0;if(!(pi instanceof Tree)||pi.children.length==0||pi.positions[0]>0)break;let ga=pi.children[0];if(ga instanceof Tree&&pi.positions[0]==0)pi=ga;else break}}let ci=ai.stateSlot(ws.state,4);if(ci>0)return ws.reduce(ci),verbose&&console.log(li+this.stackID(ws)+` (via always-reduce ${ai.getName(ci&65535)})`),!0;if(ws.stack.length>=8400)for(;ws.stack.length>6e3&&ws.forceReduce(););let ui=this.tokens.getActions(ws);for(let di=0;di<ui.length;){let hi=ui[di++],pi=ui[di++],ha=ui[di++],ga=di==ui.length||!si,va=ga?ws:ws.split(),ba=this.tokens.mainToken;if(va.apply(hi,pi,ba?ba.start:va.pos,ha),verbose&&console.log(li+this.stackID(va)+` (via ${hi&65536?`reduce of ${ai.getName(hi&65535)}`:"shift"} for ${ai.getName(pi)} @ ${ii}${va==ws?"":", split"})`),ga)return!0;va.pos>ii?oi.push(va):si.push(va)}return!1}advanceFully(ws,oi){let si=ws.pos;for(;;){if(!this.advanceStack(ws,null,null))return!1;if(ws.pos>si)return pushStackDedup(ws,oi),!0}}runRecovery(ws,oi,si){let ii=null,ai=!1;for(let li=0;li<ws.length;li++){let ci=ws[li],ui=oi[li<<1],di=oi[(li<<1)+1],hi=verbose?this.stackID(ci)+" -> ":"";if(ci.deadEnd&&(ai||(ai=!0,ci.restart(),verbose&&console.log(hi+this.stackID(ci)+" (restarted)"),this.advanceFully(ci,si))))continue;let pi=ci.split(),ha=hi;for(let ga=0;pi.forceReduce()&&ga<10&&(verbose&&console.log(ha+this.stackID(pi)+" (via force-reduce)"),!this.advanceFully(pi,si));ga++)verbose&&(ha=this.stackID(pi)+" -> ");for(let ga of ci.recoverByInsert(ui))verbose&&console.log(hi+this.stackID(ga)+" (via recover-insert)"),this.advanceFully(ga,si);this.stream.end>ci.pos?(di==ci.pos&&(di++,ui=0),ci.recoverByDelete(ui,di),verbose&&console.log(hi+this.stackID(ci)+` (via recover-delete ${this.parser.getName(ui)})`),pushStackDedup(ci,si)):(!ii||ii.score<ci.score)&&(ii=ci)}return ii}stackToTree(ws){return ws.close(),Tree.build({buffer:StackBufferCursor.create(ws),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:ws.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(ws){let oi=(stackIDs||(stackIDs=new WeakMap)).get(ws);return oi||stackIDs.set(ws,oi=String.fromCodePoint(this.nextStackID++)),oi+ws}}function pushStackDedup(Ws,ws){for(let oi=0;oi<ws.length;oi++){let si=ws[oi];if(si.pos==Ws.pos&&si.sameState(Ws)){ws[oi].score<Ws.score&&(ws[oi]=Ws);return}}ws.push(Ws)}class Dialect{constructor(ws,oi,si){this.source=ws,this.flags=oi,this.disabled=si}allows(ws){return!this.disabled||this.disabled[ws]==0}}class LRParser extends Parser{constructor(ws){if(super(),this.wrappers=[],ws.version!=14)throw new RangeError(`Parser version (${ws.version}) doesn't match runtime version (14)`);let oi=ws.nodeNames.split(" ");this.minRepeatTerm=oi.length;for(let ci=0;ci<ws.repeatNodeCount;ci++)oi.push("");let si=Object.keys(ws.topRules).map(ci=>ws.topRules[ci][1]),ii=[];for(let ci=0;ci<oi.length;ci++)ii.push([]);function ai(ci,ui,di){ii[ci].push([ui,ui.deserialize(String(di))])}if(ws.nodeProps)for(let ci of ws.nodeProps){let ui=ci[0];typeof ui=="string"&&(ui=NodeProp[ui]);for(let di=1;di<ci.length;){let hi=ci[di++];if(hi>=0)ai(hi,ui,ci[di++]);else{let pi=ci[di+-hi];for(let ha=-hi;ha>0;ha--)ai(ci[di++],ui,pi);di++}}}this.nodeSet=new NodeSet(oi.map((ci,ui)=>NodeType.define({name:ui>=this.minRepeatTerm?void 0:ci,id:ui,props:ii[ui],top:si.indexOf(ui)>-1,error:ui==0,skipped:ws.skippedNodes&&ws.skippedNodes.indexOf(ui)>-1}))),ws.propSources&&(this.nodeSet=this.nodeSet.extend(...ws.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let li=decodeArray(ws.tokenData);this.context=ws.context,this.specializerSpecs=ws.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let ci=0;ci<this.specializerSpecs.length;ci++)this.specialized[ci]=this.specializerSpecs[ci].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(ws.states,Uint32Array),this.data=decodeArray(ws.stateData),this.goto=decodeArray(ws.goto),this.maxTerm=ws.maxTerm,this.tokenizers=ws.tokenizers.map(ci=>typeof ci=="number"?new TokenGroup(li,ci):ci),this.topRules=ws.topRules,this.dialects=ws.dialects||{},this.dynamicPrecedences=ws.dynamicPrecedences||null,this.tokenPrecTable=ws.tokenPrec,this.termNames=ws.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(ws,oi,si){let ii=new Parse(this,ws,oi,si);for(let ai of this.wrappers)ii=ai(ii,ws,oi,si);return ii}getGoto(ws,oi,si=!1){let ii=this.goto;if(oi>=ii[0])return-1;for(let ai=ii[oi+1];;){let li=ii[ai++],ci=li&1,ui=ii[ai++];if(ci&&si)return ui;for(let di=ai+(li>>1);ai<di;ai++)if(ii[ai]==ws)return ui;if(ci)return-1}}hasAction(ws,oi){let si=this.data;for(let ii=0;ii<2;ii++)for(let ai=this.stateSlot(ws,ii?2:1),li;;ai+=3){if((li=si[ai])==65535)if(si[ai+1]==1)li=si[ai=pair(si,ai+2)];else{if(si[ai+1]==2)return pair(si,ai+2);break}if(li==oi||li==0)return pair(si,ai+1)}return 0}stateSlot(ws,oi){return this.states[ws*6+oi]}stateFlag(ws,oi){return(this.stateSlot(ws,0)&oi)>0}validAction(ws,oi){return!!this.allActions(ws,si=>si==oi?!0:null)}allActions(ws,oi){let si=this.stateSlot(ws,4),ii=si?oi(si):void 0;for(let ai=this.stateSlot(ws,1);ii==null;ai+=3){if(this.data[ai]==65535)if(this.data[ai+1]==1)ai=pair(this.data,ai+2);else break;ii=oi(pair(this.data,ai+1))}return ii}nextStates(ws){let oi=[];for(let si=this.stateSlot(ws,1);;si+=3){if(this.data[si]==65535)if(this.data[si+1]==1)si=pair(this.data,si+2);else break;if(!(this.data[si+2]&1)){let ii=this.data[si+1];oi.some((ai,li)=>li&1&&ai==ii)||oi.push(this.data[si],ii)}}return oi}configure(ws){let oi=Object.assign(Object.create(LRParser.prototype),this);if(ws.props&&(oi.nodeSet=this.nodeSet.extend(...ws.props)),ws.top){let si=this.topRules[ws.top];if(!si)throw new RangeError(`Invalid top rule name ${ws.top}`);oi.top=si}return ws.tokenizers&&(oi.tokenizers=this.tokenizers.map(si=>{let ii=ws.tokenizers.find(ai=>ai.from==si);return ii?ii.to:si})),ws.specializers&&(oi.specializers=this.specializers.slice(),oi.specializerSpecs=this.specializerSpecs.map((si,ii)=>{let ai=ws.specializers.find(ci=>ci.from==si.external);if(!ai)return si;let li=Object.assign(Object.assign({},si),{external:ai.to});return oi.specializers[ii]=getSpecializer(li),li})),ws.contextTracker&&(oi.context=ws.contextTracker),ws.dialect&&(oi.dialect=this.parseDialect(ws.dialect)),ws.strict!=null&&(oi.strict=ws.strict),ws.wrap&&(oi.wrappers=oi.wrappers.concat(ws.wrap)),ws.bufferLength!=null&&(oi.bufferLength=ws.bufferLength),oi}hasWrappers(){return this.wrappers.length>0}getName(ws){return this.termNames?this.termNames[ws]:String(ws<=this.maxNode&&this.nodeSet.types[ws].name||ws)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(ws){let oi=this.dynamicPrecedences;return oi==null?0:oi[ws]||0}parseDialect(ws){let oi=Object.keys(this.dialects),si=oi.map(()=>!1);if(ws)for(let ai of ws.split(" ")){let li=oi.indexOf(ai);li>=0&&(si[li]=!0)}let ii=null;for(let ai=0;ai<oi.length;ai++)if(!si[ai])for(let li=this.dialects[oi[ai]],ci;(ci=this.data[li++])!=65535;)(ii||(ii=new Uint8Array(this.maxTerm+1)))[ci]=1;return new Dialect(ws,si,ii)}static deserialize(ws){return new LRParser(ws)}}function pair(Ws,ws){return Ws[ws]|Ws[ws+1]<<16}function findFinished(Ws){let ws=null;for(let oi of Ws){let si=oi.p.stoppedAt;(oi.pos==oi.p.stream.end||si!=null&&oi.pos>si)&&oi.p.parser.stateFlag(oi.state,2)&&(!ws||ws.score<oi.score)&&(ws=oi)}return ws}function getSpecializer(Ws){if(Ws.external){let ws=Ws.extend?1:0;return(oi,si)=>Ws.external(oi,si)<<1|ws}return Ws.get}function crelt(){var Ws=arguments[0];typeof Ws=="string"&&(Ws=document.createElement(Ws));var ws=1,oi=arguments[1];if(oi&&typeof oi=="object"&&oi.nodeType==null&&!Array.isArray(oi)){for(var si in oi)if(Object.prototype.hasOwnProperty.call(oi,si)){var ii=oi[si];typeof ii=="string"?Ws.setAttribute(si,ii):ii!=null&&(Ws[si]=ii)}ws++}for(;ws<arguments.length;ws++)add(Ws,arguments[ws]);return Ws}function add(Ws,ws){if(typeof ws=="string")Ws.appendChild(document.createTextNode(ws));else if(ws!=null)if(ws.nodeType!=null)Ws.appendChild(ws);else if(Array.isArray(ws))for(var oi=0;oi<ws.length;oi++)add(Ws,ws[oi]);else throw new RangeError("Unsupported child node: "+ws)}class SelectedDiagnostic{constructor(ws,oi,si){this.from=ws,this.to=oi,this.diagnostic=si}}class LintState{constructor(ws,oi,si){this.diagnostics=ws,this.panel=oi,this.selected=si}static init(ws,oi,si){let ii=ws,ai=si.facet(lintConfig).markerFilter;ai&&(ii=ai(ii,si));let li=ws.slice().sort((pi,ha)=>pi.from-ha.from||pi.to-ha.to),ci=new RangeSetBuilder,ui=[],di=0;for(let pi=0;;){let ha=pi==li.length?null:li[pi];if(!ha&&!ui.length)break;let ga,va;for(ui.length?(ga=di,va=ui.reduce((wa,xa)=>Math.min(wa,xa.to),ha&&ha.from>ga?ha.from:1e8)):(ga=ha.from,va=ha.to,ui.push(ha),pi++);pi<li.length;){let wa=li[pi];if(wa.from==ga&&(wa.to>wa.from||wa.to==ga))ui.push(wa),pi++,va=Math.min(wa.to,va);else{va=Math.min(wa.from,va);break}}let ba=maxSeverity(ui);if(ui.some(wa=>wa.from==wa.to||wa.from==wa.to-1&&si.doc.lineAt(wa.from).to==wa.from))ci.add(ga,ga,Decoration.widget({widget:new DiagnosticWidget(ba),diagnostics:ui.slice()}));else{let wa=ui.reduce((xa,Ca)=>Ca.markClass?xa+" "+Ca.markClass:xa,"");ci.add(ga,va,Decoration.mark({class:"cm-lintRange cm-lintRange-"+ba+wa,diagnostics:ui.slice(),inclusiveEnd:ui.some(xa=>xa.to>va)}))}di=va;for(let wa=0;wa<ui.length;wa++)ui[wa].to<=di&&ui.splice(wa--,1)}let hi=ci.finish();return new LintState(hi,oi,findDiagnostic(hi))}}function findDiagnostic(Ws,ws=null,oi=0){let si=null;return Ws.between(oi,1e9,(ii,ai,{spec:li})=>{if(!(ws&&li.diagnostics.indexOf(ws)<0))if(!si)si=new SelectedDiagnostic(ii,ai,ws||li.diagnostics[0]);else{if(li.diagnostics.indexOf(si.diagnostic)<0)return!1;si=new SelectedDiagnostic(si.from,ai,si.diagnostic)}}),si}function hideTooltip(Ws,ws){let oi=ws.pos,si=ws.end||oi,ii=Ws.state.facet(lintConfig).hideOn(Ws,oi,si);if(ii!=null)return ii;let ai=Ws.startState.doc.lineAt(ws.pos);return!!(Ws.effects.some(li=>li.is(setDiagnosticsEffect))||Ws.changes.touchesRange(ai.from,Math.max(ai.to,si)))}function maybeEnableLint(Ws,ws){return Ws.field(lintState,!1)?ws:ws.concat(StateEffect.appendConfig.of(lintExtensions))}function setDiagnostics(Ws,ws){return{effects:maybeEnableLint(Ws,[setDiagnosticsEffect.of(ws)])}}const setDiagnosticsEffect=StateEffect.define(),togglePanel$1=StateEffect.define(),movePanelSelection=StateEffect.define(),lintState=StateField.define({create(){return new LintState(Decoration.none,null,null)},update(Ws,ws){if(ws.docChanged&&Ws.diagnostics.size){let oi=Ws.diagnostics.map(ws.changes),si=null,ii=Ws.panel;if(Ws.selected){let ai=ws.changes.mapPos(Ws.selected.from,1);si=findDiagnostic(oi,Ws.selected.diagnostic,ai)||findDiagnostic(oi,null,ai)}!oi.size&&ii&&ws.state.facet(lintConfig).autoPanel&&(ii=null),Ws=new LintState(oi,ii,si)}for(let oi of ws.effects)if(oi.is(setDiagnosticsEffect)){let si=ws.state.facet(lintConfig).autoPanel?oi.value.length?LintPanel.open:null:Ws.panel;Ws=LintState.init(oi.value,si,ws.state)}else oi.is(togglePanel$1)?Ws=new LintState(Ws.diagnostics,oi.value?LintPanel.open:null,Ws.selected):oi.is(movePanelSelection)&&(Ws=new LintState(Ws.diagnostics,Ws.panel,oi.value));return Ws},provide:Ws=>[showPanel.from(Ws,ws=>ws.panel),EditorView.decorations.from(Ws,ws=>ws.diagnostics)]}),activeMark=Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function lintTooltip(Ws,ws,oi){let{diagnostics:si}=Ws.state.field(lintState),ii,ai=-1,li=-1;si.between(ws-(oi<0?1:0),ws+(oi>0?1:0),(ui,di,{spec:hi})=>{if(ws>=ui&&ws<=di&&(ui==di||(ws>ui||oi>0)&&(ws<di||oi<0)))return ii=hi.diagnostics,ai=ui,li=di,!1});let ci=Ws.state.facet(lintConfig).tooltipFilter;return ii&&ci&&(ii=ci(ii,Ws.state)),ii?{pos:ai,end:li,above:Ws.state.doc.lineAt(ai).to<li,create(){return{dom:diagnosticsTooltip(Ws,ii)}}}:null}function diagnosticsTooltip(Ws,ws){return crelt("ul",{class:"cm-tooltip-lint"},ws.map(oi=>renderDiagnostic(Ws,oi,!1)))}const openLintPanel=Ws=>{let ws=Ws.state.field(lintState,!1);(!ws||!ws.panel)&&Ws.dispatch({effects:maybeEnableLint(Ws.state,[togglePanel$1.of(!0)])});let oi=getPanel(Ws,LintPanel.open);return oi&&oi.dom.querySelector(".cm-panel-lint ul").focus(),!0},closeLintPanel=Ws=>{let ws=Ws.state.field(lintState,!1);return!ws||!ws.panel?!1:(Ws.dispatch({effects:togglePanel$1.of(!1)}),!0)},nextDiagnostic=Ws=>{let ws=Ws.state.field(lintState,!1);if(!ws)return!1;let oi=Ws.state.selection.main,si=ws.diagnostics.iter(oi.to+1);return!si.value&&(si=ws.diagnostics.iter(0),!si.value||si.from==oi.from&&si.to==oi.to)?!1:(Ws.dispatch({selection:{anchor:si.from,head:si.to},scrollIntoView:!0}),!0)},lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel,preventDefault:!0},{key:"F8",run:nextDiagnostic}],lintPlugin=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.timeout=-1,this.set=!0;let{delay:ws}=Ws.state.facet(lintConfig);this.lintTime=Date.now()+ws,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,ws)}run(){clearTimeout(this.timeout);let Ws=Date.now();if(Ws<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-Ws);else{this.set=!1;let{state:ws}=this.view,{sources:oi}=ws.facet(lintConfig);oi.length&&batchResults(oi.map(si=>Promise.resolve(si(this.view))),si=>{this.view.state.doc==ws.doc&&this.view.dispatch(setDiagnostics(this.view.state,si.reduce((ii,ai)=>ii.concat(ai))))},si=>{logException(this.view.state,si)})}}update(Ws){let ws=Ws.state.facet(lintConfig);(Ws.docChanged||ws!=Ws.startState.facet(lintConfig)||ws.needsRefresh&&ws.needsRefresh(Ws))&&(this.lintTime=Date.now()+ws.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,ws.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function batchResults(Ws,ws,oi){let si=[],ii=-1;for(let ai of Ws)ai.then(li=>{si.push(li),clearTimeout(ii),si.length==Ws.length?ws(si):ii=setTimeout(()=>ws(si),200)},oi)}const lintConfig=Facet.define({combine(Ws){return Object.assign({sources:Ws.map(ws=>ws.source).filter(ws=>ws!=null)},combineConfig(Ws.map(ws=>ws.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(ws,oi)=>ws?oi?si=>ws(si)||oi(si):ws:oi}))}});function linter(Ws,ws={}){return[lintConfig.of({source:Ws,config:ws}),lintPlugin,lintExtensions]}function forceLinting(Ws){let ws=Ws.plugin(lintPlugin);ws&&ws.force()}function assignKeys(Ws){let ws=[];if(Ws)e:for(let{name:oi}of Ws){for(let si=0;si<oi.length;si++){let ii=oi[si];if(/[a-zA-Z]/.test(ii)&&!ws.some(ai=>ai.toLowerCase()==ii.toLowerCase())){ws.push(ii);continue e}}ws.push("")}return ws}function renderDiagnostic(Ws,ws,oi){var si;let ii=oi?assignKeys(ws.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+ws.severity},crelt("span",{class:"cm-diagnosticText"},ws.renderMessage?ws.renderMessage(Ws):ws.message),(si=ws.actions)===null||si===void 0?void 0:si.map((ai,li)=>{let ci=!1,ui=ha=>{if(ha.preventDefault(),ci)return;ci=!0;let ga=findDiagnostic(Ws.state.field(lintState).diagnostics,ws);ga&&ai.apply(Ws,ga.from,ga.to)},{name:di}=ai,hi=ii[li]?di.indexOf(ii[li]):-1,pi=hi<0?di:[di.slice(0,hi),crelt("u",di.slice(hi,hi+1)),di.slice(hi+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:ui,onmousedown:ui,"aria-label":` Action: ${di}${hi<0?"":` (access key "${ii[li]})"`}.`},pi)}),ws.source&&crelt("div",{class:"cm-diagnosticSource"},ws.source))}class DiagnosticWidget extends WidgetType{constructor(ws){super(),this.sev=ws}eq(ws){return ws.sev==this.sev}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class PanelItem{constructor(ws,oi){this.diagnostic=oi,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=renderDiagnostic(ws,oi,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class LintPanel{constructor(ws){this.view=ws,this.items=[];let oi=ii=>{if(ii.keyCode==27)closeLintPanel(this.view),this.view.focus();else if(ii.keyCode==38||ii.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(ii.keyCode==40||ii.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(ii.keyCode==36)this.moveSelection(0);else if(ii.keyCode==35)this.moveSelection(this.items.length-1);else if(ii.keyCode==13)this.view.focus();else if(ii.keyCode>=65&&ii.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:ai}=this.items[this.selectedIndex],li=assignKeys(ai.actions);for(let ci=0;ci<li.length;ci++)if(li[ci].toUpperCase().charCodeAt(0)==ii.keyCode){let ui=findDiagnostic(this.view.state.field(lintState).diagnostics,ai);ui&&ai.actions[ci].apply(ws,ui.from,ui.to)}}else return;ii.preventDefault()},si=ii=>{for(let ai=0;ai<this.items.length;ai++)this.items[ai].dom.contains(ii.target)&&this.moveSelection(ai)};this.list=crelt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:oi,onclick:si}),this.dom=crelt("div",{class:"cm-panel-lint"},this.list,crelt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>closeLintPanel(this.view)},"×")),this.update()}get selectedIndex(){let ws=this.view.state.field(lintState).selected;if(!ws)return-1;for(let oi=0;oi<this.items.length;oi++)if(this.items[oi].diagnostic==ws.diagnostic)return oi;return-1}update(){let{diagnostics:ws,selected:oi}=this.view.state.field(lintState),si=0,ii=!1,ai=null,li=new Set;for(ws.between(0,this.view.state.doc.length,(ci,ui,{spec:di})=>{for(let hi of di.diagnostics){if(li.has(hi))continue;li.add(hi);let pi=-1,ha;for(let ga=si;ga<this.items.length;ga++)if(this.items[ga].diagnostic==hi){pi=ga;break}pi<0?(ha=new PanelItem(this.view,hi),this.items.splice(si,0,ha),ii=!0):(ha=this.items[pi],pi>si&&(this.items.splice(si,pi-si),ii=!0)),oi&&ha.diagnostic==oi.diagnostic?ha.dom.hasAttribute("aria-selected")||(ha.dom.setAttribute("aria-selected","true"),ai=ha):ha.dom.hasAttribute("aria-selected")&&ha.dom.removeAttribute("aria-selected"),si++}});si<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)ii=!0,this.items.pop();this.items.length==0&&(this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),ii=!0),ai?(this.list.setAttribute("aria-activedescendant",ai.id),this.view.requestMeasure({key:this,read:()=>({sel:ai.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:ci,panel:ui})=>{let di=ui.height/this.list.offsetHeight;ci.top<ui.top?this.list.scrollTop-=(ui.top-ci.top)/di:ci.bottom>ui.bottom&&(this.list.scrollTop+=(ci.bottom-ui.bottom)/di)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),ii&&this.sync()}sync(){let ws=this.list.firstChild;function oi(){let si=ws;ws=si.nextSibling,si.remove()}for(let si of this.items)if(si.dom.parentNode==this.list){for(;ws!=si.dom;)oi();ws=si.dom.nextSibling}else this.list.insertBefore(si.dom,ws);for(;ws;)oi()}moveSelection(ws){if(this.selectedIndex<0)return;let oi=this.view.state.field(lintState),si=findDiagnostic(oi.diagnostics,this.items[ws].diagnostic);si&&this.view.dispatch({selection:{anchor:si.from,head:si.to},scrollIntoView:!0,effects:movePanelSelection.of(si)})}static open(ws){return new LintPanel(ws)}}function svg(Ws,ws='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${ws}>${encodeURIComponent(Ws)}</svg>')`}function underline(Ws){return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${Ws}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const baseTheme$3=EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function severityWeight(Ws){return Ws=="error"?4:Ws=="warning"?3:Ws=="info"?2:1}function maxSeverity(Ws){let ws="hint",oi=1;for(let si of Ws){let ii=severityWeight(si.severity);ii>oi&&(oi=ii,ws=si.severity)}return ws}const lintExtensions=[lintState,EditorView.decorations.compute([lintState],Ws=>{let{selected:ws,panel:oi}=Ws.field(lintState);return!ws||!oi||ws.from==ws.to?Decoration.none:Decoration.set([activeMark.range(ws.from,ws.to)])}),hoverTooltip(lintTooltip,{hideOn:hideTooltip}),baseTheme$3];function posToOffset(Ws,ws){return Ws.line(ws.line+1).from+ws.character}function offsetToPos(Ws,ws){const oi=Ws.lineAt(ws);return new Position(oi.number-1,ws-oi.from)}class Position{constructor(ws,oi){this.line=ws,this.character=oi}setLine(ws){this.line=ws}setCharacter(ws){this.character=ws}lessThanOrEqualTo(ws){return this.line<ws.line||this.line===ws.line&&this.character<=ws.character}}const isMac=()=>navigator.userAgent.includes("Mac"),isMetaKeyPressed=Ws=>isMac()?Ws.metaKey:Ws.ctrlKey,schemaEffect=StateEffect.define(),schemaStateField=StateField.define({create(){},update(Ws,ws){for(const oi of ws.effects)if(oi.is(schemaEffect))return oi.value;return Ws}}),optionsEffect=StateEffect.define(),optionsStateField=StateField.define({create(){},update(Ws,ws){for(const oi of ws.effects)if(oi.is(optionsEffect))return oi.value;return Ws}}),getSchema=Ws=>Ws.field(schemaStateField),getOpts=Ws=>Ws.field(optionsStateField),defaultOpts={showErrorOnInvalidSchema:!0},stateExtensions=(Ws,ws)=>[schemaStateField.init(()=>Ws),optionsStateField.init(()=>Object.assign(Object.assign({},defaultOpts),ws))],spec_name={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},parser$1=LRParser.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:"⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension",maxTerm:156,nodeProps:[["openedBy",6,"(",12,"[",24,"{"],["closedBy",7,")",13,"]",25,"}"]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!Q!['k!c!i'k#T#Z'k~'nR!Q!['w!c!i'w#T#Z'w~'zR!Q![(T!c!i(T#T#Z(T~(WR!Q![&Q!c!i&Q#T#Z&Q~(fPc~rs(i~(lXOY(iYZ(iZ](i]^)X^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![0h![!c(i!c!i0h!i#O(i#O#P)w#P#T(i#T#Z0h#Z~(i~0k_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![1j![!c(i!c!i1j!i#O(i#O#P)w#P#T(i#T#Z1j#Z~(i~1m_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![2l![!c(i!c!i2l!i#O(i#O#P)w#P#T(i#T#Z2l#Z~(i~2o_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:Ws=>spec_name[Ws]||-1}],tokenPrec:2989}),nodesWithBraces="RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }",keywords="scalar type interface union enum input implements fragment extend schema directive on repeatable",punctuations="( ) { } : [ ]",graphqlLanguage=LRLanguage.define({parser:parser$1.configure({props:[styleTags({Variable:tags.variableName,BooleanValue:tags.bool,Description:tags.string,StringValue:tags.string,Comment:tags.lineComment,IntValue:tags.integer,FloatValue:tags.float,EnumValue:tags.special(tags.name),NullValue:tags.null,DirectiveName:tags.modifier,[keywords]:tags.keyword,OperationType:tags.definitionKeyword,FieldName:tags.propertyName,Field:tags.propertyName,ArgumentAttributeName:tags.attributeName,Name:tags.atom,"( )":tags.paren,"{ }":tags.brace,",":tags.separator,[punctuations]:tags.punctuation}),indentNodeProp.add({[nodesWithBraces]:delimitedIndent({closing:"}",align:!0})}),foldNodeProp.add({[nodesWithBraces]:foldInside})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*(\{|\})$/}});function graphqlLanguageSupport(){return new LanguageSupport(graphqlLanguage)}const AUTOCOMPLETE_CHARS=/^[a-zA-Z0-9_@(]$/,completion=graphqlLanguage.data.of({autocomplete(Ws){const ws=getSchema(Ws.state),oi=getOpts(Ws.state);if(!ws)return null;const si=Ws.matchBefore(/\w*/);if(!si)return null;const ii=si.text.split("").pop();if(!AUTOCOMPLETE_CHARS.test(ii)&&!Ws.explicit)return null;const ai=Ws.state.doc.toString(),li=offsetToPos(Ws.state.doc,Ws.pos),ci=getAutocompleteSuggestions(ws,ai,li,void 0,void 0,oi==null?void 0:oi.autocompleteOptions);return ci.length===0?null:{from:si.from,options:ci.map(ui=>({label:ui.label,detail:ui.detail||"",info(di){if(oi!=null&&oi.onCompletionInfoRender)return oi.onCompletionInfoRender(ui,Ws,di);if(ui.documentation||ui.isDeprecated&&ui.deprecationReason){const hi=document.createElement("div");return hi.textContent=ui.documentation||ui.deprecationReason||"",hi}}}))}}}),jump=EditorView.domEventHandlers({click(Ws,ws){var oi,si,ii;const ai=getSchema(ws.state);if(!ai)return;const li=ws.state.selection.main.head,ci=offsetToPos(ws.state.doc,li),ui=getTokenAtPosition(ws.state.doc.toString(),ci),di=getTypeInfo(ai,ui.state),hi=getOpts(ws.state);hi!=null&&hi.onShowInDocs&&isMetaKeyPressed(Ws)&&hi.onShowInDocs((oi=di.fieldDef)===null||oi===void 0?void 0:oi.name,(si=di.type)===null||si===void 0?void 0:si.toString(),(ii=di.parentType)===null||ii===void 0?void 0:ii.toString())}}),SEVERITY=["error","warning","info"],lint=linter(Ws=>{const ws=getSchema(Ws.state),oi=getOpts(Ws.state);if(!ws)return[];const si=validateSchema(ws);if(si.length){if(!(oi!=null&&oi.showErrorOnInvalidSchema))return[];const ii=si.map(ai=>ai.message);return[{from:0,to:Ws.state.doc.length,severity:"error",message:ii.join(`
334
- `),actions:[]}]}return getDiagnostics(Ws.state.doc.toString(),ws).map(ii=>{if(!ii.severity||!ii.source)return null;const ai=posToOffset(Ws.state.doc,new Position(ii.range.start.line,ii.range.start.character)),li=Math.max(0,Math.min(ai,Ws.state.doc.length)),ci=posToOffset(Ws.state.doc,new Position(ii.range.end.line,ii.range.end.character-1)),ui=Math.min(Math.max(li+1,ci),Ws.state.doc.length);return{from:li,to:li===ui?ui+1:ui,severity:SEVERITY[ii.severity-1],message:ii.message,actions:[]}}).filter(ii=>!!ii)},{needsRefresh(Ws){return Ws.startState.field(schemaStateField)!==Ws.state.field(schemaStateField)||Ws.startState.field(optionsStateField)!==Ws.state.field(optionsStateField)}});function graphql(Ws,ws){return[graphqlLanguageSupport(),completion,lint,jump,stateExtensions(Ws,ws)]}const hiddenQueryTypeDefDoc=`type Query {
335
- _hidden: String
336
- }
337
- `,typeDefsDoc=typeDefs.join(`
338
- `),initialSchemaDoc=`${hiddenQueryTypeDefDoc}
339
- ${typeDefsDoc}`,initialSchema=buildSchema(initialSchemaDoc),updateTimeout=5e3;function isURL(Ws){try{return!!new URL(Ws)}catch{return!1}}const asArray=Ws=>Array.isArray(Ws)?Ws:Ws?[Ws]:[],invalidDocRegex=/\.[a-z0-9]+$/i;function isDocumentString(Ws){if(typeof Ws!="string"||invalidDocRegex.test(Ws)||isURL(Ws))return!1;try{return parse(Ws),!0}catch(ws){if(!ws.message.includes("EOF")&&Ws.replace(/(\#[^*]*)/g,"").trim()!==""&&Ws.includes(" "))throw new Error(`Failed to parse the GraphQL document. ${ws.message}
340
- ${Ws}`)}return!1}function createDefaultRules(){let Ws=["NoUnusedFragmentsRule","NoUnusedVariablesRule","KnownDirectivesRule"];return versionInfo.major<15&&(Ws=Ws.map(ws=>ws.replace(/Rule$/,""))),specifiedRules.filter(ws=>!Ws.includes(ws.name))}var MapperKind;(function(Ws){Ws.TYPE="MapperKind.TYPE",Ws.SCALAR_TYPE="MapperKind.SCALAR_TYPE",Ws.ENUM_TYPE="MapperKind.ENUM_TYPE",Ws.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",Ws.OBJECT_TYPE="MapperKind.OBJECT_TYPE",Ws.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",Ws.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",Ws.UNION_TYPE="MapperKind.UNION_TYPE",Ws.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",Ws.ROOT_OBJECT="MapperKind.ROOT_OBJECT",Ws.QUERY="MapperKind.QUERY",Ws.MUTATION="MapperKind.MUTATION",Ws.SUBSCRIPTION="MapperKind.SUBSCRIPTION",Ws.DIRECTIVE="MapperKind.DIRECTIVE",Ws.FIELD="MapperKind.FIELD",Ws.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",Ws.OBJECT_FIELD="MapperKind.OBJECT_FIELD",Ws.ROOT_FIELD="MapperKind.ROOT_FIELD",Ws.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",Ws.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",Ws.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",Ws.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",Ws.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",Ws.ARGUMENT="MapperKind.ARGUMENT",Ws.ENUM_VALUE="MapperKind.ENUM_VALUE"})(MapperKind||(MapperKind={}));function getObjectTypeFromTypeMap(Ws,ws){if(ws){const oi=Ws[ws.name];if(isObjectType(oi))return oi}}function isNamedStub(Ws){if("getFields"in Ws){const ws=Ws.getFields();for(const oi in ws)return ws[oi].name==="_fake"}return!1}function getBuiltInForStub(Ws){switch(Ws.name){case GraphQLInt.name:return GraphQLInt;case GraphQLFloat.name:return GraphQLFloat;case GraphQLString.name:return GraphQLString;case GraphQLBoolean.name:return GraphQLBoolean;case GraphQLID.name:return GraphQLID;default:return Ws}}function rewireTypes(Ws,ws){const oi=Object.create(null);for(const ha in Ws)oi[ha]=Ws[ha];const si=Object.create(null);for(const ha in oi){const ga=oi[ha];if(ga==null||ha.startsWith("__"))continue;const va=ga.name;if(!va.startsWith("__")){if(si[va]!=null){console.warn(`Duplicate schema type name ${va} found; keeping the existing one found in the schema`);continue}si[va]=ga}}for(const ha in si)si[ha]=ci(si[ha]);const ii=ws.map(ha=>ai(ha));return{typeMap:si,directives:ii};function ai(ha){if(isSpecifiedDirective(ha))return ha;const ga=ha.toConfig();return ga.args=li(ga.args),new GraphQLDirective(ga)}function li(ha){const ga={};for(const va in ha){const ba=ha[va],wa=pi(ba.type);wa!=null&&(ba.type=wa,ga[va]=ba)}return ga}function ci(ha){if(isObjectType(ha)){const ga=ha.toConfig(),va={...ga,fields:()=>ui(ga.fields),interfaces:()=>hi(ga.interfaces)};return new GraphQLObjectType(va)}else if(isInterfaceType(ha)){const ga=ha.toConfig(),va={...ga,fields:()=>ui(ga.fields)};return"interfaces"in va&&(va.interfaces=()=>hi(ga.interfaces)),new GraphQLInterfaceType(va)}else if(isUnionType(ha)){const ga=ha.toConfig(),va={...ga,types:()=>hi(ga.types)};return new GraphQLUnionType(va)}else if(isInputObjectType(ha)){const ga=ha.toConfig(),va={...ga,fields:()=>di(ga.fields)};return new GraphQLInputObjectType(va)}else if(isEnumType(ha)){const ga=ha.toConfig();return new GraphQLEnumType(ga)}else if(isScalarType(ha)){if(isSpecifiedScalarType(ha))return ha;const ga=ha.toConfig();return new GraphQLScalarType(ga)}throw new Error(`Unexpected schema type: ${ha}`)}function ui(ha){const ga={};for(const va in ha){const ba=ha[va],wa=pi(ba.type);wa!=null&&ba.args&&(ba.type=wa,ba.args=li(ba.args),ga[va]=ba)}return ga}function di(ha){const ga={};for(const va in ha){const ba=ha[va],wa=pi(ba.type);wa!=null&&(ba.type=wa,ga[va]=ba)}return ga}function hi(ha){const ga=[];for(const va of ha){const ba=pi(va);ba!=null&&ga.push(ba)}return ga}function pi(ha){if(isListType(ha)){const ga=pi(ha.ofType);return ga!=null?new GraphQLList(ga):null}else if(isNonNullType(ha)){const ga=pi(ha.ofType);return ga!=null?new GraphQLNonNull(ga):null}else if(isNamedType(ha)){let ga=oi[ha.name];return ga===void 0&&(ga=isNamedStub(ha)?getBuiltInForStub(ha):ci(ha),si[ga.name]=oi[ha.name]=ga),ga!=null?si[ga.name]:null}return null}}function transformInputValue(Ws,ws,oi=null,si=null){if(ws==null)return ws;const ii=getNullableType(Ws);if(isLeafType(ii))return oi!=null?oi(ii,ws):ws;if(isListType(ii))return asArray(ws).map(ai=>transformInputValue(ii.ofType,ai,oi,si));if(isInputObjectType(ii)){const ai=ii.getFields(),li={};for(const ci in ws){const ui=ai[ci];ui!=null&&(li[ci]=transformInputValue(ui.type,ws[ci],oi,si))}return si!=null?si(ii,li):li}}function serializeInputValue(Ws,ws){return transformInputValue(Ws,ws,(oi,si)=>{try{return oi.serialize(si)}catch{return si}})}function parseInputValue(Ws,ws){return transformInputValue(Ws,ws,(oi,si)=>{try{return oi.parseValue(si)}catch{return si}})}function mapSchema(Ws,ws={}){const oi=mapArguments(mapFields(mapTypes(mapDefaultValues(mapEnumValues(mapTypes(mapDefaultValues(Ws.getTypeMap(),Ws,serializeInputValue),Ws,ws,ci=>isLeafType(ci)),Ws,ws),Ws,parseInputValue),Ws,ws,ci=>!isLeafType(ci)),Ws,ws),Ws,ws),si=Ws.getDirectives(),ii=mapDirectives(si,Ws,ws),{typeMap:ai,directives:li}=rewireTypes(oi,ii);return new GraphQLSchema({...Ws.toConfig(),query:getObjectTypeFromTypeMap(ai,getObjectTypeFromTypeMap(oi,Ws.getQueryType())),mutation:getObjectTypeFromTypeMap(ai,getObjectTypeFromTypeMap(oi,Ws.getMutationType())),subscription:getObjectTypeFromTypeMap(ai,getObjectTypeFromTypeMap(oi,Ws.getSubscriptionType())),types:Object.values(ai),directives:li})}function mapTypes(Ws,ws,oi,si=()=>!0){const ii={};for(const ai in Ws)if(!ai.startsWith("__")){const li=Ws[ai];if(li==null||!si(li)){ii[ai]=li;continue}const ci=getTypeMapper(ws,oi,ai);if(ci==null){ii[ai]=li;continue}const ui=ci(li,ws);if(ui===void 0){ii[ai]=li;continue}ii[ai]=ui}return ii}function mapEnumValues(Ws,ws,oi){const si=getEnumValueMapper(oi);return si?mapTypes(Ws,ws,{[MapperKind.ENUM_TYPE]:ii=>{const ai=ii.toConfig(),li=ai.values,ci={};for(const ui in li){const di=li[ui],hi=si(di,ii.name,ws,ui);if(hi===void 0)ci[ui]=di;else if(Array.isArray(hi)){const[pi,ha]=hi;ci[pi]=ha===void 0?di:ha}else hi!==null&&(ci[ui]=hi)}return correctASTNodes(new GraphQLEnumType({...ai,values:ci}))}},ii=>isEnumType(ii)):Ws}function mapDefaultValues(Ws,ws,oi){const si=mapArguments(Ws,ws,{[MapperKind.ARGUMENT]:ii=>{if(ii.defaultValue===void 0)return ii;const ai=getNewType(Ws,ii.type);if(ai!=null)return{...ii,defaultValue:oi(ai,ii.defaultValue)}}});return mapFields(si,ws,{[MapperKind.INPUT_OBJECT_FIELD]:ii=>{if(ii.defaultValue===void 0)return ii;const ai=getNewType(si,ii.type);if(ai!=null)return{...ii,defaultValue:oi(ai,ii.defaultValue)}}})}function getNewType(Ws,ws){if(isListType(ws)){const oi=getNewType(Ws,ws.ofType);return oi!=null?new GraphQLList(oi):null}else if(isNonNullType(ws)){const oi=getNewType(Ws,ws.ofType);return oi!=null?new GraphQLNonNull(oi):null}else if(isNamedType(ws))return Ws[ws.name]??null;return null}function mapFields(Ws,ws,oi){const si={};for(const ii in Ws)if(!ii.startsWith("__")){const ai=Ws[ii];if(!isObjectType(ai)&&!isInterfaceType(ai)&&!isInputObjectType(ai)){si[ii]=ai;continue}const li=getFieldMapper(ws,oi,ii);if(li==null){si[ii]=ai;continue}const ci=ai.toConfig(),ui=ci.fields,di={};for(const hi in ui){const pi=ui[hi],ha=li(pi,hi,ii,ws);if(ha===void 0)di[hi]=pi;else if(Array.isArray(ha)){const[ga,va]=ha;va.astNode!=null&&(va.astNode={...va.astNode,name:{...va.astNode.name,value:ga}}),di[ga]=va===void 0?pi:va}else ha!==null&&(di[hi]=ha)}isObjectType(ai)?si[ii]=correctASTNodes(new GraphQLObjectType({...ci,fields:di})):isInterfaceType(ai)?si[ii]=correctASTNodes(new GraphQLInterfaceType({...ci,fields:di})):si[ii]=correctASTNodes(new GraphQLInputObjectType({...ci,fields:di}))}return si}function mapArguments(Ws,ws,oi){const si={};for(const ii in Ws)if(!ii.startsWith("__")){const ai=Ws[ii];if(!isObjectType(ai)&&!isInterfaceType(ai)){si[ii]=ai;continue}const li=getArgumentMapper(oi);if(li==null){si[ii]=ai;continue}const ci=ai.toConfig(),ui=ci.fields,di={};for(const hi in ui){const pi=ui[hi],ha=pi.args;if(ha==null){di[hi]=pi;continue}const ga=Object.keys(ha);if(!ga.length){di[hi]=pi;continue}const va={};for(const ba of ga){const wa=ha[ba],xa=li(wa,hi,ii,ws);if(xa===void 0)va[ba]=wa;else if(Array.isArray(xa)){const[Ca,el]=xa;va[Ca]=el}else xa!==null&&(va[ba]=xa)}di[hi]={...pi,args:va}}isObjectType(ai)?si[ii]=new GraphQLObjectType({...ci,fields:di}):isInterfaceType(ai)?si[ii]=new GraphQLInterfaceType({...ci,fields:di}):si[ii]=new GraphQLInputObjectType({...ci,fields:di})}return si}function mapDirectives(Ws,ws,oi){const si=getDirectiveMapper(oi);if(si==null)return Ws.slice();const ii=[];for(const ai of Ws){const li=si(ai,ws);li===void 0?ii.push(ai):li!==null&&ii.push(li)}return ii}function getTypeSpecifiers(Ws,ws){var oi,si,ii;const ai=Ws.getType(ws),li=[MapperKind.TYPE];return isObjectType(ai)?(li.push(MapperKind.COMPOSITE_TYPE,MapperKind.OBJECT_TYPE),ws===((oi=Ws.getQueryType())==null?void 0:oi.name)?li.push(MapperKind.ROOT_OBJECT,MapperKind.QUERY):ws===((si=Ws.getMutationType())==null?void 0:si.name)?li.push(MapperKind.ROOT_OBJECT,MapperKind.MUTATION):ws===((ii=Ws.getSubscriptionType())==null?void 0:ii.name)&&li.push(MapperKind.ROOT_OBJECT,MapperKind.SUBSCRIPTION)):isInputObjectType(ai)?li.push(MapperKind.INPUT_OBJECT_TYPE):isInterfaceType(ai)?li.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.INTERFACE_TYPE):isUnionType(ai)?li.push(MapperKind.COMPOSITE_TYPE,MapperKind.ABSTRACT_TYPE,MapperKind.UNION_TYPE):isEnumType(ai)?li.push(MapperKind.ENUM_TYPE):isScalarType(ai)&&li.push(MapperKind.SCALAR_TYPE),li}function getTypeMapper(Ws,ws,oi){const si=getTypeSpecifiers(Ws,oi);let ii;const ai=[...si];for(;!ii&&ai.length>0;){const li=ai.pop();ii=ws[li]}return ii??null}function getFieldSpecifiers(Ws,ws){var oi,si,ii;const ai=Ws.getType(ws),li=[MapperKind.FIELD];return isObjectType(ai)?(li.push(MapperKind.COMPOSITE_FIELD,MapperKind.OBJECT_FIELD),ws===((oi=Ws.getQueryType())==null?void 0:oi.name)?li.push(MapperKind.ROOT_FIELD,MapperKind.QUERY_ROOT_FIELD):ws===((si=Ws.getMutationType())==null?void 0:si.name)?li.push(MapperKind.ROOT_FIELD,MapperKind.MUTATION_ROOT_FIELD):ws===((ii=Ws.getSubscriptionType())==null?void 0:ii.name)&&li.push(MapperKind.ROOT_FIELD,MapperKind.SUBSCRIPTION_ROOT_FIELD)):isInterfaceType(ai)?li.push(MapperKind.COMPOSITE_FIELD,MapperKind.INTERFACE_FIELD):isInputObjectType(ai)&&li.push(MapperKind.INPUT_OBJECT_FIELD),li}function getFieldMapper(Ws,ws,oi){const si=getFieldSpecifiers(Ws,oi);let ii;const ai=[...si];for(;!ii&&ai.length>0;){const li=ai.pop();ii=ws[li]}return ii??null}function getArgumentMapper(Ws){return Ws[MapperKind.ARGUMENT]??null}function getDirectiveMapper(Ws){return Ws[MapperKind.DIRECTIVE]??null}function getEnumValueMapper(Ws){return Ws[MapperKind.ENUM_VALUE]??null}function correctASTNodes(Ws){if(isObjectType(Ws)){const ws=Ws.toConfig();if(ws.astNode!=null){const oi=[];for(const si in ws.fields){const ii=ws.fields[si];ii.astNode!=null&&oi.push(ii.astNode)}ws.astNode={...ws.astNode,kind:Kind.OBJECT_TYPE_DEFINITION,fields:oi}}return ws.extensionASTNodes!=null&&(ws.extensionASTNodes=ws.extensionASTNodes.map(oi=>({...oi,kind:Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLObjectType(ws)}else if(isInterfaceType(Ws)){const ws=Ws.toConfig();if(ws.astNode!=null){const oi=[];for(const si in ws.fields){const ii=ws.fields[si];ii.astNode!=null&&oi.push(ii.astNode)}ws.astNode={...ws.astNode,kind:Kind.INTERFACE_TYPE_DEFINITION,fields:oi}}return ws.extensionASTNodes!=null&&(ws.extensionASTNodes=ws.extensionASTNodes.map(oi=>({...oi,kind:Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new GraphQLInterfaceType(ws)}else if(isInputObjectType(Ws)){const ws=Ws.toConfig();if(ws.astNode!=null){const oi=[];for(const si in ws.fields){const ii=ws.fields[si];ii.astNode!=null&&oi.push(ii.astNode)}ws.astNode={...ws.astNode,kind:Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:oi}}return ws.extensionASTNodes!=null&&(ws.extensionASTNodes=ws.extensionASTNodes.map(oi=>({...oi,kind:Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new GraphQLInputObjectType(ws)}else if(isEnumType(Ws)){const ws=Ws.toConfig();if(ws.astNode!=null){const oi=[];for(const si in ws.values){const ii=ws.values[si];ii.astNode!=null&&oi.push(ii.astNode)}ws.astNode={...ws.astNode,values:oi}}return ws.extensionASTNodes!=null&&(ws.extensionASTNodes=ws.extensionASTNodes.map(oi=>({...oi,values:void 0}))),new GraphQLEnumType(ws)}else return Ws}function filterSchema({schema:Ws,typeFilter:ws=()=>!0,fieldFilter:oi=void 0,rootFieldFilter:si=void 0,objectFieldFilter:ii=void 0,interfaceFieldFilter:ai=void 0,inputObjectFieldFilter:li=void 0,argumentFilter:ci=void 0,directiveFilter:ui=void 0,enumValueFilter:di=void 0}){return mapSchema(Ws,{[MapperKind.QUERY]:hi=>filterRootFields(hi,"Query",si,ci),[MapperKind.MUTATION]:hi=>filterRootFields(hi,"Mutation",si,ci),[MapperKind.SUBSCRIPTION]:hi=>filterRootFields(hi,"Subscription",si,ci),[MapperKind.OBJECT_TYPE]:hi=>ws(hi.name,hi)?filterElementFields(GraphQLObjectType,hi,ii||oi,ci):null,[MapperKind.INTERFACE_TYPE]:hi=>ws(hi.name,hi)?filterElementFields(GraphQLInterfaceType,hi,ai||oi,ci):null,[MapperKind.INPUT_OBJECT_TYPE]:hi=>ws(hi.name,hi)?filterElementFields(GraphQLInputObjectType,hi,li||oi):null,[MapperKind.UNION_TYPE]:hi=>ws(hi.name,hi)?void 0:null,[MapperKind.ENUM_TYPE]:hi=>ws(hi.name,hi)?void 0:null,[MapperKind.SCALAR_TYPE]:hi=>ws(hi.name,hi)?void 0:null,[MapperKind.DIRECTIVE]:hi=>ui&&!ui(hi.name,hi)?null:void 0,[MapperKind.ENUM_VALUE]:(hi,pi,ha,ga)=>di&&!di(pi,ga,hi)?null:void 0})}function filterRootFields(Ws,ws,oi,si){if(oi||si){const ii=Ws.toConfig();for(const ai in ii.fields){const li=ii.fields[ai];if(oi&&!oi(ws,ai,ii.fields[ai]))delete ii.fields[ai];else if(si&&li.args)for(const ci in li.args)si(Ws.name,ai,ci,li.args[ci])||delete li.args[ci]}return new GraphQLObjectType(ii)}return Ws}function filterElementFields(Ws,ws,oi,si){if(oi||si){const ii=ws.toConfig();for(const ai in ii.fields){const li=ii.fields[ai];if(oi&&!oi(ws.name,ai,ii.fields[ai]))delete ii.fields[ai];else if(si&&"args"in li)for(const ci in li.args)si(ws.name,ai,ci,li.args[ci])||delete li.args[ci]}return new Ws(ii)}}const hiddenQueryTypeDefinitions=parse(hiddenQueryTypeDefDoc).definitions,standardLibCustomScalarDefinitions=parse(typeDefsDoc).definitions,alwaysIncludedDefinitions=[...hiddenQueryTypeDefinitions,...standardLibCustomScalarDefinitions],rules=createDefaultRules().filter(Ws=>Ws.name!=="ExecutableDefinitionsRule");function makeSharedSchemaSdl(Ws,ws,oi,si){try{const ii=buildSchema(Ws),ai=[ws,oi,si].filter(Boolean).map(ci=>safeParseSdl(ci)).filter(Boolean),li=makeSafeDocumentNode(ii,ai);return printSchema(buildASTSchema(li))}catch(ii){return console.debug("in make shared schema",ii),Ws}}function makeSafeDocumentNode(Ws,ws){try{const oi=[...alwaysIncludedDefinitions];for(const si of ws)for(const ii of si.definitions){const ai={kind:Kind.DOCUMENT,definitions:[ii]};safeValidateAst(Ws,ai)&&oi.push(ii)}return{kind:Kind.DOCUMENT,definitions:oi}}catch(oi){return console.debug("in make safe document node",oi),{kind:Kind.DOCUMENT,definitions:alwaysIncludedDefinitions}}}function safeValidateAst(Ws,ws){try{return!validate(Ws,ws,rules).length}catch(oi){return console.debug("in safe validate",oi),!1}}function safeParseSdl(Ws){try{return!Ws||!isDocumentString(Ws)?null:parse(Ws)}catch(ws){return console.debug("in safe parse",ws),null}}const SchemaContext=createContext(printSchema(initialSchema));function SchemaContextProvider(Ws){const{children:ws,globalStateSchemaSdl:oi,localStateSchemaSdl:si,operationSchemasSdl:ii}=Ws,[ai,li]=useState(()=>makeSharedSchemaSdl(printSchema(initialSchema),oi,si,ii));return useEffect(()=>{li(ci=>makeSharedSchemaSdl(ci,oi,si,ii))},[oi,si,ii]),jsx(SchemaContext.Provider,{value:ai,children:ws})}function useSchemaContext(){return useContext(SchemaContext)}class CompletionContext{constructor(ws,oi,si,ii){this.state=ws,this.pos=oi,this.explicit=si,this.view=ii,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(ws){let oi=syntaxTree(this.state).resolveInner(this.pos,-1);for(;oi&&ws.indexOf(oi.name)<0;)oi=oi.parent;return oi?{from:oi.from,to:this.pos,text:this.state.sliceDoc(oi.from,this.pos),type:oi.type}:null}matchBefore(ws){let oi=this.state.doc.lineAt(this.pos),si=Math.max(oi.from,this.pos-250),ii=oi.text.slice(si-oi.from,this.pos-oi.from),ai=ii.search(ensureAnchor(ws,!1));return ai<0?null:{from:si+ai,to:this.pos,text:ii.slice(ai)}}get aborted(){return this.abortListeners==null}addEventListener(ws,oi,si){ws=="abort"&&this.abortListeners&&(this.abortListeners.push(oi),si&&si.onDocChange&&(this.abortOnDocChange=!0))}}function toSet(Ws){let ws=Object.keys(Ws).join(""),oi=/\w/.test(ws);return oi&&(ws=ws.replace(/\w/g,"")),`[${oi?"\\w":""}${ws.replace(/[^\w\s]/g,"\\$&")}]`}function prefixMatch(Ws){let ws=Object.create(null),oi=Object.create(null);for(let{label:ii}of Ws){ws[ii[0]]=!0;for(let ai=1;ai<ii.length;ai++)oi[ii[ai]]=!0}let si=toSet(ws)+toSet(oi)+"*$";return[new RegExp("^"+si),new RegExp(si)]}function completeFromList(Ws){let ws=Ws.map(ii=>typeof ii=="string"?{label:ii}:ii),[oi,si]=ws.every(ii=>/^\w+$/.test(ii.label))?[/\w*$/,/\w+$/]:prefixMatch(ws);return ii=>{let ai=ii.matchBefore(si);return ai||ii.explicit?{from:ai?ai.from:ii.pos,options:ws,validFor:oi}:null}}class Option{constructor(ws,oi,si,ii){this.completion=ws,this.source=oi,this.match=si,this.score=ii}}function cur(Ws){return Ws.selection.main.from}function ensureAnchor(Ws,ws){var oi;let{source:si}=Ws,ii=ws&&si[0]!="^",ai=si[si.length-1]!="$";return!ii&&!ai?Ws:new RegExp(`${ii?"^":""}(?:${si})${ai?"$":""}`,(oi=Ws.flags)!==null&&oi!==void 0?oi:Ws.ignoreCase?"i":"")}const pickedCompletion=Annotation.define();function insertCompletionText(Ws,ws,oi,si){let{main:ii}=Ws.selection,ai=oi-ii.from,li=si-ii.from;return Object.assign(Object.assign({},Ws.changeByRange(ci=>{if(ci!=ii&&oi!=si&&Ws.sliceDoc(ci.from+ai,ci.from+li)!=Ws.sliceDoc(oi,si))return{range:ci};let ui=Ws.toText(ws);return{changes:{from:ci.from+ai,to:si==ii.from?ci.to:ci.from+li,insert:ui},range:EditorSelection.cursor(ci.from+ai+ui.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const SourceCache=new WeakMap;function asSource(Ws){if(!Array.isArray(Ws))return Ws;let ws=SourceCache.get(Ws);return ws||SourceCache.set(Ws,ws=completeFromList(Ws)),ws}const startCompletionEffect=StateEffect.define(),closeCompletionEffect=StateEffect.define();class FuzzyMatcher{constructor(ws){this.pattern=ws,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let oi=0;oi<ws.length;){let si=codePointAt(ws,oi),ii=codePointSize(si);this.chars.push(si);let ai=ws.slice(oi,oi+ii),li=ai.toUpperCase();this.folded.push(codePointAt(li==ai?ai.toLowerCase():li,0)),oi+=ii}this.astral=ws.length!=this.chars.length}ret(ws,oi){return this.score=ws,this.matched=oi,this}match(ws){if(this.pattern.length==0)return this.ret(-100,[]);if(ws.length<this.pattern.length)return null;let{chars:oi,folded:si,any:ii,precise:ai,byWord:li}=this;if(oi.length==1){let Ca=codePointAt(ws,0),el=codePointSize(Ca),ku=el==ws.length?0:-100;if(Ca!=oi[0])if(Ca==si[0])ku+=-200;else return null;return this.ret(ku,[0,el])}let ci=ws.indexOf(this.pattern);if(ci==0)return this.ret(ws.length==this.pattern.length?0:-100,[0,this.pattern.length]);let ui=oi.length,di=0;if(ci<0){for(let Ca=0,el=Math.min(ws.length,200);Ca<el&&di<ui;){let ku=codePointAt(ws,Ca);(ku==oi[di]||ku==si[di])&&(ii[di++]=Ca),Ca+=codePointSize(ku)}if(di<ui)return null}let hi=0,pi=0,ha=!1,ga=0,va=-1,ba=-1,wa=/[a-z]/.test(ws),xa=!0;for(let Ca=0,el=Math.min(ws.length,200),ku=0;Ca<el&&pi<ui;){let gd=codePointAt(ws,Ca);ci<0&&(hi<ui&&gd==oi[hi]&&(ai[hi++]=Ca),ga<ui&&(gd==oi[ga]||gd==si[ga]?(ga==0&&(va=Ca),ba=Ca+1,ga++):ga=0));let Ed,Od=gd<255?gd>=48&&gd<=57||gd>=97&&gd<=122?2:gd>=65&&gd<=90?1:0:(Ed=fromCodePoint(gd))!=Ed.toLowerCase()?1:Ed!=Ed.toUpperCase()?2:0;(!Ca||Od==1&&wa||ku==0&&Od!=0)&&(oi[pi]==gd||si[pi]==gd&&(ha=!0)?li[pi++]=Ca:li.length&&(xa=!1)),ku=Od,Ca+=codePointSize(gd)}return pi==ui&&li[0]==0&&xa?this.result(-100+(ha?-200:0),li,ws):ga==ui&&va==0?this.ret(-200-ws.length+(ba==ws.length?0:-100),[0,ba]):ci>-1?this.ret(-700-ws.length,[ci,ci+this.pattern.length]):ga==ui?this.ret(-900-ws.length,[va,ba]):pi==ui?this.result(-100+(ha?-200:0)+-700+(xa?0:-1100),li,ws):oi.length==2?null:this.result((ii[0]?-700:0)+-200+-1100,ii,ws)}result(ws,oi,si){let ii=[],ai=0;for(let li of oi){let ci=li+(this.astral?codePointSize(codePointAt(si,li)):1);ai&&ii[ai-1]==li?ii[ai-1]=ci:(ii[ai++]=li,ii[ai++]=ci)}return this.ret(ws-si.length,ii)}}class StrictMatcher{constructor(ws){this.pattern=ws,this.matched=[],this.score=0,this.folded=ws.toLowerCase()}match(ws){if(ws.length<this.pattern.length)return null;let oi=ws.slice(0,this.pattern.length),si=oi==this.pattern?0:oi.toLowerCase()==this.folded?-200:null;return si==null?null:(this.matched=[0,oi.length],this.score=si+(ws.length==this.pattern.length?0:-100),this)}}const completionConfig=Facet.define({combine(Ws){return combineConfig(Ws,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(ws,oi)=>ws.label.localeCompare(oi.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(ws,oi)=>ws&&oi,closeOnBlur:(ws,oi)=>ws&&oi,icons:(ws,oi)=>ws&&oi,tooltipClass:(ws,oi)=>si=>joinClass(ws(si),oi(si)),optionClass:(ws,oi)=>si=>joinClass(ws(si),oi(si)),addToOptions:(ws,oi)=>ws.concat(oi),filterStrict:(ws,oi)=>ws||oi})}});function joinClass(Ws,ws){return Ws?ws?Ws+" "+ws:Ws:ws}function defaultPositionInfo(Ws,ws,oi,si,ii,ai){let li=Ws.textDirection==Direction.RTL,ci=li,ui=!1,di="top",hi,pi,ha=ws.left-ii.left,ga=ii.right-ws.right,va=si.right-si.left,ba=si.bottom-si.top;if(ci&&ha<Math.min(va,ga)?ci=!1:!ci&&ga<Math.min(va,ha)&&(ci=!0),va<=(ci?ha:ga))hi=Math.max(ii.top,Math.min(oi.top,ii.bottom-ba))-ws.top,pi=Math.min(400,ci?ha:ga);else{ui=!0,pi=Math.min(400,(li?ws.right:ii.right-ws.left)-30);let Ca=ii.bottom-ws.bottom;Ca>=ba||Ca>ws.top?hi=oi.bottom-ws.top:(di="bottom",hi=ws.bottom-oi.top)}let wa=(ws.bottom-ws.top)/ai.offsetHeight,xa=(ws.right-ws.left)/ai.offsetWidth;return{style:`${di}: ${hi/wa}px; max-width: ${pi/xa}px`,class:"cm-completionInfo-"+(ui?li?"left-narrow":"right-narrow":ci?"left":"right")}}function optionContent(Ws){let ws=Ws.addToOptions.slice();return Ws.icons&&ws.push({render(oi){let si=document.createElement("div");return si.classList.add("cm-completionIcon"),oi.type&&si.classList.add(...oi.type.split(/\s+/g).map(ii=>"cm-completionIcon-"+ii)),si.setAttribute("aria-hidden","true"),si},position:20}),ws.push({render(oi,si,ii,ai){let li=document.createElement("span");li.className="cm-completionLabel";let ci=oi.displayLabel||oi.label,ui=0;for(let di=0;di<ai.length;){let hi=ai[di++],pi=ai[di++];hi>ui&&li.appendChild(document.createTextNode(ci.slice(ui,hi)));let ha=li.appendChild(document.createElement("span"));ha.appendChild(document.createTextNode(ci.slice(hi,pi))),ha.className="cm-completionMatchedText",ui=pi}return ui<ci.length&&li.appendChild(document.createTextNode(ci.slice(ui))),li},position:50},{render(oi){if(!oi.detail)return null;let si=document.createElement("span");return si.className="cm-completionDetail",si.textContent=oi.detail,si},position:80}),ws.sort((oi,si)=>oi.position-si.position).map(oi=>oi.render)}function rangeAroundSelected(Ws,ws,oi){if(Ws<=oi)return{from:0,to:Ws};if(ws<0&&(ws=0),ws<=Ws>>1){let ii=Math.floor(ws/oi);return{from:ii*oi,to:(ii+1)*oi}}let si=Math.floor((Ws-ws)/oi);return{from:Ws-(si+1)*oi,to:Ws-si*oi}}class CompletionTooltip{constructor(ws,oi,si){this.view=ws,this.stateField=oi,this.applyCompletion=si,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:ui=>this.placeInfo(ui),key:this},this.space=null,this.currentClass="";let ii=ws.state.field(oi),{options:ai,selected:li}=ii.open,ci=ws.state.facet(completionConfig);this.optionContent=optionContent(ci),this.optionClass=ci.optionClass,this.tooltipClass=ci.tooltipClass,this.range=rangeAroundSelected(ai.length,li,ci.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(ws.state),this.dom.addEventListener("mousedown",ui=>{let{options:di}=ws.state.field(oi).open;for(let hi=ui.target,pi;hi&&hi!=this.dom;hi=hi.parentNode)if(hi.nodeName=="LI"&&(pi=/-(\d+)$/.exec(hi.id))&&+pi[1]<di.length){this.applyCompletion(ws,di[+pi[1]]),ui.preventDefault();return}}),this.dom.addEventListener("focusout",ui=>{let di=ws.state.field(this.stateField,!1);di&&di.tooltip&&ws.state.facet(completionConfig).closeOnBlur&&ui.relatedTarget!=ws.contentDOM&&ws.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(ai,ii.id)}mount(){this.updateSel()}showOptions(ws,oi){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(ws,oi,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(ws){var oi;let si=ws.state.field(this.stateField),ii=ws.startState.field(this.stateField);if(this.updateTooltipClass(ws.state),si!=ii){let{options:ai,selected:li,disabled:ci}=si.open;(!ii.open||ii.open.options!=ai)&&(this.range=rangeAroundSelected(ai.length,li,ws.state.facet(completionConfig).maxRenderedOptions),this.showOptions(ai,si.id)),this.updateSel(),ci!=((oi=ii.open)===null||oi===void 0?void 0:oi.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!ci)}}updateTooltipClass(ws){let oi=this.tooltipClass(ws);if(oi!=this.currentClass){for(let si of this.currentClass.split(" "))si&&this.dom.classList.remove(si);for(let si of oi.split(" "))si&&this.dom.classList.add(si);this.currentClass=oi}}positioned(ws){this.space=ws,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let ws=this.view.state.field(this.stateField),oi=ws.open;if((oi.selected>-1&&oi.selected<this.range.from||oi.selected>=this.range.to)&&(this.range=rangeAroundSelected(oi.options.length,oi.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(oi.options,ws.id)),this.updateSelectedOption(oi.selected)){this.destroyInfo();let{completion:si}=oi.options[oi.selected],{info:ii}=si;if(!ii)return;let ai=typeof ii=="string"?document.createTextNode(ii):ii(si);if(!ai)return;"then"in ai?ai.then(li=>{li&&this.view.state.field(this.stateField,!1)==ws&&this.addInfoPane(li,si)}).catch(li=>logException(this.view.state,li,"completion info")):this.addInfoPane(ai,si)}}addInfoPane(ws,oi){this.destroyInfo();let si=this.info=document.createElement("div");if(si.className="cm-tooltip cm-completionInfo",ws.nodeType!=null)si.appendChild(ws),this.infoDestroy=null;else{let{dom:ii,destroy:ai}=ws;si.appendChild(ii),this.infoDestroy=ai||null}this.dom.appendChild(si),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(ws){let oi=null;for(let si=this.list.firstChild,ii=this.range.from;si;si=si.nextSibling,ii++)si.nodeName!="LI"||!si.id?ii--:ii==ws?si.hasAttribute("aria-selected")||(si.setAttribute("aria-selected","true"),oi=si):si.hasAttribute("aria-selected")&&si.removeAttribute("aria-selected");return oi&&scrollIntoView(this.list,oi),oi}measureInfo(){let ws=this.dom.querySelector("[aria-selected]");if(!ws||!this.info)return null;let oi=this.dom.getBoundingClientRect(),si=this.info.getBoundingClientRect(),ii=ws.getBoundingClientRect(),ai=this.space;if(!ai){let li=this.dom.ownerDocument.defaultView||window;ai={left:0,top:0,right:li.innerWidth,bottom:li.innerHeight}}return ii.top>Math.min(ai.bottom,oi.bottom)-10||ii.bottom<Math.max(ai.top,oi.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,oi,ii,si,ai,this.dom)}placeInfo(ws){this.info&&(ws?(ws.style&&(this.info.style.cssText=ws.style),this.info.className="cm-tooltip cm-completionInfo "+(ws.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(ws,oi,si){const ii=document.createElement("ul");ii.id=oi,ii.setAttribute("role","listbox"),ii.setAttribute("aria-expanded","true"),ii.setAttribute("aria-label",this.view.state.phrase("Completions"));let ai=null;for(let li=si.from;li<si.to;li++){let{completion:ci,match:ui}=ws[li],{section:di}=ci;if(di){let ha=typeof di=="string"?di:di.name;if(ha!=ai&&(li>si.from||si.from==0))if(ai=ha,typeof di!="string"&&di.header)ii.appendChild(di.header(di));else{let ga=ii.appendChild(document.createElement("completion-section"));ga.textContent=ha}}const hi=ii.appendChild(document.createElement("li"));hi.id=oi+"-"+li,hi.setAttribute("role","option");let pi=this.optionClass(ci);pi&&(hi.className=pi);for(let ha of this.optionContent){let ga=ha(ci,this.view.state,this.view,ui);ga&&hi.appendChild(ga)}}return si.from&&ii.classList.add("cm-completionListIncompleteTop"),si.to<ws.length&&ii.classList.add("cm-completionListIncompleteBottom"),ii}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function completionTooltip(Ws,ws){return oi=>new CompletionTooltip(oi,Ws,ws)}function scrollIntoView(Ws,ws){let oi=Ws.getBoundingClientRect(),si=ws.getBoundingClientRect(),ii=oi.height/Ws.offsetHeight;si.top<oi.top?Ws.scrollTop-=(oi.top-si.top)/ii:si.bottom>oi.bottom&&(Ws.scrollTop+=(si.bottom-oi.bottom)/ii)}function score(Ws){return(Ws.boost||0)*100+(Ws.apply?10:0)+(Ws.info?5:0)+(Ws.type?1:0)}function sortOptions(Ws,ws){let oi=[],si=null,ii=di=>{oi.push(di);let{section:hi}=di.completion;if(hi){si||(si=[]);let pi=typeof hi=="string"?hi:hi.name;si.some(ha=>ha.name==pi)||si.push(typeof hi=="string"?{name:pi}:hi)}},ai=ws.facet(completionConfig);for(let di of Ws)if(di.hasResult()){let hi=di.result.getMatch;if(di.result.filter===!1)for(let pi of di.result.options)ii(new Option(pi,di.source,hi?hi(pi):[],1e9-oi.length));else{let pi=ws.sliceDoc(di.from,di.to),ha,ga=ai.filterStrict?new StrictMatcher(pi):new FuzzyMatcher(pi);for(let va of di.result.options)if(ha=ga.match(va.label)){let ba=va.displayLabel?hi?hi(va,ha.matched):[]:ha.matched;ii(new Option(va,di.source,ba,ha.score+(va.boost||0)))}}}if(si){let di=Object.create(null),hi=0,pi=(ha,ga)=>{var va,ba;return((va=ha.rank)!==null&&va!==void 0?va:1e9)-((ba=ga.rank)!==null&&ba!==void 0?ba:1e9)||(ha.name<ga.name?-1:1)};for(let ha of si.sort(pi))hi-=1e5,di[ha.name]=hi;for(let ha of oi){let{section:ga}=ha.completion;ga&&(ha.score+=di[typeof ga=="string"?ga:ga.name])}}let li=[],ci=null,ui=ai.compareCompletions;for(let di of oi.sort((hi,pi)=>pi.score-hi.score||ui(hi.completion,pi.completion))){let hi=di.completion;!ci||ci.label!=hi.label||ci.detail!=hi.detail||ci.type!=null&&hi.type!=null&&ci.type!=hi.type||ci.apply!=hi.apply||ci.boost!=hi.boost?li.push(di):score(di.completion)>score(ci)&&(li[li.length-1]=di),ci=di.completion}return li}class CompletionDialog{constructor(ws,oi,si,ii,ai,li){this.options=ws,this.attrs=oi,this.tooltip=si,this.timestamp=ii,this.selected=ai,this.disabled=li}setSelected(ws,oi){return ws==this.selected||ws>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(oi,ws),this.tooltip,this.timestamp,ws,this.disabled)}static build(ws,oi,si,ii,ai,li){if(ii&&!li&&ws.some(di=>di.isPending))return ii.setDisabled();let ci=sortOptions(ws,oi);if(!ci.length)return ii&&ws.some(di=>di.isPending)?ii.setDisabled():null;let ui=oi.facet(completionConfig).selectOnOpen?0:-1;if(ii&&ii.selected!=ui&&ii.selected!=-1){let di=ii.options[ii.selected].completion;for(let hi=0;hi<ci.length;hi++)if(ci[hi].completion==di){ui=hi;break}}return new CompletionDialog(ci,makeAttrs(si,ui),{pos:ws.reduce((di,hi)=>hi.hasResult()?Math.min(di,hi.from):di,1e8),create:createTooltip,above:ai.aboveCursor},ii?ii.timestamp:Date.now(),ui,!1)}map(ws){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:ws.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(ws,oi,si){this.active=ws,this.id=oi,this.open=si}static start(){return new CompletionState(none$1,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(ws){let{state:oi}=ws,si=oi.facet(completionConfig),ii=(si.override||oi.languageDataAt("autocomplete",cur(oi)).map(asSource)).map(ci=>(this.active.find(ui=>ui.source==ci)||new ActiveSource(ci,this.active.some(ui=>ui.state!=0)?1:0)).update(ws,si));ii.length==this.active.length&&ii.every((ci,ui)=>ci==this.active[ui])&&(ii=this.active);let ai=this.open,li=ws.effects.some(ci=>ci.is(setActiveEffect));ai&&ws.docChanged&&(ai=ai.map(ws.changes)),ws.selection||ii.some(ci=>ci.hasResult()&&ws.changes.touchesRange(ci.from,ci.to))||!sameResults(ii,this.active)||li?ai=CompletionDialog.build(ii,oi,this.id,ai,si,li):ai&&ai.disabled&&!ii.some(ci=>ci.isPending)&&(ai=null),!ai&&ii.every(ci=>!ci.isPending)&&ii.some(ci=>ci.hasResult())&&(ii=ii.map(ci=>ci.hasResult()?new ActiveSource(ci.source,0):ci));for(let ci of ws.effects)ci.is(setSelectedEffect)&&(ai=ai&&ai.setSelected(ci.value,this.id));return ii==this.active&&ai==this.open?this:new CompletionState(ii,this.id,ai)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}function sameResults(Ws,ws){if(Ws==ws)return!0;for(let oi=0,si=0;;){for(;oi<Ws.length&&!Ws[oi].hasResult();)oi++;for(;si<ws.length&&!ws[si].hasResult();)si++;let ii=oi==Ws.length,ai=si==ws.length;if(ii||ai)return ii==ai;if(Ws[oi++].result!=ws[si++].result)return!1}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={};function makeAttrs(Ws,ws){let oi={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":Ws};return ws>-1&&(oi["aria-activedescendant"]=Ws+"-"+ws),oi}const none$1=[];function getUpdateType(Ws,ws){if(Ws.isUserEvent("input.complete")){let si=Ws.annotation(pickedCompletion);if(si&&ws.activateOnCompletion(si))return 12}let oi=Ws.isUserEvent("input.type");return oi&&ws.activateOnTyping?5:oi?1:Ws.isUserEvent("delete.backward")?2:Ws.selection?8:Ws.docChanged?16:0}class ActiveSource{constructor(ws,oi,si=!1){this.source=ws,this.state=oi,this.explicit=si}hasResult(){return!1}get isPending(){return this.state==1}update(ws,oi){let si=getUpdateType(ws,oi),ii=this;(si&8||si&16&&this.touches(ws))&&(ii=new ActiveSource(ii.source,0)),si&4&&ii.state==0&&(ii=new ActiveSource(this.source,1)),ii=ii.updateFor(ws,si);for(let ai of ws.effects)if(ai.is(startCompletionEffect))ii=new ActiveSource(ii.source,1,ai.value);else if(ai.is(closeCompletionEffect))ii=new ActiveSource(ii.source,0);else if(ai.is(setActiveEffect))for(let li of ai.value)li.source==ii.source&&(ii=li);return ii}updateFor(ws,oi){return this.map(ws.changes)}map(ws){return this}touches(ws){return ws.changes.touchesRange(cur(ws.state))}}class ActiveResult extends ActiveSource{constructor(ws,oi,si,ii,ai,li){super(ws,3,oi),this.limit=si,this.result=ii,this.from=ai,this.to=li}hasResult(){return!0}updateFor(ws,oi){var si;if(!(oi&3))return this.map(ws.changes);let ii=this.result;ii.map&&!ws.changes.empty&&(ii=ii.map(ii,ws.changes));let ai=ws.changes.mapPos(this.from),li=ws.changes.mapPos(this.to,1),ci=cur(ws.state);if(ci>li||!ii||oi&2&&(cur(ws.startState)==this.from||ci<this.limit))return new ActiveSource(this.source,oi&4?1:0);let ui=ws.changes.mapPos(this.limit);return checkValid(ii.validFor,ws.state,ai,li)?new ActiveResult(this.source,this.explicit,ui,ii,ai,li):ii.update&&(ii=ii.update(ii,ai,li,new CompletionContext(ws.state,ci,!1)))?new ActiveResult(this.source,this.explicit,ui,ii,ii.from,(si=ii.to)!==null&&si!==void 0?si:cur(ws.state)):new ActiveSource(this.source,1,this.explicit)}map(ws){return ws.empty?this:(this.result.map?this.result.map(this.result,ws):this.result)?new ActiveResult(this.source,this.explicit,ws.mapPos(this.limit),this.result,ws.mapPos(this.from),ws.mapPos(this.to,1)):new ActiveSource(this.source,0)}touches(ws){return ws.changes.touchesRange(this.from,this.to)}}function checkValid(Ws,ws,oi,si){if(!Ws)return!1;let ii=ws.sliceDoc(oi,si);return typeof Ws=="function"?Ws(ii,oi,si,ws):ensureAnchor(Ws,!0).test(ii)}const setActiveEffect=StateEffect.define({map(Ws,ws){return Ws.map(oi=>oi.map(ws))}}),setSelectedEffect=StateEffect.define(),completionState=StateField.define({create(){return CompletionState.start()},update(Ws,ws){return Ws.update(ws)},provide:Ws=>[showTooltip.from(Ws,ws=>ws.tooltip),EditorView.contentAttributes.from(Ws,ws=>ws.attrs)]});function applyCompletion(Ws,ws){const oi=ws.completion.apply||ws.completion.label;let si=Ws.state.field(completionState).active.find(ii=>ii.source==ws.source);return si instanceof ActiveResult?(typeof oi=="string"?Ws.dispatch(Object.assign(Object.assign({},insertCompletionText(Ws.state,oi,si.from,si.to)),{annotations:pickedCompletion.of(ws.completion)})):oi(Ws,ws.completion,si.from,si.to),!0):!1}const createTooltip=completionTooltip(completionState,applyCompletion);function moveCompletionSelection(Ws,ws="option"){return oi=>{let si=oi.state.field(completionState,!1);if(!si||!si.open||si.open.disabled||Date.now()-si.open.timestamp<oi.state.facet(completionConfig).interactionDelay)return!1;let ii=1,ai;ws=="page"&&(ai=getTooltip(oi,si.open.tooltip))&&(ii=Math.max(2,Math.floor(ai.dom.offsetHeight/ai.dom.querySelector("li").offsetHeight)-1));let{length:li}=si.open.options,ci=si.open.selected>-1?si.open.selected+ii*(Ws?1:-1):Ws?0:li-1;return ci<0?ci=ws=="page"?0:li-1:ci>=li&&(ci=ws=="page"?li-1:0),oi.dispatch({effects:setSelectedEffect.of(ci)}),!0}}const acceptCompletion=Ws=>{let ws=Ws.state.field(completionState,!1);return Ws.state.readOnly||!ws||!ws.open||ws.open.selected<0||ws.open.disabled||Date.now()-ws.open.timestamp<Ws.state.facet(completionConfig).interactionDelay?!1:applyCompletion(Ws,ws.open.options[ws.open.selected])},startCompletion=Ws=>Ws.state.field(completionState,!1)?(Ws.dispatch({effects:startCompletionEffect.of(!0)}),!0):!1,closeCompletion=Ws=>{let ws=Ws.state.field(completionState,!1);return!ws||!ws.active.some(oi=>oi.state!=0)?!1:(Ws.dispatch({effects:closeCompletionEffect.of(null)}),!0)};class RunningQuery{constructor(ws,oi){this.active=ws,this.context=oi,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let ws of Ws.state.field(completionState).active)ws.isPending&&this.startQuery(ws)}update(Ws){let ws=Ws.state.field(completionState),oi=Ws.state.facet(completionConfig);if(!Ws.selectionSet&&!Ws.docChanged&&Ws.startState.field(completionState)==ws)return;let si=Ws.transactions.some(ai=>{let li=getUpdateType(ai,oi);return li&8||(ai.selection||ai.docChanged)&&!(li&3)});for(let ai=0;ai<this.running.length;ai++){let li=this.running[ai];if(si||li.context.abortOnDocChange&&Ws.docChanged||li.updates.length+Ws.transactions.length>MaxUpdateCount&&Date.now()-li.time>MinAbortTime){for(let ci of li.context.abortListeners)try{ci()}catch(ui){logException(this.view.state,ui)}li.context.abortListeners=null,this.running.splice(ai--,1)}else li.updates.push(...Ws.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),Ws.transactions.some(ai=>ai.effects.some(li=>li.is(startCompletionEffect)))&&(this.pendingStart=!0);let ii=this.pendingStart?50:oi.activateOnTypingDelay;if(this.debounceUpdate=ws.active.some(ai=>ai.isPending&&!this.running.some(li=>li.active.source==ai.source))?setTimeout(()=>this.startUpdate(),ii):-1,this.composing!=0)for(let ai of Ws.transactions)ai.isUserEvent("input.type")?this.composing=2:this.composing==2&&ai.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:Ws}=this.view,ws=Ws.field(completionState);for(let oi of ws.active)oi.isPending&&!this.running.some(si=>si.active.source==oi.source)&&this.startQuery(oi);this.running.length&&ws.open&&ws.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(Ws){let{state:ws}=this.view,oi=cur(ws),si=new CompletionContext(ws,oi,Ws.explicit,this.view),ii=new RunningQuery(Ws,si);this.running.push(ii),Promise.resolve(Ws.source(si)).then(ai=>{ii.context.aborted||(ii.done=ai||null,this.scheduleAccept())},ai=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),logException(this.view.state,ai)})}scheduleAccept(){this.running.every(Ws=>Ws.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}accept(){var Ws;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let ws=[],oi=this.view.state.facet(completionConfig),si=this.view.state.field(completionState);for(let ii=0;ii<this.running.length;ii++){let ai=this.running[ii];if(ai.done===void 0)continue;if(this.running.splice(ii--,1),ai.done){let ci=cur(ai.updates.length?ai.updates[0].startState:this.view.state),ui=Math.min(ci,ai.done.from+(ai.active.explicit?0:1)),di=new ActiveResult(ai.active.source,ai.active.explicit,ui,ai.done,ai.done.from,(Ws=ai.done.to)!==null&&Ws!==void 0?Ws:ci);for(let hi of ai.updates)di=di.update(hi,oi);if(di.hasResult()){ws.push(di);continue}}let li=si.active.find(ci=>ci.source==ai.active.source);if(li&&li.isPending)if(ai.done==null){let ci=new ActiveSource(ai.active.source,0);for(let ui of ai.updates)ci=ci.update(ui,oi);ci.isPending||ws.push(ci)}else this.startQuery(li)}(ws.length||si.open&&si.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(ws)})}},{eventHandlers:{blur(Ws){let ws=this.view.state.field(completionState,!1);if(ws&&ws.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let oi=ws.open&&getTooltip(this.view,ws.open.tooltip);(!oi||!oi.dom.contains(Ws.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0}}}),windows=typeof navigator=="object"&&/Win/.test(navigator.platform),commitCharacters=Prec.highest(EditorView.domEventHandlers({keydown(Ws,ws){let oi=ws.state.field(completionState,!1);if(!oi||!oi.open||oi.open.disabled||oi.open.selected<0||Ws.key.length>1||Ws.ctrlKey&&!(windows&&Ws.altKey)||Ws.metaKey)return!1;let si=oi.open.options[oi.open.selected],ii=oi.active.find(li=>li.source==si.source),ai=si.completion.commitCharacters||ii.result.commitCharacters;return ai&&ai.indexOf(Ws.key)>-1&&applyCompletion(ws,si),!1}})),baseTheme$2=EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),defaults={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=StateEffect.define({map(Ws,ws){return ws.mapPos(Ws,-1,MapMode.TrackAfter)??void 0}}),closedBracket=new class extends RangeValue{};closedBracket.startSide=1;closedBracket.endSide=-1;const bracketState=StateField.define({create(){return RangeSet.empty},update(Ws,ws){if(Ws=Ws.map(ws.changes),ws.selection){let oi=ws.state.doc.lineAt(ws.selection.main.head);Ws=Ws.update({filter:si=>si>=oi.from&&si<=oi.to})}for(let oi of ws.effects)oi.is(closeBracketEffect)&&(Ws=Ws.update({add:[closedBracket.range(oi.value,oi.value+1)]}));return Ws}});function closeBrackets(){return[inputHandler,bracketState]}const definedClosing="()[]{}<>";function closing(Ws){for(let ws=0;ws<definedClosing.length;ws+=2)if(definedClosing.charCodeAt(ws)==Ws)return definedClosing.charAt(ws+1);return fromCodePoint(Ws<128?Ws:Ws+1)}function config(Ws,ws){return Ws.languageDataAt("closeBrackets",ws)[0]||defaults}const android=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),inputHandler=EditorView.inputHandler.of((Ws,ws,oi,si)=>{if((android?Ws.composing:Ws.compositionStarted)||Ws.state.readOnly)return!1;let ii=Ws.state.selection.main;if(si.length>2||si.length==2&&codePointSize(codePointAt(si,0))==1||ws!=ii.from||oi!=ii.to)return!1;let ai=insertBracket(Ws.state,si);return ai?(Ws.dispatch(ai),!0):!1}),deleteBracketPair=({state:Ws,dispatch:ws})=>{if(Ws.readOnly)return!1;let oi=config(Ws,Ws.selection.main.head).brackets||defaults.brackets,si=null,ii=Ws.changeByRange(ai=>{if(ai.empty){let li=prevChar(Ws.doc,ai.head);for(let ci of oi)if(ci==li&&nextChar(Ws.doc,ai.head)==closing(codePointAt(ci,0)))return{changes:{from:ai.head-ci.length,to:ai.head+ci.length},range:EditorSelection.cursor(ai.head-ci.length)}}return{range:si=ai}});return si||ws(Ws.update(ii,{scrollIntoView:!0,userEvent:"delete.backward"})),!si},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];function insertBracket(Ws,ws){let oi=config(Ws,Ws.selection.main.head),si=oi.brackets||defaults.brackets;for(let ii of si){let ai=closing(codePointAt(ii,0));if(ws==ii)return ai==ii?handleSame(Ws,ii,si.indexOf(ii+ii+ii)>-1,oi):handleOpen(Ws,ii,ai,oi.before||defaults.before);if(ws==ai&&closedBracketAt(Ws,Ws.selection.main.from))return handleClose(Ws,ii,ai)}return null}function closedBracketAt(Ws,ws){let oi=!1;return Ws.field(bracketState).between(0,Ws.doc.length,si=>{si==ws&&(oi=!0)}),oi}function nextChar(Ws,ws){let oi=Ws.sliceString(ws,ws+2);return oi.slice(0,codePointSize(codePointAt(oi,0)))}function prevChar(Ws,ws){let oi=Ws.sliceString(ws-2,ws);return codePointSize(codePointAt(oi,0))==oi.length?oi:oi.slice(1)}function handleOpen(Ws,ws,oi,si){let ii=null,ai=Ws.changeByRange(li=>{if(!li.empty)return{changes:[{insert:ws,from:li.from},{insert:oi,from:li.to}],effects:closeBracketEffect.of(li.to+ws.length),range:EditorSelection.range(li.anchor+ws.length,li.head+ws.length)};let ci=nextChar(Ws.doc,li.head);return!ci||/\s/.test(ci)||si.indexOf(ci)>-1?{changes:{insert:ws+oi,from:li.head},effects:closeBracketEffect.of(li.head+ws.length),range:EditorSelection.cursor(li.head+ws.length)}:{range:ii=li}});return ii?null:Ws.update(ai,{scrollIntoView:!0,userEvent:"input.type"})}function handleClose(Ws,ws,oi){let si=null,ii=Ws.changeByRange(ai=>ai.empty&&nextChar(Ws.doc,ai.head)==oi?{changes:{from:ai.head,to:ai.head+oi.length,insert:oi},range:EditorSelection.cursor(ai.head+oi.length)}:si={range:ai});return si?null:Ws.update(ii,{scrollIntoView:!0,userEvent:"input.type"})}function handleSame(Ws,ws,oi,si){let ii=si.stringPrefixes||defaults.stringPrefixes,ai=null,li=Ws.changeByRange(ci=>{if(!ci.empty)return{changes:[{insert:ws,from:ci.from},{insert:ws,from:ci.to}],effects:closeBracketEffect.of(ci.to+ws.length),range:EditorSelection.range(ci.anchor+ws.length,ci.head+ws.length)};let ui=ci.head,di=nextChar(Ws.doc,ui),hi;if(di==ws){if(nodeStart(Ws,ui))return{changes:{insert:ws+ws,from:ui},effects:closeBracketEffect.of(ui+ws.length),range:EditorSelection.cursor(ui+ws.length)};if(closedBracketAt(Ws,ui)){let pi=oi&&Ws.sliceDoc(ui,ui+ws.length*3)==ws+ws+ws?ws+ws+ws:ws;return{changes:{from:ui,to:ui+pi.length,insert:pi},range:EditorSelection.cursor(ui+pi.length)}}}else{if(oi&&Ws.sliceDoc(ui-2*ws.length,ui)==ws+ws&&(hi=canStartStringAt(Ws,ui-2*ws.length,ii))>-1&&nodeStart(Ws,hi))return{changes:{insert:ws+ws+ws+ws,from:ui},effects:closeBracketEffect.of(ui+ws.length),range:EditorSelection.cursor(ui+ws.length)};if(Ws.charCategorizer(ui)(di)!=CharCategory.Word&&canStartStringAt(Ws,ui,ii)>-1&&!probablyInString(Ws,ui,ws,ii))return{changes:{insert:ws+ws,from:ui},effects:closeBracketEffect.of(ui+ws.length),range:EditorSelection.cursor(ui+ws.length)}}return{range:ai=ci}});return ai?null:Ws.update(li,{scrollIntoView:!0,userEvent:"input.type"})}function nodeStart(Ws,ws){let oi=syntaxTree(Ws).resolveInner(ws+1);return oi.parent&&oi.from==ws}function probablyInString(Ws,ws,oi,si){let ii=syntaxTree(Ws).resolveInner(ws,-1),ai=si.reduce((li,ci)=>Math.max(li,ci.length),0);for(let li=0;li<5;li++){let ci=Ws.sliceDoc(ii.from,Math.min(ii.to,ii.from+oi.length+ai)),ui=ci.indexOf(oi);if(!ui||ui>-1&&si.indexOf(ci.slice(0,ui))>-1){let hi=ii.firstChild;for(;hi&&hi.from==ii.from&&hi.to-hi.from>oi.length+ui;){if(Ws.sliceDoc(hi.to-oi.length,hi.to)==oi)return!1;hi=hi.firstChild}return!0}let di=ii.to==ws&&ii.parent;if(!di)break;ii=di}return!1}function canStartStringAt(Ws,ws,oi){let si=Ws.charCategorizer(ws);if(si(Ws.sliceDoc(ws-1,ws))!=CharCategory.Word)return ws;for(let ii of oi){let ai=ws-ii.length;if(Ws.sliceDoc(ai,ws)==ii&&si(Ws.sliceDoc(ai-1,ai))!=CharCategory.Word)return ai}return-1}function autocompletion(Ws={}){return[commitCharacters,completionState,completionConfig.of(Ws),completionPlugin,completionKeymapExt,baseTheme$2]}const completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{mac:"Alt-`",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=Prec.highest(keymap.computeN([completionConfig],Ws=>Ws.facet(completionConfig).defaultKeymap?[completionKeymap]:[])),toggleComment=Ws=>{let{state:ws}=Ws,oi=ws.doc.lineAt(ws.selection.main.from),si=getConfig(Ws.state,oi.from);return si.line?toggleLineComment(Ws):si.block?toggleBlockCommentByLine(Ws):!1};function command(Ws,ws){return({state:oi,dispatch:si})=>{if(oi.readOnly)return!1;let ii=Ws(ws,oi);return ii?(si(oi.update(ii)),!0):!1}}const toggleLineComment=command(changeLineComment,0),toggleBlockComment=command(changeBlockComment,0),toggleBlockCommentByLine=command((Ws,ws)=>changeBlockComment(Ws,ws,selectedLineRanges(ws)),0);function getConfig(Ws,ws){let oi=Ws.languageDataAt("commentTokens",ws);return oi.length?oi[0]:{}}const SearchMargin=50;function findBlockComment(Ws,{open:ws,close:oi},si,ii){let ai=Ws.sliceDoc(si-SearchMargin,si),li=Ws.sliceDoc(ii,ii+SearchMargin),ci=/\s*$/.exec(ai)[0].length,ui=/^\s*/.exec(li)[0].length,di=ai.length-ci;if(ai.slice(di-ws.length,di)==ws&&li.slice(ui,ui+oi.length)==oi)return{open:{pos:si-ci,margin:ci&&1},close:{pos:ii+ui,margin:ui&&1}};let hi,pi;ii-si<=2*SearchMargin?hi=pi=Ws.sliceDoc(si,ii):(hi=Ws.sliceDoc(si,si+SearchMargin),pi=Ws.sliceDoc(ii-SearchMargin,ii));let ha=/^\s*/.exec(hi)[0].length,ga=/\s*$/.exec(pi)[0].length,va=pi.length-ga-oi.length;return hi.slice(ha,ha+ws.length)==ws&&pi.slice(va,va+oi.length)==oi?{open:{pos:si+ha+ws.length,margin:/\s/.test(hi.charAt(ha+ws.length))?1:0},close:{pos:ii-ga-oi.length,margin:/\s/.test(pi.charAt(va-1))?1:0}}:null}function selectedLineRanges(Ws){let ws=[];for(let oi of Ws.selection.ranges){let si=Ws.doc.lineAt(oi.from),ii=oi.to<=si.to?si:Ws.doc.lineAt(oi.to);ii.from>si.from&&ii.from==oi.to&&(ii=oi.to==si.to+1?si:Ws.doc.lineAt(oi.to-1));let ai=ws.length-1;ai>=0&&ws[ai].to>si.from?ws[ai].to=ii.to:ws.push({from:si.from+/^\s*/.exec(si.text)[0].length,to:ii.to})}return ws}function changeBlockComment(Ws,ws,oi=ws.selection.ranges){let si=oi.map(ai=>getConfig(ws,ai.from).block);if(!si.every(ai=>ai))return null;let ii=oi.map((ai,li)=>findBlockComment(ws,si[li],ai.from,ai.to));if(Ws!=2&&!ii.every(ai=>ai))return{changes:ws.changes(oi.map((ai,li)=>ii[li]?[]:[{from:ai.from,insert:si[li].open+" "},{from:ai.to,insert:" "+si[li].close}]))};if(Ws!=1&&ii.some(ai=>ai)){let ai=[];for(let li=0,ci;li<ii.length;li++)if(ci=ii[li]){let ui=si[li],{open:di,close:hi}=ci;ai.push({from:di.pos-ui.open.length,to:di.pos+di.margin},{from:hi.pos-hi.margin,to:hi.pos+ui.close.length})}return{changes:ai}}return null}function changeLineComment(Ws,ws,oi=ws.selection.ranges){let si=[],ii=-1;for(let{from:ai,to:li}of oi){let ci=si.length,ui=1e9,di=getConfig(ws,ai).line;if(di){for(let hi=ai;hi<=li;){let pi=ws.doc.lineAt(hi);if(pi.from>ii&&(ai==li||li>pi.from)){ii=pi.from;let ha=/^\s*/.exec(pi.text)[0].length,ga=ha==pi.length,va=pi.text.slice(ha,ha+di.length)==di?ha:-1;ha<pi.text.length&&ha<ui&&(ui=ha),si.push({line:pi,comment:va,token:di,indent:ha,empty:ga,single:!1})}hi=pi.to+1}if(ui<1e9)for(let hi=ci;hi<si.length;hi++)si[hi].indent<si[hi].line.text.length&&(si[hi].indent=ui);si.length==ci+1&&(si[ci].single=!0)}}if(Ws!=2&&si.some(ai=>ai.comment<0&&(!ai.empty||ai.single))){let ai=[];for(let{line:ci,token:ui,indent:di,empty:hi,single:pi}of si)(pi||!hi)&&ai.push({from:ci.from+di,insert:ui+" "});let li=ws.changes(ai);return{changes:li,selection:ws.selection.map(li,1)}}else if(Ws!=1&&si.some(ai=>ai.comment>=0)){let ai=[];for(let{line:li,comment:ci,token:ui}of si)if(ci>=0){let di=li.from+ci,hi=di+ui.length;li.text[hi-li.from]==" "&&hi++,ai.push({from:di,to:hi})}return{changes:ai}}return null}const fromHistory=Annotation.define(),isolateHistory=Annotation.define(),invertedEffects=Facet.define(),historyConfig=Facet.define({combine(Ws){return combineConfig(Ws,{minDepth:100,newGroupDelay:500,joinToEvent:(ws,oi)=>oi},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(ws,oi)=>(si,ii)=>ws(si,ii)||oi(si,ii)})}}),historyField_=StateField.define({create(){return HistoryState.empty},update(Ws,ws){let oi=ws.state.facet(historyConfig),si=ws.annotation(fromHistory);if(si){let ui=HistEvent.fromTransaction(ws,si.selection),di=si.side,hi=di==0?Ws.undone:Ws.done;return ui?hi=updateBranch(hi,hi.length,oi.minDepth,ui):hi=addSelection(hi,ws.startState.selection),new HistoryState(di==0?si.rest:hi,di==0?hi:si.rest)}let ii=ws.annotation(isolateHistory);if((ii=="full"||ii=="before")&&(Ws=Ws.isolate()),ws.annotation(Transaction.addToHistory)===!1)return ws.changes.empty?Ws:Ws.addMapping(ws.changes.desc);let ai=HistEvent.fromTransaction(ws),li=ws.annotation(Transaction.time),ci=ws.annotation(Transaction.userEvent);return ai?Ws=Ws.addChanges(ai,li,ci,oi,ws):ws.selection&&(Ws=Ws.addSelection(ws.startState.selection,li,ci,oi.newGroupDelay)),(ii=="full"||ii=="after")&&(Ws=Ws.isolate()),Ws},toJSON(Ws){return{done:Ws.done.map(ws=>ws.toJSON()),undone:Ws.undone.map(ws=>ws.toJSON())}},fromJSON(Ws){return new HistoryState(Ws.done.map(HistEvent.fromJSON),Ws.undone.map(HistEvent.fromJSON))}});function history(Ws={}){return[historyField_,historyConfig.of(Ws),EditorView.domEventHandlers({beforeinput(ws,oi){let si=ws.inputType=="historyUndo"?undo:ws.inputType=="historyRedo"?redo:null;return si?(ws.preventDefault(),si(oi)):!1}})]}function cmd(Ws,ws){return function({state:oi,dispatch:si}){if(!ws&&oi.readOnly)return!1;let ii=oi.field(historyField_,!1);if(!ii)return!1;let ai=ii.pop(Ws,oi,ws);return ai?(si(ai),!0):!1}}const undo=cmd(0,!1),redo=cmd(1,!1),undoSelection=cmd(0,!0),redoSelection=cmd(1,!0);class HistEvent{constructor(ws,oi,si,ii,ai){this.changes=ws,this.effects=oi,this.mapped=si,this.startSelection=ii,this.selectionsAfter=ai}setSelAfter(ws){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,ws)}toJSON(){var ws,oi,si;return{changes:(ws=this.changes)===null||ws===void 0?void 0:ws.toJSON(),mapped:(oi=this.mapped)===null||oi===void 0?void 0:oi.toJSON(),startSelection:(si=this.startSelection)===null||si===void 0?void 0:si.toJSON(),selectionsAfter:this.selectionsAfter.map(ii=>ii.toJSON())}}static fromJSON(ws){return new HistEvent(ws.changes&&ChangeSet.fromJSON(ws.changes),[],ws.mapped&&ChangeDesc.fromJSON(ws.mapped),ws.startSelection&&EditorSelection.fromJSON(ws.startSelection),ws.selectionsAfter.map(EditorSelection.fromJSON))}static fromTransaction(ws,oi){let si=none;for(let ii of ws.startState.facet(invertedEffects)){let ai=ii(ws);ai.length&&(si=si.concat(ai))}return!si.length&&ws.changes.empty?null:new HistEvent(ws.changes.invert(ws.startState.doc),si,void 0,oi||ws.startState.selection,none)}static selection(ws){return new HistEvent(void 0,none,void 0,void 0,ws)}}function updateBranch(Ws,ws,oi,si){let ii=ws+1>oi+20?ws-oi-1:0,ai=Ws.slice(ii,ws);return ai.push(si),ai}function isAdjacent(Ws,ws){let oi=[],si=!1;return Ws.iterChangedRanges((ii,ai)=>oi.push(ii,ai)),ws.iterChangedRanges((ii,ai,li,ci)=>{for(let ui=0;ui<oi.length;){let di=oi[ui++],hi=oi[ui++];ci>=di&&li<=hi&&(si=!0)}}),si}function eqSelectionShape(Ws,ws){return Ws.ranges.length==ws.ranges.length&&Ws.ranges.filter((oi,si)=>oi.empty!=ws.ranges[si].empty).length===0}function conc(Ws,ws){return Ws.length?ws.length?Ws.concat(ws):Ws:ws}const none=[],MaxSelectionsPerEvent=200;function addSelection(Ws,ws){if(Ws.length){let oi=Ws[Ws.length-1],si=oi.selectionsAfter.slice(Math.max(0,oi.selectionsAfter.length-MaxSelectionsPerEvent));return si.length&&si[si.length-1].eq(ws)?Ws:(si.push(ws),updateBranch(Ws,Ws.length-1,1e9,oi.setSelAfter(si)))}else return[HistEvent.selection([ws])]}function popSelection(Ws){let ws=Ws[Ws.length-1],oi=Ws.slice();return oi[Ws.length-1]=ws.setSelAfter(ws.selectionsAfter.slice(0,ws.selectionsAfter.length-1)),oi}function addMappingToBranch(Ws,ws){if(!Ws.length)return Ws;let oi=Ws.length,si=none;for(;oi;){let ii=mapEvent(Ws[oi-1],ws,si);if(ii.changes&&!ii.changes.empty||ii.effects.length){let ai=Ws.slice(0,oi);return ai[oi-1]=ii,ai}else ws=ii.mapped,oi--,si=ii.selectionsAfter}return si.length?[HistEvent.selection(si)]:none}function mapEvent(Ws,ws,oi){let si=conc(Ws.selectionsAfter.length?Ws.selectionsAfter.map(ci=>ci.map(ws)):none,oi);if(!Ws.changes)return HistEvent.selection(si);let ii=Ws.changes.map(ws),ai=ws.mapDesc(Ws.changes,!0),li=Ws.mapped?Ws.mapped.composeDesc(ai):ai;return new HistEvent(ii,StateEffect.mapEffects(Ws.effects,ws),li,Ws.startSelection.map(ai),si)}const joinableUserEvent=/^(input\.type|delete)($|\.)/;class HistoryState{constructor(ws,oi,si=0,ii=void 0){this.done=ws,this.undone=oi,this.prevTime=si,this.prevUserEvent=ii}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(ws,oi,si,ii,ai){let li=this.done,ci=li[li.length-1];return ci&&ci.changes&&!ci.changes.empty&&ws.changes&&(!si||joinableUserEvent.test(si))&&(!ci.selectionsAfter.length&&oi-this.prevTime<ii.newGroupDelay&&ii.joinToEvent(ai,isAdjacent(ci.changes,ws.changes))||si=="input.type.compose")?li=updateBranch(li,li.length-1,ii.minDepth,new HistEvent(ws.changes.compose(ci.changes),conc(StateEffect.mapEffects(ws.effects,ci.changes),ci.effects),ci.mapped,ci.startSelection,none)):li=updateBranch(li,li.length,ii.minDepth,ws),new HistoryState(li,none,oi,si)}addSelection(ws,oi,si,ii){let ai=this.done.length?this.done[this.done.length-1].selectionsAfter:none;return ai.length>0&&oi-this.prevTime<ii&&si==this.prevUserEvent&&si&&/^select($|\.)/.test(si)&&eqSelectionShape(ai[ai.length-1],ws)?this:new HistoryState(addSelection(this.done,ws),this.undone,oi,si)}addMapping(ws){return new HistoryState(addMappingToBranch(this.done,ws),addMappingToBranch(this.undone,ws),this.prevTime,this.prevUserEvent)}pop(ws,oi,si){let ii=ws==0?this.done:this.undone;if(ii.length==0)return null;let ai=ii[ii.length-1],li=ai.selectionsAfter[0]||oi.selection;if(si&&ai.selectionsAfter.length)return oi.update({selection:ai.selectionsAfter[ai.selectionsAfter.length-1],annotations:fromHistory.of({side:ws,rest:popSelection(ii),selection:li}),userEvent:ws==0?"select.undo":"select.redo",scrollIntoView:!0});if(ai.changes){let ci=ii.length==1?none:ii.slice(0,ii.length-1);return ai.mapped&&(ci=addMappingToBranch(ci,ai.mapped)),oi.update({changes:ai.changes,selection:ai.startSelection,effects:ai.effects,annotations:fromHistory.of({side:ws,rest:ci,selection:li}),filter:!1,userEvent:ws==0?"undo":"redo",scrollIntoView:!0})}else return null}}HistoryState.empty=new HistoryState(none,none);const historyKeymap=[{key:"Mod-z",run:undo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:redo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:redo,preventDefault:!0},{key:"Mod-u",run:undoSelection,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:redoSelection,preventDefault:!0}];function updateSel(Ws,ws){return EditorSelection.create(Ws.ranges.map(ws),Ws.mainIndex)}function setSel(Ws,ws){return Ws.update({selection:ws,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:Ws,dispatch:ws},oi){let si=updateSel(Ws.selection,oi);return si.eq(Ws.selection,!0)?!1:(ws(setSel(Ws,si)),!0)}function rangeEnd(Ws,ws){return EditorSelection.cursor(ws?Ws.to:Ws.from)}function cursorByChar(Ws,ws){return moveSel(Ws,oi=>oi.empty?Ws.moveByChar(oi,ws):rangeEnd(oi,ws))}function ltrAtCursor(Ws){return Ws.textDirectionAt(Ws.state.selection.main.head)==Direction.LTR}const cursorCharLeft=Ws=>cursorByChar(Ws,!ltrAtCursor(Ws)),cursorCharRight=Ws=>cursorByChar(Ws,ltrAtCursor(Ws));function cursorByGroup(Ws,ws){return moveSel(Ws,oi=>oi.empty?Ws.moveByGroup(oi,ws):rangeEnd(oi,ws))}const cursorGroupLeft=Ws=>cursorByGroup(Ws,!ltrAtCursor(Ws)),cursorGroupRight=Ws=>cursorByGroup(Ws,ltrAtCursor(Ws));function interestingNode(Ws,ws,oi){if(ws.type.prop(oi))return!0;let si=ws.to-ws.from;return si&&(si>2||/[^\s,.;:]/.test(Ws.sliceDoc(ws.from,ws.to)))||ws.firstChild}function moveBySyntax(Ws,ws,oi){let si=syntaxTree(Ws).resolveInner(ws.head),ii=oi?NodeProp.closedBy:NodeProp.openedBy;for(let ui=ws.head;;){let di=oi?si.childAfter(ui):si.childBefore(ui);if(!di)break;interestingNode(Ws,di,ii)?si=di:ui=oi?di.to:di.from}let ai=si.type.prop(ii),li,ci;return ai&&(li=oi?matchBrackets(Ws,si.from,1):matchBrackets(Ws,si.to,-1))&&li.matched?ci=oi?li.end.to:li.end.from:ci=oi?si.to:si.from,EditorSelection.cursor(ci,oi?-1:1)}const cursorSyntaxLeft=Ws=>moveSel(Ws,ws=>moveBySyntax(Ws.state,ws,!ltrAtCursor(Ws))),cursorSyntaxRight=Ws=>moveSel(Ws,ws=>moveBySyntax(Ws.state,ws,ltrAtCursor(Ws)));function cursorByLine(Ws,ws){return moveSel(Ws,oi=>{if(!oi.empty)return rangeEnd(oi,ws);let si=Ws.moveVertically(oi,ws);return si.head!=oi.head?si:Ws.moveToLineBoundary(oi,ws)})}const cursorLineUp=Ws=>cursorByLine(Ws,!1),cursorLineDown=Ws=>cursorByLine(Ws,!0);function pageInfo(Ws){let ws=Ws.scrollDOM.clientHeight<Ws.scrollDOM.scrollHeight-2,oi=0,si=0,ii;if(ws){for(let ai of Ws.state.facet(EditorView.scrollMargins)){let li=ai(Ws);li!=null&&li.top&&(oi=Math.max(li==null?void 0:li.top,oi)),li!=null&&li.bottom&&(si=Math.max(li==null?void 0:li.bottom,si))}ii=Ws.scrollDOM.clientHeight-oi-si}else ii=(Ws.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:oi,marginBottom:si,selfScroll:ws,height:Math.max(Ws.defaultLineHeight,ii-5)}}function cursorByPage(Ws,ws){let oi=pageInfo(Ws),{state:si}=Ws,ii=updateSel(si.selection,li=>li.empty?Ws.moveVertically(li,ws,oi.height):rangeEnd(li,ws));if(ii.eq(si.selection))return!1;let ai;if(oi.selfScroll){let li=Ws.coordsAtPos(si.selection.main.head),ci=Ws.scrollDOM.getBoundingClientRect(),ui=ci.top+oi.marginTop,di=ci.bottom-oi.marginBottom;li&&li.top>ui&&li.bottom<di&&(ai=EditorView.scrollIntoView(ii.main.head,{y:"start",yMargin:li.top-ui}))}return Ws.dispatch(setSel(si,ii),{effects:ai}),!0}const cursorPageUp=Ws=>cursorByPage(Ws,!1),cursorPageDown=Ws=>cursorByPage(Ws,!0);function moveByLineBoundary(Ws,ws,oi){let si=Ws.lineBlockAt(ws.head),ii=Ws.moveToLineBoundary(ws,oi);if(ii.head==ws.head&&ii.head!=(oi?si.to:si.from)&&(ii=Ws.moveToLineBoundary(ws,oi,!1)),!oi&&ii.head==si.from&&si.length){let ai=/^\s*/.exec(Ws.state.sliceDoc(si.from,Math.min(si.from+100,si.to)))[0].length;ai&&ws.head!=si.from+ai&&(ii=EditorSelection.cursor(si.from+ai))}return ii}const cursorLineBoundaryForward=Ws=>moveSel(Ws,ws=>moveByLineBoundary(Ws,ws,!0)),cursorLineBoundaryBackward=Ws=>moveSel(Ws,ws=>moveByLineBoundary(Ws,ws,!1)),cursorLineBoundaryLeft=Ws=>moveSel(Ws,ws=>moveByLineBoundary(Ws,ws,!ltrAtCursor(Ws))),cursorLineBoundaryRight=Ws=>moveSel(Ws,ws=>moveByLineBoundary(Ws,ws,ltrAtCursor(Ws))),cursorLineStart=Ws=>moveSel(Ws,ws=>EditorSelection.cursor(Ws.lineBlockAt(ws.head).from,1)),cursorLineEnd=Ws=>moveSel(Ws,ws=>EditorSelection.cursor(Ws.lineBlockAt(ws.head).to,-1));function toMatchingBracket(Ws,ws,oi){let si=!1,ii=updateSel(Ws.selection,ai=>{let li=matchBrackets(Ws,ai.head,-1)||matchBrackets(Ws,ai.head,1)||ai.head>0&&matchBrackets(Ws,ai.head-1,1)||ai.head<Ws.doc.length&&matchBrackets(Ws,ai.head+1,-1);if(!li||!li.end)return ai;si=!0;let ci=li.start.from==ai.head?li.end.to:li.end.from;return EditorSelection.cursor(ci)});return si?(ws(setSel(Ws,ii)),!0):!1}const cursorMatchingBracket=({state:Ws,dispatch:ws})=>toMatchingBracket(Ws,ws);function extendSel(Ws,ws){let oi=updateSel(Ws.state.selection,si=>{let ii=ws(si);return EditorSelection.range(si.anchor,ii.head,ii.goalColumn,ii.bidiLevel||void 0)});return oi.eq(Ws.state.selection)?!1:(Ws.dispatch(setSel(Ws.state,oi)),!0)}function selectByChar(Ws,ws){return extendSel(Ws,oi=>Ws.moveByChar(oi,ws))}const selectCharLeft=Ws=>selectByChar(Ws,!ltrAtCursor(Ws)),selectCharRight=Ws=>selectByChar(Ws,ltrAtCursor(Ws));function selectByGroup(Ws,ws){return extendSel(Ws,oi=>Ws.moveByGroup(oi,ws))}const selectGroupLeft=Ws=>selectByGroup(Ws,!ltrAtCursor(Ws)),selectGroupRight=Ws=>selectByGroup(Ws,ltrAtCursor(Ws)),selectSyntaxLeft=Ws=>extendSel(Ws,ws=>moveBySyntax(Ws.state,ws,!ltrAtCursor(Ws))),selectSyntaxRight=Ws=>extendSel(Ws,ws=>moveBySyntax(Ws.state,ws,ltrAtCursor(Ws)));function selectByLine(Ws,ws){return extendSel(Ws,oi=>Ws.moveVertically(oi,ws))}const selectLineUp=Ws=>selectByLine(Ws,!1),selectLineDown=Ws=>selectByLine(Ws,!0);function selectByPage(Ws,ws){return extendSel(Ws,oi=>Ws.moveVertically(oi,ws,pageInfo(Ws).height))}const selectPageUp=Ws=>selectByPage(Ws,!1),selectPageDown=Ws=>selectByPage(Ws,!0),selectLineBoundaryForward=Ws=>extendSel(Ws,ws=>moveByLineBoundary(Ws,ws,!0)),selectLineBoundaryBackward=Ws=>extendSel(Ws,ws=>moveByLineBoundary(Ws,ws,!1)),selectLineBoundaryLeft=Ws=>extendSel(Ws,ws=>moveByLineBoundary(Ws,ws,!ltrAtCursor(Ws))),selectLineBoundaryRight=Ws=>extendSel(Ws,ws=>moveByLineBoundary(Ws,ws,ltrAtCursor(Ws))),selectLineStart=Ws=>extendSel(Ws,ws=>EditorSelection.cursor(Ws.lineBlockAt(ws.head).from)),selectLineEnd=Ws=>extendSel(Ws,ws=>EditorSelection.cursor(Ws.lineBlockAt(ws.head).to)),cursorDocStart=({state:Ws,dispatch:ws})=>(ws(setSel(Ws,{anchor:0})),!0),cursorDocEnd=({state:Ws,dispatch:ws})=>(ws(setSel(Ws,{anchor:Ws.doc.length})),!0),selectDocStart=({state:Ws,dispatch:ws})=>(ws(setSel(Ws,{anchor:Ws.selection.main.anchor,head:0})),!0),selectDocEnd=({state:Ws,dispatch:ws})=>(ws(setSel(Ws,{anchor:Ws.selection.main.anchor,head:Ws.doc.length})),!0),selectAll=({state:Ws,dispatch:ws})=>(ws(Ws.update({selection:{anchor:0,head:Ws.doc.length},userEvent:"select"})),!0),selectLine=({state:Ws,dispatch:ws})=>{let oi=selectedLineBlocks(Ws).map(({from:si,to:ii})=>EditorSelection.range(si,Math.min(ii+1,Ws.doc.length)));return ws(Ws.update({selection:EditorSelection.create(oi),userEvent:"select"})),!0},selectParentSyntax=({state:Ws,dispatch:ws})=>{let oi=updateSel(Ws.selection,si=>{let ii=syntaxTree(Ws),ai=ii.resolveStack(si.from,1);if(si.empty){let li=ii.resolveStack(si.from,-1);li.node.from>=ai.node.from&&li.node.to<=ai.node.to&&(ai=li)}for(let li=ai;li;li=li.next){let{node:ci}=li;if((ci.from<si.from&&ci.to>=si.to||ci.to>si.to&&ci.from<=si.from)&&li.next)return EditorSelection.range(ci.to,ci.from)}return si});return oi.eq(Ws.selection)?!1:(ws(setSel(Ws,oi)),!0)},simplifySelection=({state:Ws,dispatch:ws})=>{let oi=Ws.selection,si=null;return oi.ranges.length>1?si=EditorSelection.create([oi.main]):oi.main.empty||(si=EditorSelection.create([EditorSelection.cursor(oi.main.head)])),si?(ws(setSel(Ws,si)),!0):!1};function deleteBy(Ws,ws){if(Ws.state.readOnly)return!1;let oi="delete.selection",{state:si}=Ws,ii=si.changeByRange(ai=>{let{from:li,to:ci}=ai;if(li==ci){let ui=ws(ai);ui<li?(oi="delete.backward",ui=skipAtomic(Ws,ui,!1)):ui>li&&(oi="delete.forward",ui=skipAtomic(Ws,ui,!0)),li=Math.min(li,ui),ci=Math.max(ci,ui)}else li=skipAtomic(Ws,li,!1),ci=skipAtomic(Ws,ci,!0);return li==ci?{range:ai}:{changes:{from:li,to:ci},range:EditorSelection.cursor(li,li<ai.head?-1:1)}});return ii.changes.empty?!1:(Ws.dispatch(si.update(ii,{scrollIntoView:!0,userEvent:oi,effects:oi=="delete.selection"?EditorView.announce.of(si.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(Ws,ws,oi){if(Ws instanceof EditorView)for(let si of Ws.state.facet(EditorView.atomicRanges).map(ii=>ii(Ws)))si.between(ws,ws,(ii,ai)=>{ii<ws&&ai>ws&&(ws=oi?ai:ii)});return ws}const deleteByChar=(Ws,ws,oi)=>deleteBy(Ws,si=>{let ii=si.from,{state:ai}=Ws,li=ai.doc.lineAt(ii),ci,ui;if(oi&&!ws&&ii>li.from&&ii<li.from+200&&!/[^ \t]/.test(ci=li.text.slice(0,ii-li.from))){if(ci[ci.length-1]==" ")return ii-1;let di=countColumn(ci,ai.tabSize),hi=di%getIndentUnit(ai)||getIndentUnit(ai);for(let pi=0;pi<hi&&ci[ci.length-1-pi]==" ";pi++)ii--;ui=ii}else ui=findClusterBreak(li.text,ii-li.from,ws,ws)+li.from,ui==ii&&li.number!=(ws?ai.doc.lines:1)?ui+=ws?1:-1:!ws&&/[\ufe00-\ufe0f]/.test(li.text.slice(ui-li.from,ii-li.from))&&(ui=findClusterBreak(li.text,ui-li.from,!1,!1)+li.from);return ui}),deleteCharBackward=Ws=>deleteByChar(Ws,!1,!0),deleteCharForward=Ws=>deleteByChar(Ws,!0,!1),deleteByGroup=(Ws,ws)=>deleteBy(Ws,oi=>{let si=oi.head,{state:ii}=Ws,ai=ii.doc.lineAt(si),li=ii.charCategorizer(si);for(let ci=null;;){if(si==(ws?ai.to:ai.from)){si==oi.head&&ai.number!=(ws?ii.doc.lines:1)&&(si+=ws?1:-1);break}let ui=findClusterBreak(ai.text,si-ai.from,ws)+ai.from,di=ai.text.slice(Math.min(si,ui)-ai.from,Math.max(si,ui)-ai.from),hi=li(di);if(ci!=null&&hi!=ci)break;(di!=" "||si!=oi.head)&&(ci=hi),si=ui}return si}),deleteGroupBackward=Ws=>deleteByGroup(Ws,!1),deleteGroupForward=Ws=>deleteByGroup(Ws,!0),deleteToLineEnd=Ws=>deleteBy(Ws,ws=>{let oi=Ws.lineBlockAt(ws.head).to;return ws.head<oi?oi:Math.min(Ws.state.doc.length,ws.head+1)}),deleteLineBoundaryBackward=Ws=>deleteBy(Ws,ws=>{let oi=Ws.moveToLineBoundary(ws,!1).head;return ws.head>oi?oi:Math.max(0,ws.head-1)}),deleteLineBoundaryForward=Ws=>deleteBy(Ws,ws=>{let oi=Ws.moveToLineBoundary(ws,!0).head;return ws.head<oi?oi:Math.min(Ws.state.doc.length,ws.head+1)}),splitLine=({state:Ws,dispatch:ws})=>{if(Ws.readOnly)return!1;let oi=Ws.changeByRange(si=>({changes:{from:si.from,to:si.to,insert:Text.of(["",""])},range:EditorSelection.cursor(si.from)}));return ws(Ws.update(oi,{scrollIntoView:!0,userEvent:"input"})),!0},transposeChars=({state:Ws,dispatch:ws})=>{if(Ws.readOnly)return!1;let oi=Ws.changeByRange(si=>{if(!si.empty||si.from==0||si.from==Ws.doc.length)return{range:si};let ii=si.from,ai=Ws.doc.lineAt(ii),li=ii==ai.from?ii-1:findClusterBreak(ai.text,ii-ai.from,!1)+ai.from,ci=ii==ai.to?ii+1:findClusterBreak(ai.text,ii-ai.from,!0)+ai.from;return{changes:{from:li,to:ci,insert:Ws.doc.slice(ii,ci).append(Ws.doc.slice(li,ii))},range:EditorSelection.cursor(ci)}});return oi.changes.empty?!1:(ws(Ws.update(oi,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function selectedLineBlocks(Ws){let ws=[],oi=-1;for(let si of Ws.selection.ranges){let ii=Ws.doc.lineAt(si.from),ai=Ws.doc.lineAt(si.to);if(!si.empty&&si.to==ai.from&&(ai=Ws.doc.lineAt(si.to-1)),oi>=ii.number){let li=ws[ws.length-1];li.to=ai.to,li.ranges.push(si)}else ws.push({from:ii.from,to:ai.to,ranges:[si]});oi=ai.number+1}return ws}function moveLine(Ws,ws,oi){if(Ws.readOnly)return!1;let si=[],ii=[];for(let ai of selectedLineBlocks(Ws)){if(oi?ai.to==Ws.doc.length:ai.from==0)continue;let li=Ws.doc.lineAt(oi?ai.to+1:ai.from-1),ci=li.length+1;if(oi){si.push({from:ai.to,to:li.to},{from:ai.from,insert:li.text+Ws.lineBreak});for(let ui of ai.ranges)ii.push(EditorSelection.range(Math.min(Ws.doc.length,ui.anchor+ci),Math.min(Ws.doc.length,ui.head+ci)))}else{si.push({from:li.from,to:ai.from},{from:ai.to,insert:Ws.lineBreak+li.text});for(let ui of ai.ranges)ii.push(EditorSelection.range(ui.anchor-ci,ui.head-ci))}}return si.length?(ws(Ws.update({changes:si,scrollIntoView:!0,selection:EditorSelection.create(ii,Ws.selection.mainIndex),userEvent:"move.line"})),!0):!1}const moveLineUp=({state:Ws,dispatch:ws})=>moveLine(Ws,ws,!1),moveLineDown=({state:Ws,dispatch:ws})=>moveLine(Ws,ws,!0);function copyLine(Ws,ws,oi){if(Ws.readOnly)return!1;let si=[];for(let ii of selectedLineBlocks(Ws))oi?si.push({from:ii.from,insert:Ws.doc.slice(ii.from,ii.to)+Ws.lineBreak}):si.push({from:ii.to,insert:Ws.lineBreak+Ws.doc.slice(ii.from,ii.to)});return ws(Ws.update({changes:si,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const copyLineUp=({state:Ws,dispatch:ws})=>copyLine(Ws,ws,!1),copyLineDown=({state:Ws,dispatch:ws})=>copyLine(Ws,ws,!0),deleteLine=Ws=>{if(Ws.state.readOnly)return!1;let{state:ws}=Ws,oi=ws.changes(selectedLineBlocks(ws).map(({from:ii,to:ai})=>(ii>0?ii--:ai<ws.doc.length&&ai++,{from:ii,to:ai}))),si=updateSel(ws.selection,ii=>{let ai;if(Ws.lineWrapping){let li=Ws.lineBlockAt(ii.head),ci=Ws.coordsAtPos(ii.head,ii.assoc||1);ci&&(ai=li.bottom+Ws.documentTop-ci.bottom+Ws.defaultLineHeight/2)}return Ws.moveVertically(ii,!0,ai)}).map(oi);return Ws.dispatch({changes:oi,selection:si,scrollIntoView:!0,userEvent:"delete.line"}),!0};function isBetweenBrackets(Ws,ws){if(/\(\)|\[\]|\{\}/.test(Ws.sliceDoc(ws-1,ws+1)))return{from:ws,to:ws};let oi=syntaxTree(Ws).resolveInner(ws),si=oi.childBefore(ws),ii=oi.childAfter(ws),ai;return si&&ii&&si.to<=ws&&ii.from>=ws&&(ai=si.type.prop(NodeProp.closedBy))&&ai.indexOf(ii.name)>-1&&Ws.doc.lineAt(si.to).from==Ws.doc.lineAt(ii.from).from&&!/\S/.test(Ws.sliceDoc(si.to,ii.from))?{from:si.to,to:ii.from}:null}const insertNewlineAndIndent=newlineAndIndent(!1),insertBlankLine=newlineAndIndent(!0);function newlineAndIndent(Ws){return({state:ws,dispatch:oi})=>{if(ws.readOnly)return!1;let si=ws.changeByRange(ii=>{let{from:ai,to:li}=ii,ci=ws.doc.lineAt(ai),ui=!Ws&&ai==li&&isBetweenBrackets(ws,ai);Ws&&(ai=li=(li<=ci.to?ci:ws.doc.lineAt(li)).to);let di=new IndentContext(ws,{simulateBreak:ai,simulateDoubleBreak:!!ui}),hi=getIndentation(di,ai);for(hi==null&&(hi=countColumn(/^\s*/.exec(ws.doc.lineAt(ai).text)[0],ws.tabSize));li<ci.to&&/\s/.test(ci.text[li-ci.from]);)li++;ui?{from:ai,to:li}=ui:ai>ci.from&&ai<ci.from+100&&!/\S/.test(ci.text.slice(0,ai))&&(ai=ci.from);let pi=["",indentString(ws,hi)];return ui&&pi.push(indentString(ws,di.lineIndent(ci.from,-1))),{changes:{from:ai,to:li,insert:Text.of(pi)},range:EditorSelection.cursor(ai+1+pi[1].length)}});return oi(ws.update(si,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(Ws,ws){let oi=-1;return Ws.changeByRange(si=>{let ii=[];for(let li=si.from;li<=si.to;){let ci=Ws.doc.lineAt(li);ci.number>oi&&(si.empty||si.to>ci.from)&&(ws(ci,ii,si),oi=ci.number),li=ci.to+1}let ai=Ws.changes(ii);return{changes:ii,range:EditorSelection.range(ai.mapPos(si.anchor,1),ai.mapPos(si.head,1))}})}const indentSelection=({state:Ws,dispatch:ws})=>{if(Ws.readOnly)return!1;let oi=Object.create(null),si=new IndentContext(Ws,{overrideIndentation:ai=>oi[ai]??-1}),ii=changeBySelectedLine(Ws,(ai,li,ci)=>{let ui=getIndentation(si,ai.from);if(ui==null)return;/\S/.test(ai.text)||(ui=0);let di=/^\s*/.exec(ai.text)[0],hi=indentString(Ws,ui);(di!=hi||ci.from<ai.from+di.length)&&(oi[ai.from]=ui,li.push({from:ai.from,to:ai.from+di.length,insert:hi}))});return ii.changes.empty||ws(Ws.update(ii,{userEvent:"indent"})),!0},indentMore=({state:Ws,dispatch:ws})=>Ws.readOnly?!1:(ws(Ws.update(changeBySelectedLine(Ws,(oi,si)=>{si.push({from:oi.from,insert:Ws.facet(indentUnit)})}),{userEvent:"input.indent"})),!0),indentLess=({state:Ws,dispatch:ws})=>Ws.readOnly?!1:(ws(Ws.update(changeBySelectedLine(Ws,(oi,si)=>{let ii=/^\s*/.exec(oi.text)[0];if(!ii)return;let ai=countColumn(ii,Ws.tabSize),li=0,ci=indentString(Ws,Math.max(0,ai-getIndentUnit(Ws)));for(;li<ii.length&&li<ci.length&&ii.charCodeAt(li)==ci.charCodeAt(li);)li++;si.push({from:oi.from+li,to:oi.from+ii.length,insert:ci.slice(li)})}),{userEvent:"delete.dedent"})),!0),toggleTabFocusMode=Ws=>(Ws.setTabFocusMode(),!0),emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}],standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent,shift:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteLineBoundaryBackward},{mac:"Mod-Delete",run:deleteLineBoundaryForward}].concat(emacsStyleKeymap.map(Ws=>({mac:Ws.key,run:Ws.run,shift:Ws.shift}))),defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket},{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment},{key:"Ctrl-m",mac:"Shift-Alt-m",run:toggleTabFocusMode}].concat(standardKeymap),indentWithTab={key:"Tab",run:indentMore,shift:indentLess},basicNormalize=typeof String.prototype.normalize=="function"?Ws=>Ws.normalize("NFKD"):Ws=>Ws;class SearchCursor{constructor(ws,oi,si=0,ii=ws.length,ai,li){this.test=li,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=ws.iterRange(si,ii),this.bufferStart=si,this.normalize=ai?ci=>ai(basicNormalize(ci)):basicNormalize,this.query=this.normalize(oi)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let ws=this.peek();if(ws<0)return this.done=!0,this;let oi=fromCodePoint(ws),si=this.bufferStart+this.bufferPos;this.bufferPos+=codePointSize(ws);let ii=this.normalize(oi);if(ii.length)for(let ai=0,li=si;;ai++){let ci=ii.charCodeAt(ai),ui=this.match(ci,li,this.bufferPos+this.bufferStart);if(ai==ii.length-1){if(ui)return this.value=ui,this;break}li==si&&ai<oi.length&&oi.charCodeAt(ai)==ci&&li++}}}match(ws,oi,si){let ii=null;for(let ai=0;ai<this.matches.length;ai+=2){let li=this.matches[ai],ci=!1;this.query.charCodeAt(li)==ws&&(li==this.query.length-1?ii={from:this.matches[ai+1],to:si}:(this.matches[ai]++,ci=!0)),ci||(this.matches.splice(ai,2),ai-=2)}return this.query.charCodeAt(0)==ws&&(this.query.length==1?ii={from:oi,to:si}:this.matches.push(1,oi)),ii&&this.test&&!this.test(ii.from,ii.to,this.buffer,this.bufferStart)&&(ii=null),ii}}typeof Symbol<"u"&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});const empty={from:-1,to:-1,match:/.*/.exec("")},baseFlags="gm"+(/x/.unicode==null?"":"u");class RegExpCursor{constructor(ws,oi,si,ii=0,ai=ws.length){if(this.text=ws,this.to=ai,this.curLine="",this.done=!1,this.value=empty,/\\[sWDnr]|\n|\r|\[\^/.test(oi))return new MultilineRegExpCursor(ws,oi,si,ii,ai);this.re=new RegExp(oi,baseFlags+(si!=null&&si.ignoreCase?"i":"")),this.test=si==null?void 0:si.test,this.iter=ws.iter();let li=ws.lineAt(ii);this.curLineStart=li.from,this.matchPos=toCharEnd(ws,ii),this.getLine(this.curLineStart)}getLine(ws){this.iter.next(ws),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let ws=this.matchPos-this.curLineStart;;){this.re.lastIndex=ws;let oi=this.matchPos<=this.to&&this.re.exec(this.curLine);if(oi){let si=this.curLineStart+oi.index,ii=si+oi[0].length;if(this.matchPos=toCharEnd(this.text,ii+(si==ii?1:0)),si==this.curLineStart+this.curLine.length&&this.nextLine(),(si<ii||si>this.value.to)&&(!this.test||this.test(si,ii,oi)))return this.value={from:si,to:ii,match:oi},this;ws=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),ws=0;else return this.done=!0,this}}}const flattened=new WeakMap;class FlattenedDoc{constructor(ws,oi){this.from=ws,this.text=oi}get to(){return this.from+this.text.length}static get(ws,oi,si){let ii=flattened.get(ws);if(!ii||ii.from>=si||ii.to<=oi){let ci=new FlattenedDoc(oi,ws.sliceString(oi,si));return flattened.set(ws,ci),ci}if(ii.from==oi&&ii.to==si)return ii;let{text:ai,from:li}=ii;return li>oi&&(ai=ws.sliceString(oi,li)+ai,li=oi),ii.to<si&&(ai+=ws.sliceString(ii.to,si)),flattened.set(ws,new FlattenedDoc(li,ai)),new FlattenedDoc(oi,ai.slice(oi-li,si-li))}}class MultilineRegExpCursor{constructor(ws,oi,si,ii,ai){this.text=ws,this.to=ai,this.done=!1,this.value=empty,this.matchPos=toCharEnd(ws,ii),this.re=new RegExp(oi,baseFlags+(si!=null&&si.ignoreCase?"i":"")),this.test=si==null?void 0:si.test,this.flat=FlattenedDoc.get(ws,ii,this.chunkEnd(ii+5e3))}chunkEnd(ws){return ws>=this.to?this.to:this.text.lineAt(ws).to}next(){for(;;){let ws=this.re.lastIndex=this.matchPos-this.flat.from,oi=this.re.exec(this.flat.text);if(oi&&!oi[0]&&oi.index==ws&&(this.re.lastIndex=ws+1,oi=this.re.exec(this.flat.text)),oi){let si=this.flat.from+oi.index,ii=si+oi[0].length;if((this.flat.to>=this.to||oi.index+oi[0].length<=this.flat.text.length-10)&&(!this.test||this.test(si,ii,oi)))return this.value={from:si,to:ii,match:oi},this.matchPos=toCharEnd(this.text,ii+(si==ii?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(Ws){try{return new RegExp(Ws,baseFlags),!0}catch{return!1}}function toCharEnd(Ws,ws){if(ws>=Ws.length)return ws;let oi=Ws.lineAt(ws),si;for(;ws<oi.to&&(si=oi.text.charCodeAt(ws-oi.from))>=56320&&si<57344;)ws++;return ws}function createLineDialog(Ws){let ws=String(Ws.state.doc.lineAt(Ws.state.selection.main.head).number),oi=crelt("input",{class:"cm-textfield",name:"line",value:ws}),si=crelt("form",{class:"cm-gotoLine",onkeydown:ai=>{ai.keyCode==27?(ai.preventDefault(),Ws.dispatch({effects:dialogEffect.of(!1)}),Ws.focus()):ai.keyCode==13&&(ai.preventDefault(),ii())},onsubmit:ai=>{ai.preventDefault(),ii()}},crelt("label",Ws.state.phrase("Go to line"),": ",oi)," ",crelt("button",{class:"cm-button",type:"submit"},Ws.state.phrase("go")));function ii(){let ai=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(oi.value);if(!ai)return;let{state:li}=Ws,ci=li.doc.lineAt(li.selection.main.head),[,ui,di,hi,pi]=ai,ha=hi?+hi.slice(1):0,ga=di?+di:ci.number;if(di&&pi){let wa=ga/100;ui&&(wa=wa*(ui=="-"?-1:1)+ci.number/li.doc.lines),ga=Math.round(li.doc.lines*wa)}else di&&ui&&(ga=ga*(ui=="-"?-1:1)+ci.number);let va=li.doc.line(Math.max(1,Math.min(li.doc.lines,ga))),ba=EditorSelection.cursor(va.from+Math.max(0,Math.min(ha,va.length)));Ws.dispatch({effects:[dialogEffect.of(!1),EditorView.scrollIntoView(ba.from,{y:"center"})],selection:ba}),Ws.focus()}return{dom:si}}const dialogEffect=StateEffect.define(),dialogField=StateField.define({create(){return!0},update(Ws,ws){for(let oi of ws.effects)oi.is(dialogEffect)&&(Ws=oi.value);return Ws},provide:Ws=>showPanel.from(Ws,ws=>ws?createLineDialog:null)}),gotoLine=Ws=>{let ws=getPanel(Ws,createLineDialog);if(!ws){let oi=[dialogEffect.of(!0)];Ws.state.field(dialogField,!1)==null&&oi.push(StateEffect.appendConfig.of([dialogField,baseTheme$1])),Ws.dispatch({effects:oi}),ws=getPanel(Ws,createLineDialog)}return ws&&ws.dom.querySelector("input").select(),!0},baseTheme$1=EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),defaultHighlightOptions={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},highlightConfig=Facet.define({combine(Ws){return combineConfig(Ws,defaultHighlightOptions,{highlightWordAroundCursor:(ws,oi)=>ws||oi,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(Ws){return[defaultTheme,matchHighlighter]}const matchDeco=Decoration.mark({class:"cm-selectionMatch"}),mainMatchDeco=Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(Ws,ws,oi,si){return(oi==0||Ws(ws.sliceDoc(oi-1,oi))!=CharCategory.Word)&&(si==ws.doc.length||Ws(ws.sliceDoc(si,si+1))!=CharCategory.Word)}function insideWord(Ws,ws,oi,si){return Ws(ws.sliceDoc(oi,oi+1))==CharCategory.Word&&Ws(ws.sliceDoc(si-1,si))==CharCategory.Word}const matchHighlighter=ViewPlugin.fromClass(class{constructor(Ws){this.decorations=this.getDeco(Ws)}update(Ws){(Ws.selectionSet||Ws.docChanged||Ws.viewportChanged)&&(this.decorations=this.getDeco(Ws.view))}getDeco(Ws){let ws=Ws.state.facet(highlightConfig),{state:oi}=Ws,si=oi.selection;if(si.ranges.length>1)return Decoration.none;let ii=si.main,ai,li=null;if(ii.empty){if(!ws.highlightWordAroundCursor)return Decoration.none;let ui=oi.wordAt(ii.head);if(!ui)return Decoration.none;li=oi.charCategorizer(ii.head),ai=oi.sliceDoc(ui.from,ui.to)}else{let ui=ii.to-ii.from;if(ui<ws.minSelectionLength||ui>200)return Decoration.none;if(ws.wholeWords){if(ai=oi.sliceDoc(ii.from,ii.to),li=oi.charCategorizer(ii.head),!(insideWordBoundaries(li,oi,ii.from,ii.to)&&insideWord(li,oi,ii.from,ii.to)))return Decoration.none}else if(ai=oi.sliceDoc(ii.from,ii.to),!ai)return Decoration.none}let ci=[];for(let ui of Ws.visibleRanges){let di=new SearchCursor(oi.doc,ai,ui.from,ui.to);for(;!di.next().done;){let{from:hi,to:pi}=di.value;if((!li||insideWordBoundaries(li,oi,hi,pi))&&(ii.empty&&hi<=ii.from&&pi>=ii.to?ci.push(mainMatchDeco.range(hi,pi)):(hi>=ii.to||pi<=ii.from)&&ci.push(matchDeco.range(hi,pi)),ci.length>ws.maxMatches))return Decoration.none}}return Decoration.set(ci)}},{decorations:Ws=>Ws.decorations}),defaultTheme=EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:Ws,dispatch:ws})=>{let{selection:oi}=Ws,si=EditorSelection.create(oi.ranges.map(ii=>Ws.wordAt(ii.head)||EditorSelection.cursor(ii.head)),oi.mainIndex);return si.eq(oi)?!1:(ws(Ws.update({selection:si})),!0)};function findNextOccurrence(Ws,ws){let{main:oi,ranges:si}=Ws.selection,ii=Ws.wordAt(oi.head),ai=ii&&ii.from==oi.from&&ii.to==oi.to;for(let li=!1,ci=new SearchCursor(Ws.doc,ws,si[si.length-1].to);;)if(ci.next(),ci.done){if(li)return null;ci=new SearchCursor(Ws.doc,ws,0,Math.max(0,si[si.length-1].from-1)),li=!0}else{if(li&&si.some(ui=>ui.from==ci.value.from))continue;if(ai){let ui=Ws.wordAt(ci.value.from);if(!ui||ui.from!=ci.value.from||ui.to!=ci.value.to)continue}return ci.value}}const selectNextOccurrence=({state:Ws,dispatch:ws})=>{let{ranges:oi}=Ws.selection;if(oi.some(ai=>ai.from===ai.to))return selectWord({state:Ws,dispatch:ws});let si=Ws.sliceDoc(oi[0].from,oi[0].to);if(Ws.selection.ranges.some(ai=>Ws.sliceDoc(ai.from,ai.to)!=si))return!1;let ii=findNextOccurrence(Ws,si);return ii?(ws(Ws.update({selection:Ws.selection.addRange(EditorSelection.range(ii.from,ii.to),!1),effects:EditorView.scrollIntoView(ii.to)})),!0):!1},searchConfigFacet=Facet.define({combine(Ws){return combineConfig(Ws,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:ws=>new SearchPanel(ws),scrollToMatch:ws=>EditorView.scrollIntoView(ws)})}});class SearchQuery{constructor(ws){this.search=ws.search,this.caseSensitive=!!ws.caseSensitive,this.literal=!!ws.literal,this.regexp=!!ws.regexp,this.replace=ws.replace||"",this.valid=!!this.search&&(!this.regexp||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!ws.wholeWord}unquote(ws){return this.literal?ws:ws.replace(/\\([nrt\\])/g,(oi,si)=>si=="n"?`
341
- `:si=="r"?"\r":si=="t"?" ":"\\")}eq(ws){return this.search==ws.search&&this.replace==ws.replace&&this.caseSensitive==ws.caseSensitive&&this.regexp==ws.regexp&&this.wholeWord==ws.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(ws,oi=0,si){let ii=ws.doc?ws:EditorState.create({doc:ws});return si==null&&(si=ii.doc.length),this.regexp?regexpCursor(this,ii,oi,si):stringCursor(this,ii,oi,si)}}class QueryType{constructor(ws){this.spec=ws}}function stringCursor(Ws,ws,oi,si){return new SearchCursor(ws.doc,Ws.unquoted,oi,si,Ws.caseSensitive?void 0:ii=>ii.toLowerCase(),Ws.wholeWord?stringWordTest(ws.doc,ws.charCategorizer(ws.selection.main.head)):void 0)}function stringWordTest(Ws,ws){return(oi,si,ii,ai)=>((ai>oi||ai+ii.length<si)&&(ai=Math.max(0,oi-2),ii=Ws.sliceString(ai,Math.min(Ws.length,si+2))),(ws(charBefore(ii,oi-ai))!=CharCategory.Word||ws(charAfter(ii,oi-ai))!=CharCategory.Word)&&(ws(charAfter(ii,si-ai))!=CharCategory.Word||ws(charBefore(ii,si-ai))!=CharCategory.Word))}class StringQuery extends QueryType{constructor(ws){super(ws)}nextMatch(ws,oi,si){let ii=stringCursor(this.spec,ws,si,ws.doc.length).nextOverlapping();if(ii.done){let ai=Math.min(ws.doc.length,oi+this.spec.unquoted.length);ii=stringCursor(this.spec,ws,0,ai).nextOverlapping()}return ii.done||ii.value.from==oi&&ii.value.to==si?null:ii.value}prevMatchInRange(ws,oi,si){for(let ii=si;;){let ai=Math.max(oi,ii-1e4-this.spec.unquoted.length),li=stringCursor(this.spec,ws,ai,ii),ci=null;for(;!li.nextOverlapping().done;)ci=li.value;if(ci)return ci;if(ai==oi)return null;ii-=1e4}}prevMatch(ws,oi,si){let ii=this.prevMatchInRange(ws,0,oi);return ii||(ii=this.prevMatchInRange(ws,Math.max(0,si-this.spec.unquoted.length),ws.doc.length)),ii&&(ii.from!=oi||ii.to!=si)?ii:null}getReplacement(ws){return this.spec.unquote(this.spec.replace)}matchAll(ws,oi){let si=stringCursor(this.spec,ws,0,ws.doc.length),ii=[];for(;!si.next().done;){if(ii.length>=oi)return null;ii.push(si.value)}return ii}highlight(ws,oi,si,ii){let ai=stringCursor(this.spec,ws,Math.max(0,oi-this.spec.unquoted.length),Math.min(si+this.spec.unquoted.length,ws.doc.length));for(;!ai.next().done;)ii(ai.value.from,ai.value.to)}}function regexpCursor(Ws,ws,oi,si){return new RegExpCursor(ws.doc,Ws.search,{ignoreCase:!Ws.caseSensitive,test:Ws.wholeWord?regexpWordTest(ws.charCategorizer(ws.selection.main.head)):void 0},oi,si)}function charBefore(Ws,ws){return Ws.slice(findClusterBreak(Ws,ws,!1),ws)}function charAfter(Ws,ws){return Ws.slice(ws,findClusterBreak(Ws,ws))}function regexpWordTest(Ws){return(ws,oi,si)=>!si[0].length||(Ws(charBefore(si.input,si.index))!=CharCategory.Word||Ws(charAfter(si.input,si.index))!=CharCategory.Word)&&(Ws(charAfter(si.input,si.index+si[0].length))!=CharCategory.Word||Ws(charBefore(si.input,si.index+si[0].length))!=CharCategory.Word)}class RegExpQuery extends QueryType{nextMatch(ws,oi,si){let ii=regexpCursor(this.spec,ws,si,ws.doc.length).next();return ii.done&&(ii=regexpCursor(this.spec,ws,0,oi).next()),ii.done?null:ii.value}prevMatchInRange(ws,oi,si){for(let ii=1;;ii++){let ai=Math.max(oi,si-ii*1e4),li=regexpCursor(this.spec,ws,ai,si),ci=null;for(;!li.next().done;)ci=li.value;if(ci&&(ai==oi||ci.from>ai+10))return ci;if(ai==oi)return null}}prevMatch(ws,oi,si){return this.prevMatchInRange(ws,0,oi)||this.prevMatchInRange(ws,si,ws.doc.length)}getReplacement(ws){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(oi,si)=>si=="$"?"$":si=="&"?ws.match[0]:si!="0"&&+si<ws.match.length?ws.match[si]:oi)}matchAll(ws,oi){let si=regexpCursor(this.spec,ws,0,ws.doc.length),ii=[];for(;!si.next().done;){if(ii.length>=oi)return null;ii.push(si.value)}return ii}highlight(ws,oi,si,ii){let ai=regexpCursor(this.spec,ws,Math.max(0,oi-250),Math.min(si+250,ws.doc.length));for(;!ai.next().done;)ii(ai.value.from,ai.value.to)}}const setSearchQuery=StateEffect.define(),togglePanel=StateEffect.define(),searchState=StateField.define({create(Ws){return new SearchState(defaultQuery(Ws).create(),null)},update(Ws,ws){for(let oi of ws.effects)oi.is(setSearchQuery)?Ws=new SearchState(oi.value.create(),Ws.panel):oi.is(togglePanel)&&(Ws=new SearchState(Ws.query,oi.value?createSearchPanel:null));return Ws},provide:Ws=>showPanel.from(Ws,ws=>ws.panel)});class SearchState{constructor(ws,oi){this.query=ws,this.panel=oi}}const matchMark=Decoration.mark({class:"cm-searchMatch"}),selectedMatchMark=Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),searchHighlighter=ViewPlugin.fromClass(class{constructor(Ws){this.view=Ws,this.decorations=this.highlight(Ws.state.field(searchState))}update(Ws){let ws=Ws.state.field(searchState);(ws!=Ws.startState.field(searchState)||Ws.docChanged||Ws.selectionSet||Ws.viewportChanged)&&(this.decorations=this.highlight(ws))}highlight({query:Ws,panel:ws}){if(!ws||!Ws.spec.valid)return Decoration.none;let{view:oi}=this,si=new RangeSetBuilder;for(let ii=0,ai=oi.visibleRanges,li=ai.length;ii<li;ii++){let{from:ci,to:ui}=ai[ii];for(;ii<li-1&&ui>ai[ii+1].from-2*250;)ui=ai[++ii].to;Ws.highlight(oi.state,ci,ui,(di,hi)=>{let pi=oi.state.selection.ranges.some(ha=>ha.from==di&&ha.to==hi);si.add(di,hi,pi?selectedMatchMark:matchMark)})}return si.finish()}},{decorations:Ws=>Ws.decorations});function searchCommand(Ws){return ws=>{let oi=ws.state.field(searchState,!1);return oi&&oi.query.spec.valid?Ws(ws,oi):openSearchPanel(ws)}}const findNext=searchCommand((Ws,{query:ws})=>{let{to:oi}=Ws.state.selection.main,si=ws.nextMatch(Ws.state,oi,oi);if(!si)return!1;let ii=EditorSelection.single(si.from,si.to),ai=Ws.state.facet(searchConfigFacet);return Ws.dispatch({selection:ii,effects:[announceMatch(Ws,si),ai.scrollToMatch(ii.main,Ws)],userEvent:"select.search"}),selectSearchInput(Ws),!0}),findPrevious=searchCommand((Ws,{query:ws})=>{let{state:oi}=Ws,{from:si}=oi.selection.main,ii=ws.prevMatch(oi,si,si);if(!ii)return!1;let ai=EditorSelection.single(ii.from,ii.to),li=Ws.state.facet(searchConfigFacet);return Ws.dispatch({selection:ai,effects:[announceMatch(Ws,ii),li.scrollToMatch(ai.main,Ws)],userEvent:"select.search"}),selectSearchInput(Ws),!0}),selectMatches=searchCommand((Ws,{query:ws})=>{let oi=ws.matchAll(Ws.state,1e3);return!oi||!oi.length?!1:(Ws.dispatch({selection:EditorSelection.create(oi.map(si=>EditorSelection.range(si.from,si.to))),userEvent:"select.search.matches"}),!0)}),selectSelectionMatches=({state:Ws,dispatch:ws})=>{let oi=Ws.selection;if(oi.ranges.length>1||oi.main.empty)return!1;let{from:si,to:ii}=oi.main,ai=[],li=0;for(let ci=new SearchCursor(Ws.doc,Ws.sliceDoc(si,ii));!ci.next().done;){if(ai.length>1e3)return!1;ci.value.from==si&&(li=ai.length),ai.push(EditorSelection.range(ci.value.from,ci.value.to))}return ws(Ws.update({selection:EditorSelection.create(ai,li),userEvent:"select.search.matches"})),!0},replaceNext=searchCommand((Ws,{query:ws})=>{let{state:oi}=Ws,{from:si,to:ii}=oi.selection.main;if(oi.readOnly)return!1;let ai=ws.nextMatch(oi,si,si);if(!ai)return!1;let li=ai,ci=[],ui,di,hi=[];if(li.from==si&&li.to==ii&&(di=oi.toText(ws.getReplacement(li)),ci.push({from:li.from,to:li.to,insert:di}),li=ws.nextMatch(oi,li.from,li.to),hi.push(EditorView.announce.of(oi.phrase("replaced match on line $",oi.doc.lineAt(si).number)+"."))),li){let pi=ci.length==0||ci[0].from>=ai.to?0:ai.to-ai.from-di.length;ui=EditorSelection.single(li.from-pi,li.to-pi),hi.push(announceMatch(Ws,li)),hi.push(oi.facet(searchConfigFacet).scrollToMatch(ui.main,Ws))}return Ws.dispatch({changes:ci,selection:ui,effects:hi,userEvent:"input.replace"}),!0}),replaceAll=searchCommand((Ws,{query:ws})=>{if(Ws.state.readOnly)return!1;let oi=ws.matchAll(Ws.state,1e9).map(ii=>{let{from:ai,to:li}=ii;return{from:ai,to:li,insert:ws.getReplacement(ii)}});if(!oi.length)return!1;let si=Ws.state.phrase("replaced $ matches",oi.length)+".";return Ws.dispatch({changes:oi,effects:EditorView.announce.of(si),userEvent:"input.replace.all"}),!0});function createSearchPanel(Ws){return Ws.state.facet(searchConfigFacet).createPanel(Ws)}function defaultQuery(Ws,ws){var oi,si,ii,ai,li;let ci=Ws.selection.main,ui=ci.empty||ci.to>ci.from+100?"":Ws.sliceDoc(ci.from,ci.to);if(ws&&!ui)return ws;let di=Ws.facet(searchConfigFacet);return new SearchQuery({search:((oi=ws==null?void 0:ws.literal)!==null&&oi!==void 0?oi:di.literal)?ui:ui.replace(/\n/g,"\\n"),caseSensitive:(si=ws==null?void 0:ws.caseSensitive)!==null&&si!==void 0?si:di.caseSensitive,literal:(ii=ws==null?void 0:ws.literal)!==null&&ii!==void 0?ii:di.literal,regexp:(ai=ws==null?void 0:ws.regexp)!==null&&ai!==void 0?ai:di.regexp,wholeWord:(li=ws==null?void 0:ws.wholeWord)!==null&&li!==void 0?li:di.wholeWord})}function getSearchInput(Ws){let ws=getPanel(Ws,createSearchPanel);return ws&&ws.dom.querySelector("[main-field]")}function selectSearchInput(Ws){let ws=getSearchInput(Ws);ws&&ws==Ws.root.activeElement&&ws.select()}const openSearchPanel=Ws=>{let ws=Ws.state.field(searchState,!1);if(ws&&ws.panel){let oi=getSearchInput(Ws);if(oi&&oi!=Ws.root.activeElement){let si=defaultQuery(Ws.state,ws.query.spec);si.valid&&Ws.dispatch({effects:setSearchQuery.of(si)}),oi.focus(),oi.select()}}else Ws.dispatch({effects:[togglePanel.of(!0),ws?setSearchQuery.of(defaultQuery(Ws.state,ws.query.spec)):StateEffect.appendConfig.of(searchExtensions)]});return!0},closeSearchPanel=Ws=>{let ws=Ws.state.field(searchState,!1);if(!ws||!ws.panel)return!1;let oi=getPanel(Ws,createSearchPanel);return oi&&oi.dom.contains(Ws.root.activeElement)&&Ws.focus(),Ws.dispatch({effects:togglePanel.of(!1)}),!0},searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Mod-Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:!0}];class SearchPanel{constructor(ws){this.view=ws;let oi=this.query=ws.state.field(searchState).query.spec;this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:oi.search,placeholder:phrase(ws,"Find"),"aria-label":phrase(ws,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:oi.replace,placeholder:phrase(ws,"Replace"),"aria-label":phrase(ws,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:oi.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:oi.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:oi.wholeWord,onchange:this.commit});function si(ii,ai,li){return crelt("button",{class:"cm-button",name:ii,onclick:ai,type:"button"},li)}this.dom=crelt("div",{onkeydown:ii=>this.keydown(ii),class:"cm-search"},[this.searchField,si("next",()=>findNext(ws),[phrase(ws,"next")]),si("prev",()=>findPrevious(ws),[phrase(ws,"previous")]),si("select",()=>selectMatches(ws),[phrase(ws,"all")]),crelt("label",null,[this.caseField,phrase(ws,"match case")]),crelt("label",null,[this.reField,phrase(ws,"regexp")]),crelt("label",null,[this.wordField,phrase(ws,"by word")]),...ws.state.readOnly?[]:[crelt("br"),this.replaceField,si("replace",()=>replaceNext(ws),[phrase(ws,"replace")]),si("replaceAll",()=>replaceAll(ws),[phrase(ws,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(ws),"aria-label":phrase(ws,"close"),type:"button"},["×"])])}commit(){let ws=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});ws.eq(this.query)||(this.query=ws,this.view.dispatch({effects:setSearchQuery.of(ws)}))}keydown(ws){runScopeHandlers(this.view,ws,"search-panel")?ws.preventDefault():ws.keyCode==13&&ws.target==this.searchField?(ws.preventDefault(),(ws.shiftKey?findPrevious:findNext)(this.view)):ws.keyCode==13&&ws.target==this.replaceField&&(ws.preventDefault(),replaceNext(this.view))}update(ws){for(let oi of ws.transactions)for(let si of oi.effects)si.is(setSearchQuery)&&!si.value.eq(this.query)&&this.setQuery(si.value)}setQuery(ws){this.query=ws,this.searchField.value=ws.search,this.replaceField.value=ws.replace,this.caseField.checked=ws.caseSensitive,this.reField.checked=ws.regexp,this.wordField.checked=ws.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(searchConfigFacet).top}}function phrase(Ws,ws){return Ws.state.phrase(ws)}const AnnounceMargin=30,Break=/[\s\.,:;?!]/;function announceMatch(Ws,{from:ws,to:oi}){let si=Ws.state.doc.lineAt(ws),ii=Ws.state.doc.lineAt(oi).to,ai=Math.max(si.from,ws-AnnounceMargin),li=Math.min(ii,oi+AnnounceMargin),ci=Ws.state.sliceDoc(ai,li);if(ai!=si.from){for(let ui=0;ui<AnnounceMargin;ui++)if(!Break.test(ci[ui+1])&&Break.test(ci[ui])){ci=ci.slice(ui);break}}if(li!=ii){for(let ui=ci.length-1;ui>ci.length-AnnounceMargin;ui--)if(!Break.test(ci[ui-1])&&Break.test(ci[ui])){ci=ci.slice(0,ui);break}}return EditorView.announce.of(`${Ws.state.phrase("current match")}. ${ci} ${Ws.state.phrase("on line")} ${si.number}.`)}const baseTheme=EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),searchExtensions=[searchState,Prec.low(searchHighlighter),baseTheme];function convertGraphQLErrorToDiagnostic(Ws){var ws,oi,si,ii;return{from:(ws=Ws.locations)!=null&&ws[0]?((oi=Ws.positions)==null?void 0:oi[0])??0:0,to:(si=Ws.locations)!=null&&si[0]?(((ii=Ws.positions)==null?void 0:ii[0])??0)+1:1,severity:"error",message:Ws.message}}function makeLinter(Ws,ws){return linter(oi=>{const si=oi.state.doc.toString();let ii=[];if(ws&&(ii=ii.concat(ws(si))),isDocumentString(si))try{const ai=parse(si),li=new Set(ai.definitions.filter(di=>"name"in di&&di.name).map(di=>di.name.value)),ci=filterSchema({schema:Ws,typeFilter:di=>!li.has(di)}),ui=validateSDL(ai,ci).map(di=>locatedError(di,ai)).filter((di,hi,pi)=>hi===pi.findIndex(ha=>{var ga,va,ba,wa,xa,Ca,el,ku;return ha.message===di.message&&((va=(ga=ha.locations)==null?void 0:ga[0])==null?void 0:va.line)===((wa=(ba=di.locations)==null?void 0:ba[0])==null?void 0:wa.line)&&((Ca=(xa=ha.locations)==null?void 0:xa[0])==null?void 0:Ca.column)===((ku=(el=di.locations)==null?void 0:el[0])==null?void 0:ku.column)}));ii=ii.concat(ui.map(convertGraphQLErrorToDiagnostic))}catch(ai){ai instanceof GraphQLError&&ii.push(convertGraphQLErrorToDiagnostic(ai))}return ii})}function makeUpdateHandler(Ws,ws,oi){return EditorView.updateListener.of(si=>{if(Ws||!si.docChanged||si.transactions.some(ai=>ai.annotation(Transaction.userEvent)==="external"))return;const ii=si.state.doc.toString();ws.current&&clearTimeout(ws.current),ws.current=setTimeout(()=>{oi==null||oi(ii)},updateTimeout)})}function makeFocusHandler(Ws,ws,oi){return EditorView.focusChangeEffect.of((si,ii)=>{if(Ws||ii)return null;ws.current&&clearTimeout(ws.current);const ai=si.doc.toString();return oi==null||oi(ai),null})}function makePasteHandler(Ws,ws,oi){return EditorView.domEventHandlers({paste:(si,ii)=>{if(Ws)return!1;const ai=ii.state.doc.toString();return ws.current&&clearTimeout(ws.current),oi==null||oi(ai),forceLinting(ii),!1}})}function useEditorRefs(){const Ws=useRef(null),ws=useRef(null),oi=useRef(new Compartment),si=useRef(new Compartment),ii=useRef(new Compartment),ai=useRef(null);return{editorRef:Ws,viewRef:ws,updateListenerCompartment:oi,focusHandlerCompartment:si,pasteHandlerCompartment:ii,timeoutRef:ai}}function useEditorCleanup(Ws){useEffect(()=>()=>{Ws.current&&(Ws.current.destroy(),Ws.current=null)},[])}function useHandlerReconfiguration(Ws,ws,oi,si,ii){useEffect(()=>{Ws&&(Ws.dispatch({effects:[ii.updateListener.reconfigure(makeUpdateHandler(ws,oi,si)),ii.focusHandler.reconfigure(makeFocusHandler(ws,oi,si)),ii.pasteHandler.reconfigure(makePasteHandler(ws,oi,si))]}),forceLinting(Ws))},[ws,si])}function useDocumentSync(Ws,ws){useEffect(()=>{if(!Ws)return;const oi=Ws.state.doc.toString();oi!==ws&&(Ws.dispatch({changes:{from:0,to:oi.length,insert:ws},annotations:[Transaction.userEvent.of("external")]}),forceLinting(Ws))},[ws])}const baseEditorExtensions=[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(!0),indentOnInput(),syntaxHighlighting(defaultHighlightStyle,{fallback:!0}),bracketMatching(),closeBrackets(),autocompletion(),rectangularSelection(),crosshairCursor(),highlightActiveLine(),highlightSelectionMatches(),EditorView.lineWrapping],baseKeymap=[...closeBracketsKeymap,...defaultKeymap,...searchKeymap,...historyKeymap,...foldKeymap,...completionKeymap,...lintKeymap,indentWithTab],GraphqlEditor=memo(function Ws(ws){const{doc:oi,readonly:si=!1,updateDocumentInModel:ii,customLinter:ai}=ws,{editorRef:li,viewRef:ci,updateListenerCompartment:ui,focusHandlerCompartment:di,pasteHandlerCompartment:hi,timeoutRef:pi}=useEditorRefs(),ha=useRef(new Compartment),ga=useRef(new Compartment),va=useSchemaContext();return useEffect(()=>{if(!ci.current){const ba=buildSchema(va);ci.current=new EditorView({state:EditorState.create({doc:oi,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,ha.current.of(graphql(ba)),ga.current.of(makeLinter(ba,ai)),ui.current.of(makeUpdateHandler(si,pi,ii)),di.current.of(makeFocusHandler(si,pi,ii)),hi.current.of(makePasteHandler(si,pi,ii)),EditorState.readOnly.of(si)]}),parent:li.current}),forceLinting(ci.current)}},[]),useEditorCleanup(ci),useEffect(()=>{const ba=ci.current;if(!ba)return;const wa=getSchema(ba.state),xa=wa?printSchema(wa):null;if(!wa||xa!==va)try{const Ca=buildSchema(va);ba.dispatch({effects:[ha.current.reconfigure(graphql(Ca)),ga.current.reconfigure(makeLinter(Ca,ai))]}),forceLinting(ba)}catch(Ca){console.debug("in schema update",Ca)}},[va,ai]),useHandlerReconfiguration(ci.current,si,pi,ii,{updateListener:ui.current,focusHandler:di.current,pasteHandler:hi.current}),useDocumentSync(ci.current,oi),jsx("div",{ref:li})}),jsonHighlighting=styleTags({String:tags.string,Number:tags.number,"True False":tags.bool,PropertyName:tags.propertyName,Null:tags.null,", :":tags.separator,"[ ]":tags.squareBracket,"{ }":tags.brace}),parser=LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[jsonHighlighting],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jsonParseLinter=()=>Ws=>{try{JSON.parse(Ws.state.doc.toString())}catch(ws){if(!(ws instanceof SyntaxError))throw ws;const oi=getErrorPosition(ws,Ws.state.doc);return[{from:oi,message:ws.message,severity:"error",to:oi}]}return[]};function getErrorPosition(Ws,ws){let oi;return(oi=Ws.message.match(/at position (\d+)/))?Math.min(+oi[1],ws.length):(oi=Ws.message.match(/at line (\d+) column (\d+)/))?Math.min(ws.line(+oi[1]).from+ +oi[2]-1,ws.length):0}const jsonLanguage=LRLanguage.define({name:"json",parser:parser.configure({props:[indentNodeProp.add({Object:continuedIndent({except:/^\s*\}/}),Array:continuedIndent({except:/^\s*\]/})}),foldNodeProp.add({"Object Array":foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function json(){return new LanguageSupport(jsonLanguage)}const JSONEditor=memo(function Ws(ws){const{doc:oi,readonly:si=!1,updateDocumentInModel:ii}=ws,{editorRef:ai,viewRef:li,updateListenerCompartment:ci,focusHandlerCompartment:ui,pasteHandlerCompartment:di,timeoutRef:hi}=useEditorRefs();return useEffect(()=>{li.current||(li.current=new EditorView({state:EditorState.create({doc:oi,extensions:[...baseEditorExtensions,keymap.of(baseKeymap),ayuLight,jsonLanguage,json(),linter(jsonParseLinter()),ci.current.of(makeUpdateHandler(si,hi,ii)),ui.current.of(makeFocusHandler(si,hi,ii)),di.current.of(makePasteHandler(si,hi,ii)),EditorState.readOnly.of(si)]}),parent:ai.current}),forceLinting(li.current))},[]),useEditorCleanup(li),useHandlerReconfiguration(li.current,si,hi,ii,{updateListener:ci.current,focusHandler:ui.current,pasteHandler:di.current}),useDocumentSync(li.current,oi),jsx("div",{ref:ai})});P$5.lazyWithPreload(()=>Promise.resolve().then(()=>editor));h$3.object({name:h$3.string(),documentType:h$3.string(),extension:h$3.string(),description:h$3.string(),authorName:h$3.string(),authorWebsite:h$3.string()});function ModelMetadata(Ws){return jsxs("div",{children:[jsx(ModelNameForm,{...Ws}),jsx("div",{className:"flex h-full flex-col gap-4",children:jsxs("div",{className:"grid flex-1 grid-cols-3 items-start gap-4",children:[jsxs("div",{className:"col-span-2 flex h-full flex-col gap-4",children:[jsx("div",{className:"shrink-0",children:jsx(DocumentTypeForm,{...Ws})}),jsx("div",{className:"min-h-0 flex-1",children:jsx(DescriptionForm,{...Ws})})]}),jsxs("div",{className:"col-span-1 flex flex-col gap-4",children:[jsx(AuthorNameForm,{...Ws}),jsx(AuthorWebsiteForm,{...Ws}),jsx(ModelExtensionForm,{...Ws})]})]})})]})}function ModelNameForm(Ws){const{name:ws,globalStateSchema:oi,localStateSchema:si,setModelName:ii,setStateSchema:ai}=Ws,li=useCallback(ci=>{if(ws===ci)return;if(ii(ci),!oi){const di=makeInitialSchemaDoc(ci,"global");ai(di,"global");return}const ui=renameSchemaType(oi,ws,ci,"global");if(ai(ui,"global"),si){const di=renameSchemaType(si,ws,ci,"local");ai(di,"local")}handleModelNameChange({oldName:ws,newName:ci,globalStateSchema:oi,localStateSchema:si,setStateSchema:ai})},[ws,oi,si,ai]);return jsx(TextField,{name:"name",value:ws,onSubmit:li,placeholder:"Model name",className:"border-none pl-0 text-xl font-bold text-gray-900",required:!0,focusOnMount:!0})}function DocumentTypeForm(Ws){const{documentType:ws,setModelId:oi}=Ws;return jsx(TextField,{label:"Document Type",name:"powerhouse/document-model",value:ws,onSubmit:oi,placeholder:"Document Type",required:!0})}function ModelExtensionForm(Ws){const{extension:ws,setModelExtension:oi}=Ws;return jsx(TextField,{name:"extension",value:ws,onSubmit:oi,label:"Model Extension",placeholder:"Example .phdm",required:!0})}function DescriptionForm(Ws){const{description:ws,setModelDescription:oi}=Ws;return jsx(TextField,{name:"description",label:"Model Description",value:ws,onSubmit:oi,placeholder:"Describe your document to others",allowEmpty:!0,className:"h-full"})}function AuthorNameForm(Ws){const{authorName:ws,setAuthorName:oi}=Ws;return jsx(TextField,{name:"authorName",value:ws,onSubmit:oi,label:"Author Name",placeholder:"Username or organisation",allowEmpty:!0})}function AuthorWebsiteForm(Ws){const{authorWebsite:ws,setAuthorWebsite:oi}=Ws;return jsx(TextField,{name:"authorWebsite",value:ws,label:"Website URL",onSubmit:si=>{ws&&!si||oi(si)},placeholder:"https://www.powerhouse.inc/",allowEmpty:!0})}function Divider({className:Ws,size:ws="sm",margin:oi="md"}){function si(){return ws==="sm"?"h-px":ws==="md"?"h-1":"h-1.5"}function ii(){return oi==="sm"?"my-4":oi==="md"?"my-6":"my-8"}const ai=si(),li=ii();return jsx("div",{className:cn("bg-gray-200",ai,li,Ws)})}function OperationForm({operation:Ws,module:ws,focusOnMount:oi,allOperationNames:si,onAddOperationAndInitialSchema:ii,updateOperationName:ai,deleteOperation:li}){const ci=!!Ws,ui=useCallback(async hi=>{if(ci&&hi===""){li(Ws.id);return}const pi=toConstantCase(hi);ci?pi!==Ws.name&&ai(Ws.id,pi):await ii(ws.id,pi)},[ci,Ws==null?void 0:Ws.id,Ws==null?void 0:Ws.name,ws.id,li,ai,ii]),di=useCallback(hi=>{ci&&hi===""&&li(Ws.id)},[ci,Ws==null?void 0:Ws.id,li]);return jsx(TextField,{name:"name",value:Ws==null?void 0:Ws.name,label:ci?"Operation name":"Add operation",onSubmit:ui,onChange:di,placeholder:"Add operation",required:!ci,allowEmpty:!ci,shouldReset:!ci,focusOnMount:oi,unique:si})}function OperationDescriptionForm({operation:Ws,focusOnMount:ws,setOperationDescription:oi}){const si=useRef(null);return useEffect(()=>{ws&&si.current&&si.current.focus()},[ws]),jsx(TextField,{ref:si,name:"description",value:Ws.description,onSubmit:ii=>oi(Ws.id,ii),label:"Operation description",allowEmpty:!0,placeholder:"Operation Description"})}function OperationErrorForm({operation:Ws,error:ws,focusOnMount:oi,onSubmit:si,onAddOperationError:ii,deleteOperationError:ai,setOperationErrorName:li}){const ci=useRef(null),ui=!!ws,di=Ws.errors.map(ha=>ha.name).filter(Boolean),hi=useCallback(ha=>{if(ui&&ha===""){ai(ws.id);return}const ga=pascalCase(ha);ui?li(Ws.id,ws.id,ga):ii(Ws.id,ga),si==null||si()},[ui,ws==null?void 0:ws.id,Ws.id,ai,li,ii,si]),pi=useCallback(ha=>{ui&&ha===""&&ai(ws.id)},[ui,ws==null?void 0:ws.id,ai]);return jsx(TextField,{ref:ci,name:"name",value:ws==null?void 0:ws.name,onSubmit:hi,onChange:pi,placeholder:"Add exception",required:!ui,allowEmpty:!ui,shouldReset:!ui,unique:di,focusOnMount:oi})}function OperationErrors({operation:Ws,addOperationError:ws,deleteOperationError:oi,setOperationErrorName:si}){const ii=useId(),[ai,li]=useState(!1),ci=useCallback(async(di,hi)=>{const pi=await ws(di,hi);return pi&&li(!0),pi},[ws,li]),ui=useCallback(()=>li(!1),[li]);return jsxs("ul",{className:"ml-4 list-disc",children:[Ws.errors.map(di=>jsx("li",{children:jsx(OperationErrorForm,{error:di,operation:Ws,onAddOperationError:ci,deleteOperationError:oi,setOperationErrorName:si})},di.id)),jsx("li",{children:jsx(OperationErrorForm,{operation:Ws,onAddOperationError:ci,deleteOperationError:oi,setOperationErrorName:si,focusOnMount:ai,onSubmit:ui},`${ii}-${ai}`)})]})}function ensureDocumentContainsNodeWithNameAndType(Ws,ws,oi){return!Ws||!isDocumentString(Ws)?!0:parse(Ws).definitions.some(si=>{var ii;return si.kind===Kind[oi]&&"name"in si&&((ii=si.name)==null?void 0:ii.value)===ws})}function createNodeTypeAndNameDiagnostic(Ws,ws){var oi,si,ii,ai;if(!Ws||!isDocumentString(Ws))return;const li=parse(Ws).definitions[0],ci="name"in li?li.name:null;return{from:((oi=ci==null?void 0:ci.loc)==null?void 0:oi.start)??((si=li.loc)==null?void 0:si.start)??0,to:((ii=ci==null?void 0:ci.loc)==null?void 0:ii.end)??((ai=li.loc)==null?void 0:ai.end)??0,severity:"error",message:ws}}function ensureValidStateSchemaName(Ws,ws,oi){if(!Ws||!isDocumentString(Ws))return[];const si=`${pascalCase(ws)}${oi==="local"?"Local":""}State`;return ensureDocumentContainsNodeWithNameAndType(Ws,si,"OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(Ws,`${sentenceCase(oi)} state schema must be named ${si}`)].filter(Boolean)}function ensureValidOperationSchemaInputName(Ws,ws){if(!Ws||!isDocumentString(Ws))return[];const oi=`${pascalCase(ws)}Input`;return ensureDocumentContainsNodeWithNameAndType(Ws,oi,"INPUT_OBJECT_TYPE_DEFINITION")?[]:[createNodeTypeAndNameDiagnostic(Ws,`Operation schema must contain an input type named ${oi}`)].filter(Boolean)}function Operation(Ws){const{operation:ws,module:oi,allOperationNames:si,lastCreatedOperationId:ii,onAddOperationAndInitialSchema:ai,updateOperationName:li,deleteOperation:ci,updateOperationSchema:ui,setOperationDescription:di,addOperationError:hi,deleteOperationError:pi,setOperationErrorName:ha}=Ws,ga=useCallback(ba=>ui(ws.id,ba),[ws.id,ui]),va=useCallback(ba=>ws.name?ensureValidOperationSchemaInputName(ba,ws.name):[],[ws.name]);return jsxs("div",{className:"mt-4 grid grid-cols-2 gap-x-12",style:{gridTemplateAreas:`
342
- "left editor"
343
- "errors editor"
344
- `,gridTemplateRows:"auto 1fr"},children:[jsxs("div",{className:"flex flex-col gap-2",style:{gridArea:"left"},children:[jsx(OperationForm,{operation:ws,onAddOperationAndInitialSchema:ai,updateOperationName:li,deleteOperation:ci,module:oi,allOperationNames:si}),jsx(OperationDescriptionForm,{operation:ws,focusOnMount:ws.id===ii,setOperationDescription:di})]}),jsx("div",{className:"relative top-8",style:{gridArea:"editor"},children:jsx(GraphqlEditor,{doc:ws.schema??"",updateDocumentInModel:ga,customLinter:va})}),jsxs("div",{style:{gridArea:"errors"},children:[jsx("h3",{className:"my-2 text-sm font-medium text-gray-700",children:"Reducer Exceptions"}),jsx(OperationErrors,{operation:ws,addOperationError:hi,deleteOperationError:pi,setOperationErrorName:ha})]})]})}function Operations({module:Ws,allOperations:ws,shouldFocusNewOperation:oi,updateOperationName:si,deleteOperation:ii,addOperationAndInitialSchema:ai,addOperationError:li,deleteOperationError:ci,setOperationErrorName:ui,updateOperationSchema:di,setOperationDescription:hi}){const[pi,ha]=useState(null),ga=useId(),va=ws.map(wa=>wa.name).filter(Boolean),ba=useCallback(async(wa,xa)=>{const Ca=await ai(wa,xa);return Ca&&ha(Ca),Ca},[ai,ha]);return jsxs("div",{children:[Ws.operations.map(wa=>jsx("div",{children:jsx(Operation,{operation:wa,module:Ws,lastCreatedOperationId:pi,allOperationNames:va,addOperationError:li,deleteOperationError:ci,setOperationErrorName:ui,onAddOperationAndInitialSchema:ba,updateOperationName:si,deleteOperation:ii,updateOperationSchema:di,setOperationDescription:hi})},wa.id)),jsx("div",{className:"mt-6 w-1/2 pr-6",children:jsx(OperationForm,{onAddOperationAndInitialSchema:ba,updateOperationName:si,deleteOperation:ii,module:Ws,allOperationNames:va,focusOnMount:oi},ga)})]})}function Module(Ws){const{module:ws,modules:oi,allOperations:si,lastCreatedModuleId:ii,onAddModule:ai,updateModuleName:li,deleteModule:ci,updateOperationName:ui,deleteOperation:di,addOperationAndInitialSchema:hi,updateOperationSchema:pi,setOperationDescription:ha,addOperationError:ga,deleteOperationError:va,setOperationErrorName:ba}=Ws;return jsxs("div",{className:"relative rounded-3xl bg-gray-100 p-6",children:[jsxs("div",{className:"mb-2 w-1/2 pr-6",children:[jsx(ModuleForm,{modules:oi,module:ws,onAddModule:ai,updateModuleName:li}),!!ws&&jsx("button",{"aria-label":"Delete module",tabIndex:-1,className:"absolute right-1 top-1 p-2 text-gray-800 transition-colors hover:text-gray-500",onClick:()=>{ci(ws.id)},children:jsx(Kd,{name:"Xmark",size:32})})]}),!!ws&&jsx(Operations,{module:ws,allOperations:si,shouldFocusNewOperation:ws.id===ii,updateOperationName:ui,deleteOperation:di,addOperationAndInitialSchema:hi,updateOperationSchema:pi,setOperationDescription:ha,addOperationError:ga,deleteOperationError:va,setOperationErrorName:ba})]})}function Modules({modules:Ws,allOperations:ws,addModule:oi,updateModuleName:si,deleteModule:ii,updateOperationName:ai,deleteOperation:li,addOperationAndInitialSchema:ci,updateOperationSchema:ui,setOperationDescription:di,addOperationError:hi,deleteOperationError:pi,setOperationErrorName:ha}){const[ga,va]=useState(null),ba=useRef(null),wa=useCallback(async xa=>{var Ca;const el=await oi(xa);return el&&(va(el),(Ca=ba.current)==null||Ca.focus()),el},[oi,va]);return jsxs("div",{className:"flex flex-col gap-2",children:[Ws.map(xa=>jsx(Module,{module:xa,modules:Ws,allOperations:ws,lastCreatedModuleId:ga,onAddModule:wa,updateModuleName:si,deleteModule:ii,updateOperationName:ai,deleteOperation:li,addOperationAndInitialSchema:ci,updateOperationSchema:ui,setOperationDescription:di,addOperationError:hi,deleteOperationError:pi,setOperationErrorName:ha},xa.id)),jsx(Module,{modules:Ws,allOperations:ws,lastCreatedModuleId:ga,onAddModule:wa,updateModuleName:si,deleteModule:ii,updateOperationName:ai,deleteOperation:li,addOperationAndInitialSchema:ci,updateOperationSchema:ui,setOperationDescription:di,addOperationError:hi,deleteOperationError:pi,setOperationErrorName:ha},"add-module"),jsx("div",{ref:ba,tabIndex:0,className:"size-0 overflow-hidden","aria-hidden":"true"})]})}const Tabs=Zd,TabsList=React.forwardRef(({className:Ws,...ws},oi)=>jsx(Qd,{ref:oi,className:cn("flex items-center justify-center rounded-xl bg-slate-50 p-1 shadow-[inset_0px_0px_2px_rgba(255,255,255,0.50)]",Ws),...ws}));TabsList.displayName=Qd.displayName;const TabsTrigger=React.forwardRef(({className:Ws,...ws},oi)=>jsx(Jd,{ref:oi,className:cn("flex w-full items-center justify-center whitespace-nowrap rounded-lg p-1 text-sm text-gray-500 transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-gray-50 data-[state=active]:text-gray-800 data-[state=active]:shadow-[0px_16px_16px_-4px_rgba(0,0,0,0.10)]",Ws),...ws}));TabsTrigger.displayName=Jd.displayName;const TabsContent=React.forwardRef(({className:Ws,...ws},oi)=>jsx(ef,{ref:oi,className:cn("",Ws),...ws}));TabsContent.displayName=ef.displayName;const Button=forwardRef((Ws,ws)=>{const{className:oi,...si}=Ws;return jsx("button",{ref:ws,...si,className:cn("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",oi)})});function StateEditor({modelName:Ws,stateSchema:ws,initialValue:oi,setStateSchema:si,setInitialState:ii,scope:ai}){const li=useSchemaContext(),[ci,ui]=useState(!1),di=useCallback(va=>ensureValidStateSchemaName(va,Ws,ai),[Ws,ai]),hi=useCallback(()=>{ui(va=>!va)},[]),pi=useCallback(va=>si(va,ai),[si,ai]),ha=useCallback(va=>ii(va,ai),[ii,ai]),ga=useCallback(()=>{const va=makeMinimalObjectFromSDL(li,ws,oi?JSON.parse(oi):{});ii(va,ai)},[li,ws,oi,ii,ai]);return jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("h3",{className:"mb-2 text-lg capitalize",children:[ai," state schema"]}),jsxs(Button,{onClick:hi,className:"mb-2 flex w-fit items-center gap-2",children:[ci?"Hide":"Show"," standard library",jsx("svg",{className:cn("inline-block transition-transform",ci?"rotate-180":"rotate-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M11.9883 6.01172C11.4363 6.01172 10.9883 6.45972 10.9883 7.01172V13.0117H6.98828L11.9883 18.0117L16.9883 13.0117H12.9883V7.01172C12.9883 6.45972 12.5403 6.01172 11.9883 6.01172Z",fill:"black"})})]}),ci&&jsx(GraphqlEditor,{doc:typeDefsDoc,readonly:!0}),jsx(GraphqlEditor,{doc:ws,updateDocumentInModel:pi,customLinter:di})]}),jsxs("div",{children:[jsxs("div",{className:"flex flex-col items-end",children:[jsxs("h3",{className:"mb-2 text-right text-lg capitalize",children:[ai," state initial value"]}),jsxs(Button,{onClick:ga,className:"mb-2 flex w-fit items-center gap-2",children:["Sync with schema"," ",jsx("svg",{className:"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsx("path",{d:"M8.00521 1.99219C6.63588 1.99219 5.32788 2.45152 4.27588 3.28419C3.98721 3.51219 3.94321 3.93285 4.17188 4.22151C4.40054 4.51018 4.82055 4.55418 5.10921 4.32552C5.92721 3.67819 6.93921 3.32552 8.00521 3.32552C10.5825 3.32552 12.6719 5.41485 12.6719 7.99218H11.3385L13.3385 10.6588L15.3385 7.99218H14.0052C14.0052 4.67818 11.3192 1.99219 8.00521 1.99219ZM2.67188 5.32552L0.671875 7.99218H2.00521C2.00521 11.3062 4.69121 13.9922 8.00521 13.9922C9.37521 13.9922 10.6825 13.5335 11.7345 12.7002C12.0232 12.4722 12.0672 12.0515 11.8385 11.7628C11.6099 11.4742 11.1899 11.4302 10.9012 11.6588C10.0825 12.3068 9.07188 12.6588 8.00521 12.6588C5.42788 12.6588 3.33854 10.5695 3.33854 7.99218H4.67188L2.67188 5.32552Z",fill:"#343839"})})]})]}),jsx(JSONEditor,{doc:oi,updateDocumentInModel:ha})]})]})}function StateSchemas({modelName:Ws,globalStateSchema:ws,localStateSchema:oi,globalStateInitialValue:si,localStateInitialValue:ii,setStateSchema:ai,setInitialState:li}){const ci=useCallback(()=>{const ui=makeInitialSchemaDoc(Ws,"local");ai(ui,"local"),li("","local")},[Ws,ai,li]);return jsxs(Tabs,{className:"pb-8",activationMode:"manual",defaultValue:"global",children:[jsx("div",{className:"my-6",children:jsxs(TabsList,{className:"mx-auto flex max-w-sm",children:[jsx(TabsTrigger,{value:"global",children:"Global"}),jsx(TabsTrigger,{value:"local",children:"Local"})]})}),jsx(TabsContent,{value:"global",tabIndex:-1,children:jsx(StateEditor,{modelName:Ws,stateSchema:ws,initialValue:si,setStateSchema:ai,setInitialState:li,scope:"global"})}),jsx(TabsContent,{value:"local",tabIndex:-1,children:oi?jsx(StateEditor,{modelName:Ws,stateSchema:oi,initialValue:ii,setStateSchema:ai,setInitialState:li,scope:"local"}):jsxs("div",{className:"",children:[jsx("h3",{className:"mb-2 text-lg capitalize",children:"local state schema"}),jsx(Button,{onClick:ci,children:"Add local state"})]})})]})}function Editor(Ws){const{document:ws,documentNodeName:oi,dispatch:si}=Ws,{name:ii,id:ai,extension:li,description:ci,author:{name:ui,website:di}}=useMemo(()=>ws.state.global,[ws.state.global]),{state:{global:{schema:hi,initialValue:pi},local:{schema:ha,initialValue:ga}},modules:va}=useMemo(()=>ws.state.global.specifications[0],[ws.state.global.specifications[0]]),ba=useMemo(()=>va.flatMap(xd=>xd.operations),[va]),wa=useRef(!ii&&!!oi&&ba.length===0);useEffect(()=>{!wa.current||!oi||(si(actions.setModelName({name:oi})),initializeModelSchema({modelName:oi,setStateSchema:(xd,Fd)=>{si(actions.setStateSchema({schema:xd,scope:Fd}))}}),wa.current=!1)},[oi]);const xa=useMemo(()=>ba.flatMap(xd=>xd.schema??[]).join(`
345
- `),[ba]),Ca=useCallback(xd=>{compareStringsWithoutWhitespace(xd,ai)||si(actions.setModelId({id:xd}))},[ai]),el=useCallback(xd=>{compareStringsWithoutWhitespace(xd,ci)||si(actions.setModelDescription({description:xd}))},[ci]),ku=useCallback(xd=>{compareStringsWithoutWhitespace(xd,li)||si(actions.setModelExtension({extension:xd}))},[li]),gd=useCallback(xd=>{compareStringsWithoutWhitespace(xd,ii)||si(actions.setModelName({name:xd}))},[ii]),Ed=useCallback(xd=>{compareStringsWithoutWhitespace(xd,ui)||si(actions.setAuthorName({authorName:xd}))},[ui]),Od=useCallback(xd=>{compareStringsWithoutWhitespace(xd,di??"")||si(actions.setAuthorWebsite({authorWebsite:xd}))},[di]),Nd=useCallback((xd,Fd)=>{compareStringsWithoutWhitespace(xd,Fd==="global"?hi:ha)||si(actions.setStateSchema({schema:xd,scope:Fd}))},[hi,ha]),Pd=useCallback((xd,Fd)=>{compareStringsWithoutWhitespace(xd,Fd==="global"?pi:ga)||si(actions.setInitialState({initialValue:xd,scope:Fd}))},[pi,ga]),Ld=useCallback(xd=>new Promise(Fd=>{try{if(va.some(af=>compareStringsWithoutWhitespace(af.name,xd))){Fd(void 0);return}const Vd=index.hashKey();si(actions.addModule({id:Vd,name:xd})),Fd(Vd)}catch(Vd){console.error("Failed to add module:",Vd),Fd(void 0)}}),[va]),rf=useCallback((xd,Fd)=>{va.some(Vd=>compareStringsWithoutWhitespace(Vd.name,Fd))||si(actions.setModuleName({id:xd,name:Fd}))},[va]),kd=useCallback(xd=>si(actions.deleteModule({id:xd})),[]),Md=useCallback((xd,Fd)=>new Promise(Vd=>{var af;try{if((((af=va.find(uf=>uf.id===xd))==null?void 0:af.operations.map(uf=>uf.name).filter(Boolean))??[]).some(uf=>compareStringsWithoutWhitespace(uf,Fd))){Vd(void 0);return}const ff=index.hashKey();si(actions.addOperation({id:ff,moduleId:xd,name:Fd})),Vd(ff)}catch(ff){console.error("Failed to add operation:",ff),Vd(void 0)}}),[va]),Td=useCallback((xd,Fd)=>{const Vd=va.find(af=>af.operations.some(ff=>ff.id===xd));((Vd==null?void 0:Vd.operations.map(af=>af.name).filter(Boolean))??[]).some(af=>compareStringsWithoutWhitespace(af,Fd))||si(actions.setOperationName({id:xd,name:Fd}))},[va]),wd=useCallback((xd,Fd)=>{const Vd=ba.find(af=>af.id===xd);Vd!=null&&Vd.schema&&compareStringsWithoutWhitespace(Fd,Vd.schema)||si(actions.setOperationSchema({id:xd,schema:Fd}))},[ba]),Cd=useCallback((xd,Fd)=>{var Vd;const af=((Vd=ba.find(ff=>ff.id===xd))==null?void 0:Vd.description)??"";compareStringsWithoutWhitespace(af,Fd)||si(actions.setOperationDescription({id:xd,description:Fd}))},[ba]),sf=useCallback(xd=>si(actions.deleteOperation({id:xd})),[]),of=useCallback((xd,Fd)=>new Promise(Vd=>{try{const af=ba.find(uf=>uf.id===xd);if(((af==null?void 0:af.errors.map(uf=>uf.name).filter(Boolean))??[]).some(uf=>compareStringsWithoutWhitespace(uf,Fd))){Vd(void 0);return}const ff=index.hashKey();si(actions.addOperationError({id:ff,operationId:xd,errorName:Fd})),Vd(ff)}catch(af){console.error("Failed to add operation error:",af),Vd(void 0)}}),[ba]),Wd=useCallback(xd=>si(actions.deleteOperationError({id:xd})),[]),df=useCallback((xd,Fd,Vd)=>{const af=ba.find(ff=>ff.id===xd);((af==null?void 0:af.errors.map(ff=>ff.name).filter(Boolean))??[]).some(ff=>compareStringsWithoutWhitespace(ff,Vd))||si(actions.setOperationErrorName({id:Fd,errorName:Vd}))},[ba]),hf=useCallback(async(xd,Fd)=>{try{const Vd=await Md(xd,Fd);if(!Vd)return;try{return wd(Vd,makeOperationInitialDoc(Fd)),Vd}catch(af){console.error("Failed to update operation schema:",af);return}}catch(Vd){console.error("Failed to add operation and schema:",Vd);return}},[Md,wd]);return jsx("main",{className:"min-h-dvh bg-gray-50",children:jsx(SchemaContextProvider,{globalStateSchemaSdl:hi,localStateSchemaSdl:ha,operationSchemasSdl:xa,children:jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-8",children:[jsx(ModelMetadata,{name:ii,documentType:ai,extension:li,description:ci,authorName:ui,authorWebsite:di??"",globalStateSchema:hi,localStateSchema:ha,setModelId:Ca,setModelDescription:el,setModelExtension:ku,setModelName:gd,setAuthorName:Ed,setAuthorWebsite:Od,setStateSchema:Nd}),jsx(Divider,{}),jsxs("div",{children:[jsx(StateSchemas,{modelName:ii,globalStateSchema:hi,globalStateInitialValue:pi,localStateSchema:ha,localStateInitialValue:ga,setStateSchema:Nd,setInitialState:Pd}),jsx(Divider,{}),jsx("h3",{className:"mb-6 text-lg",children:"Global Operations"}),jsx(Modules,{modules:va,allOperations:ba,addModule:Ld,updateModuleName:rf,deleteModule:kd,updateOperationName:Td,updateOperationSchema:wd,setOperationDescription:Cd,deleteOperation:sf,addOperationError:of,deleteOperationError:Wd,setOperationErrorName:df,addOperationAndInitialSchema:hf})]})]})})})}const editor=Object.freeze(Object.defineProperty({__proto__:null,default:Editor},Symbol.toStringTag,{value:"Module"})),y=P$5.lazyWithPreload(()=>__vitePreload(()=>import("./index-CLu1C_is-jUM7ckQa.js"),[]));function C(Ws,ws){return JSON.stringify(Ws).replace(/\s/g,"")===ws.replace(/\s/g,"")}function J({value:Ws,onChange:ws,theme:oi,onBlur:si,...ii}){const[ai,li]=useState(JSON.stringify(Ws,null,4));function ci(ui){if(ui)try{const di=JSON.parse(ui);ws(di)}catch{}}return useEffect(()=>{ci(ai)},[ai]),useEffect(()=>{C(Ws,ai)||li(JSON.stringify(Ws,null,4))},[Ws]),jsx(y,{height:"100%",language:"json",onChange:ui=>li(ui??""),theme:`vs-${oi}`,value:ai,...ii,onMount:ui=>{ui.onDidBlurEditorText(()=>{si==null||si(JSON.parse(ui.getValue()))})},options:{lineNumbers:"off",minimap:{enabled:!1},...ii.options}})}function k({dispatch:Ws,document:ws,context:oi}){const[si,ii]=useState(ws.state.global);useEffect(()=>{ii(ws.state.global)},[ws.state]);function ai(ci){Ws(BaseActions.loadState({state:{global:ci,local:ws.state.local},name:ws.name},0))}const li=ci=>{Ws(BaseActions.setName(ci))};return jsxs(DocumentEditor,{mode:oi.theme,children:[jsx(EditorToolbar,{center:[jsx(ToolbarButton,{onClick:()=>ai(si),children:"Save"},"save")],left:[jsx(ToolbarButton,{onClick:()=>Ws(BaseActions.undo(1)),children:"↺ undo"},"undo"),jsx(ToolbarButton,{onClick:()=>Ws(BaseActions.redo(1)),children:"↻ redo"},"redo")],right:[jsx(ToolbarButton,{children:"revision history"},"rev")]},"toolbar"),jsxs(EditorWorksheet,{children:[jsx("div",{style:{marginBottom:"1em"},children:jsx(TextInput,{onSubmit:li,placeholder:"Document name",size:"medium",theme:oi.theme,value:ws.name},"doc-title")}),jsx(J,{onBlur:ci=>ai(ci),onChange:ci=>ii(ci||{}),theme:oi.theme,value:si})]},"sheet")]})}export{k as default};
346
- //# sourceMappingURL=editor-Dms2goxJ.js.map