@seaveyon/harness-switch 0.24.0 → 0.26.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 (340) hide show
  1. package/dist/harness-switch.js +5718 -4031
  2. package/package.json +1 -1
  3. package/public/assets/38.4f37f008.js +1 -0
  4. package/public/assets/403.83e8a5aa.js +1 -0
  5. package/public/assets/703.74dabcc4.js +1 -0
  6. package/public/assets/780.6c88bbeb.js +203 -0
  7. package/public/assets/886.215586f6.js +1 -0
  8. package/public/assets/911.fae0dbda.js +1 -0
  9. package/public/assets/{826.55f3327b.js → 952.906cea7c.js} +1 -1
  10. package/public/assets/997.79084a9d.js +1 -0
  11. package/public/assets/main.16a7e7ef.js +62 -0
  12. package/public/assets/main.99eb8e7b.css +2 -0
  13. package/public/brand-mark-dark.png +0 -0
  14. package/public/brand-mark-light.png +0 -0
  15. package/public/index.html +1 -1
  16. package/public/assets/1044.39aafe87.js +0 -1
  17. package/public/assets/1045.21280f56.js +0 -1
  18. package/public/assets/1050.46b86852.js +0 -1
  19. package/public/assets/1064.d2226313.js +0 -1
  20. package/public/assets/109.d185b844.js +0 -1
  21. package/public/assets/117.fbce1498.js +0 -1
  22. package/public/assets/1216.f58f116a.js +0 -1
  23. package/public/assets/1266.b0b77ece.js +0 -1
  24. package/public/assets/1274.36c97e4b.js +0 -1
  25. package/public/assets/1284.6d1b1fa9.js +0 -1
  26. package/public/assets/1297.5aa40a92.js +0 -1
  27. package/public/assets/1337.91282e33.js +0 -1
  28. package/public/assets/1348.3156645b.js +0 -1
  29. package/public/assets/1446.08d331b6.js +0 -1
  30. package/public/assets/1473.b0f70164.js +0 -1
  31. package/public/assets/1495.98d34a19.js +0 -1
  32. package/public/assets/1498.a7a38ca7.js +0 -1
  33. package/public/assets/1506.50339f62.js +0 -1
  34. package/public/assets/1541.3def363d.js +0 -1
  35. package/public/assets/1558.a7617461.js +0 -1
  36. package/public/assets/1565.2f21c8e1.js +0 -1
  37. package/public/assets/1680.4e882493.js +0 -1
  38. package/public/assets/1706.b445c403.js +0 -1
  39. package/public/assets/1811.132227bb.js +0 -1
  40. package/public/assets/1822.9d44e9b8.js +0 -1
  41. package/public/assets/1852.561dcf77.js +0 -1
  42. package/public/assets/1875.f9da64a1.js +0 -1
  43. package/public/assets/193.86e5680f.js +0 -1
  44. package/public/assets/1942.edb657de.js +0 -1
  45. package/public/assets/197.be0123ad.js +0 -1
  46. package/public/assets/1972.b1548051.js +0 -1
  47. package/public/assets/198.2702464a.js +0 -1
  48. package/public/assets/1981.4e7751ba.js +0 -1
  49. package/public/assets/2048.e0b5be0d.js +0 -1
  50. package/public/assets/2067.6433a4bd.js +0 -1
  51. package/public/assets/2082.b2643ed0.js +0 -1
  52. package/public/assets/2185.248c6b44.js +0 -1
  53. package/public/assets/2202.e80e4d18.js +0 -1
  54. package/public/assets/2227.cf7e7a88.js +0 -1
  55. package/public/assets/2234.f03ed50e.js +0 -1
  56. package/public/assets/2247.8cd63431.js +0 -1
  57. package/public/assets/2301.5b08aa31.js +0 -1
  58. package/public/assets/231.073ec786.js +0 -1
  59. package/public/assets/233.9eea8428.js +0 -1
  60. package/public/assets/2332.bec77738.js +0 -1
  61. package/public/assets/234.e1ec501c.js +0 -1
  62. package/public/assets/2368.6d60e76e.js +0 -1
  63. package/public/assets/2378.a09f27ac.js +0 -1
  64. package/public/assets/2411.1a1e84d8.js +0 -1
  65. package/public/assets/2426.12abe760.js +0 -1
  66. package/public/assets/2536.d03279a1.js +0 -1
  67. package/public/assets/2605.3ae8a730.js +0 -1
  68. package/public/assets/2645.52e9596b.js +0 -1
  69. package/public/assets/2707.6df3e122.js +0 -1
  70. package/public/assets/2725.9a21dc87.js +0 -1
  71. package/public/assets/2743.d8ff9d1a.js +0 -1
  72. package/public/assets/2748.a74a539c.js +0 -1
  73. package/public/assets/2751.3761b15d.js +0 -1
  74. package/public/assets/278.06c0a585.js +0 -1
  75. package/public/assets/2810.0805c8d3.js +0 -1
  76. package/public/assets/2816.52f328bf.js +0 -1
  77. package/public/assets/2872.712f11ad.js +0 -1
  78. package/public/assets/2881.812773b3.js +0 -1
  79. package/public/assets/2895.412a0fef.js +0 -1
  80. package/public/assets/2918.ca9f8ee6.js +0 -1
  81. package/public/assets/2948.812bfd61.js +0 -1
  82. package/public/assets/3008.0e0072bf.js +0 -1
  83. package/public/assets/3084.812f46dd.js +0 -1
  84. package/public/assets/311.ff658c78.js +0 -1
  85. package/public/assets/3115.de6d897d.js +0 -1
  86. package/public/assets/312.6893cc70.js +0 -1
  87. package/public/assets/3121.abf15015.js +0 -1
  88. package/public/assets/3123.bb6961b4.js +0 -1
  89. package/public/assets/3168.f70fdbe1.js +0 -1
  90. package/public/assets/3260.b9830b0a.js +0 -1
  91. package/public/assets/331.5979e79c.js +0 -1
  92. package/public/assets/3323.33607bff.js +0 -1
  93. package/public/assets/333.62f29c23.js +0 -1
  94. package/public/assets/3339.55ba3289.js +0 -1
  95. package/public/assets/3370.ac044cd4.js +0 -1
  96. package/public/assets/3381.ebf520a0.js +0 -1
  97. package/public/assets/3384.97088998.js +0 -1
  98. package/public/assets/3420.d26395e2.js +0 -1
  99. package/public/assets/3432.9a6cbc9d.js +0 -1
  100. package/public/assets/3474.c3b0a117.js +0 -1
  101. package/public/assets/3502.713d8997.js +0 -1
  102. package/public/assets/3520.8332b3b9.js +0 -1
  103. package/public/assets/3663.7e96a229.js +0 -1
  104. package/public/assets/3707.9a1cc57e.js +0 -1
  105. package/public/assets/3712.ccdacc8b.js +0 -1
  106. package/public/assets/3724.c7124c16.js +0 -1
  107. package/public/assets/379.3eba2174.js +0 -1
  108. package/public/assets/3793.2f8f8fa2.js +0 -1
  109. package/public/assets/3808.61543a59.js +0 -1
  110. package/public/assets/3809.ea90d219.js +0 -1
  111. package/public/assets/382.df49ab73.js +0 -1
  112. package/public/assets/3844.ad345570.js +0 -1
  113. package/public/assets/3853.0041121c.js +0 -1
  114. package/public/assets/3886.4758be08.js +0 -1
  115. package/public/assets/3911.67d83e56.js +0 -1
  116. package/public/assets/3945.02b410f7.js +0 -1
  117. package/public/assets/4025.faefbdf9.js +0 -1
  118. package/public/assets/4049.274b3781.js +0 -1
  119. package/public/assets/4058.9bd8b6fd.js +0 -1
  120. package/public/assets/4087.f5f2aa77.js +0 -1
  121. package/public/assets/4145.591efba1.js +0 -1
  122. package/public/assets/4179.0e70c02d.js +0 -1
  123. package/public/assets/4261.24d2c946.js +0 -1
  124. package/public/assets/4301.d36b09ac.js +0 -1
  125. package/public/assets/438.c9ddabb1.js +0 -1
  126. package/public/assets/4405.195b8807.js +0 -1
  127. package/public/assets/4429.20a43aee.js +0 -1
  128. package/public/assets/4445.0593f53c.js +0 -1
  129. package/public/assets/4447.1f4c2594.js +0 -1
  130. package/public/assets/4458.b54836f5.js +0 -1
  131. package/public/assets/4489.e05c3f02.js +0 -1
  132. package/public/assets/4496.59f9e494.js +0 -1
  133. package/public/assets/4498.53895790.js +0 -1
  134. package/public/assets/452.bf34842d.js +0 -1
  135. package/public/assets/4525.202e71f0.js +0 -1
  136. package/public/assets/459.d0de752e.js +0 -1
  137. package/public/assets/4609.539adc7e.js +0 -1
  138. package/public/assets/4613.2c9412fc.js +0 -1
  139. package/public/assets/465.6d0c9900.js +0 -1
  140. package/public/assets/4655.817d8c16.js +0 -1
  141. package/public/assets/4704.5bd5cd1f.js +0 -1
  142. package/public/assets/4705.1b7400d1.js +0 -1
  143. package/public/assets/4785.2c122907.js +0 -1
  144. package/public/assets/4795.5b28b5a2.js +0 -1
  145. package/public/assets/4796.38fc127d.js +0 -1
  146. package/public/assets/4798.061be689.js +0 -1
  147. package/public/assets/4846.2f6655eb.js +0 -1
  148. package/public/assets/485.3fe4cb47.js +0 -1
  149. package/public/assets/4885.c0812b9f.js +0 -1
  150. package/public/assets/4952.bb1279bd.js +0 -1
  151. package/public/assets/4983.565b5198.js +0 -1
  152. package/public/assets/4992.abfa216e.js +0 -1
  153. package/public/assets/4994.5eac32c7.js +0 -1
  154. package/public/assets/4996.46cad67b.js +0 -1
  155. package/public/assets/5068.3fa2fa23.js +0 -1
  156. package/public/assets/5072.7adfff93.js +0 -1
  157. package/public/assets/5108.62165adf.js +0 -1
  158. package/public/assets/5280.bc09c97b.js +0 -1
  159. package/public/assets/5281.73e94011.js +0 -1
  160. package/public/assets/5294.b2f2f0bd.js +0 -1
  161. package/public/assets/5319.e6dcabf9.js +0 -1
  162. package/public/assets/5393.e6c80ec4.js +0 -1
  163. package/public/assets/5398.d0384b7e.js +0 -1
  164. package/public/assets/5415.c896e0e1.js +0 -1
  165. package/public/assets/544.64addbc4.js +0 -1
  166. package/public/assets/5453.08deb63c.js +0 -1
  167. package/public/assets/5458.0095414b.js +0 -1
  168. package/public/assets/5462.17536a21.js +0 -1
  169. package/public/assets/5466.7acd94a7.js +0 -1
  170. package/public/assets/5518.57996485.js +0 -1
  171. package/public/assets/5530.828452d4.js +0 -1
  172. package/public/assets/5542.9162530c.js +0 -1
  173. package/public/assets/5593.0776f2d3.js +0 -1
  174. package/public/assets/5596.8a7ddea5.js +0 -1
  175. package/public/assets/5631.f6c57eaf.js +0 -1
  176. package/public/assets/5646.1b33e69c.js +0 -1
  177. package/public/assets/5661.164c0709.js +0 -1
  178. package/public/assets/5678.c096f6c9.js +0 -1
  179. package/public/assets/5687.587f0e75.js +0 -1
  180. package/public/assets/5703.5e666028.js +0 -1
  181. package/public/assets/5708.164057e0.js +0 -1
  182. package/public/assets/5712.cc503220.js +0 -1
  183. package/public/assets/575.e898fd86.js +0 -1
  184. package/public/assets/5752.e018032d.js +0 -1
  185. package/public/assets/5813.cc59df28.js +0 -1
  186. package/public/assets/5865.012fa536.js +0 -1
  187. package/public/assets/5879.47b8e3c2.js +0 -1
  188. package/public/assets/590.8c02fbf9.js +0 -1
  189. package/public/assets/5917.87e0acee.js +0 -1
  190. package/public/assets/5959.c0de70a1.js +0 -1
  191. package/public/assets/5970.31600f7b.js +0 -1
  192. package/public/assets/6005.fb7dbdae.js +0 -1
  193. package/public/assets/6024.c3f22f35.js +0 -1
  194. package/public/assets/6070.6f66b5fa.js +0 -1
  195. package/public/assets/6084.26b44499.js +0 -1
  196. package/public/assets/6085.cb855236.js +0 -1
  197. package/public/assets/6093.bebbe3da.js +0 -1
  198. package/public/assets/6106.39b87fca.js +0 -1
  199. package/public/assets/6122.f064356d.js +0 -1
  200. package/public/assets/6150.5cb126a5.js +0 -203
  201. package/public/assets/6157.7eeb3515.js +0 -1
  202. package/public/assets/616.a5acd2aa.js +0 -1
  203. package/public/assets/6226.dd8f1fd9.js +0 -1
  204. package/public/assets/6231.c10ba8f9.js +0 -1
  205. package/public/assets/6254.69f98e64.js +0 -1
  206. package/public/assets/6308.9f7b0778.js +0 -1
  207. package/public/assets/6309.fd92f229.js +0 -1
  208. package/public/assets/6378.d0087d79.js +0 -1
  209. package/public/assets/6380.6a320a57.js +0 -1
  210. package/public/assets/6427.80120ca0.js +0 -1
  211. package/public/assets/6468.cd796686.js +0 -1
  212. package/public/assets/655.2424b6f0.js +0 -1
  213. package/public/assets/6551.1316a8b4.js +0 -1
  214. package/public/assets/6563.f0ab8ea9.js +0 -1
  215. package/public/assets/658.d1870bbc.js +0 -1
  216. package/public/assets/659.43d1bd18.js +0 -1
  217. package/public/assets/6629.d5835f7b.js +0 -1
  218. package/public/assets/670.cc579966.js +0 -1
  219. package/public/assets/6729.711b6a33.js +0 -1
  220. package/public/assets/6739.5df85504.js +0 -1
  221. package/public/assets/6766.b3b93d6b.js +0 -1
  222. package/public/assets/6781.8330074c.js +0 -1
  223. package/public/assets/6829.f83cf943.js +0 -1
  224. package/public/assets/6855.c3b857c6.js +0 -1
  225. package/public/assets/6883.55fcdbea.js +0 -1
  226. package/public/assets/6900.abab0925.js +0 -1
  227. package/public/assets/6956.8307b311.js +0 -1
  228. package/public/assets/6959.7c488de5.js +0 -1
  229. package/public/assets/698.ebc84dc0.js +0 -1
  230. package/public/assets/7015.a05d0b78.js +0 -1
  231. package/public/assets/702.98bd9103.js +0 -1
  232. package/public/assets/703.285f3139.js +0 -1
  233. package/public/assets/7091.027a641c.js +0 -1
  234. package/public/assets/7104.9c59e320.js +0 -1
  235. package/public/assets/7113.0dfbe544.js +0 -1
  236. package/public/assets/7135.e9ab3841.js +0 -1
  237. package/public/assets/7143.612c372b.js +0 -1
  238. package/public/assets/7198.dc23f6fa.js +0 -1
  239. package/public/assets/7228.5b31dd65.js +0 -1
  240. package/public/assets/7234.bec30557.js +0 -1
  241. package/public/assets/7330.b15282a7.js +0 -1
  242. package/public/assets/7342.6f18177c.js +0 -1
  243. package/public/assets/7350.e46146b3.js +0 -1
  244. package/public/assets/7372.863b3f51.js +0 -1
  245. package/public/assets/7387.78fae2d9.js +0 -1
  246. package/public/assets/7403.acdec0cd.js +0 -1
  247. package/public/assets/7404.c90b9555.js +0 -1
  248. package/public/assets/7454.61df5c53.js +0 -1
  249. package/public/assets/7459.91247a0c.js +0 -1
  250. package/public/assets/7620.1317e4da.js +0 -1
  251. package/public/assets/7655.a8e05941.js +0 -1
  252. package/public/assets/7662.5c5fd466.js +0 -1
  253. package/public/assets/7698.68eab02c.js +0 -1
  254. package/public/assets/7714.6a6656ee.js +0 -1
  255. package/public/assets/7774.b546561d.js +0 -1
  256. package/public/assets/7822.264595e9.js +0 -1
  257. package/public/assets/7827.9a988ed6.js +0 -1
  258. package/public/assets/7858.565180cd.js +0 -1
  259. package/public/assets/7880.23c4af6f.js +0 -1
  260. package/public/assets/7921.796cf6f2.js +0 -1
  261. package/public/assets/7950.9222be47.js +0 -1
  262. package/public/assets/7992.1bbe27a2.js +0 -1
  263. package/public/assets/7993.3e415bcd.js +0 -1
  264. package/public/assets/8012.1df6c7ba.js +0 -1
  265. package/public/assets/8014.1618a26d.js +0 -1
  266. package/public/assets/8095.3b776dc1.js +0 -1
  267. package/public/assets/8115.01697474.js +0 -1
  268. package/public/assets/8134.2dbefad3.js +0 -1
  269. package/public/assets/8173.98e9cda8.js +0 -1
  270. package/public/assets/8178.4448a8c8.js +0 -1
  271. package/public/assets/8189.726f5bba.js +0 -1
  272. package/public/assets/8250.6a31d3db.js +0 -1
  273. package/public/assets/8252.46abb10d.js +0 -1
  274. package/public/assets/8286.7165c5ae.js +0 -1
  275. package/public/assets/829.57aaa21f.js +0 -1
  276. package/public/assets/8295.510e74b2.js +0 -1
  277. package/public/assets/8306.ffe7fef6.js +0 -1
  278. package/public/assets/8336.071bb524.js +0 -1
  279. package/public/assets/8346.cfd200d8.js +0 -1
  280. package/public/assets/8349.8746a8e4.js +0 -1
  281. package/public/assets/8375.0bf25482.js +0 -1
  282. package/public/assets/8387.7849a364.js +0 -1
  283. package/public/assets/8408.7b3b0706.js +0 -1
  284. package/public/assets/8423.da4adde4.js +0 -1
  285. package/public/assets/8437.67cbb62b.js +0 -1
  286. package/public/assets/8439.4ab411cf.js +0 -1
  287. package/public/assets/8447.805e1fbb.js +0 -1
  288. package/public/assets/8481.30bb3786.js +0 -1
  289. package/public/assets/8531.0e8a1bcd.js +0 -1
  290. package/public/assets/855.c45d80d8.js +0 -1
  291. package/public/assets/857.47395203.js +0 -1
  292. package/public/assets/8601.e90cd434.js +0 -1
  293. package/public/assets/8671.f9b853f6.js +0 -1
  294. package/public/assets/8696.2db4dd40.js +0 -1
  295. package/public/assets/8698.d8c25bfd.js +0 -1
  296. package/public/assets/8725.2a97b2e0.js +0 -1
  297. package/public/assets/8767.f7dbaf81.js +0 -1
  298. package/public/assets/877.0d1df971.js +0 -1
  299. package/public/assets/8799.b2bc36a0.js +0 -1
  300. package/public/assets/8805.e166d436.js +0 -1
  301. package/public/assets/8861.8e37cb89.js +0 -1
  302. package/public/assets/8943.d35181ef.js +0 -1
  303. package/public/assets/9020.b1614bfe.js +0 -1
  304. package/public/assets/9048.8a6be463.js +0 -1
  305. package/public/assets/9060.f88d7ff2.js +0 -1
  306. package/public/assets/9109.e2cef4ae.js +0 -1
  307. package/public/assets/9120.0baa1b3f.js +0 -1
  308. package/public/assets/9172.9b1d2d6a.js +0 -1
  309. package/public/assets/920.5f971a4e.js +0 -1
  310. package/public/assets/9279.7ff451d0.js +0 -1
  311. package/public/assets/9285.c26079c7.js +0 -1
  312. package/public/assets/9297.7162de0e.js +0 -1
  313. package/public/assets/9328.a33ba701.js +0 -1
  314. package/public/assets/940.5806c487.js +0 -1
  315. package/public/assets/9403.d4200316.js +0 -1
  316. package/public/assets/9412.5849ed28.js +0 -1
  317. package/public/assets/9420.c4e70fab.js +0 -1
  318. package/public/assets/9467.1a7a6c92.js +0 -1
  319. package/public/assets/9502.c84dc29b.js +0 -1
  320. package/public/assets/9556.97e5f142.js +0 -1
  321. package/public/assets/9557.b10d5e41.js +0 -1
  322. package/public/assets/9597.c517cbfd.js +0 -1
  323. package/public/assets/96.fdb82714.js +0 -1
  324. package/public/assets/9619.35683308.js +0 -1
  325. package/public/assets/9623.437474fc.js +0 -1
  326. package/public/assets/9663.1210b76e.js +0 -1
  327. package/public/assets/9671.40a11985.js +0 -1
  328. package/public/assets/969.ce9121b3.js +0 -1
  329. package/public/assets/9695.84356bbf.js +0 -1
  330. package/public/assets/9728.4f98e0ce.js +0 -1
  331. package/public/assets/9770.df634bdf.js +0 -1
  332. package/public/assets/9842.6faee06c.js +0 -1
  333. package/public/assets/9886.1c62a8ff.js +0 -1
  334. package/public/assets/9888.e3c97777.js +0 -1
  335. package/public/assets/9918.7ac5f09c.js +0 -1
  336. package/public/assets/9927.89711a15.js +0 -1
  337. package/public/assets/9940.70581af3.js +0 -1
  338. package/public/assets/9990.cf02a3de.js +0 -1
  339. package/public/assets/main.77ed4e8e.css +0 -2
  340. package/public/assets/main.ad7916a2.js +0 -62
@@ -1,203 +0,0 @@
1
- "use strict";(self.webpackChunk_seaveyon_harness_switch_web=self.webpackChunk_seaveyon_harness_switch_web||[]).push([["6150"],{8437(e,t,n){let i,r,o,a,l,s,d,u,h,c;n.d(t,{T:()=>sb});var f,p,m={};n.r(m),n.d(m,{boolean:()=>tn,booleanish:()=>ti,commaOrSpaceSeparated:()=>ts,commaSeparated:()=>tl,number:()=>to,overloadedBoolean:()=>tr,spaceSeparated:()=>ta});var g={};n.r(g),n.d(g,{createOnigurumaEngine:()=>r7,getDefaultWasmLoader:()=>r4,loadWasm:()=>r2,setDefaultWasmLoader:()=>r6});let b="diffs-container";(()=>{try{return!1}catch{return!1}})();let y=/(?=^diff --git)/gm,v=/(?<=\n)/,k=/^(---|\+\+\+)\s+([^\t\r\n]+)/,S=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,C=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,x=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,w="header-prefix",L="header-filename-suffix",A="header-metadata",E="header-custom",P={dark:"pierre-dark",light:"pierre-light"},R="--diffs-scrollbar-gutter-measured",T={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...T,hunkLineCount:1});let _=Object.freeze({fromStart:0,fromEnd:0}),N={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},M={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function I(e,t){return e-(0!==t)+t}function D(e){let t=e.length;return 10===e.charCodeAt(t-1)&&(t--,13===e.charCodeAt(t-1)&&t--),e.slice(0,t)}let H=new TextEncoder,O=new TextDecoder("utf-8",{ignoreBOM:!0}),F=/[\uD800-\uDFFF]/,$=new Uint8Array(1024);function U(e){if(0===e.length)return e;if(F.test(e))return JSON.parse(JSON.stringify(e));let t=3*e.length;$.length<t&&($=new Uint8Array(t));let{written:n}=H.encodeInto(e,$);return O.decode($.subarray(0,n))}let z=/\s+/g;function B(e){return e.replace(z,"")}function G(e){let t=j(e);for(let e=0;e<t.length;e++)t[e]=U(t[e]);return t}function j(e){if(0===e.length)return[""];let t=[],n=0;for(;;){let i=e.indexOf("\n",n);if(-1===i)break;t.push(e.slice(n,i+1)),n=i+1}return n<e.length&&t.push(e.slice(n)),t}function W(e,t){let n=t,i=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;i=10*i+t}if(n!==t)return{value:i,endIndex:n}}function V(e,t,n){let i=e.indexOf(t,n);return -1===i?-1:i+1}function q(e){return null==e?e:U(e)}function K(e){let t=e.slice(1);return U(""===t?"\n":t)}function X(e,t,n){return"change"===e?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}class Q{diff(e,t,n={}){let i;"function"==typeof n?(i=n,n={}):"callback"in n&&(i=n.callback);let r=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(r,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,i)}diffWithOptionsObj(e,t,n,i){var r;let o=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,a=t.length,l=e.length,s=1,d=a+l;null!=n.maxEditLength&&(d=Math.min(d,n.maxEditLength));let u=null!=(r=n.timeout)?r:1/0,h=Date.now()+u,c=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(c[0],t,e,0,n);if(c[0].oldPos+1>=l&&f+1>=a)return o(this.buildValues(c[0].lastComponent,t,e));let p=-1/0,m=1/0,g=()=>{for(let i=Math.max(p,-s);i<=Math.min(m,s);i+=2){let r,s=c[i-1],d=c[i+1];s&&(c[i-1]=void 0);let u=!1;if(d){let e=d.oldPos-i;u=d&&0<=e&&e<a}let h=s&&s.oldPos+1<l;if(!u&&!h){c[i]=void 0;continue}if(r=!h||u&&s.oldPos<d.oldPos?this.addToPath(d,!0,!1,0,n):this.addToPath(s,!1,!0,1,n),f=this.extractCommon(r,t,e,i,n),r.oldPos+1>=l&&f+1>=a)return o(this.buildValues(r.lastComponent,t,e))||!0;c[i]=r,r.oldPos+1>=l&&(m=Math.min(m,i-1)),f+1>=a&&(p=Math.max(p,i+1))}s++};if(i)!function e(){setTimeout(function(){if(s>d||Date.now()>h)return i(void 0);g()||e()},0)}();else for(;s<=d&&Date.now()<=h;){let e=g();if(e)return e}}addToPath(e,t,n,i,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,i,r){let o=t.length,a=n.length,l=e.oldPos,s=l-i,d=0;for(;s+1<o&&l+1<a&&this.equals(n[l+1],t[s+1],r);)s++,l++,d++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!r.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,s}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,r=[];for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let o=r.length,a=0,l=0,s=0;for(;a<o;a++){let e=r[a];if(e.removed)e.value=this.join(n.slice(s,s+e.count)),s+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(l,l+e.count);i=i.map(function(e,t){let i=n[s+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(l,l+e.count));l+=e.count,e.added||(s+=e.count)}}return r}}let J=new class extends Q{constructor(){super(...arguments),this.tokenize=Y}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Y(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let r=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}function Z(e){if(!function(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||'"'===e[t]||"\\"===e[t])return!0;return!1}(e))return e;let t='"',n=new TextEncoder().encode(e),i=0;for(;i<n.length;){let e=n[i];7===e?t+="\\a":8===e?t+="\\b":9===e?t+="\\t":10===e?t+="\\n":11===e?t+="\\v":12===e?t+="\\f":13===e?t+="\\r":34===e?t+='\\"':92===e?t+="\\\\":e>=32&&e<=126?t+=String.fromCharCode(e):t+="\\"+e.toString(8).padStart(3,"0"),i++}return t+'"'}let ee={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function et(e,t,n,i,r,o,a){var l;let s;void 0===(s=a?"function"==typeof a?{callback:a}:a:{}).context&&(s.context=4);let d=s.context;if(s.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!s.callback)return u(J.diff(n,i,s));{let{callback:e}=s;l=Object.assign(Object.assign({},s),{callback:t=>{e(u(t))}}),J.diff(n,i,l)}function u(n){if(!n)return;function i(e){return e.map(function(e){return" "+e})}n.push({value:"",lines:[]});let a=[],l=0,s=0,u=[],h=1,c=1;for(let e=0;e<n.length;e++){let t=n[e],r=t.lines||function(e){let t=e.endsWith("\n"),n=e.split("\n").map(e=>e+"\n");return t?n.pop():n.push(n.pop().slice(0,-1)),n}(t.value);if(t.lines=r,t.added||t.removed){if(!l){let t=n[e-1];l=h,s=c,t&&(l-=(u=d>0?i(t.lines.slice(-d)):[]).length,s-=u.length)}for(let e of r)u.push((t.added?"+":"-")+e);t.added?c+=r.length:h+=r.length}else{if(l)if(r.length<=2*d&&e<n.length-2)for(let e of i(r))u.push(e);else{let e=Math.min(r.length,d);for(let t of i(r.slice(0,e)))u.push(t);let t={oldStart:l,oldLines:h-l+e,newStart:s,newLines:c-s+e,lines:u};a.push(t),l=0,s=0,u=[]}h+=r.length,c+=r.length}}for(let e of a)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith("\n")?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,"\"),t++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:a}}}function en(e,t){var n,i,r,o,a,l;if(t||(t=ee),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(e=>en(e,t)).join("\n")}let s=[];if(e.isGit){if(t=ee,!e.oldFileName)throw Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw Error("newFileName must be specified for Git patches");let d=e.oldFileName,u=e.newFileName;e.isCreate&&"/dev/null"===d?d=u.replace(/^b\//,"a/"):e.isDelete&&"/dev/null"===u&&(u=d.replace(/^a\//,"b/")),s.push("diff --git "+Z(d)+" "+Z(u)),e.isDelete&&s.push("deleted file mode "+(null!=(n=e.oldMode)?n:"100644")),e.isCreate&&s.push("new file mode "+(null!=(i=e.newMode)?i:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(s.push("old mode "+e.oldMode),s.push("new mode "+e.newMode)),e.isRename&&(s.push("rename from "+Z((null!=(r=e.oldFileName)?r:"").replace(/^a\//,""))),s.push("rename to "+Z((null!=(o=e.newFileName)?o:"").replace(/^b\//,"")))),e.isCopy&&(s.push("copy from "+Z((null!=(a=e.oldFileName)?a:"").replace(/^a\//,""))),s.push("copy to "+Z((null!=(l=e.newFileName)?l:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&void 0!==e.oldFileName&&s.push("Index: "+e.oldFileName),t.includeUnderline&&s.push("===================================================================");let d=e.hunks.length>0;t.includeFileHeaders&&void 0!==e.oldFileName&&void 0!==e.newFileName&&(!e.isGit||d)&&(s.push("--- "+Z(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),s.push("+++ "+Z(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t],i=0===n.oldLines?n.oldStart-1:n.oldStart,r=0===n.newLines?n.newStart-1:n.newStart;for(let e of(s.push("@@ -"+i+","+n.oldLines+" +"+r+","+n.newLines+" @@"),n.lines))s.push(e)}return s.join("\n")+"\n"}function ei(e,t,n,i=!1){let r,o;if(null===e&&null===t)throw Error("parseDiffFromFile: You must pass oldFile, newFile, or both");let a=e??er(),l=t??er(),s=function(e,t){try{return function(e,{cacheKey:t,isGitDiff:n=y.test(e),oldFile:i,newFile:r,throwOnError:o=!1}={}){let a,l=0,s=function(e){if(0===e.length)return[""];let t=`
2
- @@ `,n=e.startsWith("@@ ")?0:V(e,t,0);if(-1===n)return[e];let i=[];n>0&&i.push(e.slice(0,n));let r=n;for(;;){let n=V(e,t,r+1);if(-1===n)break;i.push(e.slice(r,n)),r=n}return i.push(e.slice(r)),i}(e),d=null==i||null==r,u=0,h=0;for(let e of s){var c,f,p;let s,m,g=j(e),b=g[0];if(null==b){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",e);continue}let y=function(e){var t;let n;if(!e.startsWith("@@ -"))return;let i=4,r=W(e,4);if(null==r)return;let o=r.value;i=r.endIndex;let a=1;if(","===e[i]){let t=W(e,i+1);if(null==t)return;a=t.value,i=t.endIndex}if(" "!==e[i]||"+"!==e[i+1])return;let l=W(e,i+=2);if(null==l)return;let s=l.value;i=l.endIndex;let d=1;if(","===e[i]){let t=W(e,i+1);if(null==t)return;d=t.value,i=t.endIndex}if(" "!==e[i]||"@"!==e[i+1]||"@"!==e[i+2])return;let u=i+3;return" "===e[u]&&(n=(t=e.slice(u+1)).endsWith("\r\n")?t.slice(0,-2):t.endsWith("\n")?t.slice(0,-1):t),{additionCount:d,additionStart:s,deletionCount:a,deletionStart:o,hunkContext:n}}(b),v=0,w=0;if(null==y||null==a){if(null!=a){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",e);continue}for(let e of(1===(a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:d||null==i||null==r?[]:G(r.contents),deletionLines:d||null==i||null==r?[]:G(i.contents),cacheKey:q(t)}).additionLines.length&&r?.contents===""&&(a.additionLines.length=0),1===a.deletionLines.length&&i?.contents===""&&(a.deletionLines.length=0),g)){if(e.startsWith("diff --git")){let t=e.trim().match(C),n=t?.[1]??t?.[2],i=t?.[3]??t?.[4];if(null==n||null==i){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",e);continue}a.name=U(i.trim()),n!==i&&(a.prevName=U(n.trim()));continue}let t=e.startsWith("---")||e.startsWith("+++")?e.match(n?S:k):null;if(null!=t){let[,e,n]=t;if("---"===e&&"/dev/null"!==n){let e=U(n.trim());a.prevName=e,a.name=e}else"+++"===e&&"/dev/null"!==n&&(a.name=U(n.trim()))}else if(n){if(e.startsWith("new mode ")&&(a.mode=U(e.slice(8).trim())),e.startsWith("old mode ")&&(a.prevMode=U(e.slice(8).trim())),e.startsWith("new file mode")&&(a.type="new",a.mode=U(e.slice(13).trim())),e.startsWith("deleted file mode")&&(a.type="deleted",a.mode=U(e.slice(17).trim())),e.startsWith("similarity index")&&(e.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),e.startsWith("index ")){let[,t,n,i]=e.trim().match(x)??[];null!=t&&(a.prevObjectId=U(t)),null!=n&&(a.newObjectId=U(n)),null!=i&&(a.mode=U(i))}e.startsWith("rename from ")&&(a.prevName=U(e.slice(12).trim())),e.startsWith("rename to ")&&(a.name=U(e.slice(10).trim()))}}continue}for(;g.length>0&&("\n"===g[g.length-1]||"\r"===g[g.length-1]||"\r\n"===g[g.length-1]||""===g[g.length-1]);)g.pop();let{additionStart:L,deletionStart:A}=y;u=d?u:A-1,h=d?h:L-1;let E={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:y.additionCount,additionStart:L,additionLines:v,deletionCount:y.deletionCount,deletionStart:A,deletionLines:w,deletionLineIndex:u,additionLineIndex:h,hunkContent:[],hunkContext:q(y.hunkContext),hunkSpecs:U(b),noEOFCRAdditions:!1,noEOFCRDeletions:!1},P=0,R=0;for(let e=1;e<g.length;e++){let t=g[e];if(P>=E.additionCount&&R>=E.deletionCount&&!t.startsWith("\\")){if(o&&function(e){let t=e[0];return"+"===t||"-"===t||" "===t}(t)&&!function(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(" "!==n&&" "!==n&&"\n"!==n&&"\r"!==n)return!1}return!0}(t))throw Error("parsePatchContent: hunk has more lines than expected");break}let n=t[0];if("+"!==n&&"-"!==n&&" "!==n&&"\\"!==n){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error("processFile: invalid rawLine:",t);continue}let i=(c=n," "===c?"context":"\\"===c?"metadata":"+"===c?"addition":"deletion");if("addition"===i){if(o&&P>=E.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let e=K(t);(null==s||"change"!==s.type)&&(s=X("change",u,h),E.hunkContent.push(s)),h++,P++,d&&a.additionLines.push(e),s.additions++,v++,m="addition"}else if("deletion"===i){if(o&&R>=E.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let e=K(t);(null==s||"change"!==s.type)&&(s=X("change",u,h),E.hunkContent.push(s)),u++,R++,d&&a.deletionLines.push(e),s.deletions++,w++,m="deletion"}else if("context"===i){if(o&&(R>=E.deletionCount||P>=E.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let e=K(t);(null==s||"context"!==s.type)&&(s=X("context",u,h),E.hunkContent.push(s)),h++,u++,P++,R++,d&&(a.deletionLines.push(e),a.additionLines.push(e)),s.lines++,m="context"}else if("metadata"===i&&null!=s){if("context"===s.type?(E.noEOFCRAdditions=!0,E.noEOFCRDeletions=!0):"deletion"===m?E.noEOFCRDeletions=!0:"addition"===m&&(E.noEOFCRAdditions=!0),d&&("addition"===m||"context"===m)){let e=a.additionLines.length-1;e>=0&&(a.additionLines[e]=D(a.additionLines[e]))}if(d&&("deletion"===m||"context"===m)){let e=a.deletionLines.length-1;e>=0&&(a.deletionLines[e]=D(a.deletionLines[e]))}}}if(o&&(P!==E.additionCount||R!==E.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");for(let e of(E.additionLines=v,E.deletionLines=w,E.collapsedBefore=Math.max((f=E.additionStart,p=E.additionCount,f-(0!==p)-l),0),a.hunks.push(E),l=I(E.additionStart,E.additionCount),E.hunkContent))"context"===e.type?(E.splitLineCount+=e.lines,E.unifiedLineCount+=e.lines):(E.splitLineCount+=Math.max(e.additions,e.deletions),E.unifiedLineCount+=e.deletions+e.additions);E.splitLineStart=a.splitLineCount+E.collapsedBefore,E.unifiedLineStart=a.unifiedLineCount+E.collapsedBefore,a.splitLineCount+=E.collapsedBefore+E.splitLineCount,a.unifiedLineCount+=E.collapsedBefore+E.unifiedLineCount}if(null!=a){if(o&&d&&!n&&0===a.hunks.length)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){let e=a.hunks[a.hunks.length-1],t=I(e.additionStart,e.additionCount),n=Math.max(a.additionLines.length-t,0);a.splitLineCount+=n,a.unifiedLineCount+=n}n||(null!=a.prevName&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(null==i||""===i.contents)&&null!=r&&""!==r.contents?a.type="new":null!=i&&""!==i.contents&&(null==r||""===r.contents)&&(a.type="deleted")),"rename-pure"!==a.type&&"rename-changed"!==a.type&&(a.prevName=void 0);var m=a;for(let e of m.hunks){for(let t=0;t<e.hunkContent.length;t++){let n=e.hunkContent[t];if("change"!==n.type)continue;let i=function(e,t){let{deletions:n,additions:i,deletionLineIndex:r,additionLineIndex:o}=t,a=Math.min(n,i),l=Math.abs(i-n);if(0===a||0===l||a*(l+1)>4096)return null;let s=[];for(let t=0;t<n;t++)s.push(B(e.deletionLines[r+t]??""));let d=[];for(let t=0;t<i;t++)d.push(B(e.additionLines[o+t]??""));let u=i>n,h=0,c=-1;for(let e=0;e<=l;e++){let t=0;for(let n=0;n<a;n++)t+=function(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(0===i)return 0;let r=0;for(;r<i&&e[r]===t[r];)r++;let o=0;for(;o<i-r&&e[e.length-1-o]===t[t.length-1-o];)o++;return(r+o)/n}(s[n+(u?0:e)],d[n+(u?e:0)]);0===e?c=t+.5*a:t>c&&(c=t,h=e)}if(0===h)return null;let f=[],p=(e,t,n,i)=>{(e>0||t>0)&&f.push({type:"change",deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:i})};return u?(p(0,h,r,o),p(a,a,r,o+h),p(0,i-a-h,r+a,o+h+a)):(p(h,0,r,o),p(a,a,r+h,o),p(n-a-h,0,r+h+a,o+a)),f}(m,n);null!=i&&(e.hunkContent.splice(t,1,...i),t+=i.length-1)}!function(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let i=n[e],r=n[e-1];if("change"!==i.type||i.additions>0&&i.deletions>0||"context"!==r.type)continue;let o=i.additions>0,a=o?t.additionLines:t.deletionLines,l=o?i.additionLineIndex:i.deletionLineIndex,s=o?i.additions:i.deletions,d=a[l]??"";if(""!==d.trim())continue;let u=!0;for(let e=1;e<s;e++)if(a[l+e]!==d){u=!1;break}if(!u)continue;let h=0;for(;h<r.lines&&t.additionLines[r.additionLineIndex+r.lines-1-h]===d;)h++;if(0===h||1===e&&h===r.lines)continue;i.additionLineIndex-=h,i.deletionLineIndex-=h;let c=i.additionLineIndex+i.additions,f=i.deletionLineIndex+i.deletions,p=n[e+1];p?.type==="context"?(p.lines+=h,p.additionLineIndex=c,p.deletionLineIndex=f):n.splice(e+1,0,{type:"context",lines:h,additionLineIndex:c,deletionLineIndex:f}),r.lines-=h,0===r.lines&&(n.splice(e-1,1),e--)}}(e,m)}return a}}(e,t)}finally{1024!==$.length&&($=new Uint8Array(1024))}}(function(e,t,n,i,r,o,a){if("function"==typeof a&&(a={callback:a}),null==a?void 0:a.callback){let{callback:l}=a;et(e,t,n,i,r,o,Object.assign(Object.assign({},a),{callback:e=>{e?l(en(e,a.headerOptions)):l(void 0)}}))}else{let l=et(e,t,n,i,r,o,a);if(!l)return;return en(l,null==a?void 0:a.headerOptions)}}(a.name,l.name,a.contents,l.contents,a.header,l.header,n),{cacheKey:(r=e?.cacheKey??e?.name,o=t?.cacheKey??t?.name,null!=r&&null!=o?r+":"+o:r??o),oldFile:a,newFile:l,throwOnError:i});if(null==s)throw Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");null===e?(s.type="new",s.prevName=void 0):null===t&&(s.type="deleted",s.prevName=void 0);let d=t?.lang??(null===t?e?.lang:void 0);return null!=d&&(s.lang=d),s}function er(){return{name:"/dev/null",contents:""}}function eo(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}let ea={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},el={display:"contents"};function es(){return null}var ed=n(1085);function eu(e,t,n){if(e===t||null==e||null==t)return e===t;let i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(let n of r)if(o.delete(n),!i.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(o))if(!i.has(e))return!1;return!0}function eh(e,t){return null==e||null==t||"string"==typeof e||"string"==typeof t?e===t:e.dark===t.dark&&e.light===t.light}function ec(e,t){let n=e?.theme??P,i=t?.theme??P,r=ef(e),o=ef(t);return eh(n,i)&&eu(e,t,["theme","parseDiffOptions"])&&eu(r,o)}function ef(e){if(null!=e&&"parseDiffOptions"in e)return e.parseDiffOptions}let ep=new Set,em=null;function eg(e){ep.add(e),em??=requestAnimationFrame(ey)}function eb(e){ep.delete(e)&&0===ep.size&&null!=em&&(cancelAnimationFrame(em),em=null)}function ey(e){let t=new Set(ep);for(let n of(ep.clear(),t))try{n(e)}catch(e){console.error(e)}em=ep.size>0?requestAnimationFrame(ey):null}function ev(e){return{...T,...e}}function ek(e,t){var n,i;let r=(n=e,i=t,n.paddingTop??(i?n.spacing:0));return t?r:e.diffHeaderHeight+r}function eS(e){return e.paddingBottom??e.spacing}function eC(e){var t;return[(t=e.additionStart,t-(0!==e.additionCount)+1),I(e.additionStart,e.additionCount)+1]}function ex({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}){let o=Math.max(t,0);if(0===o||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(!0===n||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};let a=n?.get(i),l=Math.min(Math.max(a?.fromStart??0,0),o),s=Math.min(Math.max(a?.fromEnd??0,0),o),d=l+s,u=d>=o;return{fromStart:u?o:l,fromEnd:u?0:s,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:u}}function ew({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(null==n||e.isPartial||0===e.additionLines.length||0===e.deletionLines.length)return 0;let i=e.additionLines.length-I(n.additionStart,n.additionCount),r=e.deletionLines.length-I(n.deletionStart,n.deletionCount);if(i<=0&&r<=0)return 0;if(i!==r)throw Error(`${t}: trailing context mismatch (additions=${i}, deletions=${r}) for ${e.name}`);return Math.min(i,r)}function eL({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:r}){if(t!==e.hunks.length-1)return;let o=ew({fileDiff:e,errorPrefix:r});if(o<=0)return;if(!0===n||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};let a=n?.get(e.hunks.length),l=Math.min(Math.max(a?.fromStart??0,0),o);return{fromStart:l,fromEnd:0,rangeSize:o,collapsedLines:o-l,renderAll:l>=o}}function eA({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:i}){if(!0===n||e.isPartial)return!0;for(let[r,o]of e.hunks.entries()){let[a,l]=eC(o);if(t<a){let l=ex({isPartial:e.isPartial,rangeSize:o.collapsedBefore,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}),s=a-l.rangeSize;return l.renderAll||t<s+l.fromStart||t>=a-l.fromEnd}if(t<l)return!0}let r=eL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"isAdditionLineRenderable"});if(null==r||r.renderAll)return!0;let[,o]=eC(e.hunks[e.hunks.length-1]);return t<o+r.fromStart||t>=o+r.rangeSize}function eE({type:e,metrics:t}){return t.hunkSeparatorHeight??function(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}(e)}function eP({type:e,metrics:t}){return"simple"===e||"metadata"===e||"line-info-basic"===e?0:t.spacing}function eR({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!function({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return null!=n;case"line-info":case"line-info-basic":case"custom":return!0}}({type:e,hunkIndex:n,hunkSpecs:i}))return;let r=eE({type:e,metrics:t}),o=eP({type:e,metrics:t}),a=n>0?o:0;return{height:r,gapBefore:a,gapAfter:o,totalHeight:a+r+o}}function eT({type:e,metrics:t}){if("simple"===e||"metadata"===e)return;let n=eE({type:e,metrics:t}),i=eP({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function e_(e,t){let n=ei({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function eN(e,t){return t.length>0&&t.length<e.deletionLines.length&&function(e){for(let t of e)if(t.trim().length>0)return!1;return!0}(t)}function eM(e,t,n){var i;let r,o,a=e.deletionLines.join(""),l=(i=t.length,(o=Array.from({length:r=Math.max(i,1)},(e,t)=>`${" ".repeat(t+1)}
3
- `).join(""))===a&&(o=Array.from({length:r},(e,t)=>`\u0000${" ".repeat(t)}
4
- `).join("")),o),s=ei({name:e.prevName??e.name,contents:a},{name:e.name,contents:l,lang:e.lang},n);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:t,deletionLines:s.deletionLines,type:s.type}}function eI(e,t){return eM(e,[""],t)}function eD(e,t){if(0===e.additionLines.length)return eI(e,t);if(eN(e,e.additionLines))return eM(e,e.additionLines,t);let n=e.additionLines,i=e_(e,t);return eH(i,n),i}function eH(e,t){if(!(t.length>1&&""===t.at(-1)))return;let n=t.length-e.additionLines.length;if(n<=0)return;let i=e.additionLines.length,r=e.hunks.at(-1);if(null!=r&&I(r.additionStart,r.additionCount)===i){for(let o of r.hunkContent)if("change"===o.type&&o.additions<o.deletions&&o.additionLineIndex+o.additions===i){e.additionLines=t,o.additions+=n,r.additionCount+=n,r.additionLines+=n,ez(e);return}}}function eO(e,t){return Object.assign(e,t),t}function eF(e,t){let n=e.hunks[t];if(null==n)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let i=e.additionLines.at(-1),r=e.deletionLines.at(-1);n.noEOFCRAdditions=null!=i&&""!==i&&!i.endsWith("\n"),n.noEOFCRDeletions=null!=r&&""!==r&&!r.endsWith("\n")}function e$(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function eU(e){let t=0,n=0;for(let i of e.hunkContent)"context"===i.type?(t+=i.lines,n+=i.lines):(t+=Math.max(i.additions,i.deletions),n+=i.additions+i.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function ez(e){let t=0,n=0,i=0;for(let o of e.hunks){var r;o.collapsedBefore=Math.max((r=o.additionStart,r-(0!==o.additionCount)-i),0),o.splitLineStart=t+o.collapsedBefore,o.unifiedLineStart=n+o.collapsedBefore,eU(o),t+=o.collapsedBefore+o.splitLineCount,n+=o.collapsedBefore+o.unifiedLineCount,i=I(o.additionStart,o.additionCount)}if(e.hunks.length>0){let i=e.hunks[e.hunks.length-1],r=Math.max(e.additionLines.length-I(i.additionStart,i.additionCount),0);t+=r,n+=r}e.splitLineCount=t,e.unifiedLineCount=n}let eB=new WeakMap;function eG(e,t){let n=e.hunks,i=e.additionLines,r=i.length>1&&""===i[i.length-1]?i.slice(0,-1):i,o=r===i?e:{...e,additionLines:r},a=function(e,t,n){let i=e.map((e,t)=>{let n=eX(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),r=[],o=0;for(let e of t){var a,l,s,d,u;let t=e.deletionLineIndex,h=t+e.deletions;for(;o<i.length&&i[o].deletionEnd<t;)r.push(i[o]),o++;let c=r.length>0&&(a=t,l=h,a<=(s=r[r.length-1]).deletionEnd&&l>=s.deletionStart)?r.pop():void 0;for(;o<i.length&&i[o].deletionStart<=h;){d=c,u=i[o],c=null==d?u:(d.deletionStart=Math.min(d.deletionStart,u.deletionStart),d.deletionEnd=Math.max(d.deletionEnd,u.deletionEnd),d.blocks.push(...u.blocks),null!=u.previousSpan&&(d.previousSpan??={...u.previousSpan},d.previousSpan.firstIndex=Math.min(d.previousSpan.firstIndex,u.previousSpan.firstIndex),d.previousSpan.lastIndex=Math.max(d.previousSpan.lastIndex,u.previousSpan.lastIndex)),d),o++}if(null==c){let a=t,l=h;if((0===e.deletions||0===e.additions)&&n>e.deletions){let e=r[r.length-1]?.deletionEnd??0,s=i[o]?.deletionStart??n;t>e?a--:h<s&&l++}c={deletionStart:a,deletionEnd:l,blocks:[],previousSpan:void 0}}c.deletionStart=Math.min(c.deletionStart,t),c.deletionEnd=Math.max(c.deletionEnd,h),c.blocks.push(e),r.push(c)}for(;o<i.length;)r.push(i[o]),o++;return r}(n,function(e,t){if(null==function(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i++;let r=e.length,o=t.length;for(;r>i&&o>i&&e[r-1]===t[o-1];)r--,o--;if(i!==r||i!==o)return{start:i,deletionEnd:r,additionEnd:o}}(e.deletionLines,e.additionLines))return[];let n=ei({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),i=[],r=0,o=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-r:e.deletionLineIndex-o;for(let n of(r+=t,o+=t,e.hunkContent)){if("context"===n.type){r+=n.lines,o+=n.lines;continue}let e=e$(n,0,0);0===e.additions&&(e.additionLineIndex=r),0===e.deletions&&(e.deletionLineIndex=o),i.push(e),r+=e.additions,o+=e.deletions}}return i}(o,t),e.deletionLines.length),l=function(e,t){let n=[],i=0,r=0;for(let e of t){let t=e.deletionStart-i;if(t<0)throw Error("buildRegionHunks: overlapping old-side regions");i+=t;let o=r+=t,a=[];for(let t of e.blocks){let e=t.deletionLineIndex-i,n=t.additionLineIndex-r;if(e<0||e!==n)throw Error("buildRegionHunks: canonical block context mismatch");eV(a,e,r,i),i+=e,r+=n,a.push({...t}),i+=t.deletions,r+=t.additions}let l=e.deletionEnd-i;if(l<0)throw Error("buildRegionHunks: block exceeds its old-side region");eV(a,l,r,i),i+=l,r+=l,n.push(function(e,t){let n=e.additionEnd-e.additionStart,i=e.deletionEnd-e.deletionStart,r=0,o=0;for(let e of t)"change"===e.type&&(r+=e.additions,o+=e.deletions);let a={collapsedBefore:0,additionStart:eQ(e.additionStart,n),additionCount:n,additionLines:r,additionLineIndex:function(e,t){return 0===t?e-1:e}(e.additionStart,n),deletionStart:eQ(e.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:function(e,t){return 0===t?e-1:e}(e.deletionStart,i),hunkContent:t,hunkSpecs:`@@ -${eQ(e.deletionStart,i)},${i} +${eQ(e.additionStart,n)},${n} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return eU(a),a}({additionStart:o,additionEnd:r,deletionStart:e.deletionStart,deletionEnd:e.deletionEnd},a))}if(e.deletionLines.length-i!=e.additionLines.length-r)throw Error("buildRegionHunks: trailing context mismatch");return n}(o,a);if(e.additionLines=r,e.hunks=l,e.editSessionDirty=!0,function(e){ez(e);for(let t=0;t<e.hunks.length;t++)eF(e,t)}(e),eH(e,i),function(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(eX(i)!==eX(r)||i.deletionCount!==r.deletionCount||eK(i)!==eK(r)||i.additionCount!==r.additionCount||i.splitLineCount!==r.splitLineCount||!function(e,t){let n=eq(e),i=eq(t);for(;;){let e=n.next(),t=i.next();if(!0===e.done||!0===t.done)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}(i,r))return!0}return!1}(n,e.hunks))return{regions:a.map(e=>e.previousSpan)}}function ej(e){return e?.type==="change"&&(0===e.additions||0===e.deletions)}function eW(e,t){return!0===e.editSessionDirty&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&""===e.additionLines.join("")?e_(e,t):eD(e,t)),!0)}function eV(e,t,n,i){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:i})}function*eq(e){for(let t of e.hunkContent){if("context"===t.type){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function eK(e){var t;return t=e.additionStart,t-(0!==e.additionCount)}function eX(e){var t;return t=e.deletionStart,t-(0!==e.deletionCount)}function eQ(e,t){return 0===t?e:e+1}function eJ(e){if("u">typeof HTMLStyleElement&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return"string"==typeof t&&"style"===t.toLowerCase()}function eY(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function eZ(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function e0(e){return{type:"text",value:e}}function e1({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function e8({name:e,width:t=16,height:n=16,properties:i}){return e1({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[e1({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function e2(e){return e1({tagName:"div",properties:{"data-gutter":""},children:e})}function e5(e,t,n){return e1({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":"annotation"===t?void 0:e,style:"annotation"===t?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function e6(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||"gutter-utility-slot"===t.getAttribute("slot")||"gutter-utility-slot"===t.getAttribute("name")))return!0;return!1}let e4=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class e7{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function e3(e,t){let n={},i={};for(let t of e)Object.assign(n,t.property),Object.assign(i,t.normal);return new e7(n,i,t)}function e9(e){return e.toLowerCase()}e7.prototype.normal={},e7.prototype.property={},e7.prototype.space=void 0;class te{constructor(e,t){this.attribute=t,this.property=e}}te.prototype.attribute="",te.prototype.booleanish=!1,te.prototype.boolean=!1,te.prototype.commaOrSpaceSeparated=!1,te.prototype.commaSeparated=!1,te.prototype.defined=!1,te.prototype.mustUseProperty=!1,te.prototype.number=!1,te.prototype.overloadedBoolean=!1,te.prototype.property="",te.prototype.spaceSeparated=!1,te.prototype.space=void 0;let tt=0,tn=td(),ti=td(),tr=td(),to=td(),ta=td(),tl=td(),ts=td();function td(){return 2**++tt}let tu=Object.keys(m);class th extends te{constructor(e,t,n,i){let r=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",i),"number"==typeof n)for(;++r<tu.length;){const e=tu[r];!function(e,t,n){n&&(e[t]=n)}(this,tu[r],(n&m[e])===m[e])}}}function tc(e){let t={},n={};for(let[i,r]of Object.entries(e.properties)){let o=new th(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[e9(i)]=i,n[e9(o.attribute)]=i}return new e7(t,n,e.space)}th.prototype.defined=!0;let tf=tc({properties:{ariaActiveDescendant:null,ariaAtomic:ti,ariaAutoComplete:null,ariaBusy:ti,ariaChecked:ti,ariaColCount:to,ariaColIndex:to,ariaColSpan:to,ariaControls:ta,ariaCurrent:null,ariaDescribedBy:ta,ariaDetails:null,ariaDisabled:ti,ariaDropEffect:ta,ariaErrorMessage:null,ariaExpanded:ti,ariaFlowTo:ta,ariaGrabbed:ti,ariaHasPopup:null,ariaHidden:ti,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ta,ariaLevel:to,ariaLive:null,ariaModal:ti,ariaMultiLine:ti,ariaMultiSelectable:ti,ariaOrientation:null,ariaOwns:ta,ariaPlaceholder:null,ariaPosInSet:to,ariaPressed:ti,ariaReadOnly:ti,ariaRelevant:null,ariaRequired:ti,ariaRoleDescription:ta,ariaRowCount:to,ariaRowIndex:to,ariaRowSpan:to,ariaSelected:ti,ariaSetSize:to,ariaSort:null,ariaValueMax:to,ariaValueMin:to,ariaValueNow:to,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function tp(e,t){return t in e?e[t]:t}function tm(e,t){return tp(e,t.toLowerCase())}let tg=tc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tl,acceptCharset:ta,accessKey:ta,action:null,allow:null,allowFullScreen:tn,allowPaymentRequest:tn,allowUserMedia:tn,alpha:tn,alt:null,as:null,async:tn,autoCapitalize:null,autoComplete:ta,autoFocus:tn,autoPlay:tn,blocking:ta,capture:null,charSet:null,checked:tn,cite:null,className:ta,closedBy:null,colorSpace:null,cols:to,colSpan:to,command:null,commandFor:null,content:null,contentEditable:ti,controls:tn,controlsList:ta,coords:to|tl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tn,defer:tn,dir:null,dirName:null,disabled:tn,download:tr,draggable:ti,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tn,formTarget:null,headers:ta,height:to,hidden:tr,high:to,href:null,hrefLang:null,htmlFor:ta,httpEquiv:ta,id:null,imageSizes:null,imageSrcSet:null,inert:tn,inputMode:null,integrity:null,is:null,isMap:tn,itemId:null,itemProp:ta,itemRef:ta,itemScope:tn,itemType:ta,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tn,low:to,manifest:null,max:null,maxLength:to,media:null,method:null,min:null,minLength:to,multiple:tn,muted:tn,name:null,nonce:null,noModule:tn,noValidate:tn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:tn,optimum:to,pattern:null,ping:ta,placeholder:null,playsInline:tn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tn,referrerPolicy:null,rel:ta,required:tn,reversed:tn,rows:to,rowSpan:to,sandbox:ta,scope:null,scoped:tn,seamless:tn,selected:tn,shadowRootClonable:tn,shadowRootCustomElementRegistry:tn,shadowRootDelegatesFocus:tn,shadowRootMode:null,shadowRootSerializable:tn,shape:null,size:to,sizes:null,slot:null,span:to,spellCheck:ti,src:null,srcDoc:null,srcLang:null,srcSet:null,start:to,step:null,style:null,tabIndex:to,target:null,title:null,translate:null,type:null,typeMustMatch:tn,useMap:null,value:ti,width:to,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ta,axis:null,background:null,bgColor:null,border:to,borderColor:null,bottomMargin:to,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tn,declare:tn,event:null,face:null,frame:null,frameBorder:null,hSpace:to,leftMargin:to,link:null,longDesc:null,lowSrc:null,marginHeight:to,marginWidth:to,noResize:tn,noHref:tn,noShade:tn,noWrap:tn,object:null,profile:null,prompt:null,rev:null,rightMargin:to,rules:null,scheme:null,scrolling:ti,standby:null,summary:null,text:null,topMargin:to,valueType:null,version:null,vAlign:null,vLink:null,vSpace:to,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:tn,disablePictureInPicture:tn,disableRemotePlayback:tn,exportParts:tl,part:ta,prefix:null,property:null,results:to,security:null,unselectable:null},space:"html",transform:tm}),tb=tc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ts,accentHeight:to,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:to,amplitude:to,arabicForm:null,ascent:to,attributeName:null,attributeType:null,azimuth:to,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:to,by:null,calcMode:null,capHeight:to,className:ta,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:to,diffuseConstant:to,direction:null,display:null,dur:null,divisor:to,dominantBaseline:null,download:tn,dx:null,dy:null,edgeMode:null,editable:null,elevation:to,enableBackground:null,end:null,event:null,exponent:to,externalResourcesRequired:null,fill:null,fillOpacity:to,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:tl,g2:tl,glyphName:tl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:to,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:to,horizOriginX:to,horizOriginY:to,id:null,ideographic:to,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:to,k:to,k1:to,k2:to,k3:to,k4:to,kernelMatrix:ts,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:to,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:to,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:to,overlineThickness:to,paintOrder:null,panose1:null,path:null,pathLength:to,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ta,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:to,pointsAtY:to,pointsAtZ:to,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ts,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ts,rev:ts,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ts,requiredFeatures:ts,requiredFonts:ts,requiredFormats:ts,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:to,specularExponent:to,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:to,strikethroughThickness:to,string:null,stroke:null,strokeDashArray:ts,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:to,strokeOpacity:to,strokeWidth:null,style:null,surfaceScale:to,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ts,tabIndex:to,tableValues:null,target:null,targetX:to,targetY:to,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ts,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:to,underlineThickness:to,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:to,values:null,vAlphabetic:to,vMathematical:to,vectorEffect:null,vHanging:to,vIdeographic:to,version:null,vertAdvY:to,vertOriginX:to,vertOriginY:to,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:to,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tp}),ty=tc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),tv=tc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tm}),tk=tc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),tS=e3([tf,tg,ty,tv,tk],"html"),tC=e3([tf,tb,ty,tv,tk],"svg"),tx={}.hasOwnProperty,tw=/["&'<>`]/g,tL=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,tA=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,tE=/[|\\{}()[\]^$+*?.]/g,tP=new WeakMap,tR=/[\dA-Fa-f]/,tT=/\d/,t_=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],tN={nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",times:"\xd7",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",divide:"\xf7",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},tM=["cent","copy","divide","gt","lt","not","para","times"],tI={}.hasOwnProperty,tD={};for(i in tN)tI.call(tN,i)&&(tD[tN[i]]=i);let tH=/[^\dA-Za-z]/;function tO(e,t,n){var i,r;let o,a,l=(i=n.omitOptionalSemicolons,o="&#x"+e.toString(16).toUpperCase(),i&&t&&!tR.test(String.fromCharCode(t))?o:o+";");if((n.useNamedReferences||n.useShortestReferences)&&(a=function(e,t,n,i){let r=String.fromCharCode(e);if(tI.call(tD,r)){let e=tD[r],o="&"+e;return n&&t_.includes(e)&&!tM.includes(e)&&(!i||t&&61!==t&&tH.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let i,o=(r=n.omitOptionalSemicolons,i="&#"+String(e),r&&t&&!tT.test(String.fromCharCode(t))?i:i+";");o.length<l.length&&(l=o)}return a&&(!n.useShortestReferences||a.length<l.length)?a:l}function tF(e,t){let n;var i,r=e,o=Object.assign({format:tO},t);if(r=r.replace(o.subset?(i=o.subset,(n=tP.get(i))||(n=function(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(tE,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}(i),tP.set(i,n)),n):tw,a),o.subset||o.escapeOnly)return r;return r.replace(tL,function(e,t,n){return o.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,n.charCodeAt(t+2),o)}).replace(tA,a);function a(e,t,n){return o.format(e.charCodeAt(0),n.charCodeAt(t+1),o)}}let t$=/^>|^->|<!--|-->|--!>|<!-$/g,tU=[">"],tz=["<",">"];function tB(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}let tG=/[A-Z]/g,tj=/-[a-z]/g,tW=/^data[-\w.:]+$/i;function tV(e){return"-"+e.toLowerCase()}function tq(e){return e.charAt(1).toUpperCase()}let tK=/[ \t\n\f\r]/g;function tX(e){return"object"==typeof e?"text"===e.type&&tQ(e.value):tQ(e)}function tQ(e){return""===e.replace(tK,"")}let tJ=t0(1),tY=t0(-1),tZ=[];function t0(e){return function(t,n,i){let r=t?t.children:tZ,o=(n||0)+e,a=r[o];if(!i)for(;a&&tX(a);)o+=e,a=r[o];return a}}let t1={}.hasOwnProperty;function t8(e){return function(t,n,i){return t1.call(e,t.tagName)&&e[t.tagName](t,n,i)}}let t2=t8({body:function(e,t,n){let i=tJ(n,t);return!i||"comment"!==i.type},caption:t5,colgroup:t5,dd:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){let i=tJ(n,t);return!!(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:t5,html:function(e,t,n){let i=tJ(n,t);return!i||"comment"!==i.type},li:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){let i=tJ(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||"element"!==n.type||"a"!==n.tagName&&"audio"!==n.tagName&&"del"!==n.tagName&&"ins"!==n.tagName&&"map"!==n.tagName&&"noscript"!==n.tagName&&"video"!==n.tagName},rp:t6,rt:t6,tbody:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:t4,tfoot:function(e,t,n){return!tJ(n,t)},th:t4,thead:function(e,t,n){let i=tJ(n,t);return!!(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function t5(e,t,n){let i=tJ(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&tX(i.value.charAt(0)))}function t6(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function t4(e,t,n){let i=tJ(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}let t7=t8({body:function(e){let t=tJ(e,-1,!0);return!t||"comment"!==t.type&&!("text"===t.type&&tX(t.value.charAt(0)))&&("element"!==t.type||"meta"!==t.tagName&&"link"!==t.tagName&&"script"!==t.tagName&&"style"!==t.tagName&&"template"!==t.tagName)},colgroup:function(e,t,n){let i=tY(n,t),r=tJ(e,-1,!0);return!(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&t2(i,n.children.indexOf(i),n))&&!!(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){let t=new Set;for(let n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||"element"===n.type},html:function(e){let t=tJ(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){let i=tY(n,t),r=tJ(e,-1);return!(n&&i&&"element"===i.type&&("thead"===i.tagName||"tbody"===i.tagName)&&t2(i,n.children.indexOf(i),n))&&!!(r&&"element"===r.type&&"tr"===r.tagName)}}),t3={name:[[" \n\f\r &/=>".split("")," \n\f\r \"&'/=>`".split("")],["\0 \n\f\r \"&'/<=>".split(""),"\0 \n\f\r \"&'/<=>`".split("")]],unquoted:[[" \n\f\r &>".split(""),"\0 \n\f\r \"&'<=>`".split("")],["\0 \n\f\r \"&'<=>`".split(""),"\0 \n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},t9=["<","&"];function ne(e,t,n,i){return n&&"element"===n.type&&("script"===n.tagName||"style"===n.tagName)?e.value:tF(e.value,Object.assign({},i.settings.characterReferences,{subset:t9}))}let nt=function(e,t){let n=t||{};function i(t,...n){let r=i.invalid,o=i.handlers;if(t&&tx.call(t,e)){let n=String(t[e]);r=tx.call(o,n)?o[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw Error("Expected node, not `"+e+"`")},unknown:function(e){throw Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+tF(e.value,Object.assign({},i.settings.characterReferences,{subset:tU}))+">":"\x3c!--"+e.value.replace(t$,function(e){return tF(e,Object.assign({},i.settings.characterReferences,{subset:tz}))})+"--\x3e"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){let r,o=i.schema,a="svg"!==o.space&&i.settings.omitOptionalTags,l="svg"===o.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase()),s=[];"html"===o.space&&"svg"===e.tagName&&(i.schema=tC);let d=function(e,t){let n,i=[],r=-1;if(t){for(n in t)if(null!==t[n]&&void 0!==t[n]){let r=function(e,t,n){let i,r=function(e,t){let n=e9(t),i=t,r=te;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&tW.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(tj,tq);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tj.test(e)){let n=e.replace(tG,tV);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=th}return new r(i,t)}(e.schema,t),o=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,a=+!e.settings.allowDangerousCharacters,l=e.quote;if(r.overloadedBoolean&&(n===r.attribute||""===n)?n=!0:(r.boolean||r.overloadedBoolean)&&("string"!=typeof n||n===r.attribute||""===n)&&(n=!!n),null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";let s=tF(r.attribute,Object.assign({},e.settings.characterReferences,{subset:t3.name[o][a]}));return!0===n||(n=Array.isArray(n)?(r.commaSeparated?function(e,t){let n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}:function(e){return e.join(" ").trim()})(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?s:(e.settings.preferUnquoted&&(i=tF(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:t3.unquoted[o][a]}))),i!==n&&(e.settings.quoteSmart&&tB(n,l)>tB(n,e.alternative)&&(l=e.alternative),i=l+tF(n,Object.assign({},e.settings.characterReferences,{subset:("'"===l?t3.single:t3.double)[o][a],attribute:!0}))+l),s+(i?"="+i:i))}(e,n,t[n]);r&&i.push(r)}}for(;++r<i.length;){let t=e.settings.tightAttributes?i[r].charAt(i[r].length-1):void 0;r!==i.length-1&&'"'!==t&&"'"!==t&&(i[r]+=" ")}return i.join("")}(i,e.properties),u=i.all("html"===o.space&&"template"===e.tagName?e.content:e);return i.schema=o,u&&(l=!1),!d&&a&&t7(e,t,n)||(s.push("<",e.tagName,d?" "+d:""),l&&("svg"===o.space||i.settings.closeSelfClosing)&&(r=d.charAt(d.length-1),(!i.settings.tightSelfClosing||"/"===r||r&&'"'!==r&&"'"!==r)&&s.push(" "),s.push("/")),s.push(">")),s.push(u),l||a&&t2(e,t,n)||s.push("</"+e.tagName+">"),s.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:ne(e,t,n,i)},root:function(e,t,n,i){return i.all(e)},text:ne}}),nn={},ni={},nr=[];function no(e,t){let n=t||nn,i=n.quote||'"';if('"'!==i&&"'"!==i)throw Error("Invalid quote `"+i+"`, expected `'` or `\"`");return({one:na,all:nl,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||e4,characterReferences:n.characterReferences||ni,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?tC:tS,quote:i,alternative:'"'===i?"'":'"'}).one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function na(e,t,n){return nt(e,t,n,this)}function nl(e){let t=[],n=e&&e.children||nr,i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}var ns=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),eb(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):null!=this.gutterUtilityContainer&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,"gutterSelecting"===this.pointerSession.mode&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return void 0===this.renderedSelectedLinesState||void 0===this.renderedEditorActiveLineState}setSelection(e,t){let n=!(e===this.selectedRange||eZ(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||r)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let i=e!==this.editorActiveLine,r=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||i||r)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(null!=e){if("diff"===this.mode&&"diff-line"===e.type)return{lineNumber:e.lineNumber,side:e.annotationSide};if("file"===this.mode&&"line"===e.type)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;null==t&&null==n&&null==i&&null==o&&null==r||null!=this.options.onGutterUtilityClick&&e6(e.composedPath())||(nv(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if("mouse"!==e.pointerType)return;let{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;("disabled"!==t||a||null!=n||null!=i||null!=r||null!=o)&&(nv(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;(nv(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),null==this.hoveredLine&&null==this.hoveredToken)?nv(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token"):(null!=this.hoveredToken&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),null!=this.hoveredLine&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility())};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,i=t.composedPath();nv(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});let r=this.resolvePointerTarget(i);nv(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);let{onLineClick:o,onLineNumberClick:a,onLineEnter:l,onLineLeave:s,onTokenClick:d,onTokenEnter:u,onTokenLeave:h,onHunkExpand:c,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{let e=nc(r)&&this.hoveredLine?.lineElement===r.lineElement;!(nh(r)&&this.hoveredToken?.tokenElement===r.tokenElement)&&(null!=this.hoveredToken&&(h?.(this.hoveredToken,t),this.clearHoveredToken()),nh(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),u?.(this.hoveredToken,t))),e||(null!=this.hoveredLine&&(s?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),nc(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{var p,m;if(null==r)break;if("kind"in(p=r)&&"merge-conflict-action"===p.kind&&null!=f){f(r);break}if("type"in(m=r)&&"line-info"===m.type&&null!=c){c(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?1/0:void 0);break}if(!nc(r))break;nh(r)&&null!=d&&d(this.toTokenEventBaseProps(r),t);let e=this.toEventBaseProps(r);null!=a&&r.numberColumn?a({...e,event:t}):null!=o&&o({...e,event:t})}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:a,onTokenClick:l,onTokenEnter:s,onTokenLeave:d,onHunkExpand:u,onMergeConflictActionClick:h,enableGutterUtility:c=!1,enableLineSelection:f=!1,onGutterUtilityClick:p}=this.options,m=null!=p,g="disabled"!==n||null!=i||null!=r||null!=o||null!=a||null!=l||null!=s||null!=d||null!=u||null!=h||c||f||m;if(g&&!this.hasPointerListeners){let n;e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,nv(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(n=[],("both"===t||"click"===t)&&(null!=i&&n.push("onLineClick"),null!=r&&n.push("onLineNumberClick"),null!=u&&n.push("expandable hunk separators"),null!=h&&n.push("merge conflict actions")),n)),nv(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),nv(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")}else!g&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);let b="selecting"===this.pointerSession.mode||"pendingSingleLineUnselect"===this.pointerSession.mode,y="gutterSelecting"===this.pointerSession.mode;(!f&&b||!m&&y)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(null==this.pre)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=null!=e,r=null!=t||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if("mouse"===e.pointerType&&0!==e.button||null==this.pre||"idle"!==this.pointerSession.mode)return;let t=e.composedPath();e6(t)&&null!=this.options.onGutterUtilityClick?this.startGutterSelectionFromPointerDown(e):("mouse"!==e.pointerType&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(null==n)return;let{pre:i}=this;if(null==i)return;let{lineNumber:r,eventSide:o,lineIndex:a}=n;if(e.shiftKey&&null!=this.selectedRange){let t=this.getIndexesFromSelection(this.selectedRange,"split"===i.getAttribute("data-diff-type"));if(null==t)return;let n=t.start<=t.end?a>=t.start:a<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){let t={lineNumber:r,side:o};this.selectionAnchor=t,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}!0===this.options.controlledSelection?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(null==t)return;let n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=n?.top??i;null!=i&&null!=r&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:i},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(null==t)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(null==t||null==this.selectionAnchor)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{var t;if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(null==n||null==this.selectionAnchor)return;let i={lineNumber:n.lineNumber,side:n.eventSide};if(t=this.pointerSession.pending,t.lineNumber===i.lineNumber&&t.side===i.side)return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let i=this.resolveSelectionPoint(e,{source:"coordinates-first"});null!=i&&(n.current=i,this.updateSelection(i.lineNumber,i.side));let r=this.buildSelectedLineRange(n.anchor,n.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){null!=this.hoveredLine&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t="disabled"}=this.options;null!=this.hoveredLine&&this.clearHoveredLine(),this.hoveredLine=e,"disabled"!==t&&(("both"===t||"line"===t)&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),("both"===t||"number"===t)&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){null!=this.hoveredToken&&(this.hoveredToken=void 0)}setHoveredToken(e){null!=this.hoveredToken&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(null==this.gutterUtilityContainer&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)null!=this.gutterUtilityButton&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),null==this.gutterUtilitySlot&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,null==this.gutterUtilityButton){let e=document.createElement("div");e.innerHTML=no(e1({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[e8({name:"diffs-icon-plus",properties:{"data-icon":""}})]}));let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);nu(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(null!=this.hoveredLine)return void this.showUtilityOnLine(this.hoveredLine);this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(null==e)return!1;let t=this.targetForSelectionPoint(e.bottom);return null==t?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){null!=this.gutterUtilityContainer&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return null==e?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(null!=i&&null!=r)return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(null!=t)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(null==this.pre)return;let t=this.getLineIndex(e.lineNumber,e.side);if(null==t)return;let n="diff"===this.mode?`${t[0]},${t[1]}`:`${t[0]}`;for(let t of this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`)){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(np(t));if(nu(n)&&("diff"!==this.mode||null==e.side||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){"pendingSingleLineUnselect"===this.pointerSession.mode&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(nu(n)&&(!t||n.numberColumn)&&null!=n.splitLineIndex)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:"diff"===this.mode?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return null!=n?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(nu(t))return{lineNumber:t.lineNumber,side:"diff"===this.mode?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return null!=n?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){let n=!1!==t.excludeUtility;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{let t=this.pathFromCoordinates(e,n);if(void 0!==t)return t??void 0;return this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(void 0!==n)return null===n?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&e6(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=np(e);if(t&&e6(n))return;let i=function(e){let t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;let n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;let i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}(e);return null!=i?np(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){let t=function(e){if(null==e)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(null==t)return;let n=Number.parseInt(t[2],10);if(Number.isFinite(n)&&!(n<=0))return{lineNumber:n,side:t[1]}}(function(e){let t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){let t=e.getAttribute("name")??void 0;return null!=t&&t.startsWith("annotation-")?t:void 0}}(e));if(null==t)return;let n=this.targetForSelectionPoint(t);return null!=n?np(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=nm(t)?t:nm(document)?document:void 0;if(null!=n)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return null!=n?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return void 0!==this.proposedSelectedRange?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let i,r=this.getCurrentSelectionRange();if(null==e)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}!eZ(r??void 0,i??void 0)&&(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,!0===this.options.controlledSelection?this.proposedSelectedRange=i:(this.selectedRange=i,eg(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(null==this.pre)return;let n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return null!=n&&null!=i?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:null==this.editorActiveLine?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(null==e.range)return;let i=this.getIndexesFromSelection(e.range,t);if(null==i)throw console.error({rowRange:i,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(null==this.pre||null==t&&null==i)return[];let{children:r}=this.pre;if(r.length>2)throw console.error(r),Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");let o=[];for(let a of r){let r=a.hasAttribute("data-deletions")?"deletions":a.hasAttribute("data-additions")?"additions":void 0,l=null!=e&&null!=t&&(null==e.highlightSide||null==r||e.highlightSide===r),s=null!=n&&null!=i&&(null==n.highlightSide||null==r||n.highlightSide===r);if(!l&&!s)continue;let[d,u]=a.children;if(!(d instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error("InteractionManager.renderSelection: missing gutter or content element");if(u.children.length!==d.children.length)throw Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");o.push({content:u,gutter:d,renderEditorActiveLine:s,renderSelectedLines:l})}return o}renderSelection=()=>{eb(this.renderSelection);let e=this.getSelectionRenderState();if(null==this.pre)return;let{editorActiveLine:t,selectedLines:n}=e,i=!ng(this.renderedSelectedLinesState,n),r=!ng(this.renderedEditorActiveLineState,t);if(!i&&!r)return;i&&(this.renderedSelectedLinesState=void 0),r&&(this.renderedEditorActiveLineState=void 0);let o="split"===this.pre.getAttribute("data-diff-type"),a=i?this.resolveLineRenderRange(n,o,"selected-lines"):void 0,l=r?this.resolveLineRenderRange(t,o,"editor-active-line"):void 0,s=this.getLineRenderColumns(i?n:void 0,a,r?t:void 0,l),d=null==n.range||s.some(e=>e.renderSelectedLines),u=null==t.range||s.some(e=>e.renderEditorActiveLine);if(i)for(let e of this.pre.querySelectorAll("[data-selected-line]"))e.removeAttribute("data-selected-line");if(r)for(let e of this.pre.querySelectorAll("[data-editor-active-line]"))e.removeAttribute("data-editor-active-line");let h=null==a?void 0:Math.min(a.start,a.end),c=null==a?void 0:Math.max(a.start,a.end),f=h===c,p=l?.start;for(let e of s){let{content:i,gutter:r,renderEditorActiveLine:a,renderSelectedLines:l}=e,s=Math.max(l?c??-1/0:-1/0,a?p??-1/0:-1/0),d=i.children.length;for(let e=0;e<d;e++){let d=i.children[e],u=r.children[e];if(!(d instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let m=this.parseLineIndex(d,o);if((m??0)>s)break;if(null!=m){if(l&&null!=h&&null!=c&&m>=h&&m<=c){let e=f?"single":m===h?"first":m===c?"last":"";u.setAttribute("data-selected-line",e),!n.lineNumberOnly&&(d.setAttribute("data-selected-line",e),u.nextSibling instanceof HTMLElement&&d.nextSibling instanceof HTMLElement&&(d.nextSibling.hasAttribute("data-line-annotation")||d.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(f?(e="last",d.setAttribute("data-selected-line","first")):m===h?e="":m===c&&d.setAttribute("data-selected-line",""),d.nextSibling.setAttribute("data-selected-line",e),u.nextSibling.setAttribute("data-selected-line",e)))}a&&m===p&&(u.setAttribute("data-editor-active-line",""),t.lineNumberOnly||d.setAttribute("data-editor-active-line",""))}}}i&&d&&(this.renderedSelectedLinesState=n),r&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return"file"===this.mode?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}){return"file"===this.mode?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...null!=n?{side:n}:{},...n!==i&&null!=i?{endSide:i}:{}}}resolvePointerTarget(e){let t,n,i,r,o,a,l,s,d,u,h=!1;for(let f of e){if(!(f instanceof HTMLElement))continue;if(null==u&&f.hasAttribute("data-merge-conflict-action")){var c;let e=f.getAttribute("data-merge-conflict-action")??void 0,t=f.getAttribute("data-merge-conflict-conflict-index")??void 0,n=null!=t?Number.parseInt(t,10):NaN;("current"===(c=e)||"incoming"===c||"both"===c)&&Number.isFinite(n)&&(u={kind:"merge-conflict-action",resolution:e,conflictIndex:n})}if(null==a&&f.hasAttribute("data-char")){a=f;let e=f.getAttribute("data-char");if(null!=e){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??"",n=t+e.length;(""!==e.trim()||!0===this.options.enableTokenInteractionsOnWhitespace)&&(l={tokenElement:a,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=null==o?f.getAttribute("data-column-number")??void 0:void 0;if(null!=e){o=f,d=Number.parseInt(e,10),h=!0,t=ny(f),r=f.getAttribute("data-line-index")??void 0;continue}let p=null==i?f.getAttribute("data-line")??void 0:void 0;if(null!=p){i=f,d=Number.parseInt(p,10),t=ny(f),r=f.getAttribute("data-line-index")??void 0;continue}if(null==s&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){s={hunkIndex:void 0,direction:f.hasAttribute("data-expand-up")?"up":f.hasAttribute("data-expand-down")?"down":"both",all:f.hasAttribute("data-expand-all-button")};continue}let m=null!=s?f.getAttribute("data-expand-index")??void 0:void 0;if(null!=s&&null!=m){let e=Number.parseInt(m,10);Number.isNaN(e)||(s.hunkIndex=e);continue}if(null==n&&f.hasAttribute("data-code")){n=f;break}}if(null!=u)return u;if(s?.hunkIndex!=null)return{type:"line-info",hunkIndex:s.hunkIndex,direction:s.direction,all:s.all};if(i??=null!=r?nf(n,`[data-line][data-line-index="${r}"]`):void 0,o??=null!=r?nf(n,`[data-column-number][data-line-index="${r}"]`):void 0,null==n||null==i||null==o||null==t||null==d||Number.isNaN(d))return;let f=this.parseLineIndex(i,this.isSplitDiff());return null!=l?"file"===this.mode?{kind:"token",lineType:t,lineElement:i,lineNumber:d,numberColumn:h,numberElement:o,side:void 0,splitLineIndex:f,...l}:{kind:"token",lineType:t,lineElement:i,lineNumber:d,numberColumn:h,numberElement:o,side:nb(t,n),splitLineIndex:f,...l}:"file"===this.mode?{kind:"line",lineType:t,lineElement:i,lineNumber:d,numberColumn:h,numberElement:o,side:void 0,splitLineIndex:f}:{kind:"line",lineType:t,lineElement:i,lineNumber:d,numberColumn:h,numberElement:o,side:nb(t,n),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){let n=(e.getAttribute("data-line-index")??"").split(",").map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));return t&&2===n.length?n[1]:t?void 0:n[0]}};function nd({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:d,onTokenLeave:u,renderGutterUtility:h,__debugPointerEvents:c,enableLineSelection:f,controlledSelection:p,onLineSelected:m,onLineSelectionStart:g,onLineSelectionChange:b,onLineSelectionEnd:y},v,k,S){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:function({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(null!=n&&null!=t)throw Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}({enableGutterUtility:t,renderGutterUtility:h,onGutterUtilityClick:i}),usesCustomGutterUtility:null!=h,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:v,onMergeConflictActionClick:S,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:d,onTokenLeave:u,__debugPointerEvents:c,enableLineSelection:f,controlledSelection:p,onLineSelected:m,onLineSelectionStart:g,onLineSelectionChange:b,onLineSelectionEnd:y,getLineIndex:k}}function nu(e){return null!=e&&"kind"in e&&"line"===e.kind}function nh(e){return null!=e&&"kind"in e&&"token"===e.kind}function nc(e){return nu(e)||nh(e)}function nf(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function np(e){let t=[],n=e;for(;null!=n;)t.push(n),n=n.parentNode;return t}function nm(e){return null!=e&&"function"==typeof e.elementFromPoint}function ng(e,t){var n,i;return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&((n=e?.range??null)===(i=t.range)||eZ(n??void 0,i??void 0))}function nb(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function ny(e){let t=e.getAttribute("data-line-type");if(null!=t)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function nv(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if("click"!==t)return;break;case"move":if("move"!==t)return}console.log(...n)}var nk=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let i of t){let t=e.managersByElement.get(i.target);if(null==t)continue;let r=n.get(t);null==r?n.set(t,[i]):r.push(i)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n="apply"}){var i,r,o,a;let l=new Set,s="apply"===n,d=0,u=new Map(this.observedNodes);for(let t of(this.observedNodes.clear(),e.children)){if(2===d)break;let e=(()=>{if(t instanceof HTMLElement&&"CODE"===t.tagName)return t})();if(null==e)continue;d++;let n=u.get(e);if(null!=n&&"code"!==n.type)throw Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let o=e.firstElementChild;o instanceof HTMLElement||(o=null),null!=n?(this.observedNodes.set(e,n),u.delete(e),n.numberElement!==o?(null!=n.numberElement&&(this.unobserve(n.numberElement),u.delete(n.numberElement)),null!=o&&(this.observe(o),u.delete(o),this.observedNodes.set(o,n)),n.numberElement=o,n.numberWidth=0):null!=n.numberElement?(u.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):n.numberWidth=0,i=n,r=s,i.applyColumnVariables!==r&&(i.applyColumnVariables=r,r?nS(i,{codeWidthChanged:!0,numberWidthChanged:!0}):nC(i))):(n={type:"code",codeElement:e,numberElement:o,codeWidth:"auto",numberWidth:0,applyColumnVariables:s},this.observedNodes.set(e,n),this.observe(e),null!=o&&(this.observedNodes.set(o,n),this.observe(o)))}if(d>1&&!t){let t=e.querySelectorAll('[data-line-annotation*=","]'),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(t)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:t,element:e});continue}let i=n.get(t);null==i&&(i=[],n.set(t,i)),i.push(e)}for(let[e,t]of n){if(2!==t.length){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",e,t);continue}let[n,i]=t,r=n.firstElementChild,o=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(r instanceof HTMLElement)||!(o instanceof HTMLElement))continue;let a=u.get(r);if(null!=a){this.observedNodes.set(r,a),this.observedNodes.set(o,a),u.delete(r),u.delete(o);continue}let s=r.getBoundingClientRect().height,d=o.getBoundingClientRect().height;a={type:"annotations",column1:{container:n,child:r,childHeight:s},column2:{container:i,child:o,childHeight:d},currentHeight:"auto"},l.add({child1:r,child2:o,item:a,newHeight:Math.max(s,d)})}for(let e of l)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);l.clear()}for(let[e,t]of u){this.unobserve(e),"code"===t.type?(o=t).codeElement.isConnected&&nC(o):((a=t).column1.container.isConnected&&a.column1.container.style.removeProperty("--diffs-annotation-min-height"),a.column2.container.isConnected&&a.column2.container.style.removeProperty("--diffs-annotation-min-height"))}u.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,i=n.get(t);if(i!==this){if(null!=i&&i!==this)throw Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:i}=e,r=n.get(t);if(null!=r){if(r!==this)throw Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),null!=i&&0===n.size&&(i.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let i of e){let{target:e,borderBoxSize:r,contentBoxSize:o}=i;if(!(e instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",i);continue}let a=this.observedNodes.get(e);if(null==a){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",i);continue}if("annotations"===a.type){let t=e===a.column1.child?a.column1:e===a.column2.child?a.column2:void 0;if(null==t){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:e});continue}t.childHeight=r[0].blockSize,n.add(a)}else if("code"===a.type){let n=t.get(a)??{},i=o[0].inlineSize;e===a.codeElement?n.codeInlineSize=i:e===a.numberElement&&(n.numberInlineSize=i),t.set(a,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=null!=n.codeInlineSize?function(e){let t=Math.max(Math.floor(e),0);return 0===t?"auto":t}(n.codeInlineSize):t.codeWidth,i=null!=n.numberInlineSize?Math.max(Math.ceil(n.numberInlineSize),0):t.numberWidth,r=e!==t.codeWidth,o=i!==t.numberWidth;(r||o)&&(t.codeWidth=e,t.numberWidth=i,t.applyColumnVariables&&nS(t,{codeWidthChanged:r,numberWidthChanged:o}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`),e.column2.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`))}};function nS(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:i,codeWidth:r,numberWidth:o}=e;if(t&&i.style.setProperty("--diffs-column-width",`${"number"==typeof r?`${r}px`:"auto"}`),n&&i.style.setProperty("--diffs-column-number-width",`${0===o?"auto":`${o}px`}`),t||n&&"auto"!==r){let e="number"==typeof r?Math.max(r-o,0):0;i.style.setProperty("--diffs-column-content-width",`${e>0?`${e}px`:"auto"}`)}}function nC(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function nx(e,t){return null==e||null==t?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}let nw=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
5
- <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
6
- <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
7
- </symbol>
8
- <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
9
- <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
10
- </symbol>
11
- <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
12
- <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
13
- </symbol>
14
- <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
15
- <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
16
- </symbol>
17
- <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
18
- <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
19
- </symbol>
20
- <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
21
- <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
22
- </symbol>
23
- <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
24
- <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
25
- </symbol>
26
- <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
27
- <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
28
- </symbol>
29
- <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
30
- <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
31
- </symbol>
32
- <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
33
- <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
34
- </symbol>
35
- <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
36
- <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
37
- </symbol>
38
- <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
39
- <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
40
- </symbol>
41
- <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
42
- <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
43
- </symbol>
44
- <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
45
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
46
- </symbol>
47
- <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
48
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
49
- </symbol>
50
- <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
51
- <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
52
- </symbol>
53
- <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
54
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
55
- </symbol>
56
- </svg>`,nL={};function nA(e){if(null!=r)return r;let t=e.host;if("u">typeof HTMLElement&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute("data-diffs-scrollbar-measure","true");let i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),r=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),r}function nE(e){return`${R}: ${null==e?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}let nP="@layer base, theme, rendered, unsafe;",nR=RegExp(`${R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*:\\s*[^;]+;`);function nT({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return null==e&&((e=document.createElement("code")).setAttribute("data-code",""),null!=n&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),null!=i?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function n_(e,t){let n=e?.offsetHeight??0;if(null==e||0===n)return void t();e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}if("u">typeof HTMLElement&&null==customElements.get("diffs-container")){let e;class t extends HTMLElement{constructor(){if(super(),null!=this.shadowRoot)return;const t=this.attachShadow({mode:"open"});null==e&&(e=new CSSStyleSheet).replaceSync('@layer base {\n :host {\n --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",\n "Courier New", monospace;\n --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",\n "Noto Sans", "Liberation Sans", Arial, sans-serif;\n --diffs-mixer: light-dark(#000, #fff);\n --diffs-gap-fallback: 8px;\n --diffs-scrollbar-gutter-fallback: 6px;\n --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));\n --diffs-added-light: #0dbe4e;\n --diffs-added-dark: #5ecc71;\n --diffs-modified-light: #009fff;\n --diffs-modified-dark: #69b1ff;\n --diffs-deleted-light: #ff2e3f;\n --diffs-deleted-dark: #ff6762;\n --diffs-warning-light: #d5a910;\n --diffs-warning-dark: #ffd452;\n color-scheme: light dark;\n font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n font-feature-settings: var(--diffs-font-features);\n --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));\n --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));\n --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));\n --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));\n --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));\n --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));\n --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));\n --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));\n --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));\n --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));\n --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));\n --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));\n --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));\n --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));\n --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));\n --diffs-selection-base: var(--diffs-modified-base);\n --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));\n background-color: var(--diffs-bg);\n color: var(--diffs-fg);\n display: block;\n }\n\n pre, code, [data-error-wrapper] {\n isolation: isolate;\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n outline: none;\n margin: 0;\n padding: 0;\n display: block;\n }\n\n pre, code {\n background-color: var(--diffs-bg);\n }\n\n code {\n contain: content;\n }\n\n input, button {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n }\n\n *, :before, :after {\n box-sizing: border-box;\n }\n\n [data-icon-sprite] {\n display: none;\n }\n\n [data-diffs-header], [data-separator] {\n font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));\n }\n\n [data-diffs-header][data-sticky] {\n z-index: 1;\n background-color: var(--diffs-bg);\n position: sticky;\n top: 0;\n }\n\n [data-file-info] {\n color: var(--fg);\n background-color: color-mix(in lab, var(--bg) 98%, var(--fg));\n border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));\n padding: 10px;\n font-weight: 700;\n }\n\n [data-diff], [data-file] {\n --diffs-grid-number-column-width: minmax(min-content, max-content);\n --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;\n\n &[data-dehydrated] {\n --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);\n }\n\n &:hover [data-code]::-webkit-scrollbar-thumb {\n background-color: var(--diffs-bg-context);\n }\n }\n\n @supports (-webkit-touch-callout: none) {\n :host {\n --diffs-scrollbar-gutter-fallback: 0px;\n }\n }\n\n [data-line] span {\n color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));\n background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));\n font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));\n font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));\n text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));\n }\n\n [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {\n --diffs-computed-decoration-bg: var(--diffs-bg);\n --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);\n --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);\n --diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);\n --diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);\n --diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));\n --diffs-line-bg: var(--diffs-computed-hovered-line-bg);\n color: var(--diffs-fg);\n background-color: var(--diffs-line-bg, var(--diffs-bg));\n }\n\n [data-line], [data-no-newline] {\n &[data-decoration-bg] {\n --mix-deco-light: 92%;\n --mix-deco-dark: 85%;\n\n &[data-decoration-bg-depth="2"] {\n --mix-deco-light: 88%;\n --mix-deco-dark: 80%;\n }\n\n &[data-decoration-bg-depth="3"] {\n --mix-deco-light: 85%;\n --mix-deco-dark: 78%;\n }\n\n --diffs-hover-mix-target: var(--diffs-decoration-bg);\n --diffs-computed-decoration-bg: light-dark(color-mix(in lab,\n var(--diffs-bg) var(--mix-deco-light),\n var(--diffs-decoration-bg)), color-mix(in lab,\n var(--diffs-bg) var(--mix-deco-dark),\n var(--diffs-decoration-bg)));\n }\n }\n\n [data-line-annotation], [data-gutter-buffer="annotation"] {\n --diffs-annotation-bg: var(--diffs-bg-context);\n --diffs-computed-decoration-bg: var(--diffs-annotation-bg);\n --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);\n }\n\n [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {\n --diffs-computed-decoration-bg: var(--diffs-bg-context);\n --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);\n }\n\n [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {\n --diffs-computed-decoration-bg: light-dark(color-mix(in lab,\n var(--diffs-bg) 78%,\n var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,\n var(--diffs-bg) 68%,\n var(--conflict-bg-current-header-override, var(--diffs-addition-base))));\n --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);\n }\n\n [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {\n --diffs-computed-decoration-bg: light-dark(color-mix(in lab,\n var(--diffs-bg) 78%,\n var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,\n var(--diffs-bg) 68%,\n var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));\n --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);\n }\n\n [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {\n --diffs-computed-decoration-bg: var(--diffs-bg);\n --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);\n }\n\n :where([data-background]) {\n & [data-gutter-buffer], & [data-column-number] {\n --mix-light: 91%;\n --mix-dark: 85%;\n }\n\n & [data-line], & [data-no-newline] {\n --mix-light: 88%;\n --mix-dark: 80%;\n }\n\n & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {\n --diffs-diff-line-mix-target: var(--diffs-bg);\n\n &[data-line-type="change-deletion"] {\n --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));\n --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);\n\n &:where([data-gutter-buffer], [data-column-number]) {\n color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));\n --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));\n }\n\n --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-light),\n var(--diffs-diff-line-mix-target)), color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-dark),\n var(--diffs-diff-line-mix-target)));\n }\n\n &[data-line-type="change-addition"] {\n --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));\n --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);\n\n &:where([data-gutter-buffer], [data-column-number]) {\n color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));\n --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));\n }\n\n --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-light),\n var(--diffs-diff-line-mix-target)), color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-dark),\n var(--diffs-diff-line-mix-target)));\n }\n\n &[data-merge-conflict="current"] {\n --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));\n --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);\n\n &:where([data-gutter-buffer], [data-column-number]) {\n color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));\n --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));\n }\n\n --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-light),\n var(--diffs-diff-line-mix-target)), color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-dark),\n var(--diffs-diff-line-mix-target)));\n }\n\n &[data-merge-conflict="incoming"] {\n --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));\n --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);\n\n &:where([data-gutter-buffer], [data-column-number]) {\n color: var(--diffs-modified-base);\n --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));\n }\n\n --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-light),\n var(--diffs-diff-line-mix-target)), color-mix(in lab,\n var(--diffs-computed-decoration-bg) var(--mix-dark),\n var(--diffs-diff-line-mix-target)));\n }\n }\n }\n\n [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {\n --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));\n --diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);\n\n &:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {\n --mix-selection-light: 82%;\n --mix-selection-dark: 75%;\n --diffs-hover-mix-target: var(--diffs-selection-mix-target);\n }\n\n &:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {\n --mix-selection-light: 75%;\n --mix-selection-dark: 60%;\n --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));\n --diffs-hover-mix-target: var(--diffs-selection-mix-target);\n }\n\n &:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {\n --diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,\n var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))\n var(--mix-selection-light),\n var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));\n }\n\n &:where([data-editor-overlay]), &[data-selected-line] {\n --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-diff-line-bg) var(--mix-selection-light),\n var(--diffs-selection-mix-target)), color-mix(in lab,\n var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),\n var(--diffs-selection-mix-target)));\n }\n }\n\n [data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {\n --diffs-computed-editor-active-line-bg: color-mix(in lab,\n var(--diffs-computed-selected-line-bg)\n var(--diffs-editor-active-line-source-mix, 100%),\n var(--diffs-selection-emphasis-mix-target));\n }\n\n @media (pointer: fine) {\n [data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {\n --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,\n var(--diffs-computed-editor-active-line-bg) 97%,\n var(--diffs-hover-mix-target)), color-mix(in lab,\n var(--diffs-computed-editor-active-line-bg) 91%,\n var(--diffs-hover-mix-target)));\n }\n }\n\n [data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {\n color: var(--diffs-selection-number-fg);\n }\n\n [data-no-newline] {\n user-select: none;\n\n & span {\n opacity: .6;\n }\n }\n\n [data-diff-type="split"][data-overflow="scroll"] {\n grid-template-columns: 1fr 1fr;\n display: grid;\n\n & [data-additions] {\n border-left: 1px solid var(--diffs-bg);\n }\n\n & [data-deletions] {\n border-right: 1px solid var(--diffs-bg);\n }\n }\n\n [data-code] {\n grid-auto-flow: dense;\n grid-template-columns: var(--diffs-code-grid);\n overflow: var(--diffs-overflow-override, scroll) clip;\n overscroll-behavior-x: none;\n tab-size: var(--diffs-tab-size, 2);\n padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));\n padding-bottom: max(0px,\n calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -\n var(--diffs-scrollbar-gutter)));\n scrollbar-gutter: stable;\n align-self: flex-start;\n display: grid;\n }\n\n [data-diffs-scrollbar-measure] {\n opacity: 0;\n pointer-events: none;\n scrollbar-gutter: auto;\n grid-template-columns: none;\n width: 100px;\n height: 100px;\n padding: 0;\n position: absolute;\n top: -200px;\n left: -200px;\n }\n\n [data-container-size] {\n container-type: inline-size;\n }\n\n [data-code]::-webkit-scrollbar {\n width: 0;\n height: var(--diffs-scrollbar-gutter);\n }\n\n [data-code]::-webkit-scrollbar-track {\n background: none;\n }\n\n [data-code]::-webkit-scrollbar-thumb {\n background-color: #0000;\n background-clip: content-box;\n border: 1px solid #0000;\n border-radius: 3px;\n }\n\n [data-code]::-webkit-scrollbar-corner {\n background-color: #0000;\n }\n\n @supports ((-moz-appearance: none)) {\n [data-code] {\n scrollbar-width: thin;\n scrollbar-color: var(--diffs-bg-context) transparent;\n padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));\n }\n }\n\n [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {\n & [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {\n padding-top: 0;\n }\n }\n\n [data-gutter] {\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n z-index: 3;\n background-color: var(--diffs-bg);\n grid-column: 1;\n display: grid;\n position: relative;\n\n & [data-gutter-buffer], & [data-column-number] {\n border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));\n }\n }\n\n [data-content] {\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n background-color: var(--diffs-bg);\n grid-column: 2;\n min-width: 0;\n display: grid;\n }\n\n [data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {\n grid-auto-flow: dense;\n grid-template-columns: repeat(2, var(--diffs-code-grid));\n padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n display: grid;\n\n & [data-code] {\n display: contents;\n }\n\n & [data-deletions] {\n & [data-gutter] {\n grid-column: 1;\n }\n\n & [data-content] {\n border-right: 1px solid var(--diffs-bg);\n grid-column: 2;\n }\n }\n\n & [data-additions] {\n & [data-gutter] {\n border-left: 1px solid var(--diffs-bg);\n grid-column: 3;\n }\n\n & [data-content] {\n grid-column: 4;\n }\n }\n }\n\n [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {\n overflow: clip;\n }\n\n [data-overflow="scroll"] [data-gutter] {\n position: sticky;\n left: 0;\n }\n\n [data-interactive-lines] [data-line] {\n cursor: pointer;\n }\n\n [data-interactive-line-numbers] [data-column-number] {\n cursor: pointer;\n touch-action: none;\n }\n\n [data-content-buffer], [data-gutter-buffer] {\n user-select: none;\n min-height: 1lh;\n position: relative;\n }\n\n [data-gutter-buffer] {\n padding-left: 2ch;\n padding-right: 1ch;\n\n &:before {\n content: "";\n min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));\n display: block;\n }\n }\n\n [data-gutter-buffer="annotation"] {\n --diffs-annotation-bg: var(--diffs-bg-context-gutter);\n min-height: 0;\n }\n\n [data-gutter-buffer="buffer"] {\n --diffs-line-bg: var(--diffs-bg-context-gutter);\n }\n\n [data-content-buffer] {\n background-position: 5px 0;\n background-size: 8px 8px;\n background-origin: border-box;\n background-image: repeating-linear-gradient(-45deg,\n transparent,\n transparent calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(4px * 1.414));\n grid-column: 1;\n }\n\n [data-separator] {\n box-sizing: content-box;\n background-color: var(--diffs-bg);\n }\n\n [data-separator="simple"] {\n min-height: 4px;\n }\n\n [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {\n background-color: var(--diffs-bg-separator);\n }\n\n [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {\n height: 32px;\n position: relative;\n }\n\n [data-separator-wrapper] {\n user-select: none;\n fill: currentColor;\n background-color: var(--diffs-bg);\n align-items: center;\n height: 100%;\n display: flex;\n position: absolute;\n inset-inline: 0;\n }\n\n [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-separator="metadata"] [data-separator-wrapper] {\n background-color: var(--diffs-bg-separator);\n height: 100%;\n color: var(--diffs-fg-number);\n white-space: nowrap;\n text-overflow: ellipsis;\n min-width: min-content;\n padding-inline: 1ch;\n inset-inline: 100% auto;\n overflow: hidden;\n }\n\n [data-separator="line-info"] {\n margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n\n & [data-separator-wrapper] {\n min-width: 16px;\n }\n }\n\n [data-separator="line-info-basic"], [data-separator="metadata"] {\n margin-block: 0;\n }\n\n [data-separator="line-info"][data-separator-first] {\n margin-top: 0;\n }\n\n [data-separator="line-info"][data-separator-last] {\n margin-bottom: 0;\n }\n\n [data-expand-index] [data-separator-wrapper] {\n grid-template-columns: 32px auto;\n display: grid;\n }\n\n [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 32px 32px auto;\n }\n\n [data-expand-button], [data-separator-content] {\n background-color: var(--diffs-bg-separator);\n flex: none;\n align-items: center;\n display: flex;\n }\n\n [data-expand-index] [data-separator-content]:hover {\n cursor: pointer;\n text-decoration: underline;\n }\n\n [data-expand-button] {\n cursor: pointer;\n min-width: 32px;\n color: var(--diffs-fg-number);\n border-right: 2px solid var(--diffs-bg);\n flex-shrink: 0;\n justify-content: center;\n align-self: stretch;\n\n &:hover {\n color: var(--diffs-fg);\n }\n\n &[data-expand-all-button] {\n display: none;\n }\n }\n\n [data-expand-down] [data-icon] {\n transform: scaleY(-1);\n }\n\n [data-separator-content] {\n height: 100%;\n color: var(--diffs-fg-number);\n flex: auto;\n justify-content: flex-start;\n padding: 0 1ch;\n overflow: hidden;\n }\n\n [data-separator="line-info"], [data-separator="line-info-basic"] {\n & [data-separator-content] {\n user-select: none;\n height: 100%;\n overflow: clip;\n }\n }\n\n [data-unmodified-lines] {\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 0 auto;\n min-width: 0;\n display: block;\n overflow: hidden;\n }\n\n @supports (width: 1cqi) {\n [data-unified] {\n & [data-separator="line-info"] [data-separator-wrapper] {\n padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n width: 100cqi;\n\n & [data-separator-content] {\n border-radius: 6px;\n }\n }\n\n & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-gutter] {\n & [data-separator="line-info"] [data-separator-wrapper] {\n padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n }\n\n & [data-separator="line-info"] [data-separator-content] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n & [data-separator="line-info"][data-expand-index] [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-additions] {\n & [data-content] [data-separator="line-info"] {\n background-color: var(--diffs-bg);\n\n & [data-separator-wrapper] {\n display: none;\n }\n }\n\n & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {\n background-color: var(--diffs-bg-separator);\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n height: 100%;\n display: block;\n\n & [data-separator-content], & [data-expand-button] {\n display: none;\n }\n }\n }\n\n [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {\n width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));\n }\n\n [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {\n background-color: var(--diffs-bg-separator);\n height: 100%;\n margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n display: block;\n\n & [data-separator-content], & [data-expand-button] {\n display: none;\n }\n }\n\n [data-separator="line-info"] [data-separator-wrapper] {\n & [data-expand-both], & [data-expand-down], & [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n @media (pointer: fine) {\n [data-separator="line-info"] [data-separator-wrapper] {\n &[data-separator-multi-button] {\n & [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: unset;\n }\n\n & [data-expand-down] {\n border-bottom-left-radius: 6px;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: coarse) {\n [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px 34px auto;\n\n & [data-separator-content] {\n grid-column: unset;\n grid-row: unset;\n }\n }\n\n @supports (width: 1cqi) {\n [data-separator="line-info"] [data-separator-wrapper] {\n & [data-expand-both], & [data-expand-down], & [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n &[data-separator-multi-button] {\n & [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n & [data-expand-down] {\n border-bottom-left-radius: unset;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: fine) {\n [data-separator-wrapper][data-separator-multi-button] {\n grid-template-rows: 50% 50%;\n display: grid;\n\n & [data-separator-content] {\n grid-area: 1 / 2 / -1;\n min-width: min-content;\n }\n\n & [data-expand-button] {\n grid-column: 1;\n }\n }\n\n [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px auto;\n }\n\n [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {\n grid-template-columns: 100% auto;\n }\n\n [data-separator="line-info"], [data-separator="line-info-basic"] {\n & [data-separator-multi-button] {\n & [data-expand-up] {\n border-bottom: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n\n & [data-expand-down] {\n border-top: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n }\n }\n }\n\n [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-line-annotation] {\n min-height: var(--diffs-annotation-min-height, 0);\n z-index: 2;\n }\n\n [data-merge-conflict-actions] {\n z-index: 2;\n }\n\n [data-separator="custom"] {\n grid-template-columns: subgrid;\n display: grid;\n }\n\n [data-line], [data-column-number], [data-no-newline] {\n padding-inline: 1ch;\n position: relative;\n }\n\n [data-indicators="classic"] [data-line] {\n padding-inline-start: 2ch;\n }\n\n [data-indicators="classic"] {\n & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {\n &[data-no-newline], &[data-line] {\n &:before {\n user-select: none;\n width: 1ch;\n height: 1lh;\n display: inline-block;\n position: absolute;\n top: 0;\n left: 0;\n }\n }\n }\n\n & [data-line-type="change-addition"] {\n &[data-line], &[data-no-newline] {\n &:before {\n content: "+";\n color: var(--diffs-addition-base);\n }\n }\n }\n\n & [data-line-type="change-deletion"] {\n &[data-line], &[data-no-newline] {\n &:before {\n content: "-";\n color: var(--diffs-deletion-base);\n }\n }\n }\n }\n\n [data-indicators="bars"] {\n & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {\n &[data-column-number] {\n &:before {\n content: "";\n user-select: none;\n contain: strict;\n width: 4px;\n height: 100%;\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n }\n }\n }\n\n & [data-line-type="change-deletion"] {\n &[data-column-number] {\n &:before {\n background-image: linear-gradient(0deg,\n var(--diffs-bg-deletion) 50%,\n var(--diffs-deletion-base) 50%);\n background-repeat: repeat;\n background-size: 2px 2px;\n background-size: calc(1lh / round(1lh / 2px))\n calc(1lh / round(1lh / 2px));\n }\n }\n }\n\n & [data-line-type="change-addition"] {\n &[data-column-number] {\n &:before {\n background-color: var(--diffs-addition-base);\n }\n }\n }\n }\n\n [data-overflow="wrap"] {\n & [data-line] {\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n & [data-annotation-content] {\n word-break: break-word;\n }\n }\n\n [data-overflow="scroll"] [data-line] {\n white-space: pre;\n min-height: 1lh;\n }\n\n [data-column-number] {\n box-sizing: content-box;\n text-align: right;\n user-select: none;\n color: var(--diffs-fg-number);\n padding-left: 2ch;\n }\n\n [data-line-number-content] {\n min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));\n z-index: 1;\n display: inline-block;\n position: relative;\n }\n\n [data-disable-line-numbers] {\n & [data-gutter-buffer], & [data-column-number] {\n min-width: 4px;\n padding: 0;\n\n &:before {\n min-width: 0;\n }\n }\n\n & [data-line-number-content] {\n display: none;\n }\n\n & [data-gutter-utility-slot] {\n right: unset;\n justify-content: flex-start;\n left: 0;\n }\n\n &[data-indicators="bars"] [data-gutter-utility-slot] {\n left: 6px;\n }\n }\n\n [data-file][data-disable-line-numbers] {\n & [data-gutter-buffer], & [data-column-number] {\n border-right: 0;\n min-width: 0;\n }\n }\n\n [data-diff-span] {\n box-decoration-break: clone;\n border-radius: 3px;\n }\n\n [data-line-type="change-addition"] [data-diff-span] {\n background-color: var(--diffs-bg-addition-emphasis);\n }\n\n [data-line-type="change-deletion"] [data-diff-span] {\n background-color: var(--diffs-bg-deletion-emphasis);\n }\n\n [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {\n color: var(--diffs-fg);\n padding-left: 1ch;\n }\n\n [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {\n align-items: center;\n display: flex;\n\n &:after {\n color: var(--diffs-fg-conflict-marker);\n font-size: .75rem;\n font-style: normal;\n line-height: 1.25rem;\n font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));\n padding-left: 1ch;\n }\n }\n\n [data-merge-conflict="marker-start"]:after {\n content: "(Current Change)";\n }\n\n [data-merge-conflict="marker-end"]:after {\n content: "(Incoming Change)";\n }\n\n [data-merge-conflict-actions-content] {\n min-height: 1.75rem;\n font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));\n color: var(--diffs-fg);\n align-items: center;\n gap: .25rem;\n padding-inline: .5rem;\n font-size: .75rem;\n line-height: 1.2;\n display: flex;\n }\n\n [data-merge-conflict-action] {\n appearance: none;\n color: var(--diffs-fg-number);\n font: inherit;\n cursor: pointer;\n background: none;\n border: 0;\n padding: 0;\n font-style: normal;\n }\n\n [data-merge-conflict-action]:hover {\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict-action="current"]:hover {\n color: var(--diffs-addition-base);\n }\n\n [data-merge-conflict-action="incoming"]:hover {\n color: var(--diffs-modified-base);\n }\n\n [data-merge-conflict-action-separator] {\n color: var(--diffs-fg-number);\n opacity: .6;\n user-select: none;\n }\n\n [data-diffs-header="default"] {\n background-color: var(--diffs-bg);\n justify-content: space-between;\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));\n z-index: 2;\n flex-direction: row;\n padding-inline: 16px;\n display: flex;\n position: relative;\n top: 0;\n }\n\n [data-header-content] {\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n white-space: nowrap;\n flex-direction: row;\n min-width: 0;\n display: flex;\n }\n\n [data-header-content] [data-prev-name], [data-header-content] [data-title] {\n text-overflow: ellipsis;\n white-space: nowrap;\n direction: rtl;\n min-width: 0;\n overflow: hidden;\n }\n\n [data-prev-name] {\n opacity: .7;\n }\n\n [data-rename-icon] {\n fill: currentColor;\n flex-grow: 0;\n flex-shrink: 0;\n }\n\n [data-diffs-header="default"] [data-metadata] {\n white-space: nowrap;\n align-items: center;\n gap: 1ch;\n display: flex;\n }\n\n [data-diffs-header="default"] [data-additions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-addition-base);\n }\n\n [data-diffs-header="default"] [data-deletions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-deletion-base);\n }\n\n [data-change-icon] {\n fill: currentColor;\n flex-shrink: 0;\n }\n\n [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {\n color: var(--diffs-modified-base);\n }\n\n [data-change-icon="new"] {\n color: var(--diffs-addition-base);\n }\n\n [data-change-icon="deleted"] {\n color: var(--diffs-deletion-base);\n }\n\n [data-change-icon="file"] {\n opacity: .6;\n }\n\n [data-annotation-content] {\n z-index: 2;\n isolation: isolate;\n white-space: normal;\n align-self: flex-start;\n min-width: 0;\n display: flow-root;\n position: relative;\n }\n\n [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {\n width: var(--diffs-column-content-width, auto);\n left: var(--diffs-column-number-width, 0);\n position: sticky;\n }\n\n [data-annotation-slot] {\n text-wrap-mode: wrap;\n word-break: normal;\n white-space-collapse: collapse;\n }\n\n [data-gutter-utility-slot] {\n touch-action: none;\n justify-content: flex-end;\n display: flex;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n }\n\n [data-utility-button] {\n appearance: none;\n cursor: pointer;\n width: 1lh;\n height: 1lh;\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n background-color: var(--diffs-modified-base);\n color: var(--diffs-bg);\n fill: currentColor;\n z-index: 4;\n touch-action: none;\n border: none;\n border-radius: 4px;\n justify-content: center;\n align-items: center;\n margin-right: calc(-1lh + 1ch);\n padding: 0;\n display: flex;\n position: relative;\n\n &:before {\n content: "";\n display: block;\n position: absolute;\n inset: 0 0 0 -4px;\n }\n }\n\n [data-decoration-bar-stack] {\n pointer-events: none;\n isolation: isolate;\n z-index: 1;\n background-color: var(--diffs-decoration-bar-color, transparent);\n box-sizing: content-box;\n border-left: 2px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n width: 6px;\n position: absolute;\n top: 0;\n bottom: 0;\n right: -2px;\n\n [data-decoration-bar-depth="1"] & {\n background-color: color-mix(in lab,\n var(--diffs-bg) 20%,\n var(--diffs-decoration-bar-color, transparent));\n }\n\n [data-decoration-bar-depth="2"] & {\n background-color: color-mix(in lab,\n var(--diffs-bg) 45%,\n var(--diffs-decoration-bar-color, transparent));\n }\n\n [data-decoration-bar-depth="3"] & {\n background-color: color-mix(in lab,\n var(--diffs-bg) 65%,\n var(--diffs-decoration-bar-color, transparent));\n }\n\n [data-decoration-bar-start] & {\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n }\n\n [data-decoration-bar-end] & {\n z-index: 3;\n border-bottom-right-radius: 5px;\n border-bottom-left-radius: 5px;\n }\n }\n\n [data-placeholder] {\n contain: strict;\n }\n\n [data-error-wrapper] {\n padding: var(--diffs-gap-block, var(--diffs-gap-fallback))\n var(--diffs-gap-inline, var(--diffs-gap-fallback));\n scrollbar-width: none;\n max-height: 400px;\n overflow: auto;\n\n & [data-error-message] {\n color: var(--diffs-deletion-base);\n font-size: 18px;\n font-weight: bold;\n }\n\n & [data-error-stack] {\n color: var(--diffs-fg-number);\n }\n }\n}\n\n@layer theme, rendered, unsafe;\n'),t.adoptedStyleSheets=[e]}connectedCallback(){nA(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(b,t)}async function nN(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{null!=n&&clearTimeout(n)}}function nM({oldFile:e,newFile:t},n){if(void 0!==e||void 0!==t){if(void 0===e||void 0===t)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(null===e&&null===t)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}}function nI(e){return""!==e?e.split(v):[]}function nD(e,t,n){let i="clone"===e?{...t,hunks:t.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...t.deletionLines],additionLines:[...t.additionLines]}:t;if(!i.isPartial)throw Error("hydratePartialDiff: fileDiff must be partial");switch(i.type){case"change":case"rename-changed":return function(e,t,n){let i=nI(t.contents),r=nI(n.contents),{hunks:o,splitLineCount:a,unifiedLineCount:l}=function(e,t){let n=0,i=0,r=0,o=[];for(let t of e){var a;let e=Math.max(t.additionStart-1,0),l=Math.max(t.deletionStart-1,0),s=e,d=l,u=0,h=0,c=0,f=0,p=[];for(let e of t.hunkContent){if("context"===e.type){p.push({...e,additionLineIndex:s,deletionLineIndex:d}),s+=e.lines,d+=e.lines,c+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:d}),s+=e.additions,d+=e.deletions,u+=e.additions,h+=e.deletions,c+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max((a=t.additionStart,a-(0!==t.additionCount)-r),0);o.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:l,additionLines:u,deletionLines:h,hunkContent:p,splitLineStart:n+m,unifiedLineStart:i+m,splitLineCount:c,unifiedLineCount:f}),n+=m+c,i+=m+f,r=I(t.additionStart,t.additionCount)}if(o.length>0){let e=o[o.length-1],r=Math.max(t-I(e.additionStart,e.additionCount),0);n+=r,i+=r}return{hunks:o,splitLineCount:n,unifiedLineCount:i}}(e.hunks,r.length);return e.hunks=o,e.splitLineCount=a,e.unifiedLineCount=l,e.isPartial=!1,e.deletionLines=i,e.additionLines=r,nO(e,t,n),e}(i,function(e,t){if(null==t.oldFile)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}(i,n),nH(i,n));case"rename-pure":{let e=nH(i,n);var r=i,o=n;if(null!==o.oldFile)throw Error(`hydratePartialDiff: ${r.type} diff for ${r.name} requires oldFile to be null`);let t=nI(e.contents);return i.isPartial=!1,i.deletionLines=t,i.additionLines=t,nO(i,null,e),i}}throw Error(`hydratePartialDiff: ${i.type} diffs cannot be hydrated from loaded files`)}function nH(e,t){if(null==t.newFile)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function nO(e,t,n){var i,r;let o=null!=e.cacheKey?`${e.cacheKey}:hydrated`:(i=t,r=n,null!=i&&null!=r?null!=i.cacheKey&&null!=r.cacheKey?`${i.cacheKey}:${r.cacheKey}`:void 0:i?.cacheKey??r?.cacheKey);null==o?delete e.cacheKey:e.cacheKey=o}function nF({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:r,collapsedContextThreshold:o=1,callback:a}){let l=function({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:r}){if(n<=0||"both"===t)return{hunkIndex:0,splitCount:0,unifiedCount:0};let o=function({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,r=0,o=e.hunks.length-1,a=[{splitCount:0,unifiedCount:0}];for(let l=0;l<e.hunks.length;l++){let s=e.hunks[l];if(null==s)throw Error("iterateOverDiff: invalid hunk summary index");let d=ex({isPartial:e.isPartial,rangeSize:s.collapsedBefore,expandedHunks:t,hunkIndex:l,collapsedContextThreshold:n}),u=d.fromStart+d.fromEnd;i+=u+s.splitLineCount,r+=u+s.unifiedLineCount;let h=l===o?eL({fileDiff:e,hunkIndex:l,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(null!=h){let e=h.fromStart+h.fromEnd;i+=e,r+=e}a.push({splitCount:i,unifiedCount:r})}return a}({diff:e,expandedHunks:i,collapsedContextThreshold:r}),a=0,l=e.hunks.length-1,s=e.hunks.length;for(;a<=l;){let e=a+l>>1,i=o[e+1];if(null==i)throw Error("iterateOverDiff: invalid hunk prefix index");("unified"===t?i.unifiedCount:i.splitCount)>n?(s=e,l=e-1):a=e+1}if(s>=e.hunks.length){let t=o[e.hunks.length];if(null==t)throw Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let d=o[s];if(null==d)throw Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:s,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:o}),s={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!s.isWindowedHighlight)return!1;let e=s.unifiedCount>=n+i,r=s.splitCount>=n+i;return"unified"===t?e:"split"===t?r:e&&r},shouldSkip(e,i){if(!s.isWindowedHighlight)return!1;let r=e>0&&s.unifiedCount+e<=n,o=i>0&&s.splitCount+i<=n;return"unified"===t?r:"split"===t?o:r&&o},incrementCounts(e,n){("unified"===t||"both"===t)&&(s.unifiedCount+=e),("split"===t||"both"===t)&&(s.splitCount+=n)},isInWindow(e,n){if(!s.isWindowedHighlight)return!0;let i=s.isInUnifiedWindow(e),r=s.isInSplitWindow(n);return"unified"===t?i:"split"===t?r:i||r},isInUnifiedWindow:e=>!s.isWindowedHighlight||s.unifiedCount>=n-e&&s.unifiedCount<n+i,isInSplitWindow:e=>!s.isWindowedHighlight||s.splitCount>=n-e&&s.splitCount<n+i,emit:(e,n=!1)=>(n||("unified"===t?s.incrementCounts(1,0):"split"===t?s.incrementCounts(0,1):s.incrementCounts(1,1)),a(e)??!1)};e:for(let n=l.hunkIndex;n<e.hunks.length;n++){var d,u;let i=e.hunks[n];if(null==i)throw Error("iterateOverDiff: invalid hunk index");if(s.shouldBreak())break;let a=(d=i.deletionStart,d-(0!==i.deletionCount)),l=(u=i.additionStart,u-(0!==i.additionCount)),f=e.isPartial||0!==i.deletionCount?i.deletionLineIndex:a,p=e.isPartial||0!==i.additionCount?i.additionLineIndex:l,m=ex({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:r,hunkIndex:n,collapsedContextThreshold:o}),g=n===s.finalHunkIndex?eL({fileDiff:e,hunkIndex:n,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,b=m.fromStart+m.fromEnd;function h(e,n){return null==g||g.collapsedLines<=0||g.fromStart+g.fromEnd>0?0:"unified"===t?e===i.unifiedLineStart+i.unifiedLineCount-1?g.collapsedLines:0:n===i.splitLineStart+i.splitLineCount-1?g.collapsedLines:0}let y=0===m.collapsedLines;function c(){return y?0:(y=!0,m.collapsedLines)}if(s.shouldSkip(b,b))s.incrementCounts(b,b),c();else{let e=i.unifiedLineStart-m.rangeSize,r=i.splitLineStart-m.rangeSize,o=f-m.rangeSize,d=p-m.rangeSize,u=a+1-m.rangeSize,h=l+1-m.rangeSize;if(n$(s,m.fromStart,t,t=>s.emit({hunkIndex:n,hunk:i,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:u+t,lineIndex:o+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:r+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:r+t,lineIndex:d+t,lineNumber:h+t,noEOFCR:!1}}))||(e=i.unifiedLineStart-m.fromEnd,r=i.splitLineStart-m.fromEnd,o=f-m.fromEnd,d=p-m.fromEnd,u=a+1-m.fromEnd,h=l+1-m.fromEnd,n$(s,m.fromEnd,t,t=>s.emit({hunkIndex:n,hunk:i,collapsedBefore:c(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:u+t,lineIndex:o+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:r+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:r+t,lineIndex:d+t,lineNumber:h+t,noEOFCR:!1}}),()=>{c()})))break}let v=i.unifiedLineStart,k=i.splitLineStart,S=f,C=p,x=a+1,w=l+1,L=i.hunkContent.at(-1);for(let e of i.hunkContent){if(s.shouldBreak())break e;let r=e===L;if("context"===e.type){if(s.shouldSkip(e.lines,e.lines))s.incrementCounts(e.lines,e.lines),c();else if(n$(s,e.lines,t,t=>{let o=r&&t===e.lines-1,a=v+t,l=k+t;return s.emit({hunkIndex:n,hunk:i,collapsedBefore:c(),collapsedAfter:h(a,l),type:"context",deletionLine:{lineNumber:x+t,lineIndex:S+t,noEOFCR:o&&i.noEOFCRDeletions,unifiedLineIndex:a,splitLineIndex:l},additionLine:{unifiedLineIndex:a,splitLineIndex:l,lineIndex:C+t,lineNumber:w+t,noEOFCR:o&&i.noEOFCRAdditions}})},()=>{c()}))break e;v+=e.lines,k+=e.lines,S+=e.lines,C+=e.lines,x+=e.lines,w+=e.lines}else{let o=Math.max(e.deletions,e.additions),a=e.deletions+e.additions;if(!s.shouldSkip(a,o)){let l=function(e,t,n){if(!e.isWindowedHighlight)return[[0,"unified"===n?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let i="unified"===n?"unified":"split",r=[];function o(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let i=Math.max(0,e.viewportStart-t),r=Math.min(n,e.viewportEnd-t);return r>i?[i,r]:void 0}function a(e,n){if(null==e)return;let[o,a]="split"===i?e:"additions"===n?[e[0]+t.deletions,e[1]+t.deletions]:e;a>o&&r.push([o,a])}if("split"!==n&&(a(o(e.unifiedCount,t.deletions),"deletions"),a(o(e.unifiedCount+t.deletions,t.additions),"additions")),"unified"!==n&&(a(o(e.splitCount,t.deletions),"deletions"),a(o(e.splitCount,t.additions),"additions")),0===r.length)return r;r.sort((e,t)=>e[0]-t[0]);let l=[r[0]];for(let[e,t]of r.slice(1)){let n=l[l.length-1];e<=n[1]?n[1]=Math.max(n[1],t):l.push([e,t])}return l}(s,e,t);for(let[d,u]of((l[0]?.[0]??0)>0&&c(),l))for(let l=d;l<u;l++){let d=h(v+l,"unified"===t?k+(l<e.deletions?l:l-e.deletions):k+l);if(s.emit(function({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:a,splitLineIndex:l,additionLineIndex:s,deletionLineIndex:d,additionLineNumber:u,deletionLineNumber:h,content:c,isLastContent:f,unifiedCount:p,splitCount:m}){let g=o<c.deletions?a+o:void 0,b="unified"===r?o>=c.deletions?a+o:void 0:o<c.additions?a+c.deletions+o:void 0,y="unified"===r?l+(o<c.deletions?o:o-c.deletions):l+o,v=o<c.deletions?d+o:void 0,k=o<c.deletions?h+o:void 0,S="unified"===r?o>=c.deletions?s+(o-c.deletions):void 0:o<c.additions?s+o:void 0,C="unified"===r?o>=c.deletions?u+(o-c.deletions):void 0:o<c.additions?u+o:void 0,x="unified"===r?f&&o===c.deletions-1&&t.noEOFCRDeletions:f&&o===m-1&&t.noEOFCRDeletions,w="unified"===r?f&&o===p-1&&t.noEOFCRAdditions:f&&o===m-1&&t.noEOFCRAdditions,L=null!=v&&null!=k&&null!=g?{lineNumber:k,lineIndex:v,noEOFCR:x,unifiedLineIndex:g,splitLineIndex:y}:void 0,A=null!=S&&null!=C&&null!=b?{unifiedLineIndex:b,splitLineIndex:y,lineIndex:S,lineNumber:C,noEOFCR:w}:void 0;if(null==L&&null!=A)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:A};if(null!=L&&null==A)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:L,additionLine:void 0};if(null==L||null==A)throw Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:L,additionLine:A}}({hunkIndex:n,hunk:i,collapsedBefore:c(),collapsedAfter:d,diffStyle:t,index:l,unifiedLineIndex:v,splitLineIndex:k,additionLineIndex:C,deletionLineIndex:S,additionLineNumber:w,deletionLineNumber:x,content:e,isLastContent:r,unifiedCount:a,splitCount:o}),!0))break e}}c(),s.incrementCounts(a,o),v+=a,k+=o,S+=e.deletions,C+=e.additions,x+=e.deletions,w+=e.additions}}if(null!=g){let{collapsedLines:n,fromStart:i,fromEnd:r}=g,o=i+r;if(n$(s,o,t,t=>{let i=t===o-1;return s.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:i?n:0,type:"context-expanded",deletionLine:{lineNumber:x+t,lineIndex:S+t,noEOFCR:!1,unifiedLineIndex:v+t,splitLineIndex:k+t},additionLine:{unifiedLineIndex:v+t,splitLineIndex:k+t,lineIndex:C+t,lineNumber:w+t,noEOFCR:!1}})},void 0,()=>s.shouldBreak()))break}}}function n$(e,t,n,i,r,o){let[a,l]=function(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let i=[];function r(n){let r=Math.max(0,e.viewportStart-n),o=Math.min(t,e.viewportEnd-n);o>r&&i.push([r,o])}if("split"!==n&&r(e.unifiedCount),"unified"!==n&&r(e.splitCount),0===i.length)return[0,0];let o=i[0][0],a=i[0][1];for(let e=1;e<i.length;e++){let t=i[e];o=Math.min(o,t[0]),a=Math.max(a,t[1])}return[o,a]}(e,t,n);a>0&&(e.incrementCounts(a,a),r?.());let s=a;for(;s<t;){if(o?.()===!0)return!0;if(s>=l){e.incrementCounts(t-s,t-s);break}if(e.isInWindow(0,0)){if(!0===i(s))return!0}else e.incrementCounts(1,1);s++}return!1}var nU=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(null==t||null==n)for(let i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));null==n||null==t?this.cleanUp():(this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0)}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function nz(e){return 0===e.startingLine&&e.totalLines===1/0&&0===e.bufferBefore&&0===e.bufferAfter}let nB=new Map,nG={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","\uD83D\uDD25":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function nj(e){if(nB.has(e))return nB.get(e)??"text";if(null!=nG[e])return nG[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(null!=t){if(nB.has(t[1]))return nB.get(t[1])??"text";if(null!=nG[t[1]])return nG[t[1]]??"text"}let n=e.match(/\.([^.]+)$/)?.[1]??"";return nB.has(n)?nB.get(n)??"text":nG[n]??"text"}function nW(e){let t=e.lang??nj(e.name),n=e.lang??(null!=e.prevName?nj(e.prevName):"text");return"text"===t&&"text"===n}function nV(e){let t=e[0];return null!=t&&t.length>0?t:void 0}function nq(e){return 0===e.startingLine&&e.totalLines>0}let nK=new Map,nX=new Map,nQ=new Map,nJ=new Set;function nY(e){for(let t of Array.isArray(e)?e:[e])if("text"!==t&&"ansi"!==t&&!nJ.has(t))return!1;return!0}function nZ(e,t){for(let n of e=Array.isArray(e)?e:[e]){if(nJ.has(n.name))continue;let e=nK.get(n.name);null==e&&(e=n,nK.set(n.name,e)),nJ.add(e.name),t.loadLanguageSync(e.data)}}function n0(){return"u">typeof WorkerGlobalScope&&"u">typeof self&&self instanceof WorkerGlobalScope}let n1=[{id:"abap",name:"ABAP",import:()=>n.e("5319").then(n.bind(n,6698))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:()=>n.e("4704").then(n.bind(n,9571))},{id:"ada",name:"Ada",import:()=>n.e("5453").then(n.bind(n,172))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:()=>n.e("9671").then(n.bind(n,7162))},{id:"ahk2",name:"AutoHotkey2",import:()=>n.e("857").then(n.bind(n,3488))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("829")]).then(n.bind(n,8124))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("4489"),n.e("829"),n.e("4996")]).then(n.bind(n,495))},{id:"apache",name:"Apache Conf",import:()=>n.e("8423").then(n.bind(n,970))},{id:"apex",name:"Apex",import:()=>n.e("7993").then(n.bind(n,1344))},{id:"apl",name:"APL",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("7822")]).then(n.bind(n,2701))},{id:"applescript",name:"AppleScript",import:()=>n.e("7774").then(n.bind(n,5677))},{id:"ara",name:"Ara",import:()=>n.e("7135").then(n.bind(n,6130))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>n.e("2810").then(n.bind(n,9153))},{id:"asm",name:"Assembly",import:()=>n.e("7714").then(n.bind(n,3081))},{id:"astro",name:"Astro",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("1274"),n.e("8250"),n.e("5458")]).then(n.bind(n,7097))},{id:"awk",name:"AWK",import:()=>n.e("1680").then(n.bind(n,2563))},{id:"ballerina",name:"Ballerina",import:()=>n.e("4301").then(n.bind(n,6748))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:()=>n.e("3886").then(n.bind(n,5645))},{id:"beancount",name:"Beancount",import:()=>n.e("5752").then(n.bind(n,4139))},{id:"berry",name:"Berry",aliases:["be"],import:()=>n.e("2301").then(n.bind(n,5212))},{id:"bibtex",name:"BibTeX",import:()=>n.e("9623").then(n.bind(n,4634))},{id:"bicep",name:"Bicep",import:()=>n.e("5518").then(n.bind(n,29))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:()=>n.e("9990").then(n.bind(n,1013))},{id:"blade",name:"Blade",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("8601"),n.e("7459")]).then(n.bind(n,3742))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>n.e("8252").then(n.bind(n,4679))},{id:"c",name:"C",import:()=>n.e("9048").then(n.bind(n,507))},{id:"c3",name:"C3",import:()=>n.e("5687").then(n.bind(n,2826))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>n.e("2918").then(n.bind(n,5861))},{id:"cairo",name:"Cairo",import:()=>Promise.all([n.e("1875"),n.e("8481")]).then(n.bind(n,9144))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:()=>Promise.all([n.e("9048"),n.e("658")]).then(n.bind(n,553))},{id:"clarity",name:"Clarity",import:()=>n.e("117").then(n.bind(n,8532))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>n.e("2645").then(n.bind(n,4868))},{id:"cmake",name:"CMake",import:()=>n.e("7330").then(n.bind(n,5593))},{id:"cobol",name:"COBOL",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("1498")]).then(n.bind(n,4945))},{id:"codeowners",name:"CODEOWNERS",import:()=>n.e("4496").then(n.bind(n,1715))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>n.e("6781").then(n.bind(n,9404))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([n.e("7858"),n.e("4049")]).then(n.bind(n,4728))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>n.e("9557").then(n.bind(n,1748))},{id:"coq",name:"Rocq",import:()=>n.e("9020").then(n.bind(n,8615))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([n.e("9048"),n.e("2082")]).then(n.bind(n,8393))},{id:"crystal",name:"Crystal",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9048"),n.e("8601"),n.e("1044"),n.e("379")]).then(n.bind(n,8278))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>n.e("6106").then(n.bind(n,5777))},{id:"css",name:"CSS",import:()=>n.e("5466").then(n.bind(n,2593))},{id:"csv",name:"CSV",import:()=>n.e("8861").then(n.bind(n,7948))},{id:"cue",name:"CUE",import:()=>n.e("5542").then(n.bind(n,3781))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>n.e("4994").then(n.bind(n,8585))},{id:"d",name:"D",import:()=>n.e("4445").then(n.bind(n,7916))},{id:"dart",name:"Dart",import:()=>n.e("5596").then(n.bind(n,2055))},{id:"dax",name:"DAX",import:()=>n.e("3712").then(n.bind(n,2355))},{id:"desktop",name:"Desktop",import:()=>n.e("9285").then(n.bind(n,1892))},{id:"diff",name:"Diff",import:()=>n.e("1050").then(n.bind(n,8257))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>n.e("233").then(n.bind(n,5536))},{id:"dotenv",name:"dotEnv",import:()=>n.e("8767").then(n.bind(n,210))},{id:"dream-maker",name:"Dream Maker",import:()=>n.e("8095").then(n.bind(n,5906))},{id:"edge",name:"Edge",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("616")]).then(n.bind(n,7899))},{id:"elixir",name:"Elixir",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("8346")]).then(n.bind(n,7745))},{id:"elm",name:"Elm",import:()=>Promise.all([n.e("9048"),n.e("5661")]).then(n.bind(n,4764))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>n.e("8295").then(n.bind(n,8826))},{id:"erb",name:"ERB",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("8349"),n.e("5294")]).then(n.bind(n,1005))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([n.e("6380"),n.e("7454")]).then(n.bind(n,5357))},{id:"fennel",name:"Fennel",import:()=>n.e("4613").then(n.bind(n,9908))},{id:"fish",name:"Fish",import:()=>n.e("3123").then(n.bind(n,702))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>n.e("2067").then(n.bind(n,3758))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([n.e("1045"),n.e("4447")]).then(n.bind(n,4370))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>n.e("1045").then(n.bind(n,2420))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([n.e("6380"),n.e("855")]).then(n.bind(n,9386))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>Promise.all([n.e("1297"),n.e("5530")]).then(n.bind(n,1953))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>n.e("1297").then(n.bind(n,7480))},{id:"gdshader",name:"GDShader",import:()=>n.e("3323").then(n.bind(n,9494))},{id:"genie",name:"Genie",import:()=>n.e("1565").then(n.bind(n,4108))},{id:"gherkin",name:"Gherkin",import:()=>n.e("2707").then(n.bind(n,7918))},{id:"git-commit",name:"Git Commit Message",import:()=>n.e("8115").then(n.bind(n,5326))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([n.e("1044"),n.e("7662")]).then(n.bind(n,6477))},{id:"gleam",name:"Gleam",import:()=>n.e("7113").then(n.bind(n,7856))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9120")]).then(n.bind(n,2963))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("6226")]).then(n.bind(n,5545))},{id:"glsl",name:"GLSL",import:()=>Promise.all([n.e("9048"),n.e("3945")]).then(n.bind(n,9552))},{id:"gn",name:"GN",import:()=>n.e("5280").then(n.bind(n,6099))},{id:"gnuplot",name:"Gnuplot",import:()=>n.e("198").then(n.bind(n,1365))},{id:"go",name:"Go",import:()=>n.e("7655").then(n.bind(n,5498))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([n.e("7858"),n.e("1274"),n.e("8250"),n.e("3008"),n.e("1852")]).then(n.bind(n,1047))},{id:"groovy",name:"Groovy",import:()=>n.e("8375").then(n.bind(n,4922))},{id:"hack",name:"Hack",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("8601"),n.e("2816")]).then(n.bind(n,83))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("9467")]).then(n.bind(n,7942))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("4025")]).then(n.bind(n,1792))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>n.e("5917").then(n.bind(n,2028))},{id:"haxe",name:"Haxe",import:()=>n.e("4145").then(n.bind(n,4232))},{id:"hcl",name:"HashiCorp HCL",import:()=>n.e("6122").then(n.bind(n,1489))},{id:"hjson",name:"Hjson",import:()=>n.e("7143").then(n.bind(n,3162))},{id:"hlsl",name:"HLSL",import:()=>n.e("3474").then(n.bind(n,8281))},{id:"html",name:"HTML",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844")]).then(n.bind(n,4735))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("5712")]).then(n.bind(n,9251))},{id:"http",name:"HTTP",import:()=>Promise.all([n.e("7858"),n.e("1274"),n.e("9109"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("5813")]).then(n.bind(n,9972))},{id:"hurl",name:"Hurl",import:()=>Promise.all([n.e("7858"),n.e("1274"),n.e("9109"),n.e("8250"),n.e("3008"),n.e("1852"),n.e("5708")]).then(n.bind(n,647))},{id:"hxml",name:"HXML",import:()=>Promise.all([n.e("4145"),n.e("3520")]).then(n.bind(n,4595))},{id:"hy",name:"Hy",import:()=>n.e("8286").then(n.bind(n,5517))},{id:"imba",name:"Imba",import:()=>n.e("9770").then(n.bind(n,769))},{id:"ini",name:"INI",aliases:["properties"],import:()=>n.e("6883").then(n.bind(n,4094))},{id:"java",name:"Java",import:()=>n.e("9109").then(n.bind(n,9524))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>n.e("7858").then(n.bind(n,5065))},{id:"jinja",name:"Jinja",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1348")]).then(n.bind(n,7407))},{id:"jison",name:"Jison",import:()=>Promise.all([n.e("7858"),n.e("2202")]).then(n.bind(n,4833))},{id:"json",name:"JSON",import:()=>n.e("6563").then(n.bind(n,4190))},{id:"json5",name:"JSON5",import:()=>n.e("3432").then(n.bind(n,4283))},{id:"jsonc",name:"JSON with Comments",import:()=>n.e("4798").then(n.bind(n,2621))},{id:"jsonl",name:"JSON Lines",import:()=>n.e("9927").then(n.bind(n,4682))},{id:"jsonnet",name:"Jsonnet",import:()=>n.e("9940").then(n.bind(n,8799))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>n.e("5970").then(n.bind(n,2345))},{id:"jsx",name:"JSX",import:()=>n.e("3008").then(n.bind(n,8755))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([n.e("7858"),n.e("9048"),n.e("8601"),n.e("2082"),n.e("1875"),n.e("9328"),n.e("5631")]).then(n.bind(n,9795))},{id:"just",name:"Just",aliases:["justfile"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("1875"),n.e("8349"),n.e("9060"),n.e("9663")]).then(n.bind(n,6530))},{id:"kdl",name:"KDL",import:()=>n.e("7880").then(n.bind(n,1243))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>n.e("544").then(n.bind(n,9459))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>n.e("5393").then(n.bind(n,8344))},{id:"latex",name:"LaTeX",import:()=>n.e("4525").then(n.bind(n,9628))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>n.e("7921").then(n.bind(n,4888))},{id:"less",name:"Less",import:()=>n.e("1064").then(n.bind(n,5819))},{id:"liquid",name:"Liquid",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("109")]).then(n.bind(n,6380))},{id:"llvm",name:"LLVM IR",import:()=>n.e("1216").then(n.bind(n,7619))},{id:"log",name:"Log file",import:()=>n.e("8447").then(n.bind(n,5394))},{id:"logo",name:"Logo",import:()=>n.e("7950").then(n.bind(n,3341))},{id:"lua",name:"Lua",import:()=>Promise.all([n.e("9048"),n.e("4179")]).then(n.bind(n,8974))},{id:"luau",name:"Luau",import:()=>n.e("2536").then(n.bind(n,571))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>n.e("8943").then(n.bind(n,5202))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>n.e("6380").then(n.bind(n,8311))},{id:"marko",name:"Marko",import:()=>Promise.all([n.e("5466"),n.e("1274"),n.e("4489"),n.e("1064"),n.e("6427")]).then(n.bind(n,2982))},{id:"matlab",name:"MATLAB",import:()=>n.e("2748").then(n.bind(n,9991))},{id:"mdc",name:"MDC",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("6380"),n.e("6231")]).then(n.bind(n,2138))},{id:"mdx",name:"MDX",import:()=>n.e("4058").then(n.bind(n,5393))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>n.e("1446").then(n.bind(n,8757))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>n.e("8799").then(n.bind(n,2146))},{id:"mojo",name:"Mojo",import:()=>n.e("8178").then(n.bind(n,6025))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>n.e("4261").then(n.bind(n,7876))},{id:"move",name:"Move",import:()=>n.e("7404").then(n.bind(n,6007))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>n.e("485").then(n.bind(n,5540))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>n.e("96").then(n.bind(n,5043))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:()=>n.e("655").then(n.bind(n,2130))},{id:"nginx",name:"Nginx",import:()=>Promise.all([n.e("9048"),n.e("3121")]).then(n.bind(n,3848))},{id:"nim",name:"Nim",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("9048"),n.e("6380"),n.e("2881"),n.e("2227")]).then(n.bind(n,88))},{id:"nix",name:"Nix",import:()=>n.e("3115").then(n.bind(n,3222))},{id:"nsis",name:"NSIS",import:()=>n.e("1558").then(n.bind(n,2373))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>n.e("1284").then(n.bind(n,9935))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>n.e("7234").then(n.bind(n,7401))},{id:"objective-cpp",name:"Objective-C++",import:()=>n.e("8698").then(n.bind(n,9793))},{id:"ocaml",name:"OCaml",import:()=>n.e("1473").then(n.bind(n,4984))},{id:"odin",name:"Odin",import:()=>n.e("6829").then(n.bind(n,572))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>n.e("5462").then(n.bind(n,4997))},{id:"org",name:"Org Markup",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("1875"),n.e("8349"),n.e("6380"),n.e("4489"),n.e("1064"),n.e("193"),n.e("6106"),n.e("7655"),n.e("9060"),n.e("7234"),n.e("4525"),n.e("7454"),n.e("3707"),n.e("4049"),n.e("8375"),n.e("1473"),n.e("2881"),n.e("2247")]).then(n.bind(n,8666))},{id:"pascal",name:"Pascal",import:()=>n.e("4705").then(n.bind(n,2360))},{id:"perl",name:"Perl",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("8601"),n.e("9060"),n.e("6468")]).then(n.bind(n,4959))},{id:"php",name:"PHP",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9109"),n.e("8601"),n.e("193"),n.e("4087")]).then(n.bind(n,2408))},{id:"pkl",name:"Pkl",import:()=>n.e("2426").then(n.bind(n,641))},{id:"plsql",name:"PL/SQL",import:()=>n.e("6157").then(n.bind(n,8684))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>n.e("6739").then(n.bind(n,3571))},{id:"polar",name:"Polar",import:()=>n.e("2605").then(n.bind(n,3484))},{id:"postcss",name:"PostCSS",import:()=>n.e("7992").then(n.bind(n,363))},{id:"powerquery",name:"PowerQuery",import:()=>n.e("7698").then(n.bind(n,137))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:()=>n.e("452").then(n.bind(n,5503))},{id:"prisma",name:"Prisma",import:()=>n.e("4609").then(n.bind(n,840))},{id:"prolog",name:"Prolog",import:()=>n.e("702").then(n.bind(n,9341))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>n.e("6959").then(n.bind(n,2002))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("9597")]).then(n.bind(n,1196))},{id:"puppet",name:"Puppet",import:()=>n.e("5703").then(n.bind(n,7562))},{id:"purescript",name:"PureScript",import:()=>n.e("5068").then(n.bind(n,5047))},{id:"python",name:"Python",aliases:["py"],import:()=>n.e("1875").then(n.bind(n,2510))},{id:"qml",name:"QML",import:()=>Promise.all([n.e("7858"),n.e("703")]).then(n.bind(n,226))},{id:"qmldir",name:"QML Directory",import:()=>n.e("4796").then(n.bind(n,5207))},{id:"qss",name:"Qt Style Sheets",import:()=>n.e("7372").then(n.bind(n,8903))},{id:"r",name:"R",import:()=>n.e("8012").then(n.bind(n,3554))},{id:"racket",name:"Racket",import:()=>n.e("575").then(n.bind(n,9618))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>n.e("940").then(n.bind(n,8759))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("6106"),n.e("6309")]).then(n.bind(n,3908))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:()=>n.e("7620").then(n.bind(n,335))},{id:"reg",name:"Windows Registry Script",import:()=>n.e("8439").then(n.bind(n,4330))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>n.e("6956").then(n.bind(n,9255))},{id:"rel",name:"Rel",import:()=>n.e("3370").then(n.bind(n,3409))},{id:"riscv",name:"RISC-V",import:()=>n.e("8014").then(n.bind(n,45))},{id:"ron",name:"RON",import:()=>n.e("6378").then(n.bind(n,2849))},{id:"rosmsg",name:"ROS Interface",import:()=>n.e("6308").then(n.bind(n,1967))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("1875"),n.e("8349"),n.e("6084")]).then(n.bind(n,3935))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("8349")]).then(n.bind(n,8972))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>n.e("231").then(n.bind(n,5466))},{id:"sas",name:"SAS",import:()=>Promise.all([n.e("8601"),n.e("9172")]).then(n.bind(n,1551))},{id:"sass",name:"Sass",import:()=>n.e("7403").then(n.bind(n,1318))},{id:"scala",name:"Scala",import:()=>n.e("3707").then(n.bind(n,8038))},{id:"scheme",name:"Scheme",import:()=>n.e("4498").then(n.bind(n,9449))},{id:"scss",name:"SCSS",import:()=>Promise.all([n.e("5466"),n.e("4489")]).then(n.bind(n,7136))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>n.e("3384").then(n.bind(n,8731))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>n.e("4885").then(n.bind(n,9764))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>n.e("1044").then(n.bind(n,1215))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([n.e("1044"),n.e("1495")]).then(n.bind(n,5066))},{id:"smalltalk",name:"GNU Smalltalk",import:()=>n.e("312").then(n.bind(n,155))},{id:"smithy",name:"Smithy",import:()=>n.e("7827").then(n.bind(n,1006))},{id:"solidity",name:"Solidity",import:()=>n.e("2872").then(n.bind(n,1147))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("2948")]).then(n.bind(n,879))},{id:"sparql",name:"SPARQL",import:()=>n.e("6024").then(n.bind(n,9259))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>n.e("8306").then(n.bind(n,9145))},{id:"sql",name:"SQL",import:()=>n.e("8601").then(n.bind(n,1120))},{id:"ssh-config",name:"SSH Config",import:()=>n.e("7342").then(n.bind(n,6077))},{id:"stata",name:"Stata",import:()=>Promise.all([n.e("8601"),n.e("7104")]).then(n.bind(n,8227))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>n.e("3339").then(n.bind(n,886))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>Promise.all([n.e("7858"),n.e("9842")]).then(n.bind(n,633))},{id:"svelte",name:"Svelte",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("1274"),n.e("4458")]).then(n.bind(n,657))},{id:"swift",name:"Swift",import:()=>n.e("438").then(n.bind(n,5605))},{id:"system-verilog",name:"SystemVerilog",import:()=>n.e("7387").then(n.bind(n,4214))},{id:"systemd",name:"Systemd Units",import:()=>n.e("6254").then(n.bind(n,5389))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>n.e("234").then(n.bind(n,2321))},{id:"tasl",name:"Tasl",import:()=>n.e("3793").then(n.bind(n,7096))},{id:"tcl",name:"Tcl",import:()=>n.e("5281").then(n.bind(n,8365))},{id:"templ",name:"Templ",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("7655"),n.e("459")]).then(n.bind(n,582))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>n.e("8725").then(n.bind(n,1124))},{id:"tex",name:"TeX",import:()=>n.e("3724").then(n.bind(n,2423))},{id:"toml",name:"TOML",import:()=>n.e("9297").then(n.bind(n,7176))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("331")]).then(n.bind(n,2918))},{id:"tsv",name:"TSV",import:()=>n.e("9556").then(n.bind(n,1327))},{id:"tsx",name:"TSX",import:()=>n.e("8250").then(n.bind(n,4609))},{id:"turtle",name:"Turtle",import:()=>n.e("6551").then(n.bind(n,8650))},{id:"twig",name:"Twig",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("1875"),n.e("8349"),n.e("4489"),n.e("193"),n.e("1972")]).then(n.bind(n,1775))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>n.e("1274").then(n.bind(n,2449))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>n.e("8134").then(n.bind(n,8565))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("9109"),n.e("9048"),n.e("8601"),n.e("8250"),n.e("1044"),n.e("3008"),n.e("1852"),n.e("2082"),n.e("1875"),n.e("8349"),n.e("6380"),n.e("4489"),n.e("1064"),n.e("193"),n.e("6106"),n.e("7655"),n.e("9060"),n.e("7234"),n.e("4525"),n.e("7454"),n.e("3707"),n.e("4049"),n.e("8375"),n.e("438"),n.e("9328"),n.e("7387"),n.e("855"),n.e("1972"),n.e("452"),n.e("4795")]).then(n.bind(n,6614))},{id:"v",name:"V",import:()=>n.e("8531").then(n.bind(n,7502))},{id:"vala",name:"Vala",import:()=>n.e("6855").then(n.bind(n,9242))},{id:"vb",name:"Visual Basic",import:()=>n.e("877").then(n.bind(n,4908))},{id:"verilog",name:"Verilog",import:()=>n.e("7091").then(n.bind(n,5694))},{id:"vhdl",name:"VHDL",import:()=>n.e("9403").then(n.bind(n,9398))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>n.e("3809").then(n.bind(n,3128))},{id:"vue",name:"Vue",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("3844"),n.e("1274"),n.e("1337")]).then(n.bind(n,256))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([n.e("7858"),n.e("4655")]).then(n.bind(n,2290))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([n.e("7858"),n.e("5466"),n.e("4489"),n.e("1064"),n.e("3339"),n.e("670")]).then(n.bind(n,1917))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>n.e("4785").then(n.bind(n,4776))},{id:"wasm",name:"WebAssembly",import:()=>n.e("1981").then(n.bind(n,4444))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>n.e("5415").then(n.bind(n,2541))},{id:"wgsl",name:"WGSL",import:()=>n.e("7228").then(n.bind(n,6551))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>n.e("6766").then(n.bind(n,1165))},{id:"wit",name:"WebAssembly Interface Types",import:()=>n.e("2725").then(n.bind(n,1236))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>n.e("5865").then(n.bind(n,2784))},{id:"xml",name:"XML",import:()=>Promise.all([n.e("9109"),n.e("1706")]).then(n.bind(n,9135))},{id:"xsl",name:"XSL",import:()=>Promise.all([n.e("9109"),n.e("2378")]).then(n.bind(n,1425))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>n.e("826").then(n.bind(n,7729))},{id:"zenscript",name:"ZenScript",import:()=>n.e("8387").then(n.bind(n,7886))},{id:"zig",name:"Zig",import:()=>n.e("9619").then(n.bind(n,2174))}],n8=Object.fromEntries(n1.map(e=>[e.id,e.import])),n2=Object.fromEntries(n1.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),n5={...n8,...n2};async function n6(e){if(n0())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=nX.get(e);if(null!=t)return t;try{let t=nQ.get(e);if(null==t&&Object.prototype.hasOwnProperty.call(n5,e)&&(t=n5[e]),null==t)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return nK.has(e)||nK.set(e,n),n});return nX.set(e,n),await n}finally{nX.delete(e)}}function n4(e){return null!==e&&"object"==typeof e&&"default"in e?e.default:e}var n7=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},n3=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},n9=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};let ie=function(){let e=new Map,t=new Map,n=new Map,i=0;function r(r){let o=t.get(r);if(void 0!==o)return Promise.resolve(o);let a=n.get(r);if(void 0!==a)return a;let l=e.get(r);if(void 0===l)return Promise.reject(new n3(r));let s=i,d=l().then(e=>{let o=n4(e);return s===i&&t.set(r,o),n.get(r)===d&&n.delete(r),o}).catch(e=>{throw n.get(r)===d&&n.delete(r),e});return n.set(r,d),d}function o(e,n){t.set(e,n)}return{clearResolvedThemes:function(){i++,t.clear(),n.clear()},getResolvedOrResolveTheme:function(e){let n=t.get(e);return void 0!==n?n:r(e)},getResolvedTheme:function(e){return t.get(e)},getResolvedThemes:function(e){let n=[];for(let i of e){let e=t.get(i);if(void 0===e)throw new n9(i);n.push(e)}return n},hasRegisteredTheme:function(t){return e.has(t)},hasResolvedTheme:function(e){return t.has(e)},hasResolvedThemes:function(e){for(let n of e)if(!t.has(n))return!1;return!0},registerTheme:function(t,n){if(e.has(t))throw new n7(t);e.set(t,n)},registerThemeIfAbsent:function(t,n){return!e.has(t)&&(e.set(t,n),!0)},resolveTheme:r,resolveThemes:function(e){return Promise.all(e.map(e=>r(e)))},seedResolvedTheme:o,seedResolvedThemes:function(e){for(let[t,n]of e)o(t,n)}}}(),it=new Set;function ii(e,t){for(let n of e=Array.isArray(e)?e:[e]){let e;if("string"==typeof n){if(null==(e=ie.getResolvedTheme(n)))throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,null==ie.getResolvedTheme(n)&&ie.seedResolvedTheme(n,e);it.has(n)||(it.add(n),t.loadThemeSync(e))}}function ir(e){var t,n,i;let r=[],o=new Set;for(let a of io(n=t=e.themes)||"string"==typeof(i=n).name&&"function"==typeof i.load?[t]:t)for(let e of io(a)?a.getThemes():[a]){if(o.has(e.name))throw Error(`Theme collection already contains theme "${e.name}"`);o.add(e.name),r.push(e)}let a=Object.freeze([...r]),l=Object.freeze(a.filter(e=>"light"===e.colorScheme)),s=Object.freeze(a.filter(e=>"dark"===e.colorScheme)),d=new Map(a.map(e=>[e.name,e])),u=Object.freeze(a.map(e=>e.name)),h=Object.freeze(l.map(e=>e.name)),c=Object.freeze(s.map(e=>e.name));function f(e){if(null==e)return a;let{colorScheme:t,collection:n}=e;return null==n?"light"===t?l:"dark"===t?s:a:a.filter(e=>e.collection===n&&(null==t||e.colorScheme===t))}return{getTheme:e=>d.get(e),getThemes:e=>f(e),getThemeNames:e=>e?.collection==null?e?.colorScheme==="light"?h:e?.colorScheme==="dark"?c:u:f(e).map(e=>e.name),hasTheme:e=>d.has(e),orderBy:e=>ir({themes:a.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let i=e(t.descriptor,n.descriptor);return 0!==i?i:t.index-n.index}).map(e=>e.descriptor)}),pick(e){let t=[],n=new Set;for(let i of e){if(n.has(i))throw Error(`Theme collection pick already includes theme "${i}"`);n.add(i);let e=d.get(i);if(null==e)throw Error(`Theme collection does not contain theme "${i}"`);t.push(e)}return ir({themes:t})},registerInto(e){for(let t of a)e.registerThemeIfAbsent(t.name,t.load)}}}function io(e){return"function"==typeof e.getThemes}var ia=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function il(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}var is=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,id=class{static hasCaptures(e){return null!==e&&(is.lastIndex=0,is.test(e))}static replaceCaptures(e,t,n){return e.replace(is,(e,i,r,o)=>{let a=n[parseInt(i||r,10)];if(!a)return e;{let e=t.substring(a.start,a.end);for(;"."===e[0];)e=e.substring(1);switch(o){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function iu(e,t){if(null===e&&null===t)return 0;if(!e)return -1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){var r,o;let n=(r=e[i],r<(o=t[i])?-1:+(r>o));if(0!==n)return n}return 0}return n-i}function ih(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ic(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ip=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},im=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,o=t[e];if(!o.settings)continue;if("string"==typeof o.scope){let e=o.scope;r=(e=(e=e.replace(/^[,]+/,"")).replace(/[,]+$/,"")).split(",")}else r=Array.isArray(o.scope)?o.scope:[""];let a=-1;if("string"==typeof o.settings.fontStyle){a=0;let e=o.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++)switch(e[t]){case"italic":a|=1;break;case"bold":a|=2;break;case"underline":a|=4;break;case"strikethrough":a|=8}}let l=null;"string"==typeof o.settings.foreground&&ih(o.settings.foreground)&&(l=o.settings.foreground);let s=null;"string"==typeof o.settings.background&&ih(o.settings.background)&&(s=o.settings.background);for(let t=0,o=r.length;t<o;t++){let o=r[t].trim().split(" "),d=o[o.length-1],u=null;o.length>1&&(u=o.slice(0,o.length-1)).reverse(),n[i++]=new iy(d,u,e,a,l,s)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{var n,i;let r=(n=e.scope,n<(i=t.scope)?-1:+(n>i));return 0!==r||0!==(r=iu(e.parentScopes,t.parentScopes))?r:e.index-t.index});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let o=new ik(t),a=new ib(n,o.getId(i),o.getId(r)),l=new ix(new iC(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];l.insert(0,n.scope,n.parentScopes,n.fontStyle,o.getId(n.foreground),o.getId(n.background))}return new im(o,a,l)}(e,t)}_cachedMatchRoot=new ip(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>(function(e,t){if(0===t.length)return!0;for(let r=0;r<t.length;r++){var n,i;let o=t[r],a=!1;if(">"===o){if(r===t.length-1)return!1;o=t[++r],a=!0}for(;e&&(n=e.scopeName,!((i=o)===n||n.startsWith(i)&&"."===n[i.length]));){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0})(e.parent,t.parentScopes));return n?new ib(n.fontStyle,n.foreground,n.background):null}},ig=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}},ib=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},iy=class{constructor(e,t,n,i,r,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=o}},iv=((f=iv||{})[f.NotSet=-1]="NotSet",f[f.None=0]="None",f[f.Italic=1]="Italic",f[f.Bold=2]="Bold",f[f.Underline=4]="Underline",f[f.Strikethrough=8]="Strikethrough",f),ik=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},iS=Object.freeze([]),iC=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||iS,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},ix=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length)&&!(i>=t.parentScopes.length);){let r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,o,a){let l,s,d;if(""===n)return void this._doInsertHere(t,i,r,o,a);let u=n.indexOf(".");-1===u?(l=n,s=""):(l=n.substring(0,u),s=n.substring(u+1)),this._children.hasOwnProperty(l)?d=this._children[l]:(d=new e(this._mainRule.clone(),iC.cloneArr(this._rulesWithParentScopes)),this._children[l]=d),d.insert(t+1,s,i,r,o,a)}_doInsertHere(e,t,n,i,r){if(null===t)return void this._mainRule.acceptOverwrite(e,n,i,r);for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let a=this._rulesWithParentScopes[o];if(0===iu(a.parentScopes,t))return void a.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new iC(e,t,n,i,r))}},iw=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){let n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:e.getForeground(t),background:e.getBackground(t)})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return(1024&e)!=0}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(0xff8000&e)>>>15}static getBackground(e){return(0xff000000&e)>>>24}static set(t,n,i,r,o,a,l){let s=e.getLanguageId(t),d=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),h=e.getFontStyle(t),c=e.getForeground(t),f=e.getBackground(t);return 0!==n&&(s=n),8!==i&&(d=i),null!==r&&(u=+!!r),-1!==o&&(h=o),0!==a&&(c=a),0!==l&&(f=l),(s|d<<8|u<<10|h<<11|c<<15|f<<24)>>>0}};function iL(e,t){var n;let i,r,o=[],a=(n=e,r=(i=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(n),{next:()=>{if(!r)return null;let e=r[0];return r=i.exec(n),e}}),l=a.next();for(;null!==l;){let e=0;if(2===l.length&&":"===l.charAt(1)){switch(l.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${l} in scope selector`)}l=a.next()}let t=d();if(o.push({matcher:t,priority:e}),","!==l)break;l=a.next()}return o;function s(){if("-"===l){l=a.next();let e=s();return t=>!!e&&!e(t)}if("("===l){l=a.next();let e=function(){let e=[],t=d();for(;t&&(e.push(t),"|"===l||","===l);){do l=a.next();while("|"===l||","===l);t=d()}return t=>e.some(e=>e(t))}();return")"===l&&(l=a.next()),e}if(iA(l)){let e=[];do e.push(l),l=a.next();while(iA(l));return n=>t(e,n)}return null}function d(){let e=[],t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function iA(e){return!!e&&!!e.match(/[\w\.:]+/)}function iE(e){"function"==typeof e.dispose&&e.dispose()}var iP=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},iR=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},iT=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},i_=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new iP(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new iT;for(let n of e)!function(e,t,n,i){let r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof iP?iM({baseGrammar:o,selfGrammar:r},i):iN(e.ruleName,{baseGrammar:o,selfGrammar:r,repository:r.repository},i);let a=n.injections(e.scopeName);if(a)for(let e of a)i.add(new iP(e))}(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof iP){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function iN(e,t,n){t.repository&&t.repository[e]&&iI([t.repository[e]],t,n)}function iM(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&iI(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&iI(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function iI(e,t,n){for(let i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);let e=i.repository?il({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&iI(i.patterns,{...t,repository:e},n);let r=i.include;if(!r)continue;let o=iU(r);switch(o.kind){case 0:iM({...t,selfGrammar:t.baseGrammar},n);break;case 1:iM(t,n);break;case 2:iN(o.ruleName,{...t,repository:e},n);break;case 3:case 4:let a=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){let i={baseGrammar:t.baseGrammar,selfGrammar:a,repository:e};4===o.kind?iN(o.ruleName,i,n):iM(i,n)}else 4===o.kind?n.add(new iR(o.scopeName,o.ruleName)):n.add(new iP(o.scopeName))}}}var iD=class{kind=0},iH=class{kind=1},iO=class{constructor(e){this.ruleName=e}kind=2},iF=class{constructor(e){this.scopeName=e}kind=3},i$=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function iU(e){if("$base"===e)return new iD;if("$self"===e)return new iH;let t=e.indexOf("#");return -1===t?new iF(e):0===t?new iO(e.substring(1)):new i$(e.substring(0,t),e.substring(t+1))}var iz=/\\(\d+)/,iB=/\\(\d+)/g;Symbol("RuleId");var iG=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=id.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=id.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${function e(t){let n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(~n+1)}(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?id.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?id.replaceCaptures(this._contentName,e,t):this._contentName}},ij=class extends iG{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw Error("Not supported!")}compile(e,t){throw Error("Not supported!")}compileAG(e,t,n,i){throw Error("Not supported!")}},iW=class extends iG{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new iQ(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iJ,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},iV=class extends iG{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new iJ,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},iq=class extends iG{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,o,a,l,s,d){super(e,t,n,i),this._begin=new iQ(r,this.id),this.beginCaptures=o,this._end=new iQ(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=s||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){for(let t of(this._cachedCompiledPatterns=new iJ,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},iK=class extends iG{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,o,a,l,s){super(e,t,n,i),this._begin=new iQ(r,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new iQ(a,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns)for(let t of(this._cachedCompiledPatterns=new iJ,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new iJ,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},iX=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new ij(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new iW(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=il({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new iV(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new iK(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new iq(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let o=0;for(let e in t){if("$vscodeTextmateLocation"===e)continue;let t=parseInt(e,10);t>o&&(o=t)}for(let e=0;e<=o;e++)r[e]=null;for(let o in t){if("$vscodeTextmateLocation"===o)continue;let a=parseInt(o,10),l=0;t[o].patterns&&(l=e.getCompiledRuleId(t[o],n,i)),r[a]=e.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let o=0,a=t.length;o<a;o++){let a=t[o],l=-1;if(a.include){let t=iU(a.include);switch(t.kind){case 0:case 1:l=e.getCompiledRuleId(i[a.include],n,i);break;case 2:let r=i[t.ruleName];r&&(l=e.getCompiledRuleId(r,n,i));break;case 3:case 4:let o=t.scopeName,s=4===t.kind?t.ruleName:null,d=n.getExternalGrammar(o,i);if(d)if(s){let t=d.repository[s];t&&(l=e.getCompiledRuleId(t,n,d.repository))}else l=e.getCompiledRuleId(d.repository.$self,n,d.repository)}}else l=e.getCompiledRuleId(a,n,i);if(-1!==l){let e=n.getRule(l),t=!1;if((e instanceof iV||e instanceof iq||e instanceof iK)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(l)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},iQ=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let o=0;o<t;o++)if("\\"===e.charAt(o)&&o+1<t){const t=e.charAt(o+1);"z"===t?(i.push(e.substring(n,o)),i.push("$(?!\\n)(?<!\\n)"),n=o+2):("A"===t||"G"===t)&&(r=!0),o++}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=iz.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return iB.lastIndex=0,this.source.replace(iB,(e,t)=>ic(n[parseInt(t,10)]||""))}_buildAnchorCache(){let e,t,n,i;if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let r=[],o=[],a=[],l=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,o[e]=n,a[e]=n,l[e]=n,"\\"===n&&e+1<t&&("A"===(i=this.source.charAt(e+1))?(r[e+1]="￿",o[e+1]="￿",a[e+1]="A",l[e+1]="A"):"G"===i?(r[e+1]="￿",o[e+1]="G",a[e+1]="￿",l[e+1]="G"):(r[e+1]=i,o[e+1]=i,a[e+1]=i,l[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:o.join(""),A1_G0:a.join(""),A1_G1:l.join("")}}resolveAnchors(e,t){if(!this.hasAnchor||!this._anchorCache||"string"!=typeof this.source)return this.source;if(e)if(t)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;return t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},iJ=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new iY(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){if(!this._hasAnchors)return this.compile(e);if(t)if(n)return this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1;else return this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0;return n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0)}_resolveAnchors(e,t,n){return new iY(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},iY=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){let i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},iZ=class{constructor(e,t){this.languageId=e,this.tokenType=t}},i0=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new iZ(e,8),this._embeddedLanguagesMatcher=new i1(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new iZ(0,0);_getBasicScopeAttributes=new ip(e=>new iZ(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},i1=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>ic(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};"u">typeof process&&process.env.VSCODE_TEXTMATE_DEBUG;var i8=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function i2(e,t,n,i,r,o,a,l){let s=t.content.length,d=!1,u=-1;if(a){let a=function(e,t,n,i,r,o){let a=r.beginRuleCapturedEOL?0:-1,l=[];for(let t=r;t;t=t.pop()){let n=t.getRule(e);n instanceof iK&&l.push({rule:n,stack:t})}for(let f=l.pop();f;f=l.pop()){var s,d,u,h,c;let{ruleScanner:l,findOptions:p}=(s=f.rule,d=e,u=f.stack.endRule,h=n,c=i===a,{ruleScanner:s.compileWhileAG(d,u,h,c),findOptions:0}),m=l.findNextMatchSync(t,i,p);if(m){if(-2!==m.ruleId){r=f.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(o.produce(f.stack,m.captureIndices[0].start),i6(e,t,n,f.stack,o,f.rule.whileCaptures,m.captureIndices),o.produce(f.stack,m.captureIndices[0].end),a=m.captureIndices[0].end,m.captureIndices[0].end>i&&(i=m.captureIndices[0].end,n=!1))}else{r=f.stack.pop();break}}return{stack:r,linePos:i,anchorPosition:a,isFirstLine:n}}(e,t,n,i,r,o);r=a.stack,i=a.linePos,n=a.isFirstLine,u=a.anchorPosition}let h=Date.now();for(;!d;){if(0!==l&&Date.now()-h>l)return new i8(r,!0);!function(){let a=function(e,t,n,i,r,o){let a=function(e,t,n,i,r,o){let{ruleScanner:a,findOptions:l}=i5(r.getRule(e),e,r.endRule,n,i===o),s=a.findNextMatchSync(t,i,l);return s?{captureIndices:s.captureIndices,matchedRuleId:s.ruleId}:null}(e,t,n,i,r,o),l=e.getInjections();if(0===l.length)return a;let s=function(e,t,n,i,r,o,a){let l,s=Number.MAX_VALUE,d=null,u=0,h=o.contentNameScopesList.getScopeNames();for(let o=0,c=e.length;o<c;o++){let c=e[o];if(!c.matcher(h))continue;let{ruleScanner:f,findOptions:p}=i5(t.getRule(c.ruleId),t,null,i,r===a),m=f.findNextMatchSync(n,r,p);if(!m)continue;let g=m.captureIndices[0].start;if(!(g>=s)&&(s=g,d=m.captureIndices,l=m.ruleId,u=c.priority,s===r))break}return d?{priorityMatch:-1===u,captureIndices:d,matchedRuleId:l}:null}(l,e,t,n,i,r,o);if(!s)return a;if(!a)return s;let d=a.captureIndices[0].start,u=s.captureIndices[0].start;return u<d||s.priorityMatch&&u===d?s:a}(e,t,n,i,r,u);if(!a){o.produce(r,s),d=!0;return}let l=a.captureIndices,h=a.matchedRuleId,c=!!l&&l.length>0&&l[0].end>i;if(-1===h){let a=r.getRule(e);o.produce(r,l[0].start),r=r.withContentNameScopesList(r.nameScopesList),i6(e,t,n,r,o,a.endCaptures,l),o.produce(r,l[0].end);let h=r;if(r=r.parent,u=h.getAnchorPos(),!c&&h.getEnterPos()===i){r=h,o.produce(r,s),d=!0;return}}else{let a=e.getRule(h);o.produce(r,l[0].start);let f=r,p=a.getName(t.content,l),m=r.contentNameScopesList.pushAttributed(p,e);if(r=r.push(h,i,u,l[0].end===s,null,m,m),a instanceof iq){i6(e,t,n,r,o,a.beginCaptures,l),o.produce(r,l[0].end),u=l[0].end;let i=a.getContentName(t.content,l),h=m.pushAttributed(i,e);if(r=r.withContentNameScopesList(h),a.endHasBackReferences&&(r=r.withEndRule(a.getEndWithResolvedBackReferences(t.content,l))),!c&&f.hasSameRuleAs(r)){r=r.pop(),o.produce(r,s),d=!0;return}}else if(a instanceof iK){i6(e,t,n,r,o,a.beginCaptures,l),o.produce(r,l[0].end),u=l[0].end;let i=a.getContentName(t.content,l),h=m.pushAttributed(i,e);if(r=r.withContentNameScopesList(h),a.whileHasBackReferences&&(r=r.withEndRule(a.getWhileWithResolvedBackReferences(t.content,l))),!c&&f.hasSameRuleAs(r)){r=r.pop(),o.produce(r,s),d=!0;return}}else if(i6(e,t,n,r,o,a.captures,l),o.produce(r,l[0].end),r=r.pop(),!c){r=r.safePop(),o.produce(r,s),d=!0;return}}l[0].end>i&&(i=l[0].end,n=!1)}()}return new i8(r,!1)}function i5(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function i6(e,t,n,i,r,o,a){if(0===o.length)return;let l=t.content,s=Math.min(o.length,a.length),d=[],u=a[0].end;for(let t=0;t<s;t++){let s=o[t];if(null===s)continue;let h=a[t];if(0===h.length)continue;if(h.start>u)break;for(;d.length>0&&d[d.length-1].endPos<=h.start;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?r.produceFromScopes(d[d.length-1].scopes,h.start):r.produce(i,h.start),s.retokenizeCapturedWithRuleId){let t=s.getName(l,a),o=i.contentNameScopesList.pushAttributed(t,e),d=s.getContentName(l,a),u=o.pushAttributed(d,e),c=i.push(s.retokenizeCapturedWithRuleId,h.start,-1,!1,null,o,u),f=e.createOnigString(l.substring(0,h.end));i2(e,f,n&&0===h.start,h.start,c,r,!1,0),iE(f);continue}let c=s.getName(l,a);if(null!==c){let t=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(c,e);d.push(new i4(t,h.end))}}for(;d.length>0;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var i4=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function i7(e,t,n,i,r){let o=iL(t,i3),a=iX.getCompiledRuleId(n,i,r.repository);for(let n of o)e.push({debugSelector:t,matcher:n.matcher,ruleId:a,grammar:r,priority:n.priority})}function i3(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(function(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}(t[i],e))return n=i+1,!0;return!1})}var i9=class{constructor(e,t,n,i,r,o,a,l){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new i0(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=re(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r))for(const t of iL(e,i3))this._tokenTypeMatchers.push({matcher:t.matcher,type:r[e]})}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e=[],t=this._rootScopeName,n=({lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)}).lookup(t);if(n){let i=n.injections;if(i)for(let t in i)i7(e,t,i[t],this,n);let r=this._grammarRepository.injections(t);r&&r.forEach(t=>{let n=this.getExternalGrammar(t);if(n){let t=n.injectionSelector;t&&i7(e,t,n,this,n)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=re(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){let i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=iX.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==rn.NULL)r=!1,t.reset();else{let e;r=!0;let n=this._basicScopeAttributesProvider.getDefaultAttributes(),i=this.themeProvider.getDefaults(),o=iw.set(0,n.languageId,n.tokenType,null,i.fontStyle,i.foregroundId,i.backgroundId),a=this.getRule(this._rootId).getName(null,null);e=a?rt.createRootAndLookUpScopeName(a,o,this):rt.createRoot("unknown",o),t=new rn(null,this._rootId,-1,-1,!1,null,e,e)}e+="\n";let o=this.createOnigString(e),a=o.content.length,l=new rr(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),s=i2(this,o,r,0,t,l,!0,i);return iE(o),{lineLength:a,lineTokens:l,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function re(e,t){return(e=function e(t){return Array.isArray(t)?function(t){let n=[];for(let i=0,r=t.length;i<r;i++)n[i]=e(t[i]);return n}(t):t instanceof RegExp?t:"object"==typeof t?function(t){let n={};for(let i in t)n[i]=e(t[i]);return n}(t):t}(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var rt=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(let t of n)i=new e(i,r=ig.push(r,t.scopeNames),t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new ig(null,t),n)}static createRootAndLookUpScopeName(t,n,i){let r=i.getMetadataForScope(t),o=new ig(null,t),a=i.themeProvider.themeMatch(o),l=e.mergeAttributes(n,r,a);return new e(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,o=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,o=n.backgroundId),iw.set(e,t.languageId,t.tokenType,null,i,r,o)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);let i=t.split(/ /g),r=this;for(let t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){let r=i.getMetadataForScope(n),o=t.scopePath.push(n),a=i.themeProvider.themeMatch(o),l=e.mergeAttributes(t.tokenAttributes,r,a);return new e(t,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},rn=class e{constructor(e,t,n,i,r,o,a,l){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&rt.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,o,a,l){return new e(this,t,n,i,r,o,a,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let i=rt.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,rt.fromExtension(i,n.contentNameScopesList))}},ri=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):iL(e,i3).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>iL(e,i3).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},rr=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=iw.set(n,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}if(i&&(n=iw.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ro=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,new i9(e,o,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},ra=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ro(im.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(im.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ri(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){let o=new i_(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(e=>this._loadSingleGrammar(e.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},rl=rn.NULL;function rs(e,t){let n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(let[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function rd(e,t){return e&&t?.[e?.toLowerCase()]||e}async function ru(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function rh(e){return!e||["plaintext","txt","text","plain"].includes(e)}function rc(e){return"ansi"===e||rh(e)}function rf(e){return"none"===e}let rp=/(\r?\n)/g;function rm(e,t=!1){if(0===e.length)return[["",0]];let n=e.split(rp),i=0,r=[];for(let e=0;e<n.length;e+=2){let o=t?n[e]+(n[e+1]||""):n[e];r.push([o,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}let rg="__shiki_resolved";function rb(e){if(e?.[rg])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0,o=new Map;function a(e){if(o.has(e))return o.get(e);r+=1;let n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?a(e):(o.set(e,n),n)}for(let e of(t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;let r={...e,settings:{...e.settings}};if(n){let n=a(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){let n=a(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r}),Object.keys(t.colors||{})))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){let n=a(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,rg,{enumerable:!1,writable:!1,value:!0}),t}async function ry(e){return[...new Set((await Promise.all(e.filter(e=>!rc(e)).map(async e=>await ru(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function rv(e){return(await Promise.all(e.map(async e=>rf(e)?null:rb(await ru(e))))).filter(e=>!!e)}function rk(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new ia(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var rS=class extends ra{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=rb(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=im.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=rk(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>!!t&&(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new ia(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},rC=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let e=1;e<=t.length;e++){let i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let rx=0;async function rw(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,i]=await Promise.all([rv(e.themes||[]),ry(e.langs||[]),e.engine]);return function(e){let t;rx+=1,!1!==e.warnings&&rx>=10&&rx%10==0&&console.warn(`[Shiki] ${rx} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let n=!1;if(!e.engine)throw new ia("`engine` option is required for synchronous mode");let i=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(rb),o=new rS(new rC(e.engine,i),r,i,e.langAlias);function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();let t=o.getTheme(e);if(!t)throw new ia(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),o.loadLanguages(e.flat(1))}function s(...e){for(let t of(d(),e.flat(1)))o.loadTheme(t)}function d(){if(n)throw new ia("Shiki instance has been disposed")}function u(){n||(n=!0,o.dispose(),rx-=1)}return{setTheme:function(e){d();let n=a(e);return t!==e&&(o.setTheme(n),t=e),{theme:n,colorMap:o.getColorMap()}},getTheme:a,getLanguage:function(e){d();let t=o.getGrammar("string"==typeof e?e:e.name);if(!t)throw new ia(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),o.getLoadedThemes()},getLoadedLanguages:function(){return d(),o.getLoadedLanguages()},resolveLangAlias:function(t){return rk(t,e.langAlias)},loadLanguage:async function(...e){return l(await ry(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),s(await rv(e))},loadThemeSync:s,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:i})}let rL=new WeakMap;function rA(e,t){rL.set(e,t)}function rE(e){return rL.get(e)}var rP=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries((Array.isArray(n)?n:[n]).map(e=>[e,rl])),t)}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){var t;let n,i;return t=this._stacks[e],n=[],i=new Set,!function e(t){if(i.has(t))return;i.add(t);let r=t?.nameScopesList?.scopeName;r&&n.push(r),t.parent&&e(t.parent)}(t),n}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};let rR=/,/,rT=/ /;function r_(e,t,n={}){var i,r;let o,a,{theme:l=e.getLoadedThemes()[0]}=n;if(rh(e.resolveLangAlias(n.lang||"text"))||rf(l))return rm(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:s,colorMap:d}=e.setTheme(l),u=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==u.name)throw new ia(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${u.name}"`);if(!n.grammarState.themes.includes(s.name))throw new ia(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return a=new rP((o=rN(t,i=u,r=s,d,n)).stateStack,i.name,r.name),rA(o.tokens,a),o.tokens}function rN(e,t,n,i,r){let o=rs(n,r),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:l=500,includeExplanation:s=!1}=r,d=rm(e),u=r.grammarState?function(e,t){if(!(e instanceof rP))throw new ia("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??rl:null!=r.grammarContextCode?rN(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:rl,h=[],c=[];for(let e=0,r=d.length;e<r;e++){let r,f,[p,m]=d[e];if(""===p){h=[],c.push([]);continue}if(a>0&&p.length>=a){h=[],c.push([{content:p,offset:m,color:"",fontStyle:0}]);continue}s&&"tokenType"!==s&&(r=t.tokenizeLine(p,u,l).tokens,f=0);let g=t.tokenizeLine2(p,u,l),b=g.tokens.length/2;for(let e=0;e<b;e++){let t=g.tokens[2*e],a=e+1<b?g.tokens[2*e+2]:p.length;if(t===a)continue;let l=g.tokens[2*e+1],d=rd(i[iw.getForeground(l)],o),u=iw.getFontStyle(l),c={content:p.substring(t,a),offset:m+t,color:d,fontStyle:u};if("tokenType"===s)c.type=iw.getTokenType(l);else if(s){let e=[];if("scopeName"!==s)for(let t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(rR).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(rT))})}c.explanation=[];let i=0;for(;t+i<a;){let t=r[f],n=p.substring(t.startIndex,t.endIndex);i+=n.length,c.explanation.push({content:n,scopes:"scopeName"===s?t.scopes.map(e=>({scopeName:e})):function(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let r=t[i];n[i]={scopeName:r,themeMatches:function(e,t,n){let i=[];for(let{selectors:r,settings:o}of e)for(let e of r)if(function(e,t,n){if(!rM(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)rM(e[i],n[r])&&(i-=1),r-=1;return -1===i}(e,t,n)){i.push(o);break}return i}(e,r,t.slice(0,i))}}return n}(e,t.scopes)}),f+=1}}h.push(c)}c.push(h),h=[],u=g.ruleStack}return{tokens:c,stateStack:u}}function rM(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function rI(e,t,n,i=r_){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),o=r.map(r=>{let o=i(e,t,{...n,theme:r.theme});return{tokens:o,state:rE(o),theme:"string"==typeof r.theme?r.theme:r.theme.name}}),a=function(...e){let t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){let r=e.map(e=>e[i]),o=t.map(()=>[]);t.forEach((e,t)=>e.push(o[t]));let a=r.map(()=>0),l=r.map(e=>e[0]);for(;l.every(e=>e);){let e=Math.min(...l.map(e=>e.content.length));for(let t=0;t<n;t++){let n=l[t];n.content.length===e?(o[t].push(n),a[t]+=1,l[t]=r[t][a[t]]):(o[t].push({...n,content:n.content.slice(0,e)}),l[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...o.map(e=>e.tokens)),l=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:l,offset:s,...d}=e[t][i];o.variants[r[n].color]=d}),o})),s=o[0].state?new rP(Object.fromEntries(o.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),o[0].state.lang):void 0;return s&&rA(l,s),l}function rD({name:e,load:t,colorScheme:n,collection:i,displayName:r}){var o;return{name:e,colorScheme:n,collection:i,displayName:r,load:(o=t,async()=>rb(n4(await o())))}}let rH=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],rO=new Set(rH),rF={andromeeda:()=>n.e("6900").then(n.bind(n,9247)),"aurora-x":()=>n.e("8805").then(n.bind(n,8340)),"ayu-dark":()=>n.e("4992").then(n.bind(n,7875)),"ayu-light":()=>n.e("382").then(n.bind(n,2909)),"ayu-mirage":()=>n.e("4983").then(n.bind(n,3482)),"catppuccin-frappe":()=>n.e("6093").then(n.bind(n,5068)),"catppuccin-latte":()=>n.e("6729").then(n.bind(n,8496)),"catppuccin-macchiato":()=>n.e("3808").then(n.bind(n,4643)),"catppuccin-mocha":()=>n.e("5593").then(n.bind(n,2960)),"dark-plus":()=>n.e("1541").then(n.bind(n,6948)),dracula:()=>n.e("8336").then(n.bind(n,1075)),"dracula-soft":()=>n.e("465").then(n.bind(n,3832)),"everforest-dark":()=>n.e("590").then(n.bind(n,2285)),"everforest-light":()=>n.e("9412").then(n.bind(n,7359)),"github-dark":()=>n.e("2048").then(n.bind(n,6163)),"github-dark-default":()=>n.e("3260").then(n.bind(n,7175)),"github-dark-dimmed":()=>n.e("8437").then(n.bind(n,5268)),"github-dark-high-contrast":()=>n.e("3168").then(n.bind(n,7024)),"github-light":()=>n.e("1822").then(n.bind(n,5965)),"github-light-default":()=>n.e("5398").then(n.bind(n,661)),"github-light-high-contrast":()=>n.e("278").then(n.bind(n,2725)),"gruvbox-dark-hard":()=>n.e("9918").then(n.bind(n,4061)),"gruvbox-dark-medium":()=>n.e("5108").then(n.bind(n,911)),"gruvbox-dark-soft":()=>n.e("2743").then(n.bind(n,8010)),"gruvbox-light-hard":()=>n.e("9420").then(n.bind(n,7767)),"gruvbox-light-medium":()=>n.e("5678").then(n.bind(n,3741)),"gruvbox-light-soft":()=>n.e("197").then(n.bind(n,4164)),horizon:()=>n.e("333").then(n.bind(n,5980)),"horizon-bright":()=>n.e("7350").then(n.bind(n,9285)),houston:()=>n.e("2332").then(n.bind(n,7047)),"kanagawa-dragon":()=>n.e("6005").then(n.bind(n,196)),"kanagawa-lotus":()=>n.e("2895").then(n.bind(n,7570)),"kanagawa-wave":()=>n.e("5879").then(n.bind(n,781)),laserwave:()=>n.e("920").then(n.bind(n,7419)),"light-plus":()=>n.e("659").then(n.bind(n,2142)),"material-theme":()=>n.e("969").then(n.bind(n,3968)),"material-theme-darker":()=>n.e("3381").then(n.bind(n,1988)),"material-theme-lighter":()=>n.e("9695").then(n.bind(n,4482)),"material-theme-ocean":()=>n.e("9886").then(n.bind(n,13)),"material-theme-palenight":()=>n.e("3502").then(n.bind(n,9917)),"min-dark":()=>n.e("7015").then(n.bind(n,9418)),"min-light":()=>n.e("8671").then(n.bind(n,3426)),monokai:()=>n.e("2368").then(n.bind(n,8947)),"night-owl":()=>n.e("311").then(n.bind(n,4106)),"night-owl-light":()=>n.e("2234").then(n.bind(n,3169)),nord:()=>n.e("6629").then(n.bind(n,9460)),"one-dark-pro":()=>n.e("3853").then(n.bind(n,1804)),"one-light":()=>n.e("2411").then(n.bind(n,6886)),plastic:()=>n.e("1266").then(n.bind(n,2761)),poimandres:()=>n.e("5646").then(n.bind(n,5386)),red:()=>n.e("2185").then(n.bind(n,6608)),"rose-pine":()=>n.e("1942").then(n.bind(n,3394)),"rose-pine-dawn":()=>n.e("4429").then(n.bind(n,7756)),"rose-pine-moon":()=>n.e("698").then(n.bind(n,3569)),"slack-dark":()=>n.e("9279").then(n.bind(n,8178)),"slack-ochin":()=>n.e("7198").then(n.bind(n,4157)),"snazzy-light":()=>n.e("9502").then(n.bind(n,5082)),"solarized-dark":()=>n.e("6070").then(n.bind(n,629)),"solarized-light":()=>n.e("3420").then(n.bind(n,6583)),"synthwave-84":()=>n.e("4846").then(n.bind(n,925)),"tokyo-night":()=>n.e("1811").then(n.bind(n,2686)),vesper:()=>n.e("8173").then(n.bind(n,508)),"vitesse-black":()=>n.e("3663").then(n.bind(n,9218)),"vitesse-dark":()=>n.e("1506").then(n.bind(n,4809)),"vitesse-light":()=>n.e("9888").then(n.bind(n,5923))};function r$(e){return rD({name:e,collection:"shiki",colorScheme:rO.has(e)?"light":"dark",load:rF[e]})}let rU=ir({themes:Object.freeze([...rH.map(e=>r$(e)),...["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"].map(e=>r$(e))])});async function rz(e){!function(e){if(n0())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(ie.hasRegisteredTheme(e))return;let t=rU.getTheme(e);if(null!=t)return ie.registerThemeIfAbsent(t.name,t.load);throw Error(`No valid theme loader registered for "${e}"`)}(e);let t=await ie.resolveTheme(e);if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`);return t}var rB=Object.defineProperty,rG=Object.getOwnPropertyDescriptor,rj=Object.getOwnPropertyNames,rW=Object.prototype.hasOwnProperty,rV=(e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var r,o=rj(t),a=0,l=o.length;a<l;a++)r=o[a],rW.call(e,r)||r===n||rB(e,r,{get:(e=>t[e]).bind(null,r),enumerable:!(i=rG(t,r))||i.enumerable});return e},rq=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function rK(){return"u">typeof performance?performance.now():Date.now()}let rX=(e,t)=>e+(t-e%t)%t;async function rQ(e){let t,n,i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}let o="u">typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){let i=t+n,r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&o)return o.decode(e.subarray(t,r));let a="";for(;t<r;){let n=e[t++];if(!(128&n)){a+=String.fromCharCode(n);continue}let i=63&e[t++];if((224&n)==192){a+=String.fromCharCode((31&n)<<6|i);continue}let r=63&e[t++];if((n=(240&n)==224?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++])<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return a}(i.HEAPU8,e,t):""}let l={emscripten_get_now:rK,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){let o=i.HEAPU8.length;if((e>>>=0)>0x80000000)return!1;for(let i=1;i<=4;i*=2){let a=o*(1+.2/i);if(a=Math.min(a,e+0x6000000),function(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}(Math.min(0x80000000,rX(Math.max(e,a),65536))))return!0}return!1},fd_write:()=>0};async function s(){let n=await e({env:l,wasi_snapshot_preview1:l});r((t=n.memory).buffer),Object.assign(i,n),i.UTF8ToString=a}return await s(),i}var rJ=Object.defineProperty,rY=(e,t,n)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?rJ(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n};let rZ=null;class r0{constructor(e){rY(this,"utf16Length"),rY(this,"utf8Length"),rY(this,"utf16Value"),rY(this,"utf8Value"),rY(this,"utf16OffsetToUtf8"),rY(this,"utf8OffsetToUtf16");const t=e.length,n=r0._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const o=i?new Uint32Array(n+1):null;i&&(o[n]=t);const a=new Uint8Array(n);let l=0;for(let n=0;n<t;n++){const s=e.charCodeAt(n);let d=s,u=!1;if(s>=55296&&s<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(d=(s-55296<<10)+65536|t-56320,u=!0)}i&&(r[n]=l,u&&(r[n+1]=l),d<=127?o[l+0]=n:d<=2047?(o[l+0]=n,o[l+1]=n):d<=65535?(o[l+0]=n,o[l+1]=n,o[l+2]=n):(o[l+0]=n,o[l+1]=n,o[l+2]=n,o[l+3]=n)),d<=127?a[l++]=d:(d<=2047?a[l++]=192|(1984&d)>>>6:(d<=65535?a[l++]=224|(61440&d)>>>12:(a[l++]=240|(1835008&d)>>>18,a[l++]=128|(258048&d)>>>12),a[l++]=128|(4032&d)>>>6),a[l++]=128|(63&d)>>>0),u&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){let r=e.charCodeAt(n),o=r,a=!1;if(r>=55296&&r<=56319&&n+1<i){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(o=(r-55296<<10)+65536|t-56320,a=!0)}o<=127?t+=1:o<=2047?t+=2:o<=65535?t+=3:t+=4,a&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}let r1=class e{constructor(t){if(rY(this,"id",++e.LAST_ID),rY(this,"_onigBinding"),rY(this,"content"),rY(this,"utf16Length"),rY(this,"utf8Length"),rY(this,"utf16OffsetToUtf8"),rY(this,"utf8OffsetToUtf16"),rY(this,"ptr"),!rZ)throw new rq("Must invoke loadWasm first.");this._onigBinding=rZ,this.content=t;const n=new r0(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=rZ.omalloc(1e4)),e._sharedPtrInUse=!0,rZ.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(rZ)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};rY(r1,"LAST_ID",0),rY(r1,"_sharedPtr",0),rY(r1,"_sharedPtrInUse",!1);class r8{constructor(e){if(rY(this,"_onigBinding"),rY(this,"_ptr"),!rZ)throw new rq("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new r0(e[i]);t[i]=r.createString(rZ),n[i]=r.utf8Length}const i=rZ.omalloc(4*e.length);rZ.HEAPU32.set(t,i/4);const r=rZ.omalloc(4*e.length);rZ.HEAPU32.set(n,r/4);const o=rZ.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)rZ.ofree(t[n]);rZ.ofree(r),rZ.ofree(i),0===o&&function(e){throw new rq(e.UTF8ToString(e.getLastOnigError()))}(rZ),this._onigBinding=rZ,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new r1(e);let n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){let r=this._onigBinding,o=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===o)return null;let a=r.HEAPU32,l=o/4,s=a[l++],d=a[l++],u=[];for(let t=0;t<d;t++){let n=e.convertUtf8OffsetToUtf16(a[l++]),i=e.convertUtf8OffsetToUtf16(a[l++]);u[t]={start:n,end:i,length:i-n}}return{index:s,captureIndices:u}}}function r2(e){return o||(o=async function(){rZ=await rQ(async t=>{let n=e;if("function"==typeof(n=await n)&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator)n=await n.instantiator(t);else if("function"==typeof n.default)n=await n.default(t);else{var i,r,o,a;if(void 0!==n.data&&(n=n.data),i=n,"u">typeof Response&&i instanceof Response){n="function"==typeof WebAssembly.instantiateStreaming?await (o=n,e=>WebAssembly.instantiateStreaming(o,e))(t):await (a=n,async e=>{let t=await a.arrayBuffer();return WebAssembly.instantiate(t,e)})(t)}else(r=n,"u">typeof ArrayBuffer&&(r instanceof ArrayBuffer||ArrayBuffer.isView(r))||"u">typeof Buffer&&Buffer.isBuffer?.(r)||"u">typeof SharedArrayBuffer&&r instanceof SharedArrayBuffer||"u">typeof Uint32Array&&r instanceof Uint32Array||n instanceof WebAssembly.Module)?n=await r5(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await r5(n.default)(t))}return"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}())}function r5(e){return t=>WebAssembly.instantiate(e,t)}function r6(e){a=e}function r4(){return a}async function r7(e){return e&&await r2(e),{createScanner:e=>new r8(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new r1(e)}}var r3=((e,t)=>{let n={};for(var i in e)rB(n,i,{get:e[i],enumerable:!0});return t||rB(n,Symbol.toStringTag,{value:"Module"}),n})({});rV(r3,g,"default"),d&&rV(d,g,"default");let r9=Object.fromEntries([{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>n.e("6900").then(n.bind(n,9247))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>n.e("8805").then(n.bind(n,8340))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>n.e("4992").then(n.bind(n,7875))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>n.e("382").then(n.bind(n,2909))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>n.e("4983").then(n.bind(n,3482))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xe9",type:"dark",import:()=>n.e("6093").then(n.bind(n,5068))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>n.e("6729").then(n.bind(n,8496))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>n.e("3808").then(n.bind(n,4643))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>n.e("5593").then(n.bind(n,2960))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>n.e("1541").then(n.bind(n,6948))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>n.e("8336").then(n.bind(n,1075))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>n.e("465").then(n.bind(n,3832))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>n.e("590").then(n.bind(n,2285))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>n.e("9412").then(n.bind(n,7359))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>n.e("2048").then(n.bind(n,6163))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>n.e("3260").then(n.bind(n,7175))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>n.e("8437").then(n.bind(n,5268))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>n.e("3168").then(n.bind(n,7024))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>n.e("1822").then(n.bind(n,5965))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>n.e("5398").then(n.bind(n,661))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>n.e("278").then(n.bind(n,2725))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>n.e("9918").then(n.bind(n,4061))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>n.e("5108").then(n.bind(n,911))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>n.e("2743").then(n.bind(n,8010))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>n.e("9420").then(n.bind(n,7767))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>n.e("5678").then(n.bind(n,3741))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>n.e("197").then(n.bind(n,4164))},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>n.e("333").then(n.bind(n,5980))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:()=>n.e("7350").then(n.bind(n,9285))},{id:"houston",displayName:"Houston",type:"dark",import:()=>n.e("2332").then(n.bind(n,7047))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>n.e("6005").then(n.bind(n,196))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>n.e("2895").then(n.bind(n,7570))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>n.e("5879").then(n.bind(n,781))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>n.e("920").then(n.bind(n,7419))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>n.e("659").then(n.bind(n,2142))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>n.e("969").then(n.bind(n,3968))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>n.e("3381").then(n.bind(n,1988))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>n.e("9695").then(n.bind(n,4482))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>n.e("9886").then(n.bind(n,13))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>n.e("3502").then(n.bind(n,9917))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>n.e("7015").then(n.bind(n,9418))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>n.e("8671").then(n.bind(n,3426))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>n.e("2368").then(n.bind(n,8947))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>n.e("311").then(n.bind(n,4106))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>n.e("2234").then(n.bind(n,3169))},{id:"nord",displayName:"Nord",type:"dark",import:()=>n.e("6629").then(n.bind(n,9460))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>n.e("3853").then(n.bind(n,1804))},{id:"one-light",displayName:"One Light",type:"light",import:()=>n.e("2411").then(n.bind(n,6886))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>n.e("1266").then(n.bind(n,2761))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>n.e("5646").then(n.bind(n,5386))},{id:"red",displayName:"Red",type:"dark",import:()=>n.e("2185").then(n.bind(n,6608))},{id:"rose-pine",displayName:"Ros\xe9 Pine",type:"dark",import:()=>n.e("1942").then(n.bind(n,3394))},{id:"rose-pine-dawn",displayName:"Ros\xe9 Pine Dawn",type:"light",import:()=>n.e("4429").then(n.bind(n,7756))},{id:"rose-pine-moon",displayName:"Ros\xe9 Pine Moon",type:"dark",import:()=>n.e("698").then(n.bind(n,3569))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>n.e("9279").then(n.bind(n,8178))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>n.e("7198").then(n.bind(n,4157))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>n.e("9502").then(n.bind(n,5082))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>n.e("6070").then(n.bind(n,629))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>n.e("3420").then(n.bind(n,6583))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>n.e("4846").then(n.bind(n,925))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>n.e("1811").then(n.bind(n,2686))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>n.e("8173").then(n.bind(n,508))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>n.e("3663").then(n.bind(n,9218))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>n.e("1506").then(n.bind(n,4809))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>n.e("9888").then(n.bind(n,5923))}].map(e=>[e.id,e.import])),oe=/\s+/g;function ot(e,t){if(!t)return e;for(let n of(e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(oe)),Array.isArray(e.properties.class)||(e.properties.class=[]),Array.isArray(t)?t:t.split(oe)))n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}let on=["color","background-color"];function oi(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&iv.Italic&&(t["font-style"]="italic"),e.fontStyle&iv.Bold&&(t["font-weight"]="bold");let n=[];e.fontStyle&iv.Underline&&n.push("underline"),e.fontStyle&iv.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function or(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}let oo=[function(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){var n;let r,o={lines:r=rm(n=t.source,!0).map(([e])=>e),indexToPos:function(e){if(e===n.length)return{line:r.length-1,character:r.at(-1).length};let t=e,i=0;for(let e of r){if(t<e.length)break;t-=e.length,i++}return{line:i,character:t}},posToIndex:function(e,t){let n=0;for(let t=0;t<e;t++)n+=r[t].length;return n+t}};function i(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new ia(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...o.indexToPos(e),offset:e}}{let t=o.lines[e.line];if(void 0===t)throw new ia(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${o.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new ia(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:o.posToIndex(e.line,n)}}}let a=(t.options.decorations||[]).map(e=>({...e,start:i(e.start),end:i(e.end)}));(function(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new ia(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){let t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,o=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,a=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,l=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||o||a||l){if(r&&o||a&&l||a&&n.start.offset===n.end.offset||o&&t.start.offset===t.end.offset)continue;throw new ia(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}})(a),e.set(t.meta,{decorations:a,converter:o,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(this.options.decorations?.length){var n;let i;return(i=[...(n=t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))instanceof Set?n:new Set(n)].sort((e,t)=>e-t)).length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,n=function(e,t){let n=0,i=e.length;for(;n<i;){let r=n+(i-n>>1);e[r]<=t?n=r+1:i=r}return n}(i,e.offset),r=n;for(;r<i.length&&i[r]<t;)r++;if(n===r)return e;let o=i.slice(n,r);for(let t=0;t<o.length;t++)o[t]-=e.offset;let a=0,l=[];for(let t of o)t>a&&l.push({...e,content:e.content.slice(a,t),offset:e.offset+a}),a=t;return a<e.content.length&&l.push({...e,content:e.content.slice(a),offset:e.offset+a}),l})):e}},code(e){if(!this.options.decorations?.length)return;let n=t(this),i=[...e.children].filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new ia(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){let a=i[e],l="",s=-1,d=-1;if(0===t&&(s=0),0===n&&(d=0),n===1/0&&(d=a.children.length),-1===s||-1===d)for(let e=0;e<a.children.length;e++)l+=function e(t){return"text"===t.type?t.value:"element"===t.type?t.children.map(e).join(""):""}(a.children[e]),-1===s&&l.length===t&&(s=e+1),-1===d&&l.length===n&&(d=e+1);if(-1===s)throw new ia(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===d)throw new ia(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);let u=a.children.slice(s,d);if(r.alwaysWrap||u.length!==a.children.length)if(r.alwaysWrap||1!==u.length||"element"!==u[0].type){let e={type:"element",tagName:"span",properties:{},children:u};o(e,r,"wrapper"),a.children.splice(s,u.length,e)}else o(u[0],r,"token");else o(a,r,"line")}function o(e,t,n){let i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&ot(e,t.properties.class),e=r(e,n)||e}let a=[];for(let e of n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset)){let{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>{var t;i[t=r]=o(i[t],e,"line")});r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}()];function oa(e){let t=function(e){let t=[],n=[],i=[];for(let r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...oo]}var ol=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],os={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function od(e){let t=e.shift();if("2"===t){let t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){let t=e.shift();if(t)return{type:"table",index:Number(t)}}}var ou={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};let oh=/#([0-9a-f]{3,8})/i,oc=/var\((--[\w-]+-ansi-[\w-]+)\)/,of={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function op(e,t,n={}){let i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!rh(i)&&!rf(r)&&"ansi"===i){let i,o,a,l,s,d,u,{theme:h}=e.setTheme(r);return i=rs(h,n),o=rm(t),a=function(e=ou){let t;function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}return{value:function(i){switch(i.type){case"named":return e[i.name];case"rgb":return n(i.rgb);case"table":var r;return r=i.index,function(){if(t)return t;t=[];for(let n=0;n<ol.length;n++)t.push(e[ol[n]]);let i=[0,95,135,175,215,255];for(let e=0;e<6;e++)for(let r=0;r<6;r++)for(let o=0;o<6;o++)t.push(n([i[e],i[r],i[o]]));let r=8;for(let e=0;e<24;e++,r+=10)t.push(n([r,r,r]));return t}()[r]}}}}(Object.fromEntries(ol.map(e=>{let t=`terminal.ansi${e[0].toUpperCase()}${e.substring(1)}`;return[e,h.colors?.[t]||of[e]]}))),l=null,s=null,d=new Set,u={parse(e){let t=[],n=0;do{let i=function(e,t){let n=e.indexOf("\x1b",t);if(-1!==n&&"["===e[n+1]){let t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}(e,n),r=i.sequence?e.substring(n,i.startPosition):e.substring(n);if(r.length>0&&t.push({value:r,foreground:l,background:s,decorations:new Set(d)}),i.sequence){let e=function(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9)os[i]&&t.push({type:"setDecoration",value:os[i]});else if(i<=29){let e=os[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ol[i-30]}});else if(38===i){let n=od(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ol[i-40]}});else if(48===i){let n=od(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ol[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ol[i-100+8]}})}return t}(i.sequence);for(let t of e)"resetAll"===t.type?(l=null,s=null,d.clear()):"resetForegroundColor"===t.type?l=null:"resetBackgroundColor"===t.type?s=null:"resetDecoration"===t.type&&d.delete(t.value);for(let t of e)"setForegroundColor"===t.type?l=t.value:"setBackgroundColor"===t.type?s=t.value:"setDecoration"===t.type&&d.add(t.value)}n=i.position}while(n<e.length);return t}},o.map(e=>u.parse(e[0]).map(t=>{let n,r;t.decorations.has("reverse")?(n=t.background?a.value(t.background):h.bg,r=t.foreground?a.value(t.foreground):h.fg):(n=t.foreground?a.value(t.foreground):h.fg,r=t.background?a.value(t.background):void 0),n=rd(n,i),r=rd(r,i),t.decorations.has("dim")&&(n=function(e){let t=e.match(oh);if(t){let e=t[1];if(8===e.length){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${e.slice(0,6)}${t}`}if(6===e.length)return`#${e}80`;if(4===e.length){let t=e[0],n=e[1],i=e[2],r=e[3];return`#${t}${t}${n}${n}${i}${i}${Math.round(Number.parseInt(`${r}${r}`,16)/2).toString(16).padStart(2,"0")}`}else if(3===e.length){let t=e[0],n=e[1],i=e[2];return`#${t}${t}${n}${n}${i}${i}80`}}let n=e.match(oc);return n?`var(${n[1]}-dim)`:e}(n));let o=iv.None;return t.decorations.has("bold")&&(o|=iv.Bold),t.decorations.has("italic")&&(o|=iv.Italic),t.decorations.has("underline")&&(o|=iv.Underline),t.decorations.has("strikethrough")&&(o|=iv.Strikethrough),{content:t.value,offset:e[1],color:n,bgColor:r,fontStyle:o}}))}return r_(e,t,n)}function om(e,t,n){let i,r,o,a,l,s;if("themes"in n){let{defaultColor:d="light",cssVariablePrefix:u="--shiki-",colorsRendering:h="css-vars"}=n,c=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===d?-1:+(t.color===d));if(0===c.length)throw new ia("`themes` option must not be empty");let f=rI(e,t,n,op);if(s=rE(f),d&&"light-dark()"!==d&&!c.some(e=>e.color===d))throw new ia(`\`themes\` option must contain the defaultColor key \`${d}\``);let p=c.map(t=>e.getTheme(t.theme)),m=c.map(e=>e.color);o=f.map(e=>e.map(e=>(function(e,t,n,i,r="css-vars"){let o={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(t=>oi(e.variants[t])),l=new Set(a.flatMap(e=>Object.keys(e))),s={},d=(e,i)=>{let r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return a.forEach((e,n)=>{for(let o of l){let l=e[o]||"inherit";if(0===n&&i&&on.includes(o))if("light-dark()"===i&&a.length>1){let e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new ia('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=a[e][o]||"inherit",h=a[i][o]||"inherit";s[o]=`light-dark(${u}, ${h})`,"css-vars"===r&&(s[d(n,o)]=l)}else s[o]=l;else"css-vars"===r&&(s[d(n,o)]=l)}}),o.htmlStyle=s,o})(e,m,u,d,h))),s&&rA(o,s);let g=c.map(e=>rs(e.theme,n));r=og(c,p,g,u,d,"fg",h),i=og(c,p,g,u,d,"bg",h),a=`shiki-themes ${p.map(e=>e.name).join(" ")}`,l=d?void 0:[r,i].join(";")}else if("theme"in n){let l=rs(n.theme,n);o=op(e,t,n);let d=e.getTheme(n.theme);i=rd(d.bg,l),r=rd(d.fg,l),a=d.name,s=rE(o)}else throw new ia("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:i,themeName:a,rootStyle:l,grammarState:s}}function og(e,t,n,i,r,o,a){return e.map((l,s)=>{let d=rd(t[s][o],n[s])||"inherit",u=`${i+l.color}${"bg"===o?"-bg":""}:${d}`;if(0===s&&r){if("light-dark()"===r&&e.length>1){let i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new ia('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${rd(t[i][o],n[i])||"inherit"}, ${rd(t[r][o],n[r])||"inherit"});${u}`}return d}return"css-vars"===a?u:null}).filter(e=>!!e).join(";")}let ob=/^\s+$/,oy=/^(\s*)(.*?)(\s*)$/;function ov(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>ov(e,t,n),codeToTokens:(t,n)=>om(e,t,n)}){let r=t;for(let e of oa(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:o,fg:a,bg:l,themeName:s,rootStyle:d,grammarState:u}=om(e,r,n),{mergeWhitespaces:h=!0,mergeSameStyleTokens:c=!1}=n;!0===h?o=o.map(e=>{let t,n=[],i="";return e.forEach((r,o)=>{let a=!(r.fontStyle&&(r.fontStyle&iv.Underline||r.fontStyle&iv.Strikethrough));a&&ob.test(r.content)&&e[o+1]?(void 0===t&&(t=r.offset),i+=r.content):i?(a?n.push({...r,offset:t,content:i+r.content}):n.push({content:i,offset:t},r),t=void 0,i=""):n.push(r)}),n}):"never"===h&&(o=o.map(e=>e.flatMap(e=>{if(ob.test(e.content))return e;let t=e.content.match(oy);if(!t)return e;let[,n,i,r]=t;if(!n&&!r)return e;let o=[{...e,offset:e.offset+n.length,content:i}];return n&&o.unshift({content:n,offset:e.offset}),r&&o.push({content:r,offset:e.offset+n.length+i.length}),o}))),c&&(o=o.map(e=>{let t=[];for(let n of e){if(0===t.length){t.push({...n});continue}let e=t.at(-1),i=or(e.htmlStyle||oi(e)),r=or(n.htmlStyle||oi(n)),o=e.fontStyle&&(e.fontStyle&iv.Underline||e.fontStyle&iv.Strikethrough),a=n.fontStyle&&(n.fontStyle&iv.Underline||n.fontStyle&iv.Strikethrough);o||a||i!==r?t.push({...n}):e.content+=n.content}return t}));let f={...i,get source(){return r}};for(let e of oa(n))o=e.tokens?.call(f,o)||o;return function(e,t,n,i=rE(e)){let r=oa(t),o=[],a={type:"root",children:[]},{structure:l="classic",tabindex:s="0"}=t,d={class:`shiki ${t.themeName||""}`};for(let[e,n]of(!1!==t.rootStyle&&(null!=t.rootStyle?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),!1!==s&&null!=s&&(d.tabindex=s.toString()),Object.entries(t.meta||{})))e.startsWith("_")||(d[e]=n);let u={type:"element",tagName:"pre",properties:d,children:[],data:t.data},h={type:"element",tagName:"code",properties:{},children:o},c=[],f={...n,structure:l,addClassToHast:ot,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return h},get lines(){return c}};if(e.forEach((e,t)=>{t&&("inline"===l?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===l&&o.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(let o of e){let e={type:"element",tagName:"span",properties:{...o.htmlAttrs},children:[{type:"text",value:o.content}]},s=or(o.htmlStyle||oi(o));for(let a of(s&&(e.properties.style=s),r))e=a?.span?.call(f,e,t+1,i,n,o)||e;"inline"===l?a.children.push(e):"classic"===l&&n.children.push(e),i+=o.content.length}if("classic"===l){for(let e of r)n=e?.line?.call(f,n,t+1)||n;c.push(n),o.push(n)}else"inline"===l&&c.push(n)}),"classic"===l){for(let e of r)h=e?.code?.call(f,h)||h;for(let e of(u.children.push(h),r))u=e?.pre?.call(f,u)||u;a.children.push(u)}else if("inline"===l){let e=[],t={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let n of a.children)"element"===n.type&&"br"===n.tagName?(e.push(t),t={type:"element",tagName:"span",properties:{class:"line"},children:[]}):("element"===n.type||"text"===n.type)&&t.children.push(n);e.push(t);let n={type:"element",tagName:"code",properties:{},children:e};for(let e of r)n=e?.code?.call(f,n)||n;a.children=[];for(let e=0;e<n.children.length;e++){e>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});let t=n.children[e];"element"===t.type&&a.children.push(...t.children)}}let p=a;for(let e of r)p=e?.root?.call(f,p)||p;return i&&rA(p,i),p}(o,{...n,fg:a,bg:l,themeName:s,rootStyle:!1!==n.rootStyle&&(n.rootStyle??d)},f,u)}async function ok(e){let t=await rw(e);return{getLastGrammarState:(...e)=>(function(...e){if(2===e.length)return rE(e[1]);let[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(rh(r)||rf(o))throw new ia("Plain language does not have grammar state");if("ansi"===r)throw new ia("ANSI language does not have grammar state");let{theme:a,colorMap:l}=t.setTheme(o),s=t.getLanguage(r);return new rP(rN(n,s,a,l,i).stateStack,s.name,a.name)})(t,...e),codeToTokensBase:(e,n)=>op(t,e,n),codeToTokensWithThemes:(e,n)=>rI(t,e,n),codeToTokens:(e,n)=>om(t,e,n),codeToHast:(e,n)=>ov(t,e,n),codeToHtml:(e,n)=>(function(e,t,n){let i={meta:{},options:n,codeToHast:(t,n)=>ov(e,t,n),codeToTokens:(t,n)=>om(e,t,n)},r=no(ov(e,t,n,i));for(let e of oa(n))r=e.postprocess?.call(i,r,n)||r;return r})(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}let oS=(u=(p={langs:n5,themes:r9,engine:()=>(0,r3.createOnigurumaEngine)(n.e("4405").then(n.bind(n,5380)))}).langs,h=p.themes,c=p.engine,async function(e){function t(t){if("string"==typeof t){if(rc(t=e.langAlias?.[t]||t))return[];let n=u[t];if(!n)throw new ia(`Language \`${t}\` is not included in this bundle. You may want to load it from external source.`);return n}return t}function n(e){if(rf(e))return"none";if("string"==typeof e){let t=h[e];if(!t)throw new ia(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let i=(e.themes??[]).map(e=>n(e)),r=(e.langs??[]).map(e=>t(e)),o=await ok({engine:e.engine??c(),...e,themes:i,langs:r});return{...o,loadLanguage:(...e)=>o.loadLanguage(...e.map(t)),loadTheme:(...e)=>o.loadTheme(...e.map(n)),getBundledLanguages:()=>u,getBundledThemes:()=>h}});var oC=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:r}=t;if(!r)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=i?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=r(e);return i?.set(e,t),t}catch(t){if(i?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let i="string"==typeof e?e:e.content,r=[];function o(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:0xffffffff,end:0xffffffff,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let a=n.exec(i);if(!a)continue;if(a.index===t)return o(e,a,0);r.push([e,a,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(r.length){let e=Math.min(...r.map(e=>e[1].index));for(let[t,n,i]of r)if(n.index===e)return o(t,n,i)}return null}};function ox(e){if(1!=[...e].length)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}let ow=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),oL=String.raw;function oA(e,t){if(null==e)throw Error(t??"Value expected");return e}let oE=oL`\[\^?`,oP=`c.? | C(?:-.?)?|${oL`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${oL`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${oL`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${oL`o\{[^\}]*\}?`}|${oL`\d{1,3}`}`,oR=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,oT=RegExp(oL`
57
- \\ (?:
58
- ${oP}
59
- | [gk]<[^>]*>?
60
- | [gk]'[^']*'?
61
- | .
62
- )
63
- | \( (?:
64
- \? (?:
65
- [:=!>({]
66
- | <[=!]
67
- | <[^>]*>
68
- | '[^']*'
69
- | ~\|?
70
- | #(?:[^)\\]|\\.?)*
71
- | [^:)]*[:)]
72
- )?
73
- | \*[^\)]*\)?
74
- )?
75
- | (?:${oR.source})+
76
- | ${oE}
77
- | .
78
- `.replace(/\s+/g,""),"gsu"),o_=RegExp(oL`
79
- \\ (?:
80
- ${oP}
81
- | .
82
- )
83
- | \[:(?:\^?\p{Alpha}+|\^):\]
84
- | ${oE}
85
- | &&
86
- | .
87
- `.replace(/\s+/g,""),"gsu");function oN(e,{inCharClass:t}){let n=e[1];if("c"===n||"C"===n){var i,r=e;let t="c"===r[1]?r[2]:r[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${r}"`);return oD(ox(t.toUpperCase())-64,r)}if("dDhHsSwW".includes(n)){let t;return oO({d:"digit",h:"hex",s:"space",w:"word"}[t=(i=e)[1].toLowerCase()],i,{negate:i[1]!==t})}if(e.startsWith(oL`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(3===e.length)throw Error(`Incomplete or invalid Unicode property "${e}"`);return function(e){let{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return oO("property",e,{value:i,negate:"P"===t&&!n||"p"===t&&!!n})}(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),i=new TextEncoder;return[...n].map(e=>{let t=[...i.encode(e)].map(e=>`\\x${e.toString(16)}`).join("");return oD(ox(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if("u"===n||"x"===n)return oD(function(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);return parseInt("{"===e[2]?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2),16)}(e),e);if(oz.has(n))return oD(oz.get(n),e);if(/\d/.test(n))return{type:"EscapedNumber",inCharClass:t,raw:e};if("\\"===e)throw Error(oL`Incomplete escape "\"`);if("M"===n)throw Error(`Unsupported meta "${e}"`);if(2==[...e].length)return oD(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function oM(e,t){return{type:"Assertion",kind:e,raw:t}}function oI(e){return{type:"Backreference",raw:e}}function oD(e,t){return{type:"Character",value:e,raw:t}}function oH(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function oO(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function oF(e,t,n={}){return"keep"===e?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:oA(n.flags),raw:t}}function o$(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}let oU=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),oz=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function oB(e){let t=null,n,i;if("{"===e[0]){let{minStr:r,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups;if(+r>1e5||o&&+o>1e5)throw Error("Quantifier value unsupported in Oniguruma");if((n=+r)>(i=void 0===o?+r:""===o?1/0:+o)&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if("possessive"===t)throw Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=+("+"===e[0]),i="?"===e[0]?1:1/0,t="+"===e[1]?"possessive":"?"===e[1]?"lazy":"greedy";return{type:"Quantifier",kind:t,min:n,max:i,raw:e}}function oG(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function oj(e,t){if(!Array.isArray(e.body))throw Error("Expected node with body array");if(1!==e.body.length)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}let oW=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function oV(e,t={}){var n;let i={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=function(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if("string"!=typeof e)throw Error("String expected as pattern");let i=function(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let i=e[n];if(!"imxDPSWy".includes(i))throw Error(`Invalid flag "${i}"`);if("y"===i){if(!/^y{[gw]}/.test(e.slice(n)))throw Error('Invalid or unspecified flag "y" mode');t.textSegmentMode="g"===e[n+2]?"grapheme":"word",n+=3;continue}t[({i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"})[i]]=!0}return t}(n.flags),r=[i.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX:()=>r.at(-1),numOpenGroups:0,popModX(){r.pop()},pushModX(e){r.push(e)},replaceCurrentModX(e){r[r.length-1]=e},singleline:n.rules.singleline},a=[],l;for(oT.lastIndex=0;l=oT.exec(e);){let t=function(e,t,n,i){let[r,o]=n;if("["===n||"[^"===n){let e=function(e,t,n){let i=[oH("^"===t[1],t)],r=1,o;for(o_.lastIndex=n;o=o_.exec(e);){let e=o[0];if("["===e[0]&&":"!==e[1])r++,i.push(oH("^"===e[1],e));else if("]"===e){if("CharacterClassOpen"===i.at(-1).type)i.push(oD(93,e));else if(r--,i.push({type:"CharacterClassClose",raw:e}),!r)break}else{let t=function(e){if("\\"===e[0])return oN(e,{inCharClass:!0});if("["===e[0]){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!ow.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return oO("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return"-"===e?{type:"CharacterClassHyphen",raw:e}:"&&"===e?{type:"CharacterClassIntersector",raw:e}:oD(ox(e),e)}(e);Array.isArray(t)?i.push(...t):i.push(t)}}return{tokens:i,lastIndex:o_.lastIndex||e.length}}(t,n,i);return{tokens:e.tokens,lastIndex:e.lastIndex}}if("\\"===r){if("AbBGyYzZ".includes(o))return{token:oM(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:{type:"Subroutine",raw:n}}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:oI(n)}}if("K"===o)return{token:oF("keep",n)};if("N"===o||"R"===o)return{token:oO("newline",n,{negate:"N"===o})};if("O"===o)return{token:oO("any",n)};if("X"===o)return{token:oO("text_segment",n)};let e=oN(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if("("===r){if("*"===o)return{token:function(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:i,args:r}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(""===i)throw Error(`Named callout tag with empty value not allowed "${e}"`);let o=r?r.split(",").filter(e=>""!==e).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[a,l,s]=o,d=oU.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(o.length>0)throw Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if("string"==typeof a)throw Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!o.length||o.length>2)throw Error(`Named callout must have one or two arguments "${o}"`);if("string"==typeof a&&!/^[A-Za-z_]\w*$/.test(a))throw Error(`Named callout argument one must be a tag or number "${a}"`);if(2===o.length&&("number"==typeof l||!/^[<>X]$/.test(l)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);break;case"count":case"total_count":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if(1===o.length&&("number"==typeof a||!/^[<>X]$/.test(a)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(3!==o.length)throw Error(`Named callout must have three arguments "${o}"`);if("string"==typeof a&&!/^[A-Za-z_]\w*$/.test(a))throw Error(`Named callout argument one must be a tag or number "${a}"`);if("number"==typeof l||!/^(?:[<>!=]=|[<>])$/.test(l))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if("string"==typeof s&&!/^[A-Za-z_]\w*$/.test(s))throw Error(`Named callout argument three must be a tag or number "${s}"`);break;case"custom":throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${d}"`)}return{type:"NamedCallout",kind:d,tag:i??null,arguments:r?.split(",")??null,raw:e}}(n)};if("(?{"===n)throw Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(")"!==t[i])throw Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:function(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";let r=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),o=oG(n),a=oG(i),l={};if(o&&(l.enable=o),a&&(l.disable=a),e.endsWith(")"))return t.replaceCurrentModX(r),oF("flags",e,{flags:l});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,o$("group",e,{...(o||a)&&{flags:l}});throw Error(`Unexpected flag modifier "${e}"`)}(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,"("===n&&!e.captureGroup||"(?:"===n)return{token:o$("group",n)};if("(?>"===n)return{token:o$("atomic",n)};if("(?="===n||"(?!"===n||"(?<="===n||"(?<!"===n)return{token:o$("<"===n[2]?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if("("===n&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:o$("capturing",n,{..."("!==n&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if("(?~|"===n)throw Error(`Unsupported absence function kind "${n}"`);return{token:o$("absence_repeater",n)}}throw"(?("===n?Error(`Unsupported conditional "${n}"`):Error(`Invalid or unsupported group option "${n}"`)}if(")"===n){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error('Unmatched ")"');return{token:{type:"GroupClose",raw:n}}}if(e.getCurrentModX()){if("#"===n){let e=t.indexOf(`
88
- `,i);return{lastIndex:-1===e?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=i,{lastIndex:e.exec(t)?e.lastIndex:i}}}return"."===n?{token:oO("dot",n)}:"^"===n||"$"===n?{token:oM(e.singleline?({"^":oL`\A`,$:oL`\Z`})[n]:n,n)}:"|"===n?{token:{type:"Alternator",raw:n}}:oR.test(n)?{tokens:function(e){let t,n=[],i=RegExp(oR,"gy");for(;t=i.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(t){let{min:r,max:o}=t.groups;if(+r>+o&&e.endsWith("?")){i.lastIndex--,n.push(oB(e.slice(0,-1)));continue}}}n.push(oB(e))}return n}(n)}:{token:oD(ox(n),n)}}(o,e,l[0],oT.lastIndex);t.tokens?a.push(...t.tokens):t.token&&a.push(t.token),void 0!==t.lastIndex&&(oT.lastIndex=t.lastIndex)}let s=[],d=0;a.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++d:"("===e.raw&&s.push(e)}),d||s.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=d||s.length;return{tokens:a.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:n,inCharClass:i}=e,r=n.slice(1);if(!i&&("0"!==r&&1===r.length||"0"!==r[0]&&+r<=t))return[oI(n)];let o=[],a=r.match(/^[0-7]+|\d/g);for(let e=0;e<a.length;e++){let t,i=a[e];if(0===e&&"8"!==i&&"9"!==i){if((t=parseInt(i,8))>127)throw Error(oL`Octal encoded byte above 177 unsupported "${n}"`)}else t=ox(i);o.push(oD(t,(0===e?"\\":"")+i))}return o}(e,u):e).flat(),flags:i}}(e,{flags:i.flags,rules:{captureGroup:i.rules.captureGroup,singleline:i.rules.singleline}}),o=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case"Alternator":return oq();case"Assertion":return function({kind:e}){return oK(oA({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===oL`\B`||e===oL`\Y`})}(n);case"Backreference":return function({raw:e},t){let n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),r=(n,i=!1)=>{let r=t.capturingGroups.length,o=!1;if(n>r)if(t.skipBackrefValidation)o=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,oX(i?r+1-n:n,{orphan:o})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(n)return r(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(i))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw Error(`Group name not defined to the left "${e}"`);return oX(i)}return r(+i)}(n,a);case"Character":return oJ(n.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t){let{tokens:n,walk:i}=e,r=e.parent,o=r.body.at(-1),a=n[e.nextIndex];if(!t.isCheckingRangeEnd&&o&&"CharacterClass"!==o.type&&"CharacterClassRange"!==o.type&&a&&"CharacterClassOpen"!==a.type&&"CharacterClassClose"!==a.type&&"CharacterClassIntersector"!==a.type){let e=i(r,{...t,isCheckingRangeEnd:!0});if("Character"===o.type&&"Character"===e.type)return r.body.pop(),function(e,t){if(t.value<e.value)throw Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}(o,e);throw Error("Invalid character class range")}return oJ(ox("-"))}(a,t);case"CharacterClassOpen":return function({negate:e},t,n){let{tokens:i,walk:r}=t,o=[oY()],a=i[t.nextIndex],l=ae(a);for(;"CharacterClassClose"!==l.type;){if("CharacterClassIntersector"===l.type)o.push(oY()),t.nextIndex++;else{let e=o.at(-1);e.body.push(r(e,n))}l=ae(i[t.nextIndex],a)}let s=oY({negate:e});return 1===o.length?s.body=o[0].body:(s.kind="intersection",s.body=o.map(e=>1===e.body.length?e.body[0]:e)),t.nextIndex++,s}(n,a,t);case"CharacterSet":return function({kind:e,negate:t,value:n},i){let{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:a}=i;if("property"===e){let i=o9(n);if(!ow.has(i)||a?.has(i))return o5(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:a});e="posix",n=i}return"posix"===e?function(e,t){let n=!!t?.negate;if(!ow.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}(n,{negate:t}):oZ(e,{negate:t})}(n,a);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:oA(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}(n.kind,{flags:n.flags});case"GroupOpen":return function(e,t,n){var i,r;let{tokens:o,capturingGroups:a,namedGroupsByName:l,skipLookbehindValidation:s,walk:d}=t,u=function({flags:e,kind:t,name:n,negate:i,number:r}){switch(t){case"absence_repeater":var o="repeater";!1;return{type:"AbsenceFunction",kind:o,body:o6(void 0)};case"atomic":return o0({atomic:!0});case"capturing":return oQ(r,{name:n});case"group":return o0({flags:e});case"lookahead":case"lookbehind":return o1({behind:"lookbehind"===t,negate:i});default:throw Error(`Unexpected group kind "${t}"`)}}(e),h="AbsenceFunction"===u.type,c=o3(u),f=c&&u.negate;if("CapturingGroup"===u.type&&(a.push(u),u.name&&(i=u.name,r=[],l.has(i)||l.set(i,r),l.get(i)).push(u)),h&&n.isInAbsenceFunction)throw Error("Nested absence function not supported by Oniguruma");let p=at(o[t.nextIndex]);for(;"GroupClose"!==p.type;){if("Alternator"===p.type)u.body.push(oq()),t.nextIndex++;else{let e=u.body.at(-1),t=d(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||f});if(e.body.push(t),(c||n.isInLookbehind)&&!s){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(f||n.isInNegLookbehind){if(o7(t)||"CapturingGroup"===t.type)throw Error(e)}else if(o7(t)||o3(t)&&t.negate)throw Error(e)}}p=at(o[t.nextIndex])}return t.nextIndex++,u}(n,a,t);case"NamedCallout":var i,o;return i=n.kind,o=n.tag,{type:"NamedCallout",kind:i,tag:o,arguments:n.arguments};case"Quantifier":return function({kind:e,min:t,max:n},i){let r=i.parent,o=r.body.at(-1);if(!o||!oW.has(o.type))throw Error("Quantifier requires a repeatable token");let a=o8(e,t,n,o);return r.body.pop(),a}(n,a);case"Subroutine":return function({raw:e},t){let{capturingGroups:n,subroutines:i}=t,r=e.slice(3,-1),o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(o){let e=+o.groups.num,i=n.length;if(t.hasNumberedRef=!0,(r=({"":e,"+":i+e,"-":i+1-e})[o.groups.sign])<1)throw Error("Invalid subroutine number")}else"0"===r&&(r=0);let a=o2(r);return i.push(a),a}(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:i.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:i.skipBackrefValidation,skipLookbehindValidation:i.skipLookbehindValidation,skipPropertyNameValidation:i.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:i.unicodePropertyMap,walk:o},l=(n={type:"Flags",...r.flags},{type:"Regex",body:o6(void 0),flags:n}),s=l.body[0];for(;a.nextIndex<r.tokens.length;){let e=o(s,{});"Alternative"===e.type?(l.body.push(e),s=e):s.body.push(e)}let{capturingGroups:d,hasNumberedRef:u,namedGroupsByName:h,subroutines:c}=a;if(u&&h.size&&!i.rules.captureGroup)throw Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:e}of c)if("number"==typeof e){if(e>d.length)throw Error("Subroutine uses a group number that's not defined");e&&(d[e-1].isSubroutined=!0)}else if(h.has(e)){if(h.get(e).length>1)throw Error(oL`Subroutine uses a duplicate group name "\g<${e}>"`);h.get(e)[0].isSubroutined=!0}else throw Error(oL`Subroutine uses a group name that's not defined "\g<${e}>"`);return l}function oq(e){return{type:"Alternative",body:o4(e?.body)}}function oK(e,t){let n={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(n.negate=!!t?.negate),n}function oX(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function oQ(e,t){var n;let i={name:void 0,isSubroutined:!1,...t};if(void 0!==i.name&&(n=i.name,!/^[\p{Alpha}\p{Pc}][^)]*$/u.test(n)))throw Error(`Group name "${i.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...i.name&&{name:i.name},...i.isSubroutined&&{isSubroutined:i.isSubroutined},body:o6(t?.body)}}function oJ(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${t}}"`):Error(`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:"Character",value:e}}function oY(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:o4(e?.body)}}function oZ(e,t){let n=!!t?.negate,i={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(i.negate=n),"text_segment"!==e&&("newline"!==e||n)||(i.variableLength=!0),i}function o0(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:o6(e?.body)}}function o1(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:o6(e?.body)}}function o8(e,t,n,i){if(t>n)throw Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function o2(e){return{type:"Subroutine",ref:e}}function o5(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},i=n.unicodePropertyMap?.get(o9(e));if(!i){if(n.normalizeUnknownPropertyNames)i=e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase());else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(oL`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function o6(e){if(void 0===e)e=[oq()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw Error("Invalid body; expected array of one or more Alternative nodes");return e}function o4(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error("Invalid body; expected array of nodes");return e}function o7(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function o3(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function o9(e){return e.replace(/[- _]+/g,"").toLowerCase()}function ae(e,t){return oA(e,`Unclosed character class${t?.type==="Character"&&93===t.value&&"]"===t.raw?' (started with "]")':""}`)}function at(e){return oA(e,"Unclosed group")}function an(e,t,n=null){function i(e,t){for(let n=0;n<e.length;n++){let i=r(e[n],t,n,e);n=Math.max(-1,n+i)}}function r(o,a=null,l=null,s=null){let d=0,u=!1,h={node:o,parent:a,key:l,container:s,root:e,remove(){ai(s).splice(Math.max(0,ar(l)+d),1),d--,u=!0},removeAllNextSiblings:()=>ai(s).splice(ar(l)+1),removeAllPrevSiblings(){let e=ar(l)+d;return d-=e,ai(s).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;s?s[Math.max(0,ar(l)+d)]=e:oA(a,"Can't replace root node")[l]=e,n&&r(e,a,l,s),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(ai(s).splice(Math.max(0,ar(l)+d),1,...e),d+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=r(e[n],a,ar(l)+n+t,s)}u=!0},skip(){u=!0}},{type:c}=o,f=t["*"],p=t[c],m="function"==typeof f?f:f?.enter,g="function"==typeof p?p:p?.enter;if(m?.(h,n),g?.(h,n),!u)switch(c){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(o.min,o,"min"),r(o.max,o,"max");break;case"Quantifier":r(o.body,o,"body");break;case"Regex":i(o.body,o),r(o.flags,o,"flags");break;default:throw Error(`Unexpected node type "${c}"`)}return p?.exit?.(h,n),f?.exit?.(h,n),d}return r(e),e}function ai(e){if(!Array.isArray(e))throw Error("Container expected");return e}function ar(e){if("number"!=typeof e)throw Error("Numeric key expected");return e}let ao=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`,aa=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function al(e,t,n,i){let r=RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1],a=0,l="";for(let t of e.matchAll(r)){let{0:e,groups:{$skip:r}}=t;if(!r&&(!i||i===aa.DEFAULT==!a)){n instanceof Function?l+=n(t,{context:a?aa.CHAR_CLASS:aa.DEFAULT,negated:o[o.length-1]}):l+=n;continue}"["===e[0]?(a++,o.push("^"===e[1])):"]"===e&&a&&(a--,o.pop()),l+=e}return l}function as(e,t,n){return!!function(e,t,n=0,i){let r;if(!RegExp(t,"su").test(e))return null;let o=RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let a=0;for(;r=o.exec(e);){let{0:e,groups:{$skip:t}}=r;if(!t&&(!i||i===aa.DEFAULT==!a))return r;"["===e?a++:"]"===e&&a&&a--,o.lastIndex==r.index&&o.lastIndex++}return null}(e,t,0,n)}let ad=RegExp(String.raw`(?<noncapturingStart>${ao})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu"),au=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ah=RegExp(String.raw`
89
- \\(?: \d+
90
- | c[A-Za-z]
91
- | [gk]<[^>]+>
92
- | [pPu]\{[^\}]+\}
93
- | u[A-Fa-f\d]{4}
94
- | x[A-Fa-f\d]{2}
95
- )
96
- | \((?: \? (?: [:=!>]
97
- | <(?:[=!]|[^>]+>)
98
- | [A-Za-z\-]+:
99
- | \(DEFINE\)
100
- ))?
101
- | (?<qBase>${au})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
102
- | \\?.
103
- `.replace(/\s+/g,""),"gsu"),ac=String.raw,af=ac`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,ap=ac`\(\?R=(?<rDepth>[^\)]+)\)|${af}`,am=ac`\(\?<(?![=!])(?<captureName>[^>]+)>`,ag=ac`${am}|(?<unnamed>\()(?!\?)`,ab=RegExp(ac`${am}|${ap}|\(\?|\\?.`,"gsu"),ay="Cannot use multiple overlapping recursions";function av(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e*=1)<2||e>100)throw Error(t)}function ak(e,t,n,i,r,o,a){let l=new Set;i&&al(e+t,am,({groups:{captureName:e}})=>{l.add(e)},aa.DEFAULT);let s=[n,i?l:null,r,o,a];return`${e}${aS(`(?:${e}`,"forward",...s)}(?:)${aS(`${t})`,"backward",...s)}${t}`}function aS(e,t,n,i,r,o,a){let l=e=>"forward"===t?e+2:n-e+2-1,s="";for(let t=0;t<n;t++){let n=l(t);s+=al(e,ac`${ag}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:l,backref:s}})=>{if(s&&i&&!i.has(s))return e;let d=`_$${n}`;if(l||t){let n=a+o.length+1;return o.push(n),function(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}(r,n),l?e:`(?<${t}${d}>`}return ac`\k<${s}${d}>`},aa.DEFAULT)}return s}function aC(e,t,n,i,r,o){if(e.size&&i){let a=0;al(t,ag,()=>a++,aa.DEFAULT);let l=o-a+r,s=new Map;return e.forEach((e,t)=>{let r=(i-a*n)/n,o=a*n,d=t>l+a?t+i:t,u=[];for(let t of e)if(t<=l)u.push(t);else if(t>l+a+r)u.push(t+i);else if(t<=l+a)for(let e=0;e<=n;e++)u.push(t+a*e);else for(let e=0;e<=n;e++)u.push(t+o+r*e);s.set(d,u)}),s}return e}var ax=String.fromCodePoint,aw=String.raw,aL={},aA=globalThis.RegExp;function aE(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function aP(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}aL.flagGroups=(()=>{try{new aA("(?i:)")}catch{return!1}return!0})(),aL.unicodeSets=(()=>{try{new aA("[[]]","v")}catch{return!1}return!0})(),aL.bugFlagVLiteralHyphenIsRange=!!aL.unicodeSets&&(()=>{try{new aA(aw`[\d\-a]`,"v")}catch{return!0}return!1})(),aL.bugNestedClassIgnoresNegation=aL.unicodeSets&&new aA("[[^a]]","v").test("a");var aR={ES2025:2025,ES2024:2024,ES2018:2018},aT={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function a_(e={}){if("[object Object]"!==({}).toString.call(e))throw Error("Unexpected options");if(void 0!==e.target&&!aT[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return"auto"===t.target&&(t.target=aL.flagGroups?"ES2025":aL.unicodeSets?"ES2024":"ES2018"),t}var aN=new Set([ax(304),ax(305)]),aM=aw`[\p{L}\p{M}\p{N}\p{Pc}]`;function aI(e){if(aN.has(e))return[e];let t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),r=aF.get(n),o=aH.get(n),a=aO.get(n);return 1==[...i].length&&t.add(i),a&&t.add(a),r&&t.add(r),t.add(n),o&&t.add(o),[...t]}var aD=new Map(`C Other
104
- Cc Control cntrl
105
- Cf Format
106
- Cn Unassigned
107
- Co Private_Use
108
- Cs Surrogate
109
- L Letter
110
- LC Cased_Letter
111
- Ll Lowercase_Letter
112
- Lm Modifier_Letter
113
- Lo Other_Letter
114
- Lt Titlecase_Letter
115
- Lu Uppercase_Letter
116
- M Mark Combining_Mark
117
- Mc Spacing_Mark
118
- Me Enclosing_Mark
119
- Mn Nonspacing_Mark
120
- N Number
121
- Nd Decimal_Number digit
122
- Nl Letter_Number
123
- No Other_Number
124
- P Punctuation punct
125
- Pc Connector_Punctuation
126
- Pd Dash_Punctuation
127
- Pe Close_Punctuation
128
- Pf Final_Punctuation
129
- Pi Initial_Punctuation
130
- Po Other_Punctuation
131
- Ps Open_Punctuation
132
- S Symbol
133
- Sc Currency_Symbol
134
- Sk Modifier_Symbol
135
- Sm Math_Symbol
136
- So Other_Symbol
137
- Z Separator
138
- Zl Line_Separator
139
- Zp Paragraph_Separator
140
- Zs Space_Separator
141
- ASCII
142
- ASCII_Hex_Digit AHex
143
- Alphabetic Alpha
144
- Any
145
- Assigned
146
- Bidi_Control Bidi_C
147
- Bidi_Mirrored Bidi_M
148
- Case_Ignorable CI
149
- Cased
150
- Changes_When_Casefolded CWCF
151
- Changes_When_Casemapped CWCM
152
- Changes_When_Lowercased CWL
153
- Changes_When_NFKC_Casefolded CWKCF
154
- Changes_When_Titlecased CWT
155
- Changes_When_Uppercased CWU
156
- Dash
157
- Default_Ignorable_Code_Point DI
158
- Deprecated Dep
159
- Diacritic Dia
160
- Emoji
161
- Emoji_Component EComp
162
- Emoji_Modifier EMod
163
- Emoji_Modifier_Base EBase
164
- Emoji_Presentation EPres
165
- Extended_Pictographic ExtPict
166
- Extender Ext
167
- Grapheme_Base Gr_Base
168
- Grapheme_Extend Gr_Ext
169
- Hex_Digit Hex
170
- IDS_Binary_Operator IDSB
171
- IDS_Trinary_Operator IDST
172
- ID_Continue IDC
173
- ID_Start IDS
174
- Ideographic Ideo
175
- Join_Control Join_C
176
- Logical_Order_Exception LOE
177
- Lowercase Lower
178
- Math
179
- Noncharacter_Code_Point NChar
180
- Pattern_Syntax Pat_Syn
181
- Pattern_White_Space Pat_WS
182
- Quotation_Mark QMark
183
- Radical
184
- Regional_Indicator RI
185
- Sentence_Terminal STerm
186
- Soft_Dotted SD
187
- Terminal_Punctuation Term
188
- Unified_Ideograph UIdeo
189
- Uppercase Upper
190
- Variation_Selector VS
191
- White_Space space
192
- XID_Continue XIDC
193
- XID_Start XIDS`.split(/\s/).map(e=>[o9(e),e])),aH=new Map([["s",ax(383)],[ax(383),"s"]]),aO=new Map([[ax(223),ax(7838)],[ax(107),ax(8490)],[ax(229),ax(8491)],[ax(969),ax(8486)]]),aF=new Map([aU(453),aU(456),aU(459),aU(498),...az(8072,8079),...az(8088,8095),...az(8104,8111),aU(8124),aU(8140),aU(8188)]),a$=new Map([["alnum",aw`[\p{Alpha}\p{Nd}]`],["alpha",aw`\p{Alpha}`],["ascii",aw`\p{ASCII}`],["blank",aw`[\p{Zs}\t]`],["cntrl",aw`\p{Cc}`],["digit",aw`\p{Nd}`],["graph",aw`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",aw`\p{Lower}`],["print",aw`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",aw`[\p{P}\p{S}]`],["space",aw`\p{space}`],["upper",aw`\p{Upper}`],["word",aw`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",aw`\p{AHex}`]]);function aU(e){let t=ax(e);return[t.toLowerCase(),t]}function az(e,t){return(function(e,t){let n=[];for(let i=e;i<=t;i++)n.push(i);return n})(e,t).map(e=>aU(e))}var aB=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),aG={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:i,kind:r}=e;if("repeater"===r){let e=o0();e.body[0].body.push(o1({negate:!0,body:i}),o5("Any"));let r=o0();r.body[0].body.push(o8("greedy",0,1/0,e)),n(a1(r,t),{traverse:!0})}else throw Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){let r=e.body.filter(e=>"flags"===e.kind);for(let e=n+1;e<t.body.length;e++)aP(i,t.body[e],[]).push(...r)},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=aX(t.get(e));if(n){let t=o0({flags:n});t.body[0].body=e.body,e.body=[a1(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:r,remove:o,replaceWith:a},l){let{kind:s,negate:d}=e,{asciiWordBoundaries:u,avoidSubclass:h,supportedGNodes:c,wordIsAscii:f}=l;if("text_segment_boundary"===s)throw Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if("line_end"===s)a(a1(o1({body:[oq({body:[oK("string_end")]}),oq({body:[oJ(10)]})]}),t));else if("line_start"===s)a(a1(aY(aw`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if("search_start"===s)if(c.has(e))r.flags.sticky=!0,o();else{var p;let e,r=i[n-1];if(r&&((e=["Character","CharacterClass","CharacterSet"]).includes((p=r).type)||"Quantifier"===p.type&&p.min&&e.includes(p.body.type)))a(a1(o1({negate:!0}),t));else if(h)throw Error(aw`Uses "\G" in a way that requires a subclass`);else a(a0(oK("string_start"),t)),l.strategy="clip_search"}else if("string_end"===s||"string_start"===s);else if("string_end_newline"===s)a(a1(aY(aw`(?=\n?\z)`),t));else if("word_boundary"===s){if(!f&&!u){let e=`(?:(?<=${aM})(?!${aM})|(?<!${aM})(?=${aM}))`,n=`(?:(?<=${aM})(?=${aM})|(?<!${aM})(?!${aM}))`;a(a1(aY(d?n:e),t))}}else throw Error(`Unexpected assertion kind "${s}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"!=typeof n||aJ(n)||(e.ref=n=aK(n,t))},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!aJ(i)&&(e.name=i=aK(i,t)),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){"intersection"===t.kind&&n(a1(oY({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:a,wordIsAscii:l}){let{kind:s,negate:d,value:u}=e;if(o&&("digit"===s||"digit"===u))return void n(a0(oZ("digit",{negate:d}),t));if(a&&("space"===s||"space"===u))return void n(a1(aZ(aY("[ -\r ]"),d),t));if(l&&("word"===s||"word"===u))return void n(a0(oZ("word",{negate:d}),t));if("any"===s)n(a0(o5("Any"),t));else if("digit"===s)n(a0(o5("Nd",{negate:d}),t));else if("dot"===s);else if("text_segment"===s){if("strict"===i)throw Error(aw`Use of "\X" requires non-strict accuracy`);let e="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",o=aw`\p{RI}{2}|${e}(?:\u200D${e})*`;n(a1(aY(aw`(?>\r\n|${r?aw`\p{RGI_Emoji}`:o}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===s)n(a0(o5("AHex",{negate:d}),t));else if("newline"===s)n(a1(aY(d?"[^\n]":"(?>\r\n?|[\n\v\f\x85\u2028\u2029])"),t));else if("posix"===s)if(r||"graph"!==u&&"print"!==u)n(a1(aZ(aY(a$.get(u)),d),t));else{if("strict"===i)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];d&&(e=`\0-${ax(e.codePointAt(0)-1)}${ax(e.codePointAt(2)+1)}-\u{10FFFF}`),n(a1(aY(`[${e}]`),t))}else if("property"===s)aD.has(o9(u))||(e.key="sc");else if("space"===s)n(a0(o5("space",{negate:d}),t));else if("word"===s)n(a1(aZ(aY(aM),d),t));else throw Error(`Unexpected character set kind "${s}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:a}){let{kind:l,flags:s}=e;if("flags"===l)if(s.enable||s.disable){let e=o0({flags:s});e.body[0].body=a(),r(a1(e,t),{traverse:!0})}else i();else if("keep"===l){let e=n.body[0],i=1===n.body.length&&oj(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:n;if(t.parent!==i||i.body.length>1)throw Error(aw`Uses "\K" in a way that's unsupported`);let a=o1({behind:!0});a.body[0].body=o(),r(a1(a,t))}else throw Error(`Unexpected directive kind "${l}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,e.flags.enable||e.flags.disable||delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;"lookbehind"===n&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:i}=e;if("fail"===i)n(a1(o1({negate:!0}),t));else throw Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=o0();t.body[0].body.push(e.body),e.body=a1(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],i=!1,r=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=function e(t){let n=t.find(e=>"search_start"===e.kind||function(e,t){let n={negate:null,...t};return"LookaroundAssertion"===e.type&&(null===n.negate||e.negate===n.negate)&&1===e.body.length&&oj(e.body[0],{type:"Assertion",kind:"search_start"})}(e,{negate:!1})||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!n)return null;if("search_start"===n.kind)return n;if("LookaroundAssertion"===n.type)return n.body[0].body[0];if("CapturingGroup"===n.type||"Group"===n.type){let t=[];for(let i of n.body){let n=e(i.body);if(!n)return null;Array.isArray(n)?t.push(...n):t.push(n)}return t}return null}(t.body);e?(i=!0,Array.isArray(e)?n.push(...e):n.push(e)):r=!0}i&&!r&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if("strict"===t&&n&&i)throw Error(aw`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"!=typeof n||aJ(n)||(e.ref=n=aK(n,t))}},aj={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:i,ref:r}=e;i||n.set(e,[...t.get(r).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:a,openRefs:l,reffedNodesByReferencer:s}){let d=r.get(e);if(d&&l.has(e.number)){let i=a0(aq(e.number),t);s.set(i,l.get(e.number)),n(i);return}l.set(e.number,e),a.set(e.number,[]),e.name&&aP(a,e.name,[]);let u=a.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(d===n.node||d&&d===n.origin||e===n.origin){u.splice(t,1);break}}if(a.get(e.number).push({node:e,origin:d}),e.name&&a.get(e.name).push({node:e,origin:d}),e.name){let t=aP(o,e.name,new Map),n=!1;if(d)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=aE(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){let{isRecursive:r,ref:o}=e;if(r){let n=t;for(;(n=n.parent)&&("CapturingGroup"!==n.type||n.name!==o&&n.number!==o););i.reffedNodesByReferencer.set(e,n);return}let a=i.subroutineRefMap.get(o),l=0===o,s=l?aq(0):function e(t,n,i,r){let o=Array.isArray(t)?[]:{};for(let[a,l]of Object.entries(t))"parent"===a?o.parent=Array.isArray(i)?r:i:l&&"object"==typeof l?o[a]=e(l,n,o,i):("type"===a&&"CapturingGroup"===l&&n.set(o,n.get(t)??t),o[a]=l);return o}(a,i.groupOriginByCopy,null),d=s;if(!l){var u,h;let e=aX(function(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}(a,e=>"Group"===e.type&&!!e.flags)),t=e?aE(i.globalFlags,e):i.globalFlags;u=t,h=i.currentFlags,(u.dotAll!==h.dotAll||u.ignoreCase!==h.ignoreCase)&&(d=o0({flags:function({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),e&&t||(n.disable={},e||(n.disable.dotAll=!0),t||(n.disable.ignoreCase=!0)),n}(t)})).body[0].body.push(s)}n(a1(d,t),{traverse:!l})}},aW={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}let r=i.reffedNodesByReferencer.get(e).filter(t=>(function(e,t){let n=t;do{if("Regex"===n.type)return!1;if("Alternative"===n.type)continue;if(n===e)return!1;for(let t of aQ(n.parent)){if(t===n)break;if(t===e||function e(t,n){for(let i of aQ(t)??[])if(i===n||e(i,n))return!0;return!1}(t,e))return!0}}while(n=n.parent);throw Error("Unexpected path")})(t,e));r.length?r.length>1?n(a1(o0({atomic:!0,body:r.reverse().map(e=>oq({body:[oX(e.number)]}))}),t)):e.ref=r[0].number:n(a1(o1({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=oQ();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&0!==e.ref&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function aV(e){an(e,{"*"({node:e,parent:t}){e.parent=t}})}function aq(e){let t=o2(e);return t.isRecursive=!0,t}function aK(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function aX(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return(e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable)?n:null}function aQ(e){if(!e)throw Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function aJ(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function aY(e,t){let n=oV(e,{...t,unicodePropertyMap:aD}).body;return n.length>1||n[0].body.length>1?o0({body:n}):n[0].body[0]}function aZ(e,t){return e.negate=t,e}function a0(e,t){return e.parent=t,e}function a1(e,t){return aV(e),e.parent=t,e}var a8={"*":{enter({node:e},t){if(ln(e)){let n=t.getCurrentModI();t.pushModI(e.flags?aE({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){ln(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){a9(ax(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),le(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&aB.has(e.value)&&t.setHasCasedChar()}},a2={Alternative:({body:e},t,n)=>e.map(n).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?aw`\B`:aw`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:i,name:r,number:o}=e,a={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(a.hidden=!0,o>l.number&&(a.transferTo=l.number)),t.captureMap.set(o,a),`(${r?`?<${r}>`:""}${i.map(n).join("|")})`},Character({value:e},t){let n=ax(e),i=lt(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&a9(n)){let e=aI(n);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:i,negate:r,parent:o}=e,{body:a}=e;if("intersection"===i&&!t.useFlagV)throw Error("Use of character class intersection requires min target ES2024");aL.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(li)&&(a=[oJ(45),...a.filter(e=>!li(e))]);let l=()=>`[${r?"^":""}${a.map(n).join("intersection"===i?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||aL.bugNestedClassIgnoresNegation)&&!r){let t=a.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let i=o0(),r=i.body[0];return i.parent=o,r.parent=i,e.body=a=a.filter(e=>!t.includes(e)),a.length?(e.parent=r,r.body.push(e)):i.body.pop(),t.forEach(e=>{let t=oq({body:[e]});e.parent=t,t.parent=i,i.body.push(t)}),n(i)}}t.inCharClass=!0;let i=l();return t.inCharClass=!1,i}let s=a[0];if("union"===i&&!r&&s&&((!t.useFlagV||!t.verbose)&&"union"===o.kind&&!(aL.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&"intersection"===o.kind&&1===a.length&&"CharacterClassRange"!==s.type))return a.map(n).join("");if(!t.useFlagV&&"CharacterClass"===o.type)throw Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){let n=e.min.value,i=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=lt(n,r),a=lt(i,r),l=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&(function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],i=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?i??=t[e]:null===i?n.push(t[e]):(n.push([i,t[e]]),i=null);return n})(le(e)).forEach(e=>{l.add(Array.isArray(e)?`${lt(e[0],r)}-${lt(e[1],r)}`:lt(e,r))}),`${o}-${a}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},r){if("dot"===e)return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":aw`[^\n]`;if("digit"===e)return t?aw`\D`:aw`\d`;if("property"===e){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&aB.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?aw`\P`:aw`\p`}{${i?`${i}=`:""}${n}}`}if("word"===e)return t?aw`\W`:aw`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:n,parent:i},r,o){let a=r.currentFlags;n&&(r.currentFlags=aE(a,n));let l=t.map(o).join("|"),s=r.verbose||1!==t.length||"Quantifier"===i.type||e||r.useFlagMods&&n?`(?${function(e,t,n){if(e)return">";let i="";if(t&&n){let{enable:e,disable:n}=t;i=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(n?"-":"")+(n?.ignoreCase?"i":"")+(n?.dotAll?"s":"")}return`${i}:`}(e,n,r.useFlagMods)}${l})`:l;return r.currentFlags=a,s},LookaroundAssertion({body:e,kind:t,negate:n},i,r){let o=`${"lookahead"===t?"":"<"}${n?"!":"="}`;return`(?${o}${e.map(r).join("|")})`},Quantifier:(e,t,n)=>n(e.body)+function({kind:e,max:t,min:n}){return(n||1!==t?n||t!==1/0?1===n&&t===1/0?"+":n===t?`{${n}}`:`{${n},${t===1/0?"":t}}`:"*":"?")+({greedy:"",lazy:"?",possessive:"+"})[e]}(e),Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error("Unexpected non-recursive subroutine in transformed AST");let i=n.recursionLimit;return 0===t?`(?R=${i})`:aw`\g<${t}&R=${i}>`}},a5=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),a6=new Set(["-","\\","]","^","["]),a4=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),a7=new Map([[9,aw`\t`],[10,aw`\n`],[11,aw`\v`],[12,aw`\f`],[13,aw`\r`],[8232,aw`\u2028`],[8233,aw`\u2029`],[65279,aw`\uFEFF`]]),a3=/^\p{Cased}$/u;function a9(e){return a3.test(e)}function le(e,t){let n=!!t?.firstOnly,i=e.min.value,r=e.max.value,o=[];if(i<65&&(65535===r||r>=131071)||65536===i&&r>=131071)return o;for(let e=i;e<=r;e++){let t=ax(e);if(!a9(t))continue;let a=aI(t).filter(e=>{let t=e.codePointAt(0);return t<i||t>r});if(a.length&&(o.push(...a),n))break}return o}function lt(e,{escDigit:t,inCharClass:n,useFlagV:i}){var r;if(a7.has(e))return a7.get(e);if(e<32||e>126&&e<160||e>262143||t&&(r=e)>47&&r<58)return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=ax(e);return((n?i?a4:a6:a5).has(o)?"\\":"")+o}function ln({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function li({type:e,value:t}){return"Character"===e&&45===t}var lr=class e extends RegExp{#e=new Map;#t=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,i){const r=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw Error("Cannot provide options when copying a regexp");super(t,n),this.#n=t.source,t instanceof e&&(this.#e=t.#e,this.#i=t.#i,this.#r=t.#r,this.rawOptions=t.rawOptions)}else{const e={hiddenCaptures:[],strategy:null,transfers:[],...i};super(r?"":t,n),this.#n=t,this.#e=function(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,i]of t)for(let t of i)aP(n,t,{}).transferTo=e;return n}(e.hiddenCaptures,e.transfers),this.#r=e.strategy,this.rawOptions=i??{}}r||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,i=this.lastIndex;if("clip_search"===this.#r&&n&&i){this.lastIndex=0;let e=this.#o(t.slice(i));return e&&(function(e,t,n,i){if(e.index+=t,e.input=n,i){let n=e.indices;for(let e=0;e<n.length;e++){let i=n[e];i&&(n[e]=[i[0]+t,i[1]+t])}let i=n.groups;i&&Object.keys(i).forEach(e=>{let n=i[e];n&&(i[e]=[n[0]+t,n[1]+t])})}}(e,i,t,this.hasIndices),this.lastIndex+=i),e}return this.#o(t)}#o(e){let t;this.#t.lastIndex=this.lastIndex;let n=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;let i=[...n];n.length=1,this.hasIndices&&(t=[...n.indices],n.indices.length=1);let r=[0];for(let e=1;e<i.length;e++){let{hidden:o,transferTo:a}=this.#e.get(e)??{};if(o?r.push(null):(r.push(n.length),n.push(i[e]),this.hasIndices&&n.indices.push(t[e])),a&&void 0!==i[e]){let o=r[a];if(!o)throw Error(`Invalid capture transfer to "${o}"`);if(n[o]=i[e],this.hasIndices&&(n.indices[o]=t[e]),n.groups){this.#i||(this.#i=function(e){let t,n=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,i=new Map,r=0,o=0;for(;t=n.exec(e);){let{0:e,groups:{capture:n,name:a}}=t;"["===e?r++:r?"]"===e&&r--:n&&(o++,a&&i.set(o,a))}return i}(this.source));let r=this.#i.get(a);r&&(n.groups[r]=i[e],this.hasIndices&&(n.indices.groups[r]=t[e]))}}}return n}};let lo=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],la=[...lo,"pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],ll=new Set(lo),ls={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},ld={"pierre-dark":()=>n.e("3911").then(n.bind(n,2378)),"pierre-dark-soft":()=>n.e("9728").then(n.bind(n,35)),"pierre-dark-vibrant":()=>n.e("5072").then(n.bind(n,4579)),"pierre-dark-protanopia-deuteranopia":()=>n.e("5959").then(n.bind(n,3530)),"pierre-dark-tritanopia":()=>n.e("6085").then(n.bind(n,7524)),"pierre-light":()=>n.e("3084").then(n.bind(n,3682)),"pierre-light-soft":()=>n.e("8696").then(n.bind(n,7179)),"pierre-light-vibrant":()=>n.e("8408").then(n.bind(n,7291)),"pierre-light-protanopia-deuteranopia":()=>n.e("2751").then(n.bind(n,354)),"pierre-light-tritanopia":()=>n.e("8189").then(n.bind(n,8492))};async function lu({themes:e,langs:t,preferredHighlighter:i="shiki-js"}){let r=!function(e=l){return null!=e&&"then"in e}(l??=oS({themes:[],langs:["text"],engine:"shiki-wasm"===i?r7(n.e("4405").then(n.bind(n,5380))):function(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=e=>{let n;return(n=function(e,t){var n;let i,r,o,a,l=a_(t),s=(n=oV(e,{flags:l.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:l.rules.captureGroup,singleline:l.rules.singleline},skipBackrefValidation:l.rules.allowOrphanBackrefs,unicodePropertyMap:aD}),i={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...{accuracy:l.accuracy,asciiWordBoundaries:l.rules.asciiWordBoundaries,avoidSubclass:l.avoidSubclass,bestEffortTarget:l.target}},aV(n),r={accuracy:i.accuracy,asciiWordBoundaries:i.asciiWordBoundaries,avoidSubclass:i.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:aR[i.bestEffortTarget]>=aR.ES2024,passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:n.flags.digitIsAscii,spaceIsAscii:n.flags.spaceIsAscii,wordIsAscii:n.flags.wordIsAscii},an(n,aG,r),a={currentFlags:o={dotAll:n.flags.dotAll,ignoreCase:n.flags.ignoreCase},prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap},an(n,aj,a),an(n,aW,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),n._originMap=a.groupOriginByCopy,n._strategy=r.strategy,n),d=function(e,t){let n=a_(t),i=aR[n.target]>=aR.ES2024,r=aR[n.target]>=aR.ES2025,o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw Error("Invalid recursionLimit; use 2-20");let a=null,l=null;if(!r){let t=[e.flags.ignoreCase];an(e,a8,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?a=!0:l=!0}})}let s={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!l)},d=e,u={accuracy:n.accuracy,appliedGlobalFlags:s,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!r&&a&&l),useFlagMods:r,useFlagV:i,verbose:n.verbose};function h(e){return u.lastNode=d,d=e,(function(e,t){if(null==e)throw Error(t??"Value expected");return e})(a2[e.type],`Unexpected node type "${e.type}"`)(e,u,h)}let c={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return i||(delete c.options.force.v,c.options.disable.v=!0,c.options.unicodeSetsPlugin=null),c._captureTransfers=new Map,c._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&c._hiddenCaptures.push(t),e.transferTo&&aP(c._captureTransfers,e.transferTo,[]).push(t)}),c}(s,l),u=function(e,t){let n,{hiddenCaptures:i,mode:r}={hiddenCaptures:[],mode:"plugin",...t},o=t?.captureTransfers??new Map;if(!RegExp(ap,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:i};if("plugin"===r&&as(e,ac`\(\?\(DEFINE\)`,aa.DEFAULT))throw Error("DEFINE groups cannot be used with recursion");let a=[],l=as(e,ac`\\[1-9]`,aa.DEFAULT),s=new Map,d=[],u=!1,h=0,c=0;for(ab.lastIndex=0;n=ab.exec(e);){let{0:t,groups:{captureName:f,rDepth:p,gRNameOrNum:m,gRDepth:g}}=n;if("["===t)h++;else if(h)"]"===t&&h--;else if(p){if(av(p),u)throw Error(ay);if(l)throw Error(`${"external"===r?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let t=e.slice(0,n.index),s=e.slice(ab.lastIndex);if(as(s,ap,aa.DEFAULT))throw Error(ay);let d=p-1;e=ak(t,s,d,!1,i,a,c),o=aC(o,t,d,a.length,0,c);break}else if(m){av(g);let h=!1;for(let e of d)if(e.name===m||e.num===+m){if(h=!0,e.hasRecursedWithin)throw Error(ay);break}if(!h)throw Error(ac`Recursive \g cannot be used outside the referenced group "${"external"===r?m:ac`\g<${m}&R=${g}>`}"`);let f=s.get(m),p=function(e,t){let n,i=/\\?./gsu;i.lastIndex=t;let r=e.length,o=0,a=1;for(;n=i.exec(e);){let[e]=n;if("["===e)o++;else if(o)"]"===e&&o--;else if("("===e)a++;else if(")"===e&&!--a){r=n.index;break}}return e.slice(t,r)}(e,f);if(l&&as(p,ac`${am}|\((?!\?)`,aa.DEFAULT))throw Error(`${"external"===r?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let b=e.slice(f,n.index),y=p.slice(b.length+t.length),v=a.length,k=g-1,S=ak(b,y,k,!0,i,a,c);o=aC(o,b,k,a.length-v,v,c);let C=e.slice(0,f),x=e.slice(f+p.length);e=`${C}${S}${x}`,ab.lastIndex+=S.length-t.length-b.length-y.length,d.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(f)c++,s.set(String(c),ab.lastIndex),s.set(f,ab.lastIndex),d.push({num:c,name:f});else if("("===t[0]){let e="("===t;e&&(c++,s.set(String(c),ab.lastIndex)),d.push(e?{num:c}:{})}else")"===t&&d.pop()}return i.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:i}}(d.pattern,{captureTransfers:d._captureTransfers,hiddenCaptures:d._hiddenCaptures,mode:"external"}),h=function(e,t){let n,i=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:i};let o="(?:(?=(",a=[0],l=[],s=0,d=0,u=NaN;do{let t;n=!1;let h=0,c=0,f=!1;for(ad.lastIndex=Number.isNaN(u)?0:u+o.length;t=ad.exec(e);){let{0:p,index:m,groups:{capturingStart:g,noncapturingStart:b}}=t;if("["===p)h++;else if(h)"]"===p&&h--;else if("(?>"!==p||f){if(f&&b)c++;else if(g)f?c++:(s++,a.push(s+d));else if(")"===p&&f){if(!c){let t=s+ ++d;e=`${e.slice(0,u)}${o}${e.slice(u+3,m)}))<$$${t}>)${e.slice(m+1)}`,n=!0,l.push(t);for(let e=0;e<i.length;e++)i[e]>=t&&i[e]++;if(r.size){let e=new Map;r.forEach((n,i)=>{e.set(i>=t?i+1:i,n.map(e=>e>=t?e+1:e))}),r=e}break}c--}}else u=m,f=!0}}while(n);return i.push(...l),{pattern:e=al(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>a.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${a[n]}`}return`\\${n}`},aa.DEFAULT),captureTransfers:r,hiddenCaptures:i}}(function(e){let t;if(!RegExp(`${au}\\+`).test(e))return{pattern:e};let n=[],i=null,r=null,o="",a=0;for(ah.lastIndex=0;t=ah.exec(e);){let{0:d,index:u,groups:{qBase:h,qMod:c,invalidQ:f}}=t;if("["===d)a||(r=u),a++;else if("]"===d)a?a--:r=null;else if(!a)if("+"===c&&o&&!o.startsWith("(")){if(f)throw Error(`Invalid quantifier "${d}"`);let t=-1;if(/^\{\d+\}$/.test(h)){var l,s;l=e,s=u+h.length,e=l.slice(0,s)+""+l.slice(s+c.length)}else{if(")"===o||"]"===o){let t=")"===o?i:r;if(null===t)throw Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,t)}(?>${e.slice(t,u)}${h})${e.slice(u+d.length)}`}else e=`${e.slice(0,u-o.length)}(?>${o}${h})${e.slice(u+d.length)}`;t+=4}ah.lastIndex+=t}else"("===d[0]?n.push(u):")"===d&&(i=n.length?n.pop():null);o=d}return{pattern:e}}(u.pattern).pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),c={pattern:h.pattern,flags:`${l.hasIndices?"d":""}${l.global?"g":""}${d.flags}${d.options.disable.v?"u":"v"}`};if(l.avoidSubclass){if(l.lazyCompileLength!==1/0)throw Error("Lazy compilation requires subclass")}else{let e=h.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(h.captureTransfers),n=s._strategy,i=c.pattern.length>=l.lazyCompileLength;(e.length||t.length||n||i)&&(c.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...n&&{strategy:n},...i&&{lazyCompile:i}})}return c}(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...{target:t.target}})).options?new lr(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)},{createScanner:e=>new oC(e,t),createString:e=>({content:e})}}()}))?l:await l;l=r;let o=[];for(let e of t){if("text"===e||"ansi"===e)continue;let t=nK.get(e)??n6(e);"then"in t?o.push(t):nZ(t,r)}let a=[];for(let t of e){let e=ie.getResolvedTheme(t)??rz(t);"then"in e?a.push(e):ii(e,l)}return(o.length>0||a.length>0)&&await Promise.all([Promise.all(o).then(e=>{nZ(e,r)}),Promise.all(a).then(e=>{ii(e,r)})]),r}for(let e of ir({themes:la.map(e=>rD({name:e,collection:"pierre",colorScheme:ll.has(e)?"light":"dark",displayName:ls[e],load:ld[e]}))}).getThemes())ie.registerThemeIfAbsent(e.name,e.load);function lh(e=P){let t=[];return"string"==typeof e?t.push(e):(t.push(e.dark),t.push(e.light)),t}function lc(e){for(let t of lh(e))if(!it.has(t))return!1;return!0}function lf(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function lp(e,t){return eh(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function lm(e){return e1({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function lg(e){return e1({tagName:"div",children:[e1({tagName:"span",children:[e0("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function lb(e){return e1({tagName:"div",children:[e8({name:"both"===e?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":"both"===e?"":void 0,"data-expand-up":"up"===e?"":void 0,"data-expand-down":"down"===e?"":void 0}})}function ly({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:a}){let l=0,s=[];if("metadata"===e&&null!=t&&s.push(e1({tagName:"div",children:[e0(t)],properties:{"data-separator-wrapper":""}})),("line-info"===e||"line-info-basic"===e)&&null!=t){let e=[];null!=n&&(i?(!o&&(e.push(lb("up")),l++),!a&&(e.push(lb("down")),l++)):(e.push(lb(o||a?o?"down":"up":"both")),l++)),e.push(e1({tagName:"div",children:[e1({tagName:"span",children:[e0(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&null!=n&&e.push(e1({tagName:"div",children:[e0("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),s.push(e1({tagName:"div",children:e,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return"custom"===e&&null!=r&&s.push(e1({tagName:"slot",properties:{name:r}})),e1({tagName:"div",children:s,properties:{"data-separator":0===s.length?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":a?"":void 0}})}let lv=Symbol("no-token"),lk=Symbol("multiple-tokens");function lS(e){if("element"===e.type)for(let t of(e.properties["data-char"]=void 0,e.children))lS(t)}Symbol("highlighted-lines");let lC=function(e={}){let{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=e=>e}=e,r=new Map;function o(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}function a(e){let a=t+function(e,t=0){let n=0xdeadbeef^t,i=0x41c6ce57^t;for(let t=0,r;t<e.length;t++)n=Math.imul(n^(r=e.charCodeAt(t)),0x9e3779b1),i=Math.imul(i^r,0x5f356495);return n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(i^i>>>13,0xc2b2ae35),(0x100000000*(2097151&(i=Math.imul(i^i>>>16,0x85ebca6b)^Math.imul(n^n>>>13,0xc2b2ae35)))+(n>>>0)).toString(36).slice(0,6)}("string"==typeof e?e:o(e))+n;return a=i(a),r.has(a)||r.set(a,"string"==typeof e?e:{...e}),a}return{name:"@shikijs/transformers:style-to-class",pre(e){if(!e.properties.style)return;let t=a(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=a(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry:()=>r,getCSS(){let e="";for(let[t,n]of r.entries())e+=`.${t}{${"string"==typeof n?n:o(n)}}`;return e},clearRegistry(){r.clear()}}}({classPrefix:"hl-"}),lx={name:"token-style-normalizer",tokens(e){for(let t of e)for(let e of t){if(null!=e.htmlStyle)continue;let t={};null!=e.color&&(t.color=e.color),null!=e.bgColor&&(t["background-color"]=e.bgColor),null!=e.fontStyle&&0!==e.fontStyle&&((1&e.fontStyle)!=0&&(t["font-style"]="italic"),(2&e.fontStyle)!=0&&(t["font-weight"]="bold"),(4&e.fontStyle)!=0&&(t["text-decoration"]="underline")),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function lw(e){return`--${"token"===e?"diffs-token":"diffs"}-`}let lL=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,lA=/^0(?:\.0+)?%?$/;function lE(e){if(null==e)return null;let t=function(e){let t,n=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(null==n)return null;let i=n[1],r=1;return 3===i.length?t=i.split("").map(e=>e+e).join(""):6===i.length?t=i:(t=i.slice(0,6),r=parseInt(i.slice(6,8),16)/255),[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),r]}(e);if(null==t)return null;let n=t[0]/255,i=t[1]/255,r=t[2]/255,o=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function lP(e){if(null==e)return!1;let t=e.trim().toLowerCase();if("transparent"===t||lL.test(t))return!0;let n=function(e){let t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let i=e.slice(t+1,-1).trim();if(0===i.length)return;let r=i.lastIndexOf("/");if(-1!==r)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=i.split(",");if(4===e.length)return e[3]?.trim()}}(t);return null!=n&&lA.test(n)}let lR=new WeakMap;function lT(e){var t,n;let i=lR.get(e);if(null!=i)return i;let r=e.colors??{},o={...r},a=r["editor.background"]??e.bg,l=r["editor.foreground"]??e.fg,s=r["sideBar.background"]??a,d=r["sideBar.foreground"]??l;l_(o,"editor.background",a),l_(o,"editor.foreground",l),l_(o,"sideBar.background",s),l_(o,"sideBar.foreground",d),l_(o,"input.background",r["input.background"]??s),l_(o,"sideBarSectionHeader.foreground",r["sideBarSectionHeader.foreground"]??d),l_(o,"list.activeSelectionForeground",r["list.activeSelectionForeground"]??d),l_(o,"gitDecoration.addedResourceForeground",lN(r["gitDecoration.addedResourceForeground"],r["terminal.ansiGreen"],r["editorGutter.addedBackground"])),l_(o,"gitDecoration.modifiedResourceForeground",lN(r["gitDecoration.modifiedResourceForeground"],r["terminal.ansiBlue"],r["editorGutter.modifiedBackground"])),l_(o,"gitDecoration.deletedResourceForeground",lN(r["gitDecoration.deletedResourceForeground"],r["terminal.ansiRed"],r["editorGutter.deletedBackground"]));let u=(lP(r["list.focusOutline"])?void 0:r["list.focusOutline"])??(lP(r.focusBorder)?void 0:r.focusBorder);null!=u?o["list.focusOutline"]=u:delete o["list.focusOutline"];let h=r["list.hoverBackground"];null!=h&&(t=h,null!=(n=s)&&t.toLowerCase()===n.toLowerCase()||function(e,t,n){if(null==t||null==n)return!1;let i=lE(e),r=lE(t),o=lE(n);return null!=i&&null!=r&&null!=o&&Math.abs(i-o)<Math.abs(i-r)}(h,s,d))&&delete o["list.hoverBackground"];let c=Object.freeze({...e,colors:Object.freeze(o)});return lR.set(e,c),c}function l_(e,t,n){null!=n&&""!==n&&(e[t]=n)}function lN(...e){for(let t of e)if(null!=t&&""!==t)return t}function lM(e,t){t=null!=t?`${t}-`:"";let n="",i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];null!=i&&(n+=`${lw("global")}${t}addition-color:${i};`);let r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];null!=r&&(n+=`${lw("global")}${t}deletion-color:${r};`);let o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return null!=o&&(n+=`${lw("global")}${t}modified-color:${o};`),n}function lI(e){let t=e.children[0];for(;null!=t;){if("element"===t.type&&"code"===t.tagName)return t.children;t="children"in t?t.children[0]:null}throw console.error(e),Error("getLineNodes: Unable to find children")}function lD({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function lH({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){let o=t[t.length-1];if(null==o||r||!n)return void t.push([+!i,e.value]);let a=0===o[0];if(i===a||i&&1===e.value.length&&!a){o[1]+=e.value;return}t.push([+!i,e.value])}let lO=new class extends Q{};function lF(e,t){let n;for(n=0;n<e.length&&n<t.length&&e[n]==t[n];n++);return e.slice(0,n)}function l$(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length&&e[e.length-(n+1)]==t[t.length-(n+1)];n++);return e.slice(-n)}function lU(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function lz(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function lB(e,t){return lU(e,t,"")}function lG(e,t){return t.slice(0,function(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let i=t.length;e.length<t.length&&(i=e.length);let r=Array(i),o=0;r[0]=0;for(let e=1;e<i;e++){for(t[e]==t[o]?r[e]=r[o]:r[e]=o;o>0&&t[e]!=t[o];)o=r[o];t[e]==t[o]&&o++}o=0;for(let i=n;i<e.length;i++){for(;o>0&&e[i]!=t[o];)o=r[o];e[i]==t[o]&&o++}return o}(e,t))}function lj(e,t){let n=[];for(let i of Array.from(t.segment(e))){let e=i.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function lW(e,t){let n;if(t)return lq(e,t)[1];for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function lV(e,t){if(t)return lq(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:""}function lq(e,t){if(!t)return[lV(e),lW(e)];if("word"!=t.resolvedOptions().granularity)throw Error('The segmenter passed must have a granularity of "word"');let n=lj(e,t),i=n[0],r=n[n.length-1];return[/\s/.test(i)?i:"",/\s/.test(r)?r:""]}let lK="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",lX=RegExp(`[${lK}]+|\\s+|[^${lK}]`,"ug");function lQ(e,t,n,i,r){var o,a,l,s;if(t&&n){let[l,s]=lq(t.value,r),[d,u]=lq(n.value,r);if(e){let i=lF(l,d);e.value=lz(e.value,d,i),t.value=lB(t.value,i),n.value=lB(n.value,i)}if(i){let e=l$(s,u);i.value=lU(i.value,u,e),o=t.value,t.value=lz(o,e,""),a=n.value,n.value=lz(a,e,"")}}else if(n){if(e){let e=lV(n.value,r);n.value=n.value.substring(e.length)}if(i){let e=lV(i.value,r);i.value=i.value.substring(e.length)}}else if(e&&i){let n=lV(i.value,r),[o,a]=lq(t.value,r),s=lF(n,o);t.value=lB(t.value,s);let d=l$(lB(n,s),a);l=t.value,t.value=lz(l,d,""),i.value=lU(i.value,n,d),e.value=lz(e.value,n,n.slice(0,n.length-d.length))}else if(i){let e=lV(i.value,r),n=lG(lW(t.value,r),e);s=t.value,t.value=lz(s,n,"")}else if(e){let n=lG(lW(e.value,r),lV(t.value,r));t.value=lB(t.value,n)}}new class extends Q{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let i=t.intlSegmenter;if("word"!=i.resolvedOptions().granularity)throw Error('The segmenter passed must have a granularity of "word"');n=lj(e,i)}else n=e.match(lX)||[];let i=[],r=null;return n.forEach(e=>{/\s/.test(e)?null==r?i.push(e):i.push(i.pop()+e):null!=r&&/\s/.test(r)?i[i.length-1]==r?i.push(i.pop()+e):i.push(r+e):i.push(e),r=e}),i}join(e){return e.map((e,t)=>0==t?e:e.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,i=null,r=null;return e.forEach(e=>{e.added?i=e:e.removed?r=e:((i||r)&&lQ(n,r,i,e,t.intlSegmenter),n=e,i=null,r=null)}),(i||r)&&lQ(n,r,i,null,t.intlSegmenter),e}};let lJ=new class extends Q{tokenize(e){let t=RegExp(`(\\r?\\n)|[${lK}]+|[^\\S\\n\\r]+|[^${lK}]`,"ug");return e.match(t)||[]}},lY={forcePlainText:!1},lZ=-1;var l0=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++lZ}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:P},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=lc(e.theme??P)?function(){if(null!=l&&!("then"in l))return l}():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;null==e||e.isPartial||0!==e.additionLines.length||(Object.assign(e,eI(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&null!=this.renderCache.result}refreshHighlightedResult(){let{renderCache:e}=this;if(null==e||nW(e.diff)||se(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return this.editSessionActive||n?.isWorkingPool()!==!0||null==t.cacheKey?this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e)):(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e)))}applyRefreshedResult(e,t){if(null==t||null==this.renderCache||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);lp(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,null!=e&&!0===e.isDirty&&null!=e.diff.cacheKey&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};("up"===t||"both"===t)&&(i.fromStart+=n),("down"===t||"both"===t)&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??_}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){for(let t of(this.additionAnnotations={},this.deletionAnnotations={},e)){let e=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(null==this.renderCache)return!1;let{result:i,diff:r}=this.renderCache;if(null==i)return!1;if(r.isPartial)throw Error("Could not update render cache for partial diff");let o=i.code.additionLines,a=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},i=n.map(e=>e[2]).join(""),s=t<r.additionLines.length,d=s?r.additionLines[t]??"":"",u=D(d);s&&(r.additionLines[t]=d.endsWith("\r\n")?i+"\r\n":d.endsWith("\r")?i+"\r":d.endsWith("\n")?i+"\n":i,u!==i&&(a.push(t),l.set(t,d)));o[t]={type:"element",tagName:"div",properties:{"data-line":e["data-line"]??t+1,"data-line-index":e["data-line-index"]??t,"data-line-type":e["data-line-type"]??"context"},children:n.map(([e,t,n])=>0===e&&""===t?""===n?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:n}:{type:"element",tagName:"span",properties:{"data-char":e,style:`color:${t};`},children:[{type:"text",value:n}]})}}let s=!1;if(a.length>0)if(this.editSessionActive&&!r.isPartial){if(!n)if(r.additionLines.length<=1&&""===r.additionLines.join(""))Object.assign(r,eI(r,this.options.parseDiffOptions)),this.markEditSessionPass(r),s=!0;else if(eN(r,r.additionLines))Object.assign(r,eM(r,r.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(r),s=!0;else{let e=function(e,t,n,i){let r,o=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(0===o.length)return;let{hunks:a}=e,l=0;for(let t of o){for(;l<a.length;){let e=a[l];if(t<eK(e)+e.additionCount)break;l++}let i=a[l],o=null==i?void 0:eK(i);if(null==o||t<o||null!=r&&r!==l)return eG(e,n);r=l}if(null!=r){if(function(e,t,n,i,r){if(null==i||r?.ignoreWhitespace===!0||r?.stripTrailingCr===!0)return!1;let o=function(e){let t=eB.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return eB.set(e,{lines:e.deletionLines,set:n}),n}(e),a=e.hunks[n];if(a.hunkContent.some(ej))return!1;for(let n of t){let t=i.get(n),r=e.additionLines[n];if(null==t||null==r||o.has(t)||o.has(r))return!1;let l=!1;for(let e of a.hunkContent)if("change"===e.type&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){l=!0;break}if(!l)return!1}return!0}(e,o,r,i,n)){e.editSessionDirty=!0;return}return eG(e,n)}}(r,a,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),s=null!=e}}else Object.assign(r,function(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return eO(e,e_(e,n));let i=Array.from(t);if(0===i.length)return eO(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of i){let i=e.additionLines[t],r=e.deletionLines[t];if(null==i||null==r||D(i)===D(r))return eO(e,e_(e,n))}let r=function(e,t){let n=new Set;for(let i of t){let t=function(e,t){for(let[n,i]of e.hunks.entries()){let e=i.additionLineIndex+i.additionCount;if(t>=i.additionLineIndex&&t<e)return n}}(e,i);if(null==t)return new Set;n.add(t)}return n}(e,i);if(0===r.size)return eO(e,e_(e,n));for(let t of r)if(!function(e,t,n){let i=e.hunks[t];if(null==i)return!1;let r=e.deletionLines.slice(i.deletionLineIndex,i.deletionLineIndex+i.deletionCount),o=e.additionLines.slice(i.additionLineIndex,i.additionLineIndex+i.additionCount),a=ei({name:e.prevName??e.name,contents:r.join("")},{name:e.name,contents:o.join(""),lang:e.lang},{...n,context:0}),l=a.hunks[0];return null!=l&&1===a.hunks.length&&(function(e,t){let n=e.additionLineIndex,i=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>e$(e,n,i)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=i+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,eU(e)}(i,l),eF(e,t),!0)}(e,t,n))return eO(e,e_(e,n));return(ez(e),function(e){let t=e.hunks[e.hunks.length-1];if(null==t||e.isPartial||0===e.additionLines.length||0===e.deletionLines.length)return!1;let n=e.additionLines.length-I(t.additionStart,t.additionCount),i=e.deletionLines.length-I(t.deletionStart,t.deletionCount);return(!(n<=0)||!(i<=0))&&n!==i}(e))?eO(e,e_(e,n)):eO(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}(r,a,this.options.parseDiffOptions));return i.baseThemeType=t,this.renderCache.isDirty=!0,s}applyExpansionRemap(e){null!=e&&(this.expandedHunks=function(e,t){let n=new Map,{regions:i}=t;for(let t=0;t<=i.length;t++){let r=i[t-1],o=i[t],a=0===t?e.get(0):null==r?void 0:e.get(r.lastIndex+1),l=null==o?void 0:e.get(o.firstIndex),s=a?.fromStart??0,d=l?.fromEnd??0;(s>0||d>0)&&n.set(t,{fromStart:s,fromEnd:d})}return n}(this.expandedHunks,e))}applyDocumentChange(e){if(null==this.renderCache)return;let{diff:t,result:n}=this.renderCache;if(null==n)return;if(t.isPartial)throw Error("Could not apply document change for partial diff");let{additionLines:i}=t;t.additionLines=function(e,t){let n=[],i=function(e){for(let t of e){if(t.endsWith("\r\n"))return"\r\n";if(t.endsWith("\n"))break;if(t.endsWith("\r"))return"\r"}return"\n"}(t);for(let t=0;t<e.lineCount;t++){var r;let o=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!((r=o).endsWith("\n")||r.endsWith("\r"))?o+i:o)}return n}(e,i),n.code.additionLines=function(e,t,n,i){let r=l3(e),o=l3(t),a=Math.min(r,o),l=0;for(;l<a&&e[l]===t[l];)l++;let s=0;for(;s<a-l&&e[r-1-s]===t[o-1-s];)s++;let d=Array(t.length);for(let e=0;e<l;e++)d[e]=n[e];for(let e=0;e<s;e++)d[o-1-e]=n[r-1-e];r<e.length&&o<t.length&&(d[t.length-1]=n[e.length-1]);for(let i=e.length;i<t.length;i++)d[i]??=n[i];for(let e=l;e<t.length;e++)d[e]??=l9(e,i.getLineText(e));return d}(i,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&""===t.additionLines.join("")?(Object.assign(t,eI(t,this.options.parseDiffOptions)),n.code.additionLines[0]=l9(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,eD(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(eN(e,n)){Object.assign(e,eM(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(eG(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n="change"===t?"deletions"===e?"change-deletion":"change-addition":t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>e1({tagName:"div",children:[e1({tagName:"div",children:e.annotations?.map(e=>e1({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}});getOptionsWithDefaults(){let{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:a=!1,expandUnchanged:l=!1,collapsedContextThreshold:s=1,expansionLineCount:d=100,hunkSeparators:u="line-info",lineDiffType:h="word-alt",maxLineDiffLength:c=1e3,overflow:f="scroll",stickyHeader:p=!1,theme:m=P,headerRenderMode:g="default",tokenizeMaxLineLength:b=1e3,tokenizeMaxLength:y=1e5,useTokenTransformer:v=!1,useCSSClasses:k=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:a,expandUnchanged:l,collapsedContextThreshold:s,expansionLineCount:d,hunkSeparators:u,lineDiffType:h,maxLineDiffLength:c,overflow:f,stickyHeader:p,theme:this.workerManager?.getDiffRenderOptions().theme??m,headerRenderMode:g,tokenizeMaxLineLength:b,tokenizeMaxLength:y,useTokenTransformer:v,useCSSClasses:k}}async initializeHighlighter(){return this.highlighter=await lu(function(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:lh(t),preferredHighlighter:n}}(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(null==e)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=se(e,this.getTokenizeMaxLength()),i=this.workerManager?.getDiffResultCache(e);null==i||lp(t,i.options)||(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!nW(e),options:t,result:n?void 0:i?.result,renderRange:void 0},this.editSessionActive||this.workerManager?.isWorkingPool()!==!0?null==this.highlighter&&(this.computedLang=e.lang??nj(e.name),this.initializeHighlighter()):null!=this.renderCache.result||n||this.workerManager.highlightDiffAST(this,this.diff)}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??P}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&!0!==e.useTokenTransformer?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||!0===this.options.useTokenTransformer,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result!=null&&lf(e,n.diff)&&lp(t,n.options)?{options:t,forceHighlight:!1}:{options:t,forceHighlight:!0}}renderDiff(e=this.renderCache?.diff,t=N){if(null==e)return;let{expandUnchanged:n,collapsedContextThreshold:i}=this.getOptionsWithDefaults(),{options:r,forceHighlight:o}=this.getRenderOptions(e),a=this.getMatchingWorkerResultCache(e,r);null==a||this.hasHighlightedRenderCache(e,r)||(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...a},o=!1),this.renderCache??={diff:e,highlighted:!1,options:r,result:void 0,renderRange:void 0};let l=e.additionLines.length>0||e.deletionLines.length>0,s=!l||nW(e)||se(e,this.getTokenizeMaxLength()),d=!lf(e,this.renderCache.diff),u=!nx(this.renderCache.renderRange,t);if(this.editSessionActive||this.workerManager?.isWorkingPool()!==!0){this.computedLang=e.lang??nj(e.name);let t=null!=this.highlighter&&lc(r.theme),n=null!=this.highlighter&&nY(this.computedLang),i=!s&&n;if(null!=this.highlighter&&t&&(o||s||!this.renderCache.highlighted&&i||null==this.renderCache.result)){let{result:t,options:r}=this.renderDiffWithHighlighter(e,this.highlighter,s||!n);this.renderCache={diff:e,options:r,highlighted:i,result:t,renderRange:void 0}}t&&(s||n)||this.asyncHighlight(e).then(({result:t,options:n})=>{null!=this.renderCache&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!s)})}else{let a=null==this.renderCache.result&&this.renderCache.highlighted&&!s&&!d&&nz(t);a&&(this.renderCache.highlightPending=!0),!a&&(s||null==this.renderCache.result||!this.renderCache.highlighted&&(d||u))&&(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,(null==this.renderCache.result||d||u||o)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,!!nz(t)||!!n||this.expandedHunks,i)),this.renderCache.renderRange=t),!s&&l&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e)}return null!=this.renderCache.result?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=N){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a}=this.getOptionsWithDefaults();return e1({tagName:"pre",properties:function({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:a,customProperties:l}){return{...l,"data-diff":"diff"===a?"":void 0,"data-file":"file"===a?"":void 0,"data-diff-type":"diff"===a?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":"bars"===e||"classic"===e?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a,split:e,totalLines:t,customProperties:n})})}async asyncHighlight(e){let t=se(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??nj(e.name);let n=null!=this.highlighter&&lc(this.getLocalHighlightTheme()),i=t||null!=this.highlighter&&nY(this.computedLang);return null!=this.highlighter&&n&&i||(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults(),o=function(e,t,n,{forcePlainText:i,startingLine:r,totalLines:o,expandedHunks:a,collapsedContextThreshold:l=1}=lY){i?(r??=0,o??=1/0):(r=0,o=1/0);let s=r>0||o<1/0,d="string"==typeof n.theme?t.getTheme(n.theme).type:void 0,u=function({theme:e=P,highlighter:t,prefix:n}){let i="";if("string"==typeof e){let r=t.getTheme(e),o=lT(r);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${lw("global")}fg:${o.fg};`,i+=`${lw("global")}bg:${o.bg};`,i+=lM(r,n)}else{let n=t.getTheme(e.dark),r=lT(n);i+=`${lw("global")}dark:${r.fg};`,i+=`${lw("global")}dark-bg:${r.bg};`,i+=lM(n,"dark"),r=lT(n=t.getTheme(e.light)),i+=`${lw("global")}light:${r.fg};`,i+=`${lw("global")}light-bg:${r.bg};`,i+=lM(n,"light")}return i}({theme:n.theme,highlighter:t}),h=i&&!s&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,c={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=n,p=!i&&!e.isPartial,m=new Map;function g(e,t,n,i){if(s){let e=n.at(-1);(null==e||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:i.length,count:0},n.push(e)),e.count++}i.push(e)}for(let d of(nF({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:!s||(i?a:void 0),collapsedContextThreshold:l,callback:({hunkIndex:t,additionLine:n,deletionLine:i,type:r})=>{let o,a,l=(o=p?0:t,a=m.get(o)??{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]},m.set(o,a),a),s=null!=n?n.splitLineIndex:i.splitLineIndex;"change"===r&&null!=n&&null!=i&&function({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:r,additionDecorations:o,lineDiffType:a,maxLineDiffLength:l}){var s,d,u,h;if(null==e||null==t||"none"===a||(e=D(e),t=D(t),e.length>l||t.length>l))return;let c="char"===a?(s=e,d=t,lO.diff(s,d,void 0)):(u=e,h=t,lJ.diff(u,h,void 0)),f=[],p=[],m="word-alt"===a,g=c.at(-1);for(let e of c){let t=e===g;e.added||e.removed?e.removed?lH({item:e,arr:f,enableJoin:m,isLastItem:t}):lH({item:e,arr:p,enableJoin:m,isLastItem:t}):(lH({item:e,arr:f,enableJoin:m,isNeutral:!0,isLastItem:t}),lH({item:e,arr:p,enableJoin:m,isNeutral:!0,isLastItem:t}))}let b=0;for(let e of f)1===e[0]&&r.push(lD({line:n,spanStart:b,spanLength:e[1].length})),b+=e[1].length;for(let e of(b=0,p))1===e[0]&&o.push(lD({line:i,spanStart:b,spanLength:e[1].length})),b+=e[1].length}({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[i.lineIndex],deletionLineIndex:l.deletionContent.length,additionLineIndex:l.additionContent.length,deletionDecorations:l.deletionDecorations,additionDecorations:l.additionDecorations,lineDiffType:h,maxLineDiffLength:f}),null!=i&&(g(e.deletionLines[i.lineIndex],i.lineIndex,l.deletionSegments,l.deletionContent),l.deletionInfo.push({type:"change"===r?"change-deletion":r,lineNumber:i.lineNumber,altLineNumber:"change"===r?void 0:n.lineNumber??void 0,lineIndex:`${i.unifiedLineIndex},${s}`})),null!=n&&(g(e.additionLines[n.lineIndex],n.lineIndex,l.additionSegments,l.additionContent),l.additionInfo.push({type:"change"===r?"change-addition":r,lineNumber:n.lineNumber,altLineNumber:"change"===r?void 0:i.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${s}`}))}}),m.values())){if(0===d.deletionContent.length&&0===d.additionContent.length)continue;let r={name:e.prevName??e.name,contents:d.deletionContent.value},o={name:e.name,contents:d.additionContent.value},{deletionLines:a,additionLines:l}=function({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:r,deletionDecorations:o,additionDecorations:a,languageOverride:l,options:{theme:s=P,...d}}){let u=l??nj(e.name),h=l??nj(t.name),{state:c,transformers:f}=function(e=!1,t=!1){let n={lineInfo:[]},i=[{line:e=>(delete e.properties.class,e),pre(t){let i=function(e){let t=e.children[0];for(;null!=t;){if("element"===t.type&&"code"===t.tagName)return t;t="children"in t?t.children[0]:null}}(t),r=[];if(null!=i){let t=1;for(let o of i.children)"element"===o.type&&(e&&function e(t){let n,i=function(e){let t=e.properties["data-char"];if("number"==typeof t)return t}(t);if(null!=i)return i;let r=lv,o=[],a=[],l=()=>{if(0===a.length||null==n){a=[],n=void 0;return}if(1===a.length){let i=a[0];if(i?.type==="element"){var e,t;for(let r of(e=i,t=n,e.properties["data-char"]=t,i.children))lS(r)}else lS(i);o.push(i),a=[],n=void 0;return}for(let e of a)lS(e);o.push(e1({tagName:"span",properties:{"data-char":n},children:a})),a=[],n=void 0},s=e=>{if(e!==lv){if(e===lk){r=lk;return}if(r===lv){r=e;return}r!==e&&(r=lk)}};for(let i of t.children){let t="element"===i.type?e(i):lv;if(s(t),"number"!=typeof t){l(),o.push(i);continue}null!=n&&n!==t&&l(),n??=t,a.push(i)}return l(),t.children=o,r}(o),r.push(function(e,t,n){let i="function"==typeof n.lineInfo?n.lineInfo(t):n.lineInfo[t-1];if(null==i){let i=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(i,{node:e,line:t,state:n}),Error(i)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,0===e.children.length&&e.children.push(e0("\n")),e}(o,t,n)),t++);i.children=r}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t)n.__lineChar??=e,e+=n.content.length}},preprocess(e,t){t.mergeWhitespaces="never"},span(e,t,n,i,r){if(r?.offset!=null&&null!=r.content){let t=r.__lineChar;null!=t&&(e.properties["data-char"]=t)}return e}}:null}];return t&&i.push(lx,lC),e&&i.push({line:e=>("element"===e.type&&0===e.children.length&&e.children.push({type:"element",tagName:"br",properties:{},children:[]}),e)}),{state:n,transformers:i,toClass:lC}}(d.useTokenTransformer),p="string"==typeof s?{...d,lang:"text",theme:s,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:lw("token"),tokenizeTimeLimit:0}:{...d,lang:"text",themes:s,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:lw("token"),tokenizeTimeLimit:0};return{deletionLines:""===e.contents?[]:(p.lang=u,c.lineInfo=n,p.decorations=o,lI(r.codeToHast(D(e.contents),p))),additionLines:""===t.contents?[]:(p.lang=h,p.decorations=a,c.lineInfo=i,lI(r.codeToHast(D(t.contents),p)))}}({deletionFile:r,deletionInfo:d.deletionInfo,deletionDecorations:d.deletionDecorations,additionFile:o,additionInfo:d.additionInfo,additionDecorations:d.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(p){c.deletionLines=a,c.additionLines=l;continue}if(d.deletionSegments.length>0)for(let e of d.deletionSegments)for(let t=0;t<e.count;t++)c.deletionLines[e.targetIndex+t]=a[e.originalOffset+t];else c.deletionLines.push(...a);if(d.additionSegments.length>0)for(let e of d.additionSegments)for(let t=0;t<e.count;t++)c.additionLines[e.targetIndex+t]=l[e.originalOffset+t];else c.additionLines.push(...l)}return{code:c,themeStyles:u,baseThemeType:d}}(e,t,i,{forcePlainText:n,expandedHunks:!!n||void 0,collapsedContextThreshold:r});if(this.editSessionActive&&1===e.additionLines.length&&""===e.additionLines[0]&&null==o.code.additionLines[0]){let t;if(nF({diff:e,diffStyle:"both",expandedHunks:!!n||void 0,collapsedContextThreshold:r,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),null==t)throw Error("DiffHunksRenderer: missing empty addition line");o.code.additionLines[0]=l9(0,"",t.unifiedLineIndex,t.splitLineIndex)}return{result:o,options:i}}onHighlightSuccess(e,t,n,i=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){if(null==this.renderCache)return;let r=!0===this.renderCache.highlightPending||!this.renderCache.highlighted||!lp(this.renderCache.options,n)||!lf(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(null!=n&&lp(t,n.options))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&lf(e,n.diff)&&lp(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){var o,a;let l,{diffStyle:s,disableFileHeader:d,expandUnchanged:u,expansionLineCount:h,collapsedContextThreshold:c,hunkSeparators:f}=this.getOptionsWithDefaults(),p=this.renderCache?.isDirty??!1;this.diff=e;let m="unified"===s,g=(o=e,a=null!=this.options.loadDiffFiles,o.isPartial&&a&&("change"===o.type||"rename-changed"===o.type)),b=!e.isPartial||g,y=[],v=[],k=[],S=[],{additionLines:C,deletionLines:x}=n,w={rowCount:0,hunkSeparators:f,additionsContentAST:y,deletionsContentAST:v,unifiedContentAST:k,unifiedGutterAST:e2(),deletionsGutterAST:e2(),additionsGutterAST:e2(),expansionLineCount:h,hunkData:S,incrementRowCount(e=1){w.rowCount+=e},pushToGutter(e,t){switch(e){case"unified":w.unifiedGutterAST.children.push(t);break;case"deletions":w.deletionsGutterAST.children.push(t);break;case"additions":w.additionsGutterAST.children.push(t)}}},L=ew({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),A={size:0,side:void 0,increment(){this.size+=1},flush(){if("unified"!==s){if(this.size<=0||null==this.side){this.side=void 0,this.size=0;return}"additions"===this.side?(w.pushToGutter("additions",e5(void 0,"buffer",this.size)),y?.push(lm(this.size))):(w.pushToGutter("deletions",e5(void 0,"buffer",this.size)),v?.push(lm(this.size))),this.size=0,this.side=void 0}}},E=(e,t,n,i,r)=>{w.pushToGutter(e,function(e,t,n,i={}){return e1({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:null!=t?[e1({tagName:"span",properties:{"data-line-number-content":""},children:[e0(`${t}`)]})]:void 0})}(t,n,i,r))};function P(e){A.flush(),"unified"===s?l4("unified",e,w):(l4("deletions",e,w),l4("additions",e,w))}this.pushFileLevelAnnotations(e,s,t,w),nF({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:!!u||this.expandedHunks,collapsedContextThreshold:c,callback:({hunkIndex:t,hunk:n,collapsedBefore:i,collapsedAfter:r,additionLine:o,deletionLine:a,type:l})=>{let d=null!=a?a.splitLineIndex:o.splitLineIndex,u=null!=o?o.unifiedLineIndex:a.unifiedLineIndex;"split"===s&&"change"!==l&&A.flush(),i>0&&P({hunkIndex:t,collapsedLines:i,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:0===t,isLastHunk:!1,isExpandable:b});let h="unified"===s?u:d,c={type:l,hunkIndex:t,lineIndex:h,unifiedLineIndex:u,splitLineIndex:d,deletionLine:a,additionLine:o};if("unified"===s){let n=this.getUnifiedInjectedRowsForLine?.(c);n?.before!=null&&l2(n.before,w);let i=null!=a?x[a.lineIndex]:void 0,r=null!=o?C[o.lineIndex]:void 0;if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let s="change"===l?null!=o?"change-addition":"change-deletion":l,f=this.getUnifiedLineDecoration({type:l,lineType:s,additionLineIndex:o?.lineIndex,deletionLineIndex:a?.lineIndex});E("unified",f.gutterLineType,null!=o?o.lineNumber:a.lineNumber,`${u},${d}`,f.gutterProperties),null!=r?r=l7(r,f.contentProperties,p&&null!=o?{"data-line":o.lineNumber,"data-line-index":`${u},${d}`}:void 0):null!=i&&(i=l7(i,f.contentProperties,p&&null!=a?{"data-line":a.lineNumber,"data-line-index":`${u},${d}`}:void 0)),l6({diffStyle:"unified",type:l,deletionLine:i,additionLine:r,unifiedSpan:this.getAnnotations("unified",a?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:w}),n?.after!=null&&l2(n.after,w)}else{let n=this.getSplitInjectedRowsForLine?.(c);n?.before!=null&&l5(n.before,w,A);let i=null!=a?x[a.lineIndex]:void 0,r=null!=o?C[o.lineIndex]:void 0,s=this.getSplitLineDecoration({side:"deletions",type:l,lineIndex:a?.lineIndex}),u=this.getSplitLineDecoration({side:"additions",type:l,lineIndex:o?.lineIndex});if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if("change"===l){if(null==r)return"additions";else if(null==i)return"deletions"}})();null!=f?(null!=A.side&&A.side!==f&&A.flush(),A.side=f,A.increment()):"change"===l&&A.flush();let m=this.getAnnotations("split",a?.lineNumber,o?.lineNumber,t,h);if(null!=m&&A.size>0&&A.flush(),null!=a){let e=l7(i,s.contentProperties,p?{"data-line":a.lineNumber,"data-line-index":`${a.unifiedLineIndex},${d}`}:void 0);E("deletions",s.gutterLineType,a.lineNumber,`${a.unifiedLineIndex},${d}`,s.gutterProperties),null!=e&&(i=e)}if(null!=o){let e=l7(r,u.contentProperties,p?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${d}`}:void 0);E("additions",u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${d}`,u.gutterProperties),null!=e&&(r=e)}l6({diffStyle:"split",type:l,additionLine:r,deletionLine:i,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:w}),n?.after!=null&&l5(n.after,w,A)}let m="split"===s&&null!=n&&d===n.splitLineStart+n.splitLineCount-1,y=t===e.hunks.length-1&&null!=n&&("split"===s?d===n.splitLineStart+n.splitLineCount-1:u===n.unifiedLineStart+n.unifiedLineCount-1),v=!!m&&n.noEOFCRDeletions,k=!!m&&n.noEOFCRAdditions,S=(a?.noEOFCR??!1)||v,R=(o?.noEOFCR??!1)||k;if(R||S){if("split"===s&&A.flush(),S){let e="context"===l||"context-expanded"===l?l:"change-deletion";"unified"===s?(w.unifiedContentAST.push(lg(e)),w.pushToGutter("unified",e5(e,"metadata",1))):(w.deletionsContentAST.push(lg(e)),w.pushToGutter("deletions",e5(e,"metadata",1)),R||(w.pushToGutter("additions",e5(void 0,"buffer",1)),w.additionsContentAST.push(lm(1))))}if(R){let e="context"===l||"context-expanded"===l?l:"change-addition";"unified"===s?(w.unifiedContentAST.push(lg(e)),w.pushToGutter("unified",e5(e,"metadata",1))):(w.additionsContentAST.push(lg(e)),w.pushToGutter("additions",e5(e,"metadata",1)),S||(w.pushToGutter("deletions",e5(void 0,"buffer",1)),w.deletionsContentAST.push(lm(1))))}w.incrementRowCount(1)}"simple"!==f&&"metadata"!==f&&(r>0||y&&g)&&P({hunkIndex:"context-expanded"===l?t:t+1,collapsedLines:y&&g?"unknown":r,rangeSize:L,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:b}),w.incrementRowCount(1)}}),"split"===s&&A.flush();let R=Math.max(null==(l=e.hunks.at(-1))?0:Math.max(I(l.additionStart,l.additionCount),I(l.deletionStart,l.deletionCount)),e.additionLines.length??0,e.deletionLines.length??0),T=t.bufferBefore>0||t.bufferAfter>0,_=!m&&"deleted"!==e.type,N=!m&&"new"!==e.type,M=w.rowCount>0||T;y=_&&M?y:void 0,v=N&&M?v:void 0,k=m&&M?k:void 0;let D=this.createPreElement(null!=v&&null!=y,R);return{unifiedGutterAST:m&&M?w.unifiedGutterAST.children:void 0,unifiedContentAST:k,deletionsGutterAST:N&&M?w.deletionsGutterAST.children:void 0,deletionsContentAST:v,additionsGutterAST:_&&M?w.additionsGutterAST.children:void 0,additionsContentAST:y,hunkData:S,preNode:D,themeStyles:i,baseThemeType:r,headerElement:d?void 0:this.renderHeader(this.diff),totalLines:R,rowCount:w.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){var n;let i="unified"===e?t.unifiedGutterAST:"deletions"===e?t.deletionsGutterAST:t.additionsGutterAST,r="unified"===e?t.unifiedContentAST:"deletions"===e?t.deletionsContentAST:t.additionsContentAST;if(null==i||null==r)return;let o=e2(i);return o.properties.style=`grid-row: span ${t.rowCount}`,[o,(n=t.rowCount,e1({tagName:"div",children:r,properties:{"data-content":"",style:`grid-row: span ${n}`}}))]}renderFullAST(e,t=[]){let n="line-info"===this.getOptionsWithDefaults().hunkSeparators,i=this.renderCodeAST("unified",e);if(null!=i)return t.push(e1({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};let r=this.renderCodeAST("deletions",e);null!=r&&t.push(e1({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));let o=this.renderCodeAST("additions",e);return null!=o&&t.push(e1({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return no(this.renderFullAST(e,t))}renderPartialHTML(e,t){return null==t?no(e):no(e1({tagName:"code",children:e,properties:{"data-code":"","data-container-size":"line-info"===this.getOptionsWithDefaults().hunkSeparators?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!nq(n))return;let r="new"!==e.type?l1(nV(this.deletionAnnotations)):[],o="deleted"!==e.type?l1(nV(this.additionAnnotations)):[];if(0===r.length&&0===o.length)return;let{createAnnotationElement:a}=this;"unified"===t?l6({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:-1,lineIndex:-1,annotations:r.concat(o)},createAnnotationElement:a,context:i}):l6({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:-1,lineIndex:-1,annotations:r},additionSpan:{type:"annotation",hunkIndex:-1,lineIndex:-1,annotations:o},createAnnotationElement:a,context:i})}getAnnotations(e,t,n,i,r){let o={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=t)for(let e of this.deletionAnnotations[t]??[])o.annotations.push(eo(e));let a={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=n)for(let t of this.additionAnnotations[n]??[])("unified"===e?o:a).annotations.push(eo(t));return"unified"===e?o.annotations.length>0?o:void 0:0!==a.annotations.length||0!==o.annotations.length?{deletionSpan:o,additionSpan:a}:void 0}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return function({fileOrDiff:e,mode:t,stickyHeader:n}){let i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return e1({tagName:"div",children:["custom"===t?e1({tagName:"slot",properties:{name:E}}):function({name:e,prevName:t,iconType:n}){let i=[e1({tagName:"slot",properties:{name:w}}),e8({name:function(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}(n),properties:{"data-change-icon":n}})];return null!=t&&(i.push(e1({tagName:"div",children:[e1({tagName:"bdi",children:[e0(t)]})],properties:{"data-prev-name":""}})),i.push(e8({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(e1({tagName:"div",children:[e1({tagName:"bdi",children:[e0(e)]})],properties:{"data-title":""}})),i.push(e1({tagName:"slot",properties:{name:L}})),e1({tagName:"div",children:i,properties:{"data-header-content":""}})}({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),..."custom"===t?[]:[function(e){let t=[];if(null!=e){let n=0,i=0;for(let t of e.hunks)n+=t.additionLines,i+=t.deletionLines;(i>0||0===n)&&t.push(e1({tagName:"span",children:[e0(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||0===i)&&t.push(e1({tagName:"span",children:[e0(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(e1({tagName:"slot",properties:{name:A}})),e1({tagName:"div",children:t,properties:{"data-metadata":""}})}(i)]],properties:r})}({fileOrDiff:e,mode:t,stickyHeader:n})}};function l1(e){return e?.map(e=>eo(e))??[]}let l8=new Intl.PluralRules("en-US");function l2(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function l5(e,t,n){for(let{deletion:i,addition:r}of e){if(null==i&&null==r)continue;let e=null!=i&&null!=r?void 0:null==i?"deletions":"additions";(null==e||n.side!==e)&&n.flush(),null!=i&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),null!=r&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),null!=e&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function l6({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:a,createAnnotationElement:l,context:s}){let d=!1;"unified"===e?(null!=i?s.unifiedContentAST.push(i):null!=n&&s.unifiedContentAST.push(n),null!=r&&(s.unifiedContentAST.push(l(r)),s.pushToGutter("unified",e5("change"===t?null!=n?"change-deletion":"change-addition":t,"annotation",1)),d=!0)):"split"===e&&(null!=n&&s.deletionsContentAST.push(n),null!=i&&s.additionsContentAST.push(i),null!=o&&(s.deletionsContentAST.push(l(o)),s.pushToGutter("deletions",e5("change"===t?null!=n?"change-deletion":"context":t,"annotation",1)),d=!0),null!=a&&(s.additionsContentAST.push(l(a)),s.pushToGutter("additions",e5("change"===t?null!=i?"change-addition":"context":t,"annotation",1)),d=!0)),d&&s.incrementRowCount(1)}function l4(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:a,isExpandable:l},s){if("number"==typeof n&&n<=0)return;let d="unified"===e?s.unifiedContentAST:"deletions"===e?s.deletionsContentAST:s.additionsContentAST;if("metadata"===s.hunkSeparators){null!=r&&(s.pushToGutter(e,ly({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),d.push(ly({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&s.incrementRowCount(1));return}if("simple"===s.hunkSeparators){t>0&&(s.pushToGutter(e,ly({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(ly({type:"simple",isFirstHunk:o,isLastHunk:!1})),"additions"!==e&&s.incrementRowCount(1));return}let u=`hunk-separator-${e}-${t}`,h=i>s.expansionLineCount,c=l?t:void 0,f="number"==typeof n?`${n} unmodified line${"one"===l8.select(n)?"":"s"}`:"More unchanged context may be available";s.pushToGutter(e,ly({type:s.hunkSeparators,content:f,expandIndex:c,chunked:h,slotName:u,isFirstHunk:o,isLastHunk:a})),d.push(ly({type:s.hunkSeparators,content:f,expandIndex:c,chunked:h,slotName:u,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&s.incrementRowCount(1),s.hunkData.push({slotName:u,hunkIndex:t,lines:"number"==typeof n?n:0,lineCountKnown:"number"==typeof n,type:e,expandable:l?{up:!o,down:!a,chunked:h}:void 0})}function l7(e,t,n){return null==e||"element"!==e.type||null==t&&null==n?e:{...e,properties:{...e.properties,...t,...n}}}function l3(e){return e.length>0&&""===e[e.length-1]?e.length-1:e.length}function l9(e,t,n=e,i=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${i}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function se(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}let st=-1;var sn=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++st}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:P},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new nk,this.scrollSyncManager=new nU,this.interactionManager=new ns("diff",nd(e,"function"==typeof e.hunkSeparators||(e.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===e.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:"function"==typeof e?.hunkSeparators?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}createHunksRenderer(e){return new l0(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{let n,i,r=this.fileDiffCache;if(null==r)return;let o=r.hunks.at(-1);e:for(let a of r.hunks){let r="deletions"===t?a.deletionStart:a.additionStart,l="deletions"===t?a.deletionCount:a.additionCount,s=r-(0!==l)+1,d=a.splitLineStart,u=a.unifiedLineStart;if(e<s){let t=s-e;n=Math.max(u-t,0),i=Math.max(d-t,0);break}if(e>=s+l){if(a===o){let t=e-(s+l);n=u+a.unifiedLineCount+t,i=d+a.splitLineCount+t;break}continue}for(let r of a.hunkContent)if("context"===r.type)if(e<s+r.lines){let t=e-s;i=d+t,n=u+t;break e}else s+=r.lines,d+=r.lines,u+=r.lines;else{let o="deletions"===t?r.deletions:r.additions;if(e<s+o){let o=e-s;n=u+("additions"===t?r.deletions:0)+o,i=d+o;break e}s+=o,d+=Math.max(r.deletions,r.additions),u+=r.deletions+r.additions}break}if(null!=n&&null!=i)return[n,i]};setOptions(e){null!=e&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(nd(this.options,"function"==typeof this.options.hunkSeparators||(this.options.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===this.options.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if("string"==typeof this.options.theme||null==this.fileContainer||null==this.appliedThemeCSS)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return null!=this.appliedThemeCSS&&!eh(this.appliedThemeCSS.theme,this.options.theme??P)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!e&&!t&&!n&&"function"!=typeof this.options.hunkSeparators}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,null!=e&&this.setEditorActiveLine(...e),null!=t&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||null==this.pre){this.managersDirty=!1;return}let{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:"wrap"===t,columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),"scroll"===t&&"split"===e?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return"function"==typeof this.options.hunkSeparators||"scroll"===e&&(this.lineAnnotations.length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){null!=this.codeUnified&&(this.codeUnified.scrollLeft=e),null!=this.codeAdditions&&(this.codeAdditions.scrollLeft=e),null!=this.codeDeletions&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){eb(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),null!=this.refreshViewTimeout&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:i,fileDiff:r,...o}){if(!this.enabled)throw Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(null!=this.fileContainer)throw Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");let a=nM(o,"FileDiff.hydrate"),l=a?.oldFile,s=a?.newFile;this.hydrateElements(e,t),function(e,t,n=!1){return!n&&null==e&&t}(this.pre,function({fileDiff:e,oldFile:t,newFile:n}){return null!=e&&e.hunks.length>0||null!=t||null!=n}({fileDiff:r,oldFile:l,newFile:s}),this.options.collapsed)||function(e,t,n=!1){return null==e&&t&&!n}(this.headerElement,function({fileDiff:e,oldFile:t,newFile:n}){return null!=e||null!=t||null!=n}({fileDiff:r,oldFile:l,newFile:s}),this.options.disableFileHeader)?this.render({...o,fileContainer:e,lineAnnotations:i,fileDiff:r,preventEmit:!0}):this.hydrationSetup({fileDiff:r,lineAnnotations:i,...a}),n||this.emitPostRender()}hydrateElements(e,t){for(let n of(this.fileContainer!==e&&this.emitPostRender(!0),!function(e,t){if(null==t)return;let n=e.shadowRoot??e.attachShadow({mode:"open"});""===n.innerHTML&&(n.innerHTML=t)}(e,t),e.shadowRoot?.children??[])){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){for(let e of(this.pre=n,n.children))e instanceof HTMLElement&&"code"===e.tagName.toLowerCase()&&("deletions"in e.dataset&&(this.codeDeletions=e),"additions"in e.dataset&&(this.codeAdditions=e),"unified"in e.dataset&&(this.codeUnified=e));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}}null!=this.pre&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(void 0!==t&&void 0!==n?ei(t,n,this.options.parseDiffOptions):void 0),null!=this.pre&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){var e;let{fileDiff:t,options:{loadDiffFiles:n}}=this;null!=t&&null!=n&&(e=t).isPartial&&("change"===e.type||"rename-changed"===e.type||"rename-pure"===e.type)&&this.pendingFiles?.fileDiff!==t&&(this.pendingFiles={fileDiff:t,promise:this.loadFilesForDiff(t,n)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(!0===this.options.disableErrorHandling)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(nD("merge",e,t),this.setHydratedState(t),await nN(()=>this.primeHighlightCache(e)),this.enabled&&this.fileDiff===e&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:i=!1,lineAnnotations:r,fileContainer:o,containerWrapper:a,renderRange:l,...s}){let d,u=nM(s,"FileDiff.render"),h=u?.oldFile,c=u?.newFile;if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");null!=e&&void 0===e.cacheKey&&(e.cacheKey=null!=e.prevName?e.prevName+":"+e.name:e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p="system",expandUnchanged:m=!1}=this.options,g=f?void 0:l,b=this.hasThemeChanged(),y=null!=u,v=y&&(!si(h,this.deletionFile)||!si(c,this.additionFile)),k=null!=e&&e!==this.fileDiff,S=null!=r&&(r.length>0||this.lineAnnotations.length>0)&&r!==this.lineAnnotations;if(!f&&nx(g,this.renderRange)&&!n&&!S&&!b&&(null!=e&&e===this.fileDiff||null==e&&!v))return this.applyCachedThemeState(p);null==e&&y&&(v||null==this.fileDiff)&&(d=ei(u.oldFile,u.newFile,this.options.parseDiffOptions));let{renderRange:C}=this;if(this.renderRange=g,y?(this.deletionFile=h,this.additionFile=c):null!=e&&(this.deletionFile=void 0,this.additionFile=void 0),null!=e?this.fileDiff=e:null!=d&&(k=!0,this.fileDiff=d),k&&(this.cachedHeaderHTML=void 0),null!=r&&this.setLineAnnotations(r),null==this.fileDiff)return!1;!0===this.fileDiff.editSessionDirty&&this.shouldSelfHealEditSession()&&(eW(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:x=!1,disableFileHeader:w=!1}=this.options;if(w&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,a),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,M);null!=e&&this.applyThemeState(o,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,o),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(x)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(n,S,v||k||b)&&this.applyPartialRender({previousRenderRange:C,renderRange:g}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,g);if(null==t)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(o,t.themeStyles,p,t.baseThemeType),null!=t.headerElement&&this.applyHeaderToDOM(t.headerElement,o),null!=t.additionsContentAST||null!=t.deletionsContentAST||null!=t.unifiedContentAST?this.applyHunksToDOM(e,t):null!=this.pre&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,g),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),null!=this.editor&&this.syncRenderViewToEditor()}catch(e){if(x)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,o)}return i||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,null==t))return;this.options.onPostRender?.(t,this,"unmount");return}if(null==t)return;let i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,i=this.lineAnnotations,r=this.computeEditorRenderRange(this.renderRange);null==e||null==t||null==n||n.isPartial||this.hunksRenderer.initializeHighlighter().then(o=>{this.enabled&&this.editor===e&&this.fileContainer===t&&this.fileDiffCache===n&&e.__syncRenderView(o,t,n,i,r)})}computeEditorRenderRange(e){let t,n,i=this.fileDiffCache;if(null==e||null==i||nz(e))return e;let{diffStyle:r="split",expandUnchanged:o=!1,collapsedContextThreshold:a=1}=this.options;return(nF({diff:i,diffStyle:r,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:!!o||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({additionLine:e})=>{null!=e&&(t??=e.lineNumber,n=e.lineNumber)}}),null==t||null==n)?{...e,startingLine:0,totalLines:0}:{...e,startingLine:t-1,totalLines:n-t+1}}attachEditor(e){if("file-diff"!==this.type)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,!0!==e&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(null==e||!0!==e.editSessionDirty)return!1;let{collapsedContextThreshold:t=1}=this.options,n=function(e,t,n){let i=[];if(e.isPartial)return i;for(let[r,o]of e.hunks.entries()){let a=ex({isPartial:e.isPartial,rangeSize:o.collapsedBefore,expandedHunks:t,hunkIndex:r,collapsedContextThreshold:n});if(a.rangeSize<=n)continue;let l=eX(o),s=l-a.rangeSize;a.fromStart>0&&i.push([s,s+a.fromStart]),a.fromEnd>0&&i.push([l-a.fromEnd,l])}let r=eL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(null!=r&&r.fromStart>0&&r.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=eX(t)+t.deletionCount;i.push([n,n+r.fromStart])}return i}(e,this.hunksRenderer.getExpandedHunksMap(),t);return eW(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(function(e,t){let n=new Map;if(0===t.length)return n;let i=(e,i,r)=>{if(r<=i)return;let o=0,a=0;for(let[e,n]of t)n<=i||e>=r||(e<=i&&(o=Math.max(o,Math.min(n,r)-i)),n>=r&&(a=Math.max(a,r-Math.max(e,i))));(o>0||a>0)&&n.set(e,{fromStart:o,fromEnd:a})};for(let[t,n]of e.hunks.entries()){let e=eX(n);i(t,e-Math.max(n.collapsedBefore,0),e)}let r=e.hunks[e.hunks.length-1];return null!=r&&!e.isPartial&&e.deletionLines.length>0&&i(e.hunks.length,eX(r)+r.deletionCount,e.deletionLines.length),n}(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(null!=n){let e=this.fileDiff?.cacheKey;null!=e&&null==n.cacheKey&&(n.cacheKey=e),this.fileDiff=n}void 0!==t&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:i,lineCountChangeInFlight:r}=n;if(this.hunksRenderer.updateRenderCache(e,t,r)){null!=this.refreshViewTimeout&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}!0===i&&(null!=this.refreshViewTimeout&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,"split"===this.options.diffStyle?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(null==t)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options;return eA({fileDiff:t,lineNumber:e,expandedHunks:!!n||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(null==n)return e;let{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options;return function({fileDiff:e,lineNumber:t,direction:n,expandedHunks:i,collapsedContextThreshold:r}){if(!0===i||e.isPartial)return t;let o=[],a=1;for(let[t,n]of e.hunks.entries()){let[l,s]=eC(n),d=ex({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:i,hunkIndex:t,collapsedContextThreshold:r}),u=l-d.rangeSize;d.renderAll?o.push([u,l]):(d.fromStart>0&&o.push([u,u+d.fromStart]),d.fromEnd>0&&o.push([l-d.fromEnd,l])),o.push([l,s]),a=s}let l=eL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:i,collapsedContextThreshold:r,errorPrefix:"getNearestRenderableAdditionLine"});if(null!=l){let e=a;a=e+l.rangeSize,l.renderAll?o.push([e,a]):l.fromStart>0&&o.push([e,e+l.fromStart])}if(t>=a)return t;if("down"===n){for(let[e,n]of o)if(n>t)return Math.max(e,t);return}for(let e=o.length-1;e>=0;e--){let[n,i]=o[e];if(n<=t)return Math.min(i-1,t)}}({fileDiff:n,lineNumber:e,direction:t,expandedHunks:!!i||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:i=1,expansionLineCount:r=100}=this.options;if(null==t||t.isPartial||n)return!1;let o=this.hunksRenderer.getExpandedHunksMap();for(let[n,a]of t.hunks.entries()){let[l,s]=eC(a);if(e<l){let s=ex({isPartial:t.isPartial,rangeSize:a.collapsedBefore,expandedHunks:o,hunkIndex:n,collapsedContextThreshold:i}),d=l-s.rangeSize;if(s.renderAll||e<d+s.fromStart||e>=l-s.fromEnd)return!1;let u=e-(d+s.fromStart)+1,h=l-s.fromEnd-e;return u<=h?this.expandHunk(n,"up",u+r):this.expandHunk(n,"down",h+r),!0}if(e<s)return!1}let a=eL({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"FileDiff.revealLine"});if(null==a||a.renderAll)return!1;let[,l]=eC(t.hunks[t.hunks.length-1]);return!(e<l+a.fromStart)&&!(e>=l+a.rangeSize)&&(this.expandHunk(t.hunks.length,"up",e-(l+a.fromStart)+1+r),!0)}shouldSelfHealEditSession(){return null==this.editor}escalateEditSessionRender(){eg(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();for(let{element:e}of(this.separatorCache.clear(),this.annotationCache.values()))e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(null==this.fileContainer)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),null==this.placeHolder){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(null==e||null==t||!t.isWorkingPool()||null==e.cacheKey||nW(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof t){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){var i;let e=r.slotName,o=this.separatorCache.get(e);if(null==o||(i=o.hunkData,r.slotName!==i.slotName||r.hunkIndex!==i.hunkIndex||r.lines!==i.lines||r.lineCountKnown!==i.lineCountKnown||r.type!==i.type||r.expandable?.chunked!==i.expandable?.chunked||r.expandable?.up!==i.expandable?.up||r.expandable?.down!==i.expandable?.down)){o?.element.remove();let n=document.createElement("div");n.style.display="contents",n.slot=r.slotName;let i=t(r,this);null!=i&&n.appendChild(i),this.fileContainer.appendChild(n),o={element:n,hunkData:r},this.separatorCache.set(e,o)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||null==this.fileContainer){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(null!=t&&this.lineAnnotations.length>0)for(let[i,r]of this.lineAnnotations.entries()){var n;let o=`${i}-${eo(r)}`,a=this.annotationCache.get(o);if(null==a||(n=a.annotation,r.lineNumber!==n.lineNumber||r.side!==n.side||r.metadata!==n.metadata)){a?.element.remove();let e=t(r);if(null==e)continue;(a={element:function(e){let t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}(eo(r)),annotation:r}).element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(o,a)}e.delete(o)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e,{renderGutterUtility:t}=this.options;if(null==this.fileContainer||null==t){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=t(this.interactionManager.getHoveredLine);if(null!=n&&null!=this.gutterUtilityContent)return;if(null==n){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let i=((e=document.createElement("div")).slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e);i.appendChild(n),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;return null!=n&&r&&this.editor?.__captureFocusForDOMReplacement(),r&&this.emitPostRender(!0),this.fileContainer=i,null!=n&&r&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),null!=t&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(null!=t)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:eJ(e)&&e.hasAttribute("data-theme-css")?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):eJ(e)&&e.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(null==this.spriteSVG){let e=document.createElement("div");e.innerHTML=nw;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}null!=this.spriteSVG&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return null==this.pre?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){for(let t of(this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,Array.from(e.children)))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,i=this.cachedHeaderHTML??no(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){let e=document.createElement("div");e.innerHTML=i;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;null!=this.headerElement?t.shadowRoot?.replaceChild(n,this.headerElement):t.shadowRoot?.prepend(n),this.headerElement=n,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||null==n)return;let{renderCustomHeader:r,renderHeaderPrefix:o,renderHeaderFilenameSuffix:a,renderHeaderMetadata:l}=this.options;if(null!=r){let e=r(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,E,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let s=o?.(n)??void 0,d=a?.(n)??void 0,u=l?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,w,s),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,L,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,A,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(null==i)return void t?.remove();let r=t??this.createHeaderSlotElement(n);return null==t&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(null!=t){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}if(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e){let n;this.unsafeCSSStyle??=((n=document.createElement("style")).setAttribute("data-unsafe-css",""),n),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=`${nP}
194
- @layer unsafe {
195
- ${e}
196
- }`,this.appliedUnsafeCSS=e}}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,a=this.options.theme??P,l="string"==typeof a?a:{...a},s=nA(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===s){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:s};return}this.themeCSSStyle=function({shadowRoot:e,currentNode:t,themeCSS:n}){let i;return""===n.trim()?void t?.remove():((t??=((i=document.createElement("style")).setAttribute("data-theme-css",""),i)).textContent=n,t.parentNode!==e&&e.appendChild(t),t)}({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:function(e,t="system",n){return`${nP}
197
- @layer rendered {
198
- :host {${"system"===t?"":`
199
- color-scheme: ${t};`}
200
- ${nE(n)}
201
- ${e}
202
- }
203
- }`}(t,o,s)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:s}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;if(null!=e&&null!=this.themeCSSStyle){var t;let n;this.themeCSSStyle.textContent=(t=this.themeCSSStyle.textContent??"",n=nE(nA(e)),t.replace(nR,n))}}shouldGuardRebuildScroll(){return null!=this.editor&&(s??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent))}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?n_(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let i=this.getColumnPair(e);if(null==i)return!1;let r=sr(t[0]),o=sr(t[1]);return null!=r&&null!=o&&(i.gutter.innerHTML=no(r),i.content.innerHTML=no(o),n!==this.lastRowCount&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r="wrap"===n?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],l=this.hunksRenderer.renderCodeAST("unified",t),s=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),null!=l?(o=null==this.codeUnified||null!=this.codeAdditions||null!=this.codeDeletions,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=nT({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeUnified,l,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l)),a.push(this.codeUnified)):null!=s||null!=d?(null!=s?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=nT({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeDeletions,s,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(s)),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),null!=d?(o=o||null==this.codeAdditions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=nT({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeAdditions,d,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d)),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),0===a.length?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==n||null==e||null==t||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||null==this.lastRowCount)return!1;let l=this.getCodeColumns(a,i,o,r);if(null==l)return!1;let s=e.startingLine,d=t.startingLine,u=s+e.totalLines,h=d+t.totalLines,c=Math.max(s,d),f=Math.min(u,h);if(f<=c)return!1;let p=Math.max(0,c-s),m=Math.max(0,u-f),g=this.trimColumns({columns:l,trimStart:p,trimEnd:m,previousStart:s,overlapStart:c,overlapEnd:f,diffStyle:a});if(g<0)throw Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<g)throw Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let b=this.lastRowCount-g,y=(e,t)=>{if(!(t<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},v=y(d,Math.max(c-d,0));if(null==v&&d<c)return!1;let k=y(f,Math.max(h-f,0));if(null==k&&h>f)return!1;let S=(e,t)=>{if(null!=e){if("unified"!==a||Array.isArray(l))if("split"===a&&Array.isArray(l))this.insertPartialHTML(a,l,e,t);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,l,e,t);b+=e.rowCount}};return this.cleanupErrorWrapper(),S(v,"afterbegin"),S(k,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(a,l,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,i){if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST("deletions",n),r=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],e,i),this.renderPartialColumn(t[1],r,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,e,i)}}refreshSplitDiffView(){if("split"!==this.options.diffStyle)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(null==e)return;let t=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(null==n)return;let i=this.hunksRenderer.renderCodeAST(t,e),r=sr(i?.[0]),o=sr(i?.[1]);for(let[e,t]of[[n.gutter,r],[n.content,o]])if(null!=t&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let i=e.children[n],r=t[n].properties["data-line-type"];null!=r&&i.dataset.lineType!==r&&(i.dataset.lineType=r)}};n("deletions",t[0]),n("additions",t[1])}refreshUnifiedDiffView(){if("unified"!==this.options.diffStyle)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(null==e)return;let t=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(null==t||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST("unified",e),i=sr(n?.[0]),r=sr(n?.[1]),o=()=>{for(let[e,n]of[[t.gutter,i],[t.content,r]])null!=n&&(e.innerHTML=no(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?n_(this.pre,o):o(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(null==e||null==t)return;let i=sr(t[0]),r=sr(t[1]);if(null==i||null==r)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);"beforeend"===n&&o?.type==="element"&&"number"==typeof o.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);let a=r.at(-1);"afterbegin"===n&&a?.type==="element"&&"number"==typeof a.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);null!=a&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let i=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${n}`),e.content.style.setProperty("grid-row",`span ${n}`))};if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t))i(t[0]),i(t[1]);else throw Error("dun fuuuuked up");else i(t)}trimColumnRows(e,t,n){let i=0,r=0,o=0,a=!1,l=n>=0;if(null==e)return 0;let s=Array.from(e.content.children),d=Array.from(e.gutter.children);if(s.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<s.length&&(!(t<=0)||l||a);){let e=d[o],u=s[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),r++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(t>0||l&&i>=n)&&(e.remove(),u.remove(),t>0&&0==--t&&(a=!0),r++),i++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(t>0||l&&i>=n)&&(e.remove(),u.remove(),r++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let n=Math.min(t,o),i=o-n;i>0?(this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=n):(e.remove(),u.remove(),r+=o),0==(t-=n)&&0===i&&(a=!0)}else if(l){let t=i,a=i+o-1;if(n<=t)e.remove(),u.remove(),r+=o;else if(n<=a){let t=a-n+1,i=o-t;this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=t}}i+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let l=Math.max(0,i-r),s=n-r;if(s<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let h=d?l:0,c=u?s:-1;if("unified"===t&&!Array.isArray(e))return this.trimColumnRows(e,h,c);if("split"===t&&Array.isArray(e)){let t=this.trimColumnRows(e[0],h,c),n=this.trimColumnRows(e[1],h,c);if(null!=e[0]&&null!=e[1]&&t!==n)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?t:n}throw console.error({diffStyle:t,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getColumnPair(e){if(null==e)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}getCodeColumns(e,t,n,i){if("unified"===e)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(i);return null!=e||null!=t?[e,t]:void 0}}updateBuffers(e){null!=this.pre&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(null==t||this.shouldDisableVirtualizationBuffers()){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){var o;let{diffIndicators:a="bars",disableBackground:l=!1,disableLineNumbers:s=!1,overflow:d="scroll",diffStyle:u="split"}=this.options,h={type:"diff",diffIndicators:a,disableBackground:l,disableLineNumbers:s,overflow:d,split:"unified"!==u&&null!=t&&null!=n,totalLines:i,customProperties:r};o=this.appliedPreAttributes,(null==h||null==o?h!==o:!function(e=nL,t=nL){if(e===t)return!0;let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let i of n)if(e[i]!==t[i])return!1;return!0}(h.customProperties,o.customProperties)||h.type!==o.type||h.diffIndicators!==o.diffIndicators||h.disableBackground!==o.disableBackground||h.disableLineNumbers!==o.disableLineNumbers||h.overflow!==o.overflow||h.split!==o.split||h.totalLines!==o.totalLines)&&(!function(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:a,totalLines:l,customProperties:s}){if(null!=s)for(let t in s){let n=s[t];null!=n&&e.setAttribute(t,`${n}`)}switch("diff"===t?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators")}r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),"diff"===t?e.setAttribute("data-diff-type",a?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`)}(e,h),this.appliedPreAttributes=h)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);let i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);let r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function si(e,t){return null==e||null==t?null==e&&null==t:eY(e,t)}function sr(e){if(null!=e&&"element"===e.type)return e.children??[]}let so=-1;var sa=class extends sn{__id=`little-virtualized-file-diff:${++so}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=ev(n)}setMetrics(e,t=!1){let n=ev(e);!t&&eu(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return null!=e&&e!==this.lineAnnotations&&(0!==e.length||0!==this.lineAnnotations.length)&&(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){var t;return null!=e&&(t=this.lineAnnotations,!!t?.some(e=>0===e.lineNumber))&&this.lineAnnotations.some(t=>0===t.lineNumber&&("new"===e.type?"additions"===t.side:"deleted"!==e.type||"deletions"===t.side))}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){return this.metrics.lineHeight*(e?2:1)}setOptions(e){var t,n,i,r;if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(null==e)return;let{options:o}=this,a=!ec(o,e),l=a&&(t=o,n=e,(t.diffStyle??"split")!==(n.diffStyle??"split")||(t.overflow??"scroll")!==(n.overflow??"scroll")||(t.collapsed??!1)!==(n.collapsed??!1)||(t.disableLineNumbers??!1)!==(n.disableLineNumbers??!1)||(t.disableFileHeader??!1)!==(n.disableFileHeader??!1)||(t.diffIndicators??"bars")!==(n.diffIndicators??"bars")||(t.hunkSeparators??"line-info")!==(n.hunkSeparators??"line-info")||!!t.loadDiffFiles!=!!n.loadDiffFiles||(t.expandUnchanged??!1)!==(n.expandUnchanged??!1)||(t.collapsedContextThreshold??1)!==(n.collapsedContextThreshold??1)||t.unsafeCSS!==n.unsafeCSS);super.setOptions(e),l&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:(i=o,r=e,(i.disableFileHeader??!1)!==(r.disableFileHeader??!1)||(i.hunkSeparators??"line-info")!==(r.hunkSeparators??"line-info")||!!i.loadDiffFiles!=!!r.loadDiffFiles||(i.expandUnchanged??!1)!==(r.expandUnchanged??!1)||(i.collapsedContextThreshold??1)!==(r.collapsedContextThreshold??1))}),a&&(this.forceRenderOverride=!0),a&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,l)}setThemeType(e){if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),0!==this.cache.measuredHeightDeltaTotal&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),0!==this.cache.totalLines&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),null!=this.renderRange&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1,{overflow:t="scroll"}=this.options;if(null==this.fileContainer||null==this.fileDiff)return 0!==this.height&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),"scroll"===t&&0===this.lineAnnotations.length&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),i="split"===n?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],r=this.hasFileAnnotations(this.fileDiff);if(null!=this.renderRange&&r&&nq(this.renderRange)){let t=function(e){let t;for(let n of e){if(null==n)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&"-1,-1"===n.dataset.lineAnnotation&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}(i)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!r&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of i){if(null==t)continue;let i=t.children[1];if(i instanceof HTMLElement)for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(null==i)continue;let r=function(e,t){let[n,i]=e.split(",").map(Number);return"split"===t?i:n}(i,n),o=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in t.nextElementSibling.dataset||"noNewline"in t.nextElementSibling.dataset)&&("noNewline"in t.nextElementSibling.dataset&&(a=!0),o+=t.nextElementSibling.getBoundingClientRect().height);let l=this.getEstimatedLineHeight(a),s=this.cache.heightDeltas.get(r)??0,d=o-l;d!==s&&(e=!0,this.cache.measuredHeightDeltaTotal+=d-s,0===d?this.cache.heightDeltas.delete(r):this.cache.heightDeltas.set(r,d))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>null!=this.fileContainer&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,i){let r=!lf(this.fileDiff,e),o=this.syncLineAnnotations(i),a=n?.resetDiffLayoutCache===!0||r||o,l=r||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=ev(n.metrics),a=!0,l=!0);let{collapsed:s=!1,expandUnchanged:d=!1}=this.options;return this.currentCollapsed!==s&&(this.currentCollapsed=s,a=!0),this.currentExpandUnchanged!==d&&(this.currentExpandUnchanged=d,a=!0,l=!0),a&&this.resetLayoutCache({includeEstimatedHeights:l}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){let n;if(null==this.fileDiff||e<1)return;let i=this.getLineIndex(e,t);if(null==i)return;let{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsed:a=!1,collapsedContextThreshold:l=1}=this.options,s=this.getDiffStyle(),d=this.getHunkSeparatorType(),u="split"===s?i[1]:i[0];this.approximateLayoutCheckpoints();let h=ek(this.metrics,r),c=this.getLayoutCheckpointBeforeLineIndex(u),f=c?.top??h+this.cache.fileAnnotationHeight;return a?{top:h,height:0}:(nF({diff:this.fileDiff,diffStyle:s,startingLine:c?.renderedLineIndex??0,expandedHunks:!!o||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:e,hunk:t,collapsedBefore:i,collapsedAfter:r,deletionLine:o,additionLine:a})=>{let l="split"===s?a?.splitLineIndex??o?.splitLineIndex:a?.unifiedLineIndex??o?.unifiedLineIndex;if(null==l)throw Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(i>0){let r=eR({type:d,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(null!=r){if(f+=r.gapBefore,u>=l-i&&u<l)return n={top:f,height:r.height},!0;f+=r.height+r.gapAfter}}let h=this.getLineHeight(l,(a?.noEOFCR??!1)||(o?.noEOFCR??!1));if(l===u)return n={top:f,height:h},!0;if(f+=h,r>0){let e=eT({type:d,metrics:this.metrics});if(null!=e){if(u>l&&u<=l+r)return n={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),n)}getEditorViewport(){return"simple"===this.virtualizer.type?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t;if(null==this.fileDiff)return;let{disableFileHeader:n=!1,expandUnchanged:i=!1,collapsed:r=!1,collapsedContextThreshold:o=1}=this.options;if(r)return;let a=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(e),d=s?.top??ek(this.metrics,n)+this.cache.fileAnnotationHeight;return nF({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:!!i||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:n,hunk:i,collapsedBefore:r,collapsedAfter:o,deletionLine:s,additionLine:u})=>{let h="split"===a?u?.splitLineIndex??s?.splitLineIndex:u?.unifiedLineIndex??s?.unifiedLineIndex;if(null==h)throw Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(r>0){let e=eR({type:l,metrics:this.metrics,hunkIndex:n,hunkSpecs:i?.hunkSpecs});null!=e&&(d+=e.totalHeight)}if(d>=e&&(null!=s?t={lineNumber:s.lineNumber,side:"deletions",top:d}:null!=u&&(t={lineNumber:u.lineNumber,side:"additions",top:d}),null!=t))return!0;let c=this.getLineHeight(h,(u?.noEOFCR??!1)||(s?.noEOFCR??!1));if(d+=c,o>0){let e=eT({type:l,metrics:this.metrics});null!=e&&(d+=e.totalHeight)}return!1}}),t}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(null==this.top||null==this.fileDiff)return;if(!0===this.options.collapsed)return{topOffset:this.top,height:this.height};let t=null!=e?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(null==t)return;let{bufferBefore:n,bufferAfter:i,totalLines:r}=t,o=0;if(0===r){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+n+o,height:this.height-(n+i)}}cleanUp(e=!1){null!=this.fileContainer&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{null!=this.fileDiff&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(this.isAdvancedMode()){let n=nD("clone",e,t);if(await nN(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(nD("merge",e,t),this.setHydratedState(t),await nN(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t,n=!1,{pendingExpansions:i,pendingHydratedDiff:r}=this;if(null!=i)for(let e of(this.pendingExpansions=void 0,i))this.hunksRenderer.expandHunk(e.hunkIndex,e.direction,e.expansionLineCountOverride),n=!0;return null!=r&&(this.pendingHydratedDiff=void 0,r.expectedDiff===e&&(this.setHydratedState(r.files),t=r.nextDiff)),null!=t?(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})):n&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)),t}loadFilesIfNecessary(){if(null!=this.pendingHydratedDiff){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(null==t||0===t.length||null==n)return!1;let{expansionLineCount:i=100,collapsedContextThreshold:r=1}=this.options,o=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...o.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??i;("up"===e.direction||"both"===e.direction)&&(t.fromStart+=n),("down"===e.direction||"both"===e.direction)&&(t.fromEnd+=n),o.set(e.hunkIndex,t)}return eA({fileDiff:n,lineNumber:e,expandedHunks:o,collapsedContextThreshold:r})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),this.enabled&&null!=this.fileDiff&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||null==this.fileContainer||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{renderRange:i}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()){if(n&&void 0!==i&&void 0!==this.fileDiff){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,e);t.bufferAfter!==i.bufferAfter&&this.updateBuffers(t)}}else this.computeApproximateSize(!0);this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let i=0===this.height;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,null==t){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:o=!1}=this.options,a=ek(this.metrics,r);if(this.height+=a,o){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!i&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t="split"===this.getDiffStyle()?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(null==t)throw Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(null==e){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(null!=this.cache.estimatedSplitHeight&&null!=this.cache.estimatedUnifiedHeight)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,{splitHeight:r,unifiedHeight:o}=function({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:a,canHydratePartialDiff:l}){let s=ek(t,n),d=s,u=!!r||o,h=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let r=e.hunks[n];if(null==r)throw Error("computeEstimatedDiffHeights: invalid hunk index");let o=ex({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:a}),c=(o.fromStart+o.fromEnd)*t.lineHeight;if(s+=c,d+=c,o.collapsedLines>0){let e=eR({type:i,metrics:t,hunkIndex:n,hunkSpecs:r.hunkSpecs})?.totalHeight??0;s+=e,d+=e}s+=r.splitLineCount*t.lineHeight,d+=r.unifiedLineCount*t.lineHeight;let f=function(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(null==t)return{split:0,unified:0};if("context"===t.type){let e=+(t.lines>0);return{split:e,unified:e}}return function(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:i||r?1:0,unified:n}}(e,t)}(r);s+=f.split*t.lineHeight,d+=f.unified*t.lineHeight;let p=n===h?eL({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:a,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(null!=p){let e=(p.fromStart+p.fromEnd)*t.lineHeight;if(s+=e,d+=e,p.collapsedLines>0){let e=eT({type:i,metrics:t})?.totalHeight??0;s+=e,d+=e}}else if(n===h&&e.isPartial&&l){let e=eT({type:i,metrics:t})?.totalHeight??0;s+=e,d+=e}}if(e.hunks.length>0){let e=eS(t);s+=e,d+=e}return{splitHeight:s,unifiedHeight:d}}({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,canHydratePartialDiff:sd(e,null!=this.options.loadDiffFiles)});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=o}validateComputedHeight(e=this.fileDiff){if(null==this.fileContainer||null==e)return;let t=this.fileContainer.getBoundingClientRect();t.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:i,...r}={}){let o=nM(r,"VirtualizedFileDiff.render"),a=null!=o,l=o?.oldFile,s=o?.newFile,d=a&&(!su(l,this.deletionFile)||!su(s,this.additionFile)),u=t??this.fileDiff;null==t&&a&&(d||null==this.fileDiff)&&(u=ei(o.oldFile,o.newFile,this.options.parseDiffOptions));let{forceRenderOverride:h,isSetup:c}=this;this.forceRenderOverride=void 0;let f=this.syncLineAnnotations(i);f&&this.resetLayoutCache({includeEstimatedHeights:!1});let p=null!=t&&t!==this.fileDiff,m=null!=u&&!lf(this.fileDiff,u);if(m&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),null==u)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(c)this.top??=this.getVirtualizedTop(),m&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,u));else{this.computeApproximateSize(!1,u);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(null==t)throw Error("VirtualizedFileDiff.render: simple virtualizer is not available");t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!(p||d)||!c))return this.fileDiff=u,null!=o&&(this.deletionFile=l,this.additionFile=s),m&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let g=this.virtualizer.getWindowSpecs(),b=this.top??0,y=this.computeRenderRangeFromWindow(u,b,g),v=super.render({fileDiff:u,fileContainer:e,renderRange:y,lineAnnotations:i,forceRender:(h??n)||f||m,...o,...r});return this.isSimpleMode()&&v&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),v}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return"simple"===this.virtualizer.type}isAdvancedMode(){return"advanced"===this.virtualizer.type}getVirtualizedTop(){return"advanced"===this.virtualizer.type?this.virtualizer.getLocalTopForInstance(this):null!=this.fileContainer?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return"simple"===this.virtualizer.type?this.virtualizer:void 0}getAdvancedVirtualizer(){return"advanced"===this.virtualizer.type?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){var e;return"function"==typeof(e=this.options.hunkSeparators)?"custom":e??"line-info"}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||null==e||0===e.hunks.length||!0===this.options.collapsed)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,r=e.hunks.length-1,o=sd(e,null!=this.options.loadDiffFiles),a=this.getDiffStyle(),l=this.getHunkSeparatorType(),s=!!n||this.hunksRenderer.getExpandedHunksMap(),d=function(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],i=[0],r=0;for(let[e,o]of t)n.push(e),r+=o,i.push(r);return{lineIndexes:n,prefixTotals:i}}(this.cache.heightDeltas),u=ek(this.metrics,t)+this.cache.fileAnnotationHeight,h=0,c=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:i=0,metadataOffsets:r=[]})=>{if(e<=0)return;let o=h,a=h+e,l=3e3*Math.ceil(o/3e3);for(;l<a;){let e=l-o,i=u+(e>0?n:0)+e*this.metrics.lineHeight+function(e,t){let n=0;for(let i of e)i<t&&n++;return n}(r,e)*this.metrics.lineHeight+sl(d,t,t+e);this.cache.checkpoints.push({renderedLineIndex:l,lineIndex:t+e,top:i}),l+=3e3}u+=n+e*this.metrics.lineHeight+r.length*this.metrics.lineHeight+sl(d,t,t+e)+i,h=a};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(null==n)throw Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");let d=ex({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:s,hunkIndex:t,collapsedContextThreshold:i}),u=d.collapsedLines>0?eR({type:l,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;c({rowCount:d.fromStart,startLineIndex:("split"===a?n.splitLineStart:n.unifiedLineStart)-d.rangeSize});let h=u;c({rowCount:d.fromEnd,startLineIndex:("split"===a?n.splitLineStart:n.unifiedLineStart)-d.fromEnd,preSeparatorHeight:h}),d.fromEnd>0&&(h=0);let f=t===r?eL({fileDiff:e,hunkIndex:t,expandedHunks:s,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"}):void 0,p=null!=f&&f.collapsedLines>0||t===r&&o?eT({type:l,metrics:this.metrics})?.totalHeight??0:0,m=null!=f?f.fromStart+f.fromEnd:0,g="split"===a?n.splitLineCount:n.unifiedLineCount,b="split"===a?n.splitLineStart:n.unifiedLineStart;c({rowCount:g,startLineIndex:b,preSeparatorHeight:h,postSeparatorHeight:0===m?p:0,metadataOffsets:function({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let i=t.hunkContent.at(-1);if(null==i)return[];if("context"===i.type)return[n-1];let r=Math.max(i.deletions,i.additions),o=i.deletions+i.additions;if("split"===e)return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let a=[];return i.deletions>0&&t.noEOFCRDeletions&&a.push(n-o+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&a.push(n-1),a}({diffStyle:a,hunk:n,rowCount:g})}),null!=f&&m>0&&c({rowCount:m,startLineIndex:b+g,postSeparatorHeight:p})}this.cache.totalLines=h}getLayoutCheckpointBeforeLineIndex(e){let t;if(e<=0||0===this.cache.checkpoints.length)return;let n=0,i=this.cache.checkpoints.length-1;for(;n<=i;){let r=n+i>>1,o=this.cache.checkpoints[r];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(t=o,n=r+1):i=r-1}return t}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){let t=n+i>>1,o=this.cache.checkpoints[t];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(r=t,n=t+1):i=t-1}if(null==t)return r>=0?this.cache.checkpoints[r]:void 0;for(let e=r;e>=0;e--){let n=this.cache.checkpoints[e];if(null==n)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(n.renderedLineIndex%t==0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let i of e.hunks)n+="split"===t?i.splitLineCount:i.unifiedLineCount;return n}let{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o=!!i||this.hunksRenderer.getExpandedHunksMap();for(let[i,a]of e.hunks.entries()){n+="split"===t?a.splitLineCount:a.unifiedLineCount;let l=Math.max(a.collapsedBefore,0),{fromStart:s,fromEnd:d,renderAll:u}=ex({isPartial:e.isPartial,rangeSize:l,expandedHunks:o,hunkIndex:i,collapsedContextThreshold:r});l>0&&(n+=u?l:s+d)}let a=eL({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});return null!=a&&(n+=a.fromStart+a.fromEnd),n}getLayoutLineCount(e,t){return Math.max(this.getExpandedLineCount(e,t),"split"===t?e.splitLineCount:e.unifiedLineCount,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){let r,o,a,{disableFileHeader:l=!1,expandUnchanged:s=!1,collapsedContextThreshold:d=1}=this.options,{hunkLineCount:u,lineHeight:h}=this.metrics,c=this.getDiffStyle(),f=this.getHunkSeparatorType(),p=sd(e,null!=this.options.loadDiffFiles),m=this.height,g=this.getLayoutLineCount(e,c),b=ek(this.metrics,l),y=e.hunks.length>0?eS(this.metrics):0,{fileAnnotationHeight:v}=this.cache,k=b+v,S=Math.max(0,m-b-v-y),C=this.hasFileAnnotations(e),x=t+b;if(t<n-m||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-b-y};if(g<=u||0===e.hunks.length)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),g=this.getLayoutLineCount(e,c);let w=Math.ceil(Math.ceil(Math.max(i-n,0)/h)/u)*u+u,L=w/u,A=[],E=(n+i)/2,P=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-w*h*2),u),R=t+(P?.top??k),T=P?.renderedLineIndex??0;if(nF({diff:e,diffStyle:c,startingLine:P?.renderedLineIndex??0,expandedHunks:!!s||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:d,callback:({hunkIndex:l,hunk:s,collapsedBefore:d,collapsedAfter:h,deletionLine:m,additionLine:g})=>{let b=null!=g?g.splitLineIndex:m.splitLineIndex,y=null!=g?g.unifiedLineIndex:m.unifiedLineIndex,v=(g?.noEOFCR??!1)||(m?.noEOFCR??!1),S=l===e.hunks.length-1&&null!=s&&("split"===c?b===s.splitLineStart+s.splitLineCount-1:y===s.unifiedLineStart+s.unifiedLineCount-1),C=(d>0?eR({type:f,metrics:this.metrics,hunkIndex:l,hunkSpecs:s?.hunkSpecs}):void 0)?.totalHeight??0;R+=C;let x=T%u==0,w=Math.floor(T/u);if(x&&(A[w]=R-(t+k+C),null!=a)){if(a<=0)return!0;a--}let P=this.getLineHeight("split"===c?b:y,v);if(R>n-P&&R<i&&(r??=w),null==o&&R+P>E&&(o=w),null==a&&R>=i&&x&&(a=L),T++,R+=P,h>0||S&&p){let e=eT({type:f,metrics:this.metrics});null!=e&&(R<i&&R+e.totalHeight>n&&(r??=w),null==o&&R+e.totalHeight>E&&(o=w),R+=e.totalHeight)}return!1}}),null==r)if(!(v>0)||!C||!(x<i)||!(x+v>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-b-y};else r=0,o=0;let _=Math.round((o??=r)-L/2),N=Math.max(0,Math.min(_,Math.max(0,Math.ceil(g/u)-L))),M=N*u,I=_<0?w+_*u:w,D=A[N]??0,H=N+I/u;return{startingLine:M,totalLines:I,bufferBefore:0===M?0:v+D,bufferAfter:Math.max(0,H<A.length?S-A[H]:S-(R-t-k))}}};function sl({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||0===e.length)return 0;let r=ss(e,n);return(t[ss(e,i)]??0)-(t[r]??0)}function ss(e,t){let n=0,i=e.length;for(;n<i;){let r=n+i>>1,o=e[r];if(null==o)throw Error("VirtualizedFileDiff: invalid prefix index");o<t?n=r+1:i=r}return n}function sd(e,t){return e.isPartial&&t&&("change"===e.type||"rename-changed"===e.type)}function su(e,t){return null==e||null==t?null==e&&null==t:eY(e,t)}var sh=n(4041);let sc=(0,sh.createContext)(void 0),sf=(0,sh.createContext)(void 0),sp=(0,sh.createContext)(void 0),sm="u"<typeof window?sh.useEffect:sh.useLayoutEffect;function sg({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i}){return t||i||n?{...e,controlledSelection:t,renderCustomHeader:n?es:e?.renderCustomHeader,renderGutterUtility:i?es:e?.renderGutterUtility}:e}function sb({oldFile:e,newFile:t,options:n,editorOptions:i,metrics:r,lineAnnotations:o,selectedLines:a,className:l,style:s,prerenderedHTML:d,renderAnnotation:u,renderCustomHeader:h,renderHeaderPrefix:c,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderGutterUtility:m,disableWorkerPool:g=!1,edit:y=!1}){var v;let k=(0,sh.useMemo)(()=>ei(e,t,n?.parseDiffOptions),[e,t,n?.parseDiffOptions]),{ref:S,getHoveredLine:C}=function({fileDiff:e,options:t,editorOptions:n,lineAnnotations:i,selectedLines:r,prerenderedHTML:o,metrics:a,hasGutterRenderUtility:l,hasCustomHeader:s,disableWorkerPool:d,edit:u}){var h;let c,f=(0,sh.useContext)(sp),p=void 0!==r,m=(0,sh.useContext)(sf),g=(0,sh.useContext)(sc),b=(0,sh.useRef)(null),y=(h=n=>{if(null!=n){if(null!=b.current)throw Error("useFileDiffInstance: An instance should not already exist when a node is created");null!=f?b.current=new sa(sg({controlledSelection:p,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),f,a,!d?m:void 0,!0):b.current=new sn(sg({controlledSelection:p,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),!d?m:void 0,!0),b.current.hydrate({fileDiff:e,fileContainer:n,lineAnnotations:i,prerenderedHTML:o})}else{if(null==b.current)throw Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");b.current.cleanUp(),b.current=null}},c=(0,sh.useRef)(h),(0,sh.useInsertionEffect)(()=>void(c.current=h)),(0,sh.useCallback)((...e)=>c.current(...e),[]));return sm(()=>{let{current:n}=b;if(null==n)return;let o=sg({controlledSelection:p,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),a=void 0!==o&&!ec(n.options,o);n.setOptions(o),n.render({forceRender:a,fileDiff:e,lineAnnotations:i}),void 0!==r&&n.setSelectedLines(r)}),sm(()=>{if(u&&null!=b.current){if(void 0===g)throw Error("FileDiff: EditContext is not attached");let e=g(n??{});if(null==e)throw Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return e.edit(b.current)}catch(t){throw e.cleanUp(),t}}},[u]),{ref:y,getHoveredLine:(0,sh.useCallback)(()=>b.current?.getHoveredLine(),[])}}({fileDiff:k,options:n,editorOptions:i,metrics:r,lineAnnotations:o,selectedLines:a,prerenderedHTML:d,hasGutterRenderUtility:null!=m,hasCustomHeader:null!=h,disableWorkerPool:g,edit:y});return(0,ed.jsx)(b,{ref:S,className:l,style:s,children:(v=function({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderFilenameSuffix:r,renderHeaderMetadata:o,renderAnnotation:a,renderGutterUtility:l,renderMergeConflictUtility:s,lineAnnotations:d,getHoveredLine:u,getInstance:h}){let c=n?.(e),f=i?.(e),p=r?.(e),m=o?.(e);return(0,ed.jsxs)(ed.Fragment,{children:[null!=c?(0,ed.jsx)("div",{slot:E,children:c}):(0,ed.jsxs)(ed.Fragment,{children:[null!=f&&(0,ed.jsx)("div",{slot:"header-prefix",children:f}),null!=p&&(0,ed.jsx)("div",{slot:"header-filename-suffix",children:p}),null!=m&&(0,ed.jsx)("div",{slot:"header-metadata",children:m})]}),null!=a&&d?.map((e,t)=>(0,ed.jsx)("div",{slot:eo(e),children:a(e)},t)),null!=t&&null!=s&&null!=h&&t.map(t=>{var n;let i;if(null==t)return;let r=null!=(i=function(e,t){let n=t.hunks[e.hunkIndex];if(null!=n)return{hunkIndex:e.hunkIndex,lineIndex:function(e,t){let n=e.unifiedLineStart;for(let i=0;i<t;i++){let t=e.hunkContent[i];n+="context"===t.type?t.lines:t.deletions+t.additions}return n}(n,e.startContentIndex)}}(n=t,e))?function({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}({hunkIndex:i.hunkIndex,lineIndex:i.lineIndex,conflictIndex:n.conflictIndex}):void 0;return(0,ed.jsx)("div",{slot:r,style:el,children:s(t,h)},r)}),null!=l&&(0,ed.jsx)("div",{slot:"gutter-utility-slot",style:ea,children:l(u)})]})}({fileDiff:k,renderCustomHeader:h,renderHeaderPrefix:c,renderHeaderFilenameSuffix:f,renderHeaderMetadata:p,renderAnnotation:u,lineAnnotations:o,renderGutterUtility:m,getHoveredLine:C}),"u"<typeof window&&null!=d?(0,ed.jsxs)(ed.Fragment,{children:[(0,ed.jsx)("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:d}}),v]}):(0,ed.jsx)(ed.Fragment,{children:v}))})}}}]);